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

Vaclav Jansa vaclav.jansa at gmail.com
Sun Aug 13 15:52:40 EDT 2023


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 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. 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 <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 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 listEvergreen-general at list.evergreen-ils.orghttp://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/20230813/1797345f/attachment-0001.htm>
-------------- next part --------------
TASK [Run autogen] *********************************************************************************************************************************************************************************************************************************************************
task path: /egconfigs/evergreen_restart_services.yml:246
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/tmp/ansible-tmp-1691955811.3021035-268626877188247 `" && echo ansible-tmp-1691955811.3021035-268626877188247="` echo /var/tmp/ansible-tmp-1691955811.3021035-268626877188247 `" ) && sleep 0'
Using module file /usr/lib/python3/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-8jcdfzrj7/tmpu_162fxc TO /var/tmp/ansible-tmp-1691955811.3021035-268626877188247/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c 'setfacl -m u:opensrf:r-x /var/tmp/ansible-tmp-1691955811.3021035-268626877188247/ /var/tmp/ansible-tmp-1691955811.3021035-268626877188247/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /var/tmp/ansible-tmp-1691955811.3021035-268626877188247/ /var/tmp/ansible-tmp-1691955811.3021035-268626877188247/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'chown opensrf /var/tmp/ansible-tmp-1691955811.3021035-268626877188247/ /var/tmp/ansible-tmp-1691955811.3021035-268626877188247/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u opensrf /bin/sh -c '"'"'echo BECOME-SUCCESS-emmpouikhamfoksmsivjzpnfgzfvlflj ; PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/openils/bin /usr/bin/python3 /var/tmp/ansible-tmp-1691955811.3021035-268626877188247/AnsiballZ_command.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /var/tmp/ansible-tmp-1691955811.3021035-268626877188247/ > /dev/null 2>&1 && sleep 0'
fatal: [127.0.0.1]: FAILED! => {
    "changed": true,
    "cmd": "export PATH=$PATH:/openils/bin && /openils/bin/autogen.sh -u",
    "delta": "0:00:00.006476",
    "end": "2023-08-13 15:43:31.481994",
    "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-13 15:43:31.475518",
    "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"
    ]
}

PLAY RECAP *****************************************************************************************************************************************************************************************************************************************************************
127.0.0.1                  : ok=51   changed=35   unreachable=0    failed=1    skipped=8    rescued=0    ignored=10  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Dockerfile
Type: application/octet-stream
Size: 2458 bytes
Desc: not available
URL: <http://list.evergreen-ils.org/pipermail/evergreen-general/attachments/20230813/1797345f/attachment-0001.obj>


More information about the Evergreen-general mailing list