indico / indico-containers

Containerization of Indico
27 stars 26 forks source link

Failed to build #16

Closed marcbria closed 5 years ago

marcbria commented 5 years ago

With last docker version, I cloned the project, edit the indico.env with my port and pwd and then run the "docker-compose up" but I got an error:

+ pip download --no-deps -d /tmp/indico-pip indico
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting indico
  Downloading https://files.pythonhosted.org/packages/69/b1/6f5687f07fd4d26b15f3be8e845de4a94863dab100ca809c3c5b548ca2b2/indico-2.2.2-py2-none-any.whl (44.5MB)
  Saved /tmp/indico-pip/indico-2.2.2-py2-none-any.whl
Successfully downloaded indico
+ unzip /tmp/indico-pip/indico-2.2.2-py2-none-any.whl -d /srv/ 'indico/htdocs/*'
Archive:  /tmp/indico-pip/indico-2.2.2-py2-none-any.whl
caution: filename not matched:  indico/htdocs/*
ERROR: Service 'indico-static' failed to build: The command '/bin/sh -c set -ex &&         mkdir /tmp/indico-pip &&         pip install -U pip &&         pip download --no-deps -d /tmp/indico-pip indico &&         unzip /tmp/indico-pip/indico-*.whl -d /srv/ 'indico/htdocs/*' &&         rm -rf /tmp/indico-pip' returned a non-zero code: 11

Any clue about what is happening?

Thanks in advance, m.

ThiefMaster commented 5 years ago

Looks like we never updated this for 2.2 so it tries to include the old htdocs folder which doesn't exist anymore here: https://github.com/indico/indico-containers/blob/40ca341243bf691990b9899a5333de4327e56897/indico/static/Dockerfile#L13

Try replacing indico/htdocs/* with indico/web/static/* in that line.

ThiefMaster commented 5 years ago

You'll also have to adapt the nginx config here:

https://github.com/indico/indico-containers/blob/df0e50e69bb5d7b1ac7abfd69077e648cc375740/nginx/indico.conf.template#L13-L25

based on the 2.2-style paths here: https://docs.getindico.io/en/stable/installation/production/debian/nginx/

A PR updating this to work with 2.2 would be greatly appreciated! :)

marcbria commented 5 years ago

Woooww... 2 minutes. Probably that was the fastest answer I ever get in my 20 years working with free software. I will make a capture to show when I need to finish those silly discussions. ;-)

Thanks. Fixing Dockerfile paths worked and now I can rise the container... but I'm still unable to reach the site... probably because nginx configuration. I'm not a nginx guy (still stuck in apache) but took a look to the link you sent and they look fine to me. If you give further indications I love to fix and make the PR.

BTW, just in case it could be related: The only port I have open in my server for this service is 8084. So I replaced 8080 port in docker-compose and in .env file (but not anywhere else). Is it fine?

Thanks for your time, m.

ThiefMaster commented 5 years ago

Basically the regexes matching the various types of assets and paths the aliases point to changed between 2.1 and 2.2. You can see what changed here (in the /etc/nginx/conf.d/indico.conf block):

marcbria commented 5 years ago

A diff between both versions show the flowing changes:

10a11
> chown-socket = indico:nginx
72,73c73,74

Something new to add in "/etc/uwsgi/apps-available/indico.ini" isn't it?

<   location ~ ^/static/assets/(core|(?:plugin|theme)-[^/]+)/(.*)$ {
<     alias /opt/indico/assets/$1/$2;

To be removed in " /etc/nginx/conf.d/indico.conf", yes?

>   location ~ ^/(images|fonts)(.*)/(.+?)(__v[0-9a-f]+)?\.([^.]+)$ {
>     alias /opt/indico/web/static/$1$2/$3.$5;
77,78c78,79
<   location ~ ^/(css|images|js|static(?!/plugins|/assets|/themes|/custom))(/.*)$ {
<     alias /opt/indico/web/htdocs/$1$2;

I can find a match for this rule in the master branch: https://github.com/indico/indico-containers/blob/master/nginx/indico.conf.template What do you want me to do?

>   location ~ ^/(css|dist|images|fonts)/(.*)$ {
>     alias /opt/indico/web/static/$1/$2;
83c84
<     alias /opt/indico/web/htdocs/robots.txt;
>     alias /opt/indico/web/static/robots.txt;
88c89

The closest one is this "alias /opt/indico/static/htdocs/robots.txt". Unsure if I really need to touch this.

Sorry to ask to be so specific, but as I don't know know nginx works... I'm kind of blind here.