Thanks for opening this issue. The basic idea is to run ogs with both MKL and custom Python environment on envinf server. I'm not so clear if singularity is the best way to this target. But currently I can only use custom Python environment on envinf1 with singularity.
@bilke Dear Lars, may I ask you if this issue is successfully solved or not? Because I have just tried to build the ogs with -DOGS_USE_MKL=ON with singularity on the envinf1 but failed. The error message is that the MKL library is not found. My work command on the envinf1 within the singularity is cmake ../ogs -DCMAKE_BUILD_TYPE=Release -DOGS_DISABLE_CCACHE=ON -DOGS_USE_MKL=ON. Could you please point out where I have done wrong. Thank you very much.
If you want to build OGS in a container with the CMake option -DOGS_USE_MKL=ON make sure that the container was also built with the --mkl container maker option.
Sorry but I'm not clearly get your mean about 'the conatiner was also built with the --mkl container maker option'. I get the image of the ogs container from singularity pull docker://registry.opengeosys.org/ogs/ogs/gcc. Do you mean I should not get the image from this link, but should make a user defined container? How could I do it? Is there a userguide I can refer to? Thanks.
Sorry.. It seems I have found the userguide. It's in the project overview site of the OGS COntainer Maker. I will firstly look into it. Thanks!
@bilke Thanks for your updating. Now the ogs.py can be found. However, at the last step when building a image, I met a problem again. The comman I gave is as follows:
Evaluating compiler.py
Evaluating ogs.py
Created definition /home/chensh/source/_out/docker/clang/8/ogs-f06be701/system/Dockerfile
Running: DOCKER_BUILDKIT=1 docker build -t registry.opengeosys.org/ogs/ogs/clang-8-ogs-f06be701-system-dev:latest -f _out/docker/clang/8/ogs-f06be701/system/Dockerfile .
failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: permission denied
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/registry.opengeosys.org/ogs/ogs/clang-8-ogs-f06be701-system-dev:latest/json": dial unix /var/run/docker.sock: connect: permission denied
Traceback (most recent call last):
File "/home/chensh/.venv/ogs-container-maker/bin/ogscm", line 8, in
sys.exit(main())
File "/home/chensh/.venv/ogs-container-maker/lib/python3.9/site-packages/ogscm/cli.py", line 278, in main
b.build()
File "/home/chensh/.venv/ogs-container-maker/lib/python3.9/site-packages/ogscm/app/builder.py", line 23, in build
self.build_docker()
File "/home/chensh/.venv/ogs-container-maker/lib/python3.9/site-packages/ogscm/app/builder.py", line 46, in build_docker
inspect_out = subprocess.check_output(
File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'docker inspect registry.opengeosys.org/ogs/ogs/clang-8-ogs-f06be701-system-dev:latest | grep Id' returned non-zero exit status 1.
I re-tried with ogscm compiler.py ogs.py --build and met the same message. And in the folder _out/images/ there is no image(I guess should be a image with name of xxx.sif) to be found.
I'm very sorry for disturb you a lot. But could you please also have a check. Thanks!
@ShuangChen88 Ah sorry my fault. You need to have privileges to run docker. I have added you to the docker-group on envinf1. You may have to log out and login and try again!
@bilke Thank you very much, Lars. May I ask you is that mean I can only build a ogs container on envinf1? Because now I'm trying to make a container on envinf2 :).
Thank you for you help. Now I have succesfully built a image on envinf2 with ogscm compiler.py ogs.py --build --convert :).
But I failed to built on envinf1 with ogscm compiler.py ogs.py --compiler clang --mkl --build --convert. The error message I got is:
=> ERROR [25/25] RUN scif install /scif/recipes/ogs.scif 147.0s
[25/25] RUN scif install /scif/recipes/ogs.scif:
#32 7.591 Cloning into 'src'...
#32 7.809 warning: redirecting to https://gitlab.opengeosys.org/ogs/ogs.git/
#32 18.42 warning: redirecting to https://gitlab.opengeosys.org/ogs/ogs.git/
Updating files: 100% (7088/7088), done.
#32 86.64 HEAD is now at f06be7019 Merge branch 'GocadTSurfaceReader_Linux' into 'master'
#32 86.81 warning: redirecting to https://gitlab.opengeosys.org/ogs/ogs.git/
#32 88.08 -- The C compiler identification is Clang 8.0.1
#32 89.43 -- The CXX compiler identification is Clang 8.0.1
#32 89.43 -- Detecting C compiler ABI info
#32 90.26 -- Detecting C compiler ABI info - done
#32 90.27 -- Check for working C compiler: /usr/bin/clang - skipped
#32 90.27 -- Detecting C compile features
#32 90.27 -- Detecting C compile features - done
#32 90.28 -- Detecting CXX compiler ABI info
#32 90.99 -- Detecting CXX compiler ABI info - done
#32 91.00 -- Check for working CXX compiler: /usr/bin/clang++ - skipped
#32 91.00 -- Detecting CXX compile features
#32 91.00 -- Detecting CXX compile features - done
#32 91.00 -- Downloading CPM.cmake to /scif/apps/ogs/build/cmake/CPM_0.31.1.cmake
#32 91.50 -- CPM: adding package cmake-modules@0 (cdc041689061fbb2df086b059fe71ac868cf626d)
#32 97.63 -- Found Git: /usr/bin/git (found version "2.31.0")
#32 97.68 -- OGS VERSION: 6.3.3-812-gf06be7019 (reported by git)
#32 97.68 -- CPM: adding package json-cmake@0 (9708cb091f6b89b94d71ae98f8b9e68ea04c47dd)
#32 99.41 Creating virtualenv ogs-build in /scif/apps/ogs/build/.venv
#32 99.86 Updating dependencies
#32 99.86 Resolving dependencies...
#32 99.86
#32 99.86 Writing lock file
#32 100.2 -- Found Python3: /scif/apps/ogs/build/.venv/bin/python (found suitable version "3.8.5", minimum required is "3.6") found components: Interpreter Development Development.Module Development.Embed
#32 100.8
#32 100.8 Updating dependencies
#32 100.8 Resolving dependencies...
#32 138.8
#32 138.8 Writing lock file
#32 138.9
#32 138.9 Package operations: 30 installs, 0 updates, 0 removals
#32 138.9
#32 138.9 • Installing decorator (4.4.2)
#32 138.9 • Installing ipython-genutils (0.2.0)
#32 138.9 • Installing six (1.15.0)
#32 140.0 • Installing attrs (20.3.0)
#32 140.0 • Installing docutils (0.16)
#32 140.0 • Installing pyparsing (2.4.7)
#32 140.0 • Installing pyrsistent (0.17.3)
#32 140.0 • Installing smmap (3.0.5)
#32 140.1 • Installing traitlets (4.3.3)
#32 141.9 • Installing amply (0.1.4)
#32 141.9 • Installing certifi (2020.12.5)
#32 141.9 • Installing chardet (4.0.0)
#32 141.9 • Installing gitdb (4.0.5)
#32 141.9 • Installing idna (2.10)
#32 141.9 • Installing jsonschema (3.2.0)
#32 141.9 • Installing jupyter-core (4.7.1)
#32 142.0 • Installing urllib3 (1.26.4)
#32 142.7 • Installing appdirs (1.4.4)
#32 142.7 • Installing configargparse (1.4)
#32 142.7 • Installing datrie (0.8.2)
#32 142.7 • Installing nbformat (5.1.2)
#32 142.7 • Installing gitpython (3.1.14)
#32 142.7 • Installing pyyaml (5.4.1)
#32 142.7 • Installing ratelimiter (1.2.0.post0)
#32 142.7 • Installing requests (2.25.1)
#32 142.7 • Installing psutil (5.8.0)
#32 142.7 • Installing pulp (2.4)
#32 142.7 • Installing toposort (1.6)
#32 142.7 • Installing wrapt (1.12.1)
#32 144.4 Connection pool is full, discarding connection: files.pythonhosted.org
#32 145.4 • Installing snakemake (5.27.4)
#32 146.8 -- Set release compiler flags
#32 146.8 CMake Error at scripts/cmake/CompilerSetup.cmake:110 (message):
#32 146.8 Aborting: Clang 9.0 is required! Found version 8.0.1
#32 146.8 Call Stack (most recent call first):
#32 146.8 CMakeLists.txt:80 (include)
#32 146.8
#32 146.8
#32 146.8 -- Configuring incomplete, errors occurred!
#32 146.8 See also "/scif/apps/ogs/build/CMakeFiles/CMakeOutput.log".
#32 146.8 Installing base at /scif
#32 146.8 + apprun ogs
#32 146.8 + appenv ogs
#32 146.8 + apphelp ogs
#32 146.8 + applabels ogs
#32 146.8 + appinstall ogs
#32 146.8 ERROR Return value 256 for install of ogs
failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = failed to build LLB: executor failed running [/bin/sh -c scif install /scif/recipes/ogs.scif]: runc did not terminate sucessfully
Error: No such object: registry.opengeosys.org/ogs/ogs/clang-8-ogs-f06be701-system-dev:latest
Traceback (most recent call last):
File "/home/chensh/.venv/ogs-container-maker/bin/ogscm", line 8, in
sys.exit(main())
File "/home/chensh/.venv/ogs-container-maker/lib/python3.9/site-packages/ogscm/cli.py", line 278, in main
b.build()
File "/home/chensh/.venv/ogs-container-maker/lib/python3.9/site-packages/ogscm/app/builder.py", line 23, in build
self.build_docker()
File "/home/chensh/.venv/ogs-container-maker/lib/python3.9/site-packages/ogscm/app/builder.py", line 46, in build_docker
inspect_out = subprocess.check_output(
File "/usr/lib/python3.9/subprocess.py", line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.9/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'docker inspect registry.opengeosys.org/ogs/ogs/clang-8-ogs-f06be701-system-dev:latest | grep Id' returned non-zero exit status 1.
I will try more tommorow and update you my latest status.
@bilke Thanks for your comment. After setting --compiler_version 9 the container ogs.sif is successfully built with clang.
However, during my test I met another problem which I think I need to report to you. By using gcc and clang compiler I successfully created two '.sif' image on envinf2. After that I cd to the folder where the '.sif' file located. And then I give the following command which according to your 'Run' part in the Readme guide:
So I'm not sure if I really successfully created a ogs singularity image or not.
Besides, my beginning target is trying to run a simulation with custom python environment and MKL together on envinf. So I tried to generate a specific container for my use. Now I changed a way to work around the problem. I changed my python code for my simulation, which only uses the included python modules that already existed on envinf2. Now my simulation is successfully started with MKL under the envinf2's python environment. So currently I do not need to generate a specific container, but I will still try myself to make through the way of singularity generation.
Thank you very much for your continued supports and suggestions to me.
Per default ogs is not in the PATH. You could start the container with the --app ogs option (this sets the PATH inside to container to /scif/apps/ogs/bin):