Closed fzimmermann89 closed 3 weeks ago
Should be merged after #460
Coverage Report
Tests | Skipped | Failures | Errors | Time |
---|---|---|---|---|
1872 | 0 :zzz: | 0 :x: | 0 :fire: | 1m 41s :stopwatch: |
:file_folder: Download as zip :mag: View online
@ckolbPTB did you have a docker file for python3.10? I think we need stupid if case in the install script:
I am getting hit by a chicken and egg problem: During build of the docker image, mrpro cannot be installed with python 3.10 as we currently install from github main (and there the min version is python 3.11) This results in missing requirements later on This results in the tests not passing. So I have to split this into two PRs.
One PR will enable 3.10 compatibility Second PR will enable tests for 3.10
...or we would have to fix the docker logic, but this would also be a second PR as I want to keep this one only python3.10 related to be able to just revert it later on
Any other suggestions? @ckolbPTB @schuenke @JoHa0811 ?
This should be merged as two commits to make undo of the python3.10 changes easier in the future.
A few questions out of curiosity:
Seems to me a lot of work for something which is outdated and we will have to revert soon again. Would it not make more sense to try to overcome the problem of python 3.10 in colab? We are not the only ones complaining about this. Are there no options to upgrade python or run one of our containers in colab (maybe something like this: https://github.com/drengskapur/docker-in-colab)?
Seems to me a lot of work for something which is outdated and we will have to revert soon again. Would it not make more sense to try to overcome the problem of python 3.10 in colab? We are not the only ones complaining about this. Are there no options to upgrade python or run one of our containers in colab (maybe something like this: https://github.com/drengskapur/docker-in-colab)?
There is no good way to use notebooks in a docker at colab.
When we moved to python 3.11, we wanted to get "Self" to work and I did not know about typing_extensions...
A few questions out of curiosity:
- Any idea why https://github.com/PTB-MR/mrpro/actions/runs/11451086815 is still running after ~6h ?
I have to manually kill them or wait till they time out. There is a bug in pip that installing packages from '/' does not work and freezes. In docklerfiles, it is common to COPY to '/', run and remove afterwards. Took me a few tries to realize this is the issue.
- Any idea why for the build of py310 and py311 the "Cached" value is ~7%, but for py312 ~28%? see here
No idea. One possible difference is how far previous runs for this task got.
- In general, splitting the docker build is a good idea imo. However, it seems like it's not resulting in a faster build yet, no? Would this change with the next run?
It should. Here the pyproject.toml changed, which it will not do most of the time..
- Any idea why for the build of py310 and py311 the "Cached" value is ~7%, but for py312 ~28%? see here
No idea. One possible difference is how far previous runs for this task got.
- In general, splitting the docker build is a good idea imo. However, it seems like it's not resulting in a faster build yet, no? Would this change with the next run?
It should. Here the pyproject.toml changed, which it will not do most of the time..
Lets try adding a scope for each docker image (py10,py11,py12): https://docs.docker.com/build/cache/backends/gha/#scope
Scope is a key used to identify the cache object. By default, it is set to buildkit. If you build multiple images, each build will >overwrite the cache of the previous, leaving only the final cache.
To preserve the cache for multiple builds, you can specify this scope attribute with a specific name. In the following example, the >cache is set to the image name, to ensure each image gets its own cache:
GitHub's cache access restrictions, still apply. Only the cache for the current branch, the base branch and the default branch is >accessible by a workflow.
This now also changed when dependencies are updated to newest versions. We do no longer update on each push to main all dependencies. Our normal PRs should not fail because a dependency is updated, this was a bit annoying in the past.
Instead, dependencies are updated if either the pyproject.toml is changed, or the VERSION is changed.
Long term, it would be great to get a dependabot-like action checking for requirements going.
Change our code to support python3.10 again --> colab!
Import all typing stuff from
typing_extension
which backports typing features and in current python versions, reexports from typing.Replace tuple unpacking in typehints by
Unpack
. This look a bit less nice but might be an ok trade-off. We can revert this commit if we want to drop python3.10 support againAdd a docker container for python 3.10
Refactor docker files: installing from github via clone will created chicken and egg problem as main was not installable in python 3.10. docker containers are now split in steps that might be cached.
Biggest difference is, our dependencies in the docker container will only update if we touch the pyproject.toml. If we want to, we can also update them on updates to VERSION, for example.
Closes #456