ucphhpc / docker-migrid

Containerized MiG
GNU General Public License v2.0
3 stars 7 forks source link

Build error on v1.0.5 with rocky8 #52

Closed benibr closed 3 months ago

benibr commented 3 months ago

I experience a build error with the latest version v1.0.5 when I build with rocky8 and development.env and docker-compose_development.yml

 => [migrid-volume-init install_mig 9/9] RUN cp generated-confs/MiGserver.conf /home/mig/mig/server/     && cp generated-confs/static-skin.css /home/mig/mig/images/     && cp generated-confs/index.html /home  0.2s
 => [migrid-volume-init setup_mig_configs  1/25] RUN cd /home/mig/mig     && python shared/httpsclient.py | grep -A 80 "xml version"     > /home/mig/state/wwwpublic/oiddiscover.xml                             0.5s
 => [migrid-volume-init setup_mig_configs  2/25] RUN cp generated-confs/sshd_config-MiG-sftp-subsys /etc/ssh/     && chown 0:0 /etc/ssh/sshd_config-MiG-sftp-subsys                                              0.2s
 => ERROR [migrid-volume-init setup_mig_configs  3/25] RUN cd /home/mig/mig/src/libpam-mig     && make && make install                                                                                           1.3s
------
 > [migrid-volume-init setup_mig_configs  3/25] RUN cd /home/mig/mig/src/libpam-mig     && make && make install:
0.330 /home/mig/mig/shared/pwcrypto.py:55: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
0.330   import cryptography
0.523 /home/mig/mig/shared/pwcrypto.py:55: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
0.523   import cryptography
0.728 /home/mig/mig/shared/pwcrypto.py:55: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
0.728   import cryptography
0.832 which: no python-config in (/home/mig/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
0.843 which: no python3-config in (/home/mig/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
0.876 which: no python-config in (/home/mig/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
0.886 which: no python3-config in (/home/mig/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
0.901 /bin/sh: --: invalid option
0.901 Usage:    /bin/sh [GNU long option] [option] ...
0.901   /bin/sh [GNU long option] [option] script-file ...
0.901 GNU long options:
0.901   --debug
0.901   --debugger
0.901   --dump-po-strings
0.901   --dump-strings
0.901   --help
0.901   --init-file
0.901   --login
0.901   --noediting
0.901   --noprofile
0.901   --norc
0.901   --posix
0.901   --rcfile
0.901   --rpm-requires
0.901   --restricted
0.901   --verbose
0.901   --version
0.901 Shell options:
0.901   -ilrsD or -c command or -O shopt_option         (invocation only)
0.901   -abefhkmnptuvxBCHP or -o option
0.979 which: no python-config in (/home/mig/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
0.990 which: no python3-config in (/home/mig/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
0.992 make: --cflags: Command not found
1.025 which: no python-config in (/home/mig/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
1.036 which: no python3-config in (/home/mig/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
1.068 which: no python-config in (/home/mig/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
1.079 which: no python3-config in (/home/mig/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
1.093 /bin/sh: --: invalid option
1.093 Usage:    /bin/sh [GNU long option] [option] ...
1.093   /bin/sh [GNU long option] [option] script-file ...
1.093 GNU long options:
1.093   --debug
1.093   --debugger
1.093   --dump-po-strings
1.093   --dump-strings
1.093   --help
1.093   --init-file
1.093   --login
1.093   --noediting
1.093   --noprofile
1.093   --norc
1.093   --posix
1.093   --rcfile
1.093   --rpm-requires
1.093   --restricted
1.093   --verbose
1.093   --version
1.093 Shell options:
1.093   -ilrsD or -c command or -O shopt_option         (invocation only)
1.093   -abefhkmnptuvxBCHP or -o option
1.095 gcc -std=gnu99 -fPIC   -D'MIG_UID=1000' -D'MIG_GID=1000' -D'RATE_LIMIT_EXPIRE_DELAY=300' -D'JOBSIDMOUNT_HOME="/home/mig/state/webserver_home/"' -D'JOBSIDMOUNT_LENGTH=64' -D'JUPYTERSIDMOUNT_HOME="/home/mig/state/sessid_to_jupyter_mount_link_home/"' -D'JUPYTERSIDMOUNT_LENGTH=64' -D'PASSWORD_MIN_LENGTH=8' -D'PASSWORD_MIN_CLASSES=3' -D'SHARELINK_HOME="/home/mig/state/sharelink_home/"' -D'SHARELINK_LENGTH=10' -D'USERNAME_REGEX="^[a-zA-Z0-9][a-zA-Z0-9.@_-]{0,127}$"' -D'LIBPYTHON=""'  -Wall -Wpedantic  -o libpam_mig.so libpam_mig.c -shared
1.241 In file included from libpam_mig.c:96:
1.241 migauthhandler.c:39:10: fatal error: Python.h: No such file or directory
1.241  #include <Python.h>
1.241           ^~~~~~~~~~
1.241 compilation terminated.
1.245 make: *** [Makefile:92: libpam_mig.so] Error 1
------
failed to solve: process "/bin/sh -c cd $MIG_ROOT/mig/src/libpam-mig     && make && make install" did not complete successfully: exit code: 2
make: *** [dockerbuild] Error 17

I'm not sure where to look exactly for the root of this problem. I guess it's a error about python versions?!

Also I guess the CI didn't find it because the default is centos7, I opened #51 to address this issue.

jonasbardino commented 3 months ago

It sounds like the python lookup failing when building the PAM module for the openssh+sftpsubsys service. My immediate suspicion it that it could be related to the WITH_PY3=False default in development.yml and rocky8+ transitioning to python3. I guess we should flip the default on if so and maybe in any case because we definitely want all the python3 testing we can get. Do you have a site to test that assumption easily or should I try to get one running?

jonasbardino commented 3 months ago

It does run on our rocky8 'production' test site using WITH_PY3=True. On podman rather than docker, but I guess that detail is irrelevant here. I realized that it wasn't much effort to spin up that rocky8 development setup on my laptop, so I just did now and can confirm that I got the same error. Commenting out the development.env WITH_PY3 value to effectively rely on the Dockerfile default (True in rocky8) makes it build again. I'll probably commit that solution in the repo.

jonasbardino commented 3 months ago

Changed along with the other other python3-related PREFER_PY3 and MIG_GIT_BRANCH values in the env files, because explicit values broke at least one of the container distro flavors e.g. because they changed git branch to one not working with chosen python(3) or picked python2 on Rocky9 where unavailable. Closing here but please reopen if any issues remain.

I changed production.env accordingly assuming you don't use it directly on AU or KU IT sites anyway. You probably still want to consider syncing those changes on to your own env files, however.