[Evergreen-general] How to make changes to eg_vhost.conf in the Docker container?

Blake Graham-Henderson blake at mobiusconsortium.org
Tue Aug 15 16:47:04 EDT 2023


Vaclav,

That would cause the error. The folder should be owned by the opensrf 
user. There is a command that is run during the image setup:

- name: copy the oils_sip.xml
     become: true
     shell: cp {{ openils_path }}/conf/oils_sip.xml.example {{ 
openils_path }}/conf/oils_sip.xml && chown opensrf:opensrf -R {{ 
openils_path }}

install_evergreen.yml
(line 774)

This command should be changing the ownership to opensrf. It's a mystery 
that it's failing to do that. Unless your vars.yml doesn't have a value 
for "openils_path" ?

vars.yml:

   openils_path: /openils

(line 44)

Just double checking: are you inside the container when you check the 
folder permissions?
# ll /openils

^^^^ that's executed in the container?

-Blake-
Conducting Magic
Will consume any data format
MOBIUS

On 8/14/2023 3:40 PM, Vaclav Jansa wrote:

> Hello Blake,
> thank you for all your inputs.
>
> I started today from scratch (to be sure).
> generic-dockerhub is used (again) and all recommended edits are added 
> to vars and Dockerfile. Issue still persists.
>
> So here is time for some tee and ansible check
>
> But from quick check is the problem in missing/not progressing chown. 
> Everything is owned by root
> # ll /openils
> total 32
> drwxr-xr-x  8 root root 4096 Aug 14 16:06 ./
> drwxr-xr-x  1 root root 4096 Aug 14 16:18 ../
> drwxr-xr-x  2 root root 4096 Aug 14 16:06 bin/
> drwxr-xr-x  2 root root 4096 Aug 14 16:10 conf/
> drwxr-xr-x  4 root root 4096 Aug 14 16:06 include/
> drwxr-xr-x  3 root root 4096 Aug 14 16:06 lib/
> drwxr-xr-x  4 root root 4096 Aug 14 16:06 share/
> drwxr-xr-x 12 root root 4096 Aug 14 16:06 var/
>
> But autogen task is running with opensrf
>
>  - name: Run autogen
>     become: true
>     become_user: opensrf
>     environment:
>       PATH: "{{ ansible_env.PATH }}:{{openils_path}}/bin"
>     shell:  export PATH=$PATH:{{openils_path}}/bin && 
> {{openils_path}}/bin/autogen.sh -u
>
> I will try to repair it tomorrow.
>
> Best regards
>
> Vaclav
>
>
> On Sun, Aug 13, 2023 at 10:36 PM Blake Henderson 
> <blake at mobiusconsortium.org> wrote:
>
>     Vaclav,
>
>
>     Which docker folder are you building?
>
>     generic-dockerhub
>     or
>     generic-dockerhub-dev
>
>     You should be building your container image from:
>     generic-dockerhub
>
>     (not generic-dockerhub-dev)
>
>     Do you have anything defined in vars.yml for
>     "shared_jackets_folder"? You shouldn't.
>
>     Make sure you pull the most recent commit to the repository:
>
>     cd eg-docker
>     # if you've made changes to the repository, let's make sure
>     everything is back to default:
>     git clean -x -f -d
>
>     git pull
>
>     Check the vars.yml, make sure you have:
>     ubuntu_version: focal
>     evergreen_version: 3.11.1
>     add_evergreen_language_support: no
>
>
>     For troubleshooting, you can edit the Dockerfile such that it
>     doesn't start Evergreen when the image runs:
>
>     vi Dockerfile
>
>     Comment out this line:
>
>     # ENTRYPOINT cd /egconfigs && ansible-playbook
>     evergreen_restart_services.yml -vvvv -e "hosts=127.0.0.1" && while
>     true; do sleep 1; done
>
>     uncomment this line
>     ENTRYPOINT while true; do sleep 1; done
>
>     Rebuild your image:
>
>     docker build --add-host public.localhost:127.0.1.2 --add-host
>     public:127.0.1.2 --add-host private.localhost:127.0.1.3 --add-host
>     private:127.0.1.3 . --no-cache
>
>     Then run the resulting image
>
>     docker run -it -p 80:80 -p 443:443 -p 210:210 -p 6001:6001 -p
>     32:22 -p 5433:5432 -h app.evergreen.com <http://app.evergreen.com>
>     <image id>
>
>     Login to the container:
>     docker exec -it `docker ps -q` bash
>
>     Since you commented out the ENTRYPOINT line, you'll need to run it
>     by hand:
>
>     cd /egconfigs && ansible-playbook evergreen_restart_services.yml
>     -vvvv -e "hosts=127.0.0.1"
>
>
>     If it has an error, at least the container doesn't die. You can
>     investigate the folder permissions. And maybe fix whatever the
>     issue is.
>
>     Hopefully I've given you some ideas to try.
>
>     Good luck!
>
>
>     -Blake-
>     Conducting Magic
>     Can consume data in any format
>     MOBIUS
>
>     On 8/13/2023 2:52 PM, Vaclav Jansa wrote:
>
>>     Hello Blake,
>>     docker image was build from Fridays clone of docker git.
>>     with command
>>     docker build . --add-host public.localhost:127.0.1.2 --add-host
>>     public:127.0.1.2 --add-host private.localhost:127.0.1.3
>>     --add-host private:127.0.1.3 --no-cache
>>
>>     Configuration file is attached,
>>
>>     Failure is then reported almost at end of startup
>>
>>     docker run -it -p 80:80 -p 443:443 -p 210:210 -p 6001:6001 -p
>>     32:22 -p 5433:5432 -h app.evergreen.com
>>     <http://app.evergreen.com> 65d123dbd2ed
>>
>>     in task Run autogen.
>>
>>     Error is also attached.
>>
>>     Many thanks for your check and all hints
>>
>>     Vaclav
>>
>>     On Sun, Aug 13, 2023 at 4:19 AM Blake Henderson
>>     <blake at mobiusconsortium.org> wrote:
>>
>>         Vaclav,
>>
>>         Which command did you use to produce that error?
>>
>>         -Blake-
>>         MOBIUS
>>
>>         On Fri, Aug 11, 2023, 1:42 PM Vaclav Jansa via
>>         Evergreen-general <evergreen-general at list.evergreen-ils.org>
>>         wrote:
>>
>>             Hello Blake and Jane,
>>             thanks for all the magic.
>>
>>             We still try to solve multiple problems with
>>             localization. So image with enabled i18n will be better
>>             for us and our testing.
>>
>>             Unfortunately our builded image does not start correctly
>>             / it reports some access issue
>>
>>             fatal: [127.0.0.1]: FAILED! => {
>>             "changed": true,
>>             "cmd": "export PATH=$PATH:/openils/bin &&
>>             /openils/bin/autogen.sh -u",
>>             "delta": "0:00:00.005884",
>>             "end": "2023-08-11 14:29:36.772621",
>>             "invocation": {
>>             "module_args": {
>>             "_raw_params": "export PATH=$PATH:/openils/bin &&
>>             /openils/bin/autogen.sh -u",
>>             "_uses_shell": true,
>>             "argv": null,
>>             "chdir": null,
>>             "creates": null,
>>             "executable": null,
>>             "removes": null,
>>             "stdin": null,
>>             "stdin_add_newline": true,
>>             "strip_empty_ends": true,
>>             "warn": true
>>             }
>>             },
>>             "msg": "non-zero return code",
>>             "rc": 1,
>>             "start": "2023-08-11 14:29:36.766737",
>>             "stderr": "mkdir: cannot create directory
>>             ‘/openils/var/web/opac/extras/ac’: Permission denied",
>>             "stderr_lines": [
>>             "mkdir: cannot create directory
>>             ‘/openils/var/web/opac/extras/ac’: Permission denied"
>>             ],
>>             "stdout": "Unable to write to
>>             /openils/var/web/opac/common/js, please check\nUnable to
>>             write to /openils/var/web/js/dojo/fieldmapper, please
>>             check\nUnable to write to
>>             /openils/var/web/opac/extras/slimpac, please check",
>>             "stdout_lines": [
>>             "Unable to write to /openils/var/web/opac/common/js,
>>             please check",
>>             "Unable to write to /openils/var/web/js/dojo/fieldmapper,
>>             please check",
>>             "Unable to write to /openils/var/web/opac/extras/slimpac,
>>             please check"
>>
>>             I will try it one more time from build. But maybe you
>>             meet already this issue.
>>
>>             I use for build kvm virtual machine with Ubuntu LTS 22.04
>>             and actual docker.io <http://docker.io>. everything is
>>             running under user added in docker group.
>>
>>             Many thanks for all your inputs
>>
>>             Vaclav
>>
>>             (a guy which build docker images for Linda's dinner)
>>
>>             On Fri, Aug 11, 2023 at 4:32 PM Blake Graham-Henderson
>>             via Evergreen-general
>>             <evergreen-general at list.evergreen-ils.org> wrote:
>>
>>                 Linda,
>>
>>                 The images that we've posted to dockerhub were not
>>                 built with i18n turned on. That switch needs to have
>>                 been set to "yes" during the build process. Which
>>                 means, you'll probably want to build your own docker
>>                 image instead of using the pre-made images.
>>
>>                 Repo: https://github.com/mcoia/eg-docker
>>
>>                 Building your own image is done like this:
>>
>>                 1. Clone the git repository that does the work:
>>
>>                 git clone https://github.com/mcoia/eg-docker.git
>>
>>                 2. Customize the vars.yml to suit your needs
>>
>>                 cd eg-docker/generic-dockerhub
>>                 vi vars.yml
>>
>>                 The main two variables are:
>>                   ubuntu_version: focal
>>                   evergreen_version: 3.9.1
>>
>>                 I'd change evergreen_version to: 3.11.1
>>
>>                 You're also interested in this setting:
>>                 add_evergreen_language_support: no
>>
>>                 If you change that setting to "yes" - it will cause
>>                 the build to edit the eg_vhost.conf file during the
>>                 build.
>>
>>                 But* if you already have an eg_vhost.conf file that
>>                 you would like to use, then leave that setting "no"
>>                 and copy your eg_vhost.conf file directly into the
>>                 generic-dockerhub folder.
>>
>>                 You'll need to make one more change in order to
>>                 incorporate your eg_vhost.conf:
>>
>>                 # edit Dockerfile
>>                 vi Dockerfile
>>
>>                 Add this line:
>>                 ADD eg_vhost.conf /egconfigs/eg_vhost.conf
>>
>>                 Put that line right above this line:
>>                 RUN cd /egconfigs && ansible-playbook
>>                 install_evergreen.yml -v -e "hosts=127.0.0.1"
>>
>>                 so it should look like this:
>>
>>                 .....
>>                 ADD vars.yml /egconfigs/vars.yml
>>                 ADD install_evergreen.yml
>>                 /egconfigs/install_evergreen.yml
>>                 ADD evergreen_restart_services.yml
>>                 /egconfigs/evergreen_restart_services.yml
>>                 ADD restart_post_boot.yml
>>                 /egconfigs/restart_post_boot.yml
>>                 ADD eg_vhost.conf /egconfigs/eg_vhost.conf
>>                 RUN cd /egconfigs && ansible-playbook
>>                 install_evergreen.yml -v -e "hosts=127.0.0.1"
>>                 ENTRYPOINT cd /egconfigs && ansible-playbook
>>                 evergreen_restart_services.yml -vvvv -e
>>                 "hosts=127.0.0.1" && while true; do sleep 1; done
>>                 #ENTRYPOINT while true; do sleep 1; done
>>
>>
>>                 Now, you're ready to build your own docker image.
>>                 Like this:
>>
>>                 docker build \
>>                 --add-host public.localhost:127.0.1.2 \
>>                 --add-host public:127.0.1.2 \
>>                 --add-host private.localhost:127.0.1.3 \
>>                 --add-host private:127.0.1.3 \
>>                 . --no-cache
>>
>>                 You do need to be in the generic-dockerhub folder
>>                 when you run that command
>>
>>                 It will take about 15 minutes to complete. Once
>>                 completed, Docker will report the sha hash of the
>>                 image that you just built. You can see it with this
>>                 command:
>>
>>                 docker images
>>
>>                 Now that you have your own image. You can start an
>>                 Evergreen server from it. Like this:
>>
>>                 |docker run -it -p 80:80 -p 443:443 -p 210:210 -p
>>                 6001:6001 -p 32:22 -p 5433:5432 -h app.evergreen.com
>>                 <http://app.evergreen.com> <your_new_image_sha_hash>
>>                 Watch it boot up, and make sure it finishes. You will
>>                 know that it finishes when you see the "PLAY RECAP"
>>                 line, and there should be 0 fails. You can safely
>>                 disconnect from the container leaving it running
>>                 using the magic key combination: ctrl+pq (NOT ctrl+c,
>>                 that will kill it) |
>>
>>                 Now that I've said all of that, and you're going to supply your own eg_vhost.conf file, it might be faster to use the pre-built image from dockerhub, boot it up,
>>                 then replace the eg_vhost.conf file located in the container, and restart apache2.
>>
>>                 So that would look like this:
>>
>>                 1. Start docker with the community container:
>>                 |docker run -it -p 80:80 -p 443:443 -p 210:210 -p
>>                 6001:6001 -p 32:22 -p 5433:5432 -h app.evergreen.com
>>                 <http://app.evergreen.com>
>>                 mobiusoffice/evergreen-ils:latest|
>>
>>                 2. Wait for it to finish starting (look for that PLAY RECAP line, and confirm "0 fail"). Press ctrl+pq.
>>
>>                 3. SSH into the container
>>
>>                 ssh -p 32 user at localhost
>>
>>                 the password is "password"
>>
>>                 3a. Alternatively, you can attach to the container using "docker exec"
>>
>>                 docker exec -it `docker ps -q` bash
>>
>>                 4. Once you're on the shell of the container, you need to make your edits to:
>>                 /etc/apache2/eg_vhost.conf
>>
>>                 note: vi is not installed in the container, you might have to install vi:
>>
>>                 apt-get update && apt-get install -y vim
>>
>>                 vi /etc/apache2/eg_vhost.conf
>>                 (make changes)
>>
>>                 Save the file
>>
>>                 5. Restart apache
>>
>>                 /etc/init.d/apache2 restart
>>
>>                 That should do it!
>>
>>                 Good luck. Feel free to ask questions!
>>
>>
>>                 -Blake-
>>                 Conducting Magic
>>                 Will consume any data format
>>                 MOBIUS
>>
>>                 On 8/11/2023 8:17 AM, Jane Sandberg via
>>                 Evergreen-general wrote:
>>>                 That is very mysterious!
>>>
>>>                 These steps worked for me to add the 950 db seed in
>>>                 French within a docker container:
>>>
>>>                 docker exec -it [container_name] bash
>>>                 cd /home/opensrf/repos/Evergreen
>>>                 make -f Open-ILS/src/extras/Makefile.install
>>>                 ubuntu-focal-translator
>>>                 su opensrf
>>>                 cd build/i18n
>>>                 mkdir locale
>>>                 make newpot
>>>                 make LOCALE=fr-CA updatepo
>>>                 exit # go back to root user
>>>                 cd /home/opensrf/repos/Evergreen/build/i18n && make
>>>                 LOCALE=fr-CA install
>>>                 su evergreen
>>>                 psql -f
>>>                 Open-ILS/src/sql/Pg/950.data.seed-values-fr-CA.sql
>>>
>>>                 El vie, 11 ago 2023 a la(s) 05:51, Linda Jansová
>>>                 (linda.jansova at gmail.com) escribió:
>>>
>>>                     Thank you very much, Jane!
>>>
>>>                     We currently use the dev tag (but we may also
>>>                     try some other non-dev tags as you have
>>>                     suggested :-); actually, it seems that the
>>>                     language selector in the OPAC correctly appears
>>>                     after a couple of reloads, then - for a couple
>>>                     of other reloads - it disappears only to appear
>>>                     again after some more reloads ;-).
>>>
>>>                     It definitely works in mysterious ways so far;
>>>                     we would probably also need to add the 950 db
>>>                     seed with French (and Czech) translations. Any
>>>                     ideas how to do this correctly?
>>>
>>>                     Linda
>>>
>>>                     On 8/11/23 14:25, Jane Sandberg wrote:
>>>>                     Hi Linda,
>>>>
>>>>                     What tag of the Evergreen container are you
>>>>                     using?  I believe that the instructions under
>>>>                     "Restarting Evergreen services" are only
>>>>                     applicable to the "dev" tag (i.e. if you ran
>>>>                     `docker run
>>>>                     [...] mobiusoffice/evergreen-ils:dev`). If you
>>>>                     don't specify a tag, it defaults to the
>>>>                     "latest" tag, which doesn't contain the
>>>>                     file-based restart/recompile methods.
>>>>
>>>>                     I typically use the non-dev tags, using the
>>>>                     following steps to restart apache.
>>>>                     Theoretically, they should work if you are
>>>>                     using the dev tag too, but I haven't tried them:
>>>>
>>>>                     1. docker ps # this will show the name of the
>>>>                     running container
>>>>                     2. docker exec -it [container_name] bash # this
>>>>                     will provide a shell within the running
>>>>                     container. For example, if step 1 had mentioned
>>>>                     that the running Evergreen container is named
>>>>                     "peaceful_spence", it would be `docker exec -it
>>>>                     peaceful_spence bash`
>>>>                     3. apache2ctl restart # simply restarts apache.
>>>>                     When I need to restart all services, I use
>>>>                     `ansible-playbook
>>>>                     /egconfigs/evergreen_restart_services.yml -e
>>>>                     hosts="127.0.0.1"` instead.
>>>>
>>>>                     Hope this helps,
>>>>
>>>>                        -Jane
>>>>
>>>>                     El vie, 11 ago 2023 a la(s) 04:28, Linda
>>>>                     Jansová via Evergreen-general
>>>>                     (evergreen-general at list.evergreen-ils.org)
>>>>                     escribió:
>>>>
>>>>                         Dear all,
>>>>
>>>>                         We have just started experimenting with a
>>>>                         Docker container
>>>>                         (https://hub.docker.com/r/mobiusoffice/evergreen-ils),
>>>>                         mainly to see whether it could help us
>>>>                         identify what causes i18n issues reported
>>>>                         in a separate thread (with a subject
>>>>                         "Evergreen 3.11.0a not properly switching
>>>>                         into Czech in the staff client").
>>>>
>>>>                         At this point we are a bit stuck as we
>>>>                         would like to make appropriate i18n changes
>>>>                         to the eg_vhost.conf file and then make
>>>>                         them visible both in the OPAC and in the
>>>>                         staff client.
>>>>
>>>>                         We have uncommented lines related to French
>>>>                         translation (just to see if it works before
>>>>                         we would make a deep dive into Czech) and
>>>>                         restarted Evergreen as described at
>>>>                         https://hub.docker.com/r/mobiusoffice/evergreen-ils
>>>>                         (under the heading "Restarting Evergreen
>>>>                         services") but it doesn’t seem to change
>>>>                         anything in the OPAC.
>>>>
>>>>                         How exactly should we proceed?
>>>>
>>>>                         (Maybe a more specific piece of
>>>>                         documentation that would answer our
>>>>                         question is available somewhere; in that
>>>>                         case, sharing a URL would be great :-).)
>>>>
>>>>                         Thank you in advance!
>>>>
>>>>                         Linda
>>>>
>>>>                         _______________________________________________
>>>>                         Evergreen-general mailing list
>>>>                         Evergreen-general at list.evergreen-ils.org
>>>>                         http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general
>>>>
>>>
>>>
>>>                 _______________________________________________
>>>                 Evergreen-general mailing list
>>>                 Evergreen-general at list.evergreen-ils.org
>>>                 http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general
>>
>>                 _______________________________________________
>>                 Evergreen-general mailing list
>>                 Evergreen-general at list.evergreen-ils.org
>>                 http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general
>>
>>             _______________________________________________
>>             Evergreen-general mailing list
>>             Evergreen-general at list.evergreen-ils.org
>>             http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.evergreen-ils.org/pipermail/evergreen-general/attachments/20230815/d1038902/attachment-0001.htm>


More information about the Evergreen-general mailing list