Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added new dockerfile #403

Merged
merged 37 commits into from
Apr 14, 2023
Merged

added new dockerfile #403

merged 37 commits into from
Apr 14, 2023

Conversation

Aristoeu
Copy link
Collaborator

@Aristoeu Aristoeu commented Feb 26, 2023

Based on SeisSCOPED container, updated mongo to 5.0, Python to 3.8

@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2023

Codecov Report

Merging #403 (05f482c) into master (551ffab) will increase coverage by 0.00%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##           master     #403   +/-   ##
=======================================
  Coverage   53.75%   53.75%           
=======================================
  Files         131      131           
  Lines       20781    20781           
=======================================
+ Hits        11170    11171    +1     
+ Misses       9611     9610    -1     

see 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Aristoeu Aristoeu marked this pull request as ready for review February 27, 2023 00:16
@Aristoeu
Copy link
Collaborator Author

Aristoeu commented Mar 7, 2023

It works fine in my local docker. I built a docker image from this branch and use docker run -p 8888:8888 to start, then in jupyter's terminal the tests are running correct. But in Singularity, many tests failed and printed the errors:
mspasspy.ccore.utility.MsPASSError: Runntime error: cannot create a database client with: localhost:27017
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno -2] Name or service not known, Timeout: 30s, Topology...

@Aristoeu
Copy link
Collaborator Author

Aristoeu commented Mar 10, 2023

Dockerfile: container-base:latest
Dockerfile_ubuntu20.04_jupyterlab: container-base:ubuntu20.04_jupyterlab
Dockerfile_ubuntu20.04_mpi: container-base:ubuntu20.04_mpi
Dockerfile_dev: base container is mongo 5.0, Python updated to 3.8
Dockerfile_old: old dockerfile

@Aristoeu Aristoeu requested a review from wangyinz March 12, 2023 04:52
@Aristoeu Aristoeu marked this pull request as draft March 16, 2023 16:49
@Aristoeu
Copy link
Collaborator Author

It works fine in my local docker. I built a docker image from this branch and use docker run -p 8888:8888 to start, then in jupyter's terminal the tests are running correct. But in Singularity, many tests failed and printed the errors: mspasspy.ccore.utility.MsPASSError: Runntime error: cannot create a database client with: localhost:27017 pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno -2] Name or service not known, Timeout: 30s, Topology...

It is solved by changing localhost to 127.0.0.1 in pymongo package. At first the change didn't work, because I imported the package at the wrong location. I added PYTHONPATH environment variable to solve this.

@Aristoeu
Copy link
Collaborator Author

Aristoeu commented Mar 18, 2023

Dockerfile: container-base:latest Dockerfile_ubuntu20.04_jupyterlab: container-base:ubuntu20.04_jupyterlab Dockerfile_ubuntu20.04_mpi: container-base:ubuntu20.04_mpi Dockerfile_dev: base container is mongo 5.0, Python updated to 3.8 Dockerfile_old: old dockerfile

The former build failure on arm is due to the use of cmake arguments SSE2 and AVX2 when building numcodecs. ARM has no support for SSE2 and AVX2. I disabled them and updated the Python version to 3.8, all tags of images can be built successfully now.

When running the images, all of them built in amd64 work well. In arm64, images built by Dockerfile_ubuntu20.04_jupyterlab and Dockerfile_dev work well.

Copy link
Member

@wangyinz wangyinz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the good work! This is pretty good except that I have a few questions which are in the inline comments. I think the questions implies to all these containers instead of just the ones with the comments.

Dockerfile_ubuntu20.04_jupyterlab Outdated Show resolved Hide resolved
Dockerfile_ubuntu20.04_jupyterlab Outdated Show resolved Hide resolved
docker-entrypoint.sh Outdated Show resolved Hide resolved
python/tests/test_ccore.py Outdated Show resolved Hide resolved
@Aristoeu Aristoeu marked this pull request as ready for review March 31, 2023 01:51
@Aristoeu Aristoeu requested a review from wangyinz March 31, 2023 01:52
Copy link
Member

@wangyinz wangyinz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good! I only have some questions posted in the comment. I think we could merge it pretty soon!

Dockerfile Outdated Show resolved Hide resolved
Dockerfile_ubuntu20.04_mpi Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@wangyinz
Copy link
Member

btw, we should address the issue (#408 (comment)) in this PR. The variables needs to be removed from the startup script and put into the container. @Yangzhengtang Could you please help @Aristoeu fix it? Thank you!

@Aristoeu
Copy link
Collaborator Author

Aristoeu commented Apr 5, 2023

pandas has a new version 2.0.0 on April 3, and has removed deprecated DataFrame.append() methods, which are used in mspass. I temporarily specified pandas version==1.5.3 in requirements.txt.

removed path and pythonpath from the startup script and put into the container

@wangyinz
Copy link
Member

wangyinz commented Apr 10, 2023

I just tried building the containers locally with arm64, and they all failed. One obvious issue that I can see is that that in the Dockerfile, there are multiple reference to focal in the lines, but after we updated the base container, the ubuntu version is not jammy. Also, after fixing that, there is still issues with the mongodb install step. It seems there is the same error even when building with amd64. Maybe there is something wrong in the mongodb repo or package name provided.

I also realized that the container-base:latest does not have a arm64 image due to the MPI built-in. This is not what we wanted as our default image because we want to be able to build both the amd64 and arm64 containers as the default. So, let's change the base image of Dockerfile to ghcr.io/seisscoped/container-base:ubuntu22.04_jupyterlab instead. Then, we can change the current Dockerfile_ubuntu22.04_jupyterlab to Dockerfile_mpi, and base it off of ghcr.io/seisscoped/container-base:latest.

Also, the Dockerfile_dev is still the old version, but in our workflow, it should be exactly the same as the Dockerfile except that it builds with the debug option. Please fix that too. Thanks! @Aristoeu

@Aristoeu
Copy link
Collaborator Author

Thanks for testing! I updated mongo to 6.0 to be compatible with ubuntu 22, and applied the changes. I built Dockerfile locally in amd and arm successfully. They should all work now.

Besides, the codecov package has been removed from PyPi as deprecated, so the recent tests #410 #412 failed. Removing installation of codecov in .github/workflows/python-package.yml will solve this issue. similar issue

@Aristoeu Aristoeu requested a review from wangyinz April 14, 2023 05:51
@wangyinz
Copy link
Member

Thank you! I will merge it now.

@wangyinz wangyinz merged commit cd1b19c into master Apr 14, 2023
@wangyinz wangyinz deleted the new_dockerfile branch April 14, 2023 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants