-
Notifications
You must be signed in to change notification settings - Fork 18
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
Rewamp Docker file for home archiving #773
Conversation
efed403
to
4fd2159
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #773 +/- ##
=======================================
Coverage 68.28% 68.28%
=======================================
Files 45 45
Lines 4143 4143
=======================================
Hits 2829 2829
Misses 1314 1314
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
4fd2159
to
731ee91
Compare
2489325
to
efdb7e5
Compare
7d63263
to
9c64aaf
Compare
|
||
on: | ||
pull_request: | ||
paths: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're copying the full contents of the repo in the image, I don't think we can do any filtering here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @danielhollas. Just go through the PR, some minor comments, let's discuss tomorrow.
run: pytest -v tests --cov=aiidalab_qe | ||
env: | ||
TAG: ${{ matrix.tag }} | ||
run: pytest -v tests ${{ matrix.aiida-core-version == '2.3' && '--cov=aiidalab_qe' || '' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit confusing can you explain what it achieved? Is it equivalent as original one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I can add a comment, this is explained more in #764 on which this PR builds. Could you please take a look and review that separately? This just means that tests with aiida=2.5 will not run with --cov
which speeds them up quite a lot.
# 3.Install python dependencies | ||
# Use uv instead of pip to speed up installation, per docs: | ||
# https://github.com/astral-sh/uv/blob/main/docs/guides/docker.md#using-uv-temporarily | ||
# Use the same constraint file as pip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice stuff!
if [[ ! -d ${home} ]]; then | ||
echo "Directory $home does not exist!" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this check exist in @superstar54's implementation, but why it is necessary, when is the home can be empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to guard against if somebody executed this script by mistake outside of the container.
Thanks! It would be great if you at @superstar54 could give it a test, run the container and open the QeApp and try running some calculation to see if things are working, it's possible I overlooked something. |
The PR to ghcr is not triggered, if you can bring it back, I think it is even better to test on the Azure k8s. |
Hi @danielhollas , thanks for the great work. I have tested locally, and the QEApp is running fine. One comment: in #740 , it only takes 6 s to launch, and this PR needs around ~ 12 s, any improvement can be done? |
I don't know, feel free to investigate. But I suspect that in #774 you're not doing some work that actually needs to get done, e.g. generating the SSH key and running database migration. Those two things easily add 3s. |
You can test how much time it takes if you run it for the second time (with the volume attached). If there is any time difference, that would suggest that an improvement is possible |
Closing in favour of #778 |
Build on top of #764
Alternative to #740
The main goal here is to reduce the complexity of status quo and of #740.
00_untar_home.sh
which is basically the same here as in Docker image with home directory tar #740.build.json
anddocker-bake.hcl
which were introducing unnecessary complexity. One can now build the image by simply runningdocker build . -t aiidalab/qe:newbuild
. This also allowed me to use podman on my dev machine, which otherwise doesn't support the buildx backend.I've done some quick benchmarking, at starting the container takes around 12s on my machine. The image takes around 6.5Gb. We could trade around 300Mb images size for extra 3s of startup time if we compressed the home.tar archive. (My timings seems roughly consistent with those observed in #740.
@unkcpz @superstar54 Let me know what you think. I'd recommend to ignore the noise in the diff and just look at the new Dockerfile to see if that makes sense.
I am happy to split this up to smaller pieces if somebody will actually review them. :-P