-
Notifications
You must be signed in to change notification settings - Fork 13
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
Docker image for top level directory #4
Conversation
Makefile
Outdated
constraints.txt: requirements.txt requirements/requirements_wrapper.txt requirements/requirements_lint.txt | ||
pip-compile $^ --output-file constraints.txt |
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 should probably look at requirements files in its subdirectories, rather than having copies of those requirements files, to avoid duplicating data. It can include requirements not just from fv3core, but also from fv3gfs-util and fv3gfs-physics.
This isn't to say there shouldn't be any requirements files at the top level (esp for linting or for running the top-level integration tests), it's just that if requirements get updated for fv3core then ideally we should only need to update the fv3core requirements in the fv3core directory.
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 good point. It now reads the requirement data for the individual repository.
docker/entrypoint.sh
Outdated
pip install -r requirements.txt | ||
pip install -e /fv3gfs-util | ||
pip install -e /fv3core | ||
pip install -e /fv3gfs-physics |
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.
Do these need a -c constraints.txt
?
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 don't think so because the docker image already installed the requirements with constraints.
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'd ask to add -c constraints.txt
. I'd expect this wouldn't update the packages, but I'm not confident that pip install package==version
followed by pip install package
will never upgrade it. And it's possible for an error or refactor to cause the requirements to no longer be installed during the docker build.
docker/dependencies.Dockerfile
Outdated
|
||
## Build FMS | ||
##--------------------------------------------------------------------------------- | ||
FROM fv3gfs-environment AS fv3gfs-fms-install |
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.
Note that if you remove fv3gfs-wrapper from this level as I suggested in another comment, it will also involve removing the FMS and ESMF stages, and fv3gfs-build
, and maybe also fv3gfs-environment
.
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.
FMS, ESMF, fv3gfs-build, and fv3gfs-environment are removed.
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.
So much cleaner now! We also talked about removing the test data link from the top level, since you will already have access to the test data through the fv3core/fv3gfs-physics mounts. You may want to add the test arguments you run inside the dev image to the README so others can conveniently copy-paste them as needed.
@@ -0,0 +1 @@ | |||
v30 |
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 is a good design, but you should communicate to the team that the integration, physics, and dycore have separate pins of the gt4py version.
Makefile
Outdated
FV3=fv3core | ||
FV3_PATH ?=/$(FV3) |
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.
The $(FV3)
variable is only used here.
FV3=fv3core | |
FV3_PATH ?=/$(FV3) | |
FV3_PATH ?=/fv3core |
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.
Actually we don't need these variables anymore, deleted
Makefile
Outdated
PHY=fv3gfs-physics | ||
PHY_PATH ?=/$(PHY) |
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.
The $(PHY) variable is only used here.
PHY=fv3gfs-physics | |
PHY_PATH ?=/$(PHY) | |
PHY_PATH ?=/fv3gfs-physics |
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.
Same as above
Makefile
Outdated
PULL ?=True | ||
CONTAINER_ENGINE ?=docker | ||
TEST_DATA_HOST ?=$(CWD)/test_data/$(EXPERIMENT) | ||
FV3UTIL_DIR=$(CWD)/fv3gfs-util |
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 unused.
FV3UTIL_DIR=$(CWD)/fv3gfs-util |
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.
Same as before
Makefile
Outdated
dev: | ||
docker run --rm -it \ | ||
--network host \ | ||
-v $(TEST_DATA_HOST):$(TEST_DATA_RUN_LOC) \ |
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 would suggest removing the test data link from the integration dev
entrypoint, to avoid adding a third place (physics, dynamics and integration) that depends on this test data. This entrypoint is the only place where you still have a dependency.
We can always specify an additional -v
flag manually to mount this data if we want to use it inside the integrations image while developing.
On that note, I think you should add a RUN_ARGS ?= --rm
flag to this file and use it in this make target, to give a clear way to add additional docker run arguments.
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.
Test data mount is removed, updated documentation to point to test data. RUN_ARGS
added.
docker/Makefile
Outdated
build_core_deps: ## build container images of dependencies | ||
docker build -f $(DEPENDENCIES_DOCKERFILE) -t $(MPI_IMAGE) $(BUILD_ARGS) --target fv3gfs-mpi ../external/fv3gfs-fortran | ||
$(MAKE) build_core_env | ||
docker build -f $(DEPENDENCIES_DOCKERFILE) -t $(SERIALBOX_IMAGE) $(BUILD_ARGS) --target fv3gfs-environment-serialbox . | ||
|
||
build_core_env: | ||
docker build -f $(DEPENDENCIES_DOCKERFILE) -t $(ENVIRONMENT_IMAGE) $(BUILD_ARGS) --target fv3gfs-environment . |
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.
It looks like build_core_env
only appears here, this would make the lines a bit more uniform.
nit: could you rename each of these to remove core
? I believe this was meant to refer to fv3core
. As mentioned in the other comment, it doesn't look like there's a need to separate dependencies into two groups here.
build_core_deps: ## build container images of dependencies | |
docker build -f $(DEPENDENCIES_DOCKERFILE) -t $(MPI_IMAGE) $(BUILD_ARGS) --target fv3gfs-mpi ../external/fv3gfs-fortran | |
$(MAKE) build_core_env | |
docker build -f $(DEPENDENCIES_DOCKERFILE) -t $(SERIALBOX_IMAGE) $(BUILD_ARGS) --target fv3gfs-environment-serialbox . | |
build_core_env: | |
docker build -f $(DEPENDENCIES_DOCKERFILE) -t $(ENVIRONMENT_IMAGE) $(BUILD_ARGS) --target fv3gfs-environment . | |
build_core_deps: ## build container images of dependencies | |
docker build -f $(DEPENDENCIES_DOCKERFILE) -t $(MPI_IMAGE) $(BUILD_ARGS) --target fv3gfs-mpi ../external/fv3gfs-fortran | |
docker build -f $(DEPENDENCIES_DOCKERFILE) -t $(ENVIRONMENT_IMAGE) $(BUILD_ARGS) --target fv3gfs-environment . | |
docker build -f $(DEPENDENCIES_DOCKERFILE) -t $(SERIALBOX_IMAGE) $(BUILD_ARGS) --target fv3gfs-environment-serialbox . |
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.
Consolidated to deps, no more reference to core_deps
docker/dependencies.Dockerfile
Outdated
#RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 && \ | ||
# update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8 && \ | ||
# update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-8 8 |
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.
Please delete these commented lines.
docker/dependencies.Dockerfile
Outdated
#RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 && \ | ||
# update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8 && \ | ||
# update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-8 8 |
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.
Same here.
docker/entrypoint.sh
Outdated
pip install -r requirements.txt | ||
pip install -e /fv3gfs-util | ||
pip install -e /fv3core | ||
pip install -e /fv3gfs-physics |
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'd ask to add -c constraints.txt
. I'd expect this wouldn't update the packages, but I'm not confident that pip install package==version
followed by pip install package
will never upgrade it. And it's possible for an error or refactor to cause the requirements to no longer be installed during the docker build.
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.
LGTM!
Update dwind phys is an object
Added docker image from the top level that includes fv3core, fv3gfs-physics, and fv3gfs-util.
fv3core
tofv3gfs-integration
fv3gfs-integration
fv3core
pytest to run withmake savepoint_tests
or manually throughmake dev && pytest -v -s --data_path=/test_data/ /port_dev/tests