-
Notifications
You must be signed in to change notification settings - Fork 7
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 Refactoring #78
base: 0.4
Are you sure you want to change the base?
Conversation
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.
Overall, this looks good, just two small changes in your Makefile dependencies.
|
||
docker build --no-cache -t $(NAME)_base:latest -f ../base.dockerfile . | ||
build_conda: |
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.
build_conda
should have a dependency on build_base
|
||
docker build --no-cache -t $(NAME)_base:latest -f ../base.dockerfile . | ||
build_conda: | ||
docker build --no-cache --build-arg NAME=$(NAME) -t $(NAME)_conda:latest -f docker/dockerfile.conda . | ||
|
||
build_service: |
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.
build_service
should have a dependency on build_conda
Description
This PR introduces significant improvements to the Docker setup and the build process, enhancing both efficiency and reliability. The key changes include:
Dockerfile Reorganization:
base.dockerfile
andservice.dockerfile
existed within the./services
directory. The Makefile navigated toservices/[name]/
to execute builds using these Dockerfiles../docker
directory and introduced a third Dockerfile,dockerfile.conda
. The three Dockerfiles are:dockerfile.base
dockerfile.conda
dockerfile.service
Optimized Conda Environment Setup:
services/[name]/environment.yml
in thebase.dockerfile
, leading to redundant installations and increased build times.dockerfile.base
now creates a shared base environment with common dependencies.dockerfile.conda
updates this base environment with service-specific dependencies. This reuse of the base image significantly reduces build times by avoiding repeated installations of common packages.Makefile Enhancements:
N_DEVICES
directly utilizednvidia-smi
, causing crashes on machines without Nvidia GPUs. The updated Makefile now safely checks for the presence ofnvidia-smi
before attempting to use it.Benchmarks
I conducted a performance comparison between the old and the refactored build setups on the
dev
deployment:NOTE: This benchmark excludes the
ray_worker
service from the build process. Including it would likely result in even more substantial reductions in build duration.