Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a fixed environment container (with docker for e.g.) to support starting developers or testers. #1071

Open
Boldie opened this issue Feb 13, 2020 · 23 comments

Comments

@Boldie
Copy link

Boldie commented Feb 13, 2020

We shall provide an easy to use environment and also a reference environment to support testing and developing. Common used tasks shall be made easy accessible for e.g. using a shell script or similar thing. For e.g. the following stuff shall be possible:

  • Load demo data to a database
  • Complete setup including easy to use database setup.
  • "One-Click" installation and then use for development or testing.
  • It is not intended for the usage as a first priority, It can be used but the focus shall be on the development and testing site.

I suggest to make a docker container for this stuff.

@Boldie
Copy link
Author

Boldie commented Feb 13, 2020

Maybe this is also related to #1041 #1066

@christianlupus
Copy link
Collaborator

There is a docker container managed by mhubig. Although I'd like to see it be under official namespace of partkeepr. But this is merely for production and not for development.

One problem is that there needs to be a way to run the setup without calling a set of web sites. This is needed as (at the moment according to my understanding) nobody except for @Drachenkaetzchen knows exactly what happens during setup routine. This needs to be done manually in order to make automated builds and tests possible.

@shafr
Copy link

shafr commented Feb 14, 2020

It would be much more convinient to do a docker-compose with PostgreSQL.
And you can export demo site to .sql files (from normal installation) and then import them inside database during intialization.

  • What about windows users ?
  • What about *pi users ? It would be nice to have embedded database that would not take a lot of space.

@Drachenkaetzchen
Copy link
Member

This is needed as (at the moment according to my understanding) nobody except for @Drachenkaetzchen knows exactly what happens during setup routine.

Well, the code is there.

Also, all setup does is to generate the config.php file and wraps symfony commands to setup the environment. See https://wiki.partkeepr.org/wiki/Running_PartKeepr_from_GIT#Updating

@christianlupus
Copy link
Collaborator

christianlupus commented Feb 14, 2020

Well, that is a good source of information. Thank you for the hint @Drachenkaetzchen.

@christianlupus
Copy link
Collaborator

Just a small question at @Drachenkaetzchen and @dromer. Where would we put such files? Some repos I have seen use a subfolder, other use a complete own repo for all sort of CI/CD. What would be your preference for partkeepr? Maybe I can do something here but I want to avoid make the work twice.

@dromer
Copy link
Contributor

dromer commented Feb 15, 2020

I agree with @shafr that a simple docker and/or docker-compose file should be enough to get going.

However it is important that there is a volume mounted for any assets and cache that partkeepr needs. Usually everything is self-contained with docker, but in this case a mounted volume is quite necessary.

@dromer
Copy link
Contributor

dromer commented Feb 15, 2020

@christianlupus I think a dockerfile in the root should be fine. Unless it becomes a 'collection' of files then a subdir to keep it a bit neater.

@shafr
Copy link

shafr commented Feb 20, 2020

Well using docker image for composer:1.9.3 causes issues with packages:

  Problem 1
    - Installation request for fr3d/ldap-bundle dev-master -> satisfiable by fr3d/ldap-bundle[dev-master].
    - fr3d/ldap-bundle dev-master requires ext-ldap * -> the requested PHP extension ldap is missing from your system.
  Problem 2
    - Installation request for moontoast/math 1.1.2 -> satisfiable by moontoast/math[1.1.2].
    - moontoast/math 1.1.2 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
  Problem 3
    - Installation request for nfq-alpha/sprite-bundle dev-min-image-fix -> satisfiable by nfq-alpha/sprite-bundle[dev-min-image-fix].
    - nfq-alpha/sprite-bundle dev-min-image-fix requires ext-gd * -> the requested PHP extension gd is missing from your system.
  Problem 4
    - Installation request for zendframework/zend-ldap 2.5.1 -> satisfiable by zendframework/zend-ldap[2.5.1].
    - zendframework/zend-ldap 2.5.1 requires ext-ldap * -> the requested PHP extension ldap is missing from your system.

I'm not sure how php composer package system works, but when I tried adding manually missing packages, it had no effect.

Seems like that alpine OS packages are missing (or there were never compiled for that OS). Most likely the best way to do installation is to use clean ubuntu image or ubuntu + php7, then install missing packages:

sudo apt-get install php7.0-gd
sudo apt-get install php7.0-intl
sudo apt-get install php7.0-xsl

and use it as builder.

@christianlupus
Copy link
Collaborator

At the moment I am working on a patch in my personal fork. Yesterday I successfully installed it but found that the GitHub Packages docker system does not provide anonymous access to public packages (See this discussion). So I need to rework things a bit.

There are still some open things to do but especially I do not (yet) have a database dump to import in case of development to have some dummy entries.

@christianlupus
Copy link
Collaborator

I managed to get "something" running. As soon as I commit something to my master branch or add any tag, a new build is triggered. This time I use dockerhub as it allows everyone to download the generated images without any credentials.

@dromer Do you prefer to have a clean history in a potential PR or are you going to squash anyways? Otherwise I have to rework my branch history 😏.

@dromer
Copy link
Contributor

dromer commented Feb 20, 2020

Depending on the amount of lines we can squash it (if it's just a concise config or 2 that would be fine).
Separate Dockerfile.yml and docker-compose.yml would be nice.

@christianlupus
Copy link
Collaborator

I opened PR #1088. However, I need #1085, which is thus a subset of #1088.

You might want to have a look at the PR and tell me if you are willing to squash or if I should rework the history.

@shafr
Copy link

shafr commented Feb 21, 2020

Depending on the amount of lines we can squash it (if it's just a concise config or 2 that would be fine).
Separate Dockerfile.yml and docker-compose.yml would be nice.

No squash is needed - rather use multi-stage builds

@dromer
Copy link
Contributor

dromer commented Feb 21, 2020

@shafr we where talking about git commits. and also I don't see how multi-stage Dockerfile is relevant here.

@christianlupus
Copy link
Collaborator

@Drachenkaetzchen To have a more detailed docker image, I'd like to add quite some testing data there. Would you be ok, if we added the test data from the demo page there? Of course, we would remove your personal account from the SQL dump to avoid any leaking of password hashes and replace it by something general (that can be published).

@Drachenkaetzchen
Copy link
Member

The demo site is already cleaned out of personal data I think. Do you have access to the dump?

@christianlupus
Copy link
Collaborator

Unfortunately neither to the SQL dump nor to a file system dump of the data folder. Otherwise, I would have added these as example data in the docker PR. Are these large? Maybe you can send me the dumps? If required, I can send you a link to my personal NextCloud instance so no big mails need to be sent around.

@Drachenkaetzchen
Copy link
Member

Here are the sql dump and the data files: https://cloud.drachenkatze.org/index.php/s/6WJWp9t9qRqwzrx

@christianlupus
Copy link
Collaborator

Thank you, I downloaded the files. Are you keeping the link open in the future? Otherwise you can close it now.

@Drachenkaetzchen
Copy link
Member

No, I don't have a huge amount of disk space so I'll remove it now.

@Boldie
Copy link
Author

Boldie commented Jun 21, 2020

@christianlupus Did you succeed in making a working docker image?

@christianlupus
Copy link
Collaborator

@Boldie At the moment there is #1088 that goes into this direction. You can check out the relevant commits and use them my temporarily merging (locally) with your dev branch. Unfortunately, I am a bit short of thime these days. There are some edges and I might need to work over it once again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants