-
Notifications
You must be signed in to change notification settings - Fork 511
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
[Core] Add docker run options #3682
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.
Thanks @Michaelvll! - haven't tried but the code lgtm. Left some comments on the documentation.
Co-authored-by: Romil Bhardwaj <romil.bhardwaj@berkeley.edu>
… into docker-run-options
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 @Michaelvll! LGTM - this will be quite helpful for our users.
Nit - bad args in run_config
aren't surfaced nicely, but can be debugged by the user if they go through the logs. We may want to improve the error surfacing here in the future. Example.
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 for adding this @Michaelvll ! It would be useful for our user :) Left one thing to discuss and other parts looks great to me!
# These options will be passed directly as command line args to `docker run`, | ||
# see: https://docs.docker.com/reference/cli/docker/container/run/ | ||
# | ||
# The following run options are applied by default and cannot be overridden: |
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.
Where have we guarantee this "cannot be override"? In the code it seems like we are just appending them in the docker run cmds and follow the default behaviour of multiple same argument to the command. Do we need some checks on the docker run options to make sure it does not conflict w/ existing options?
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 is hard to check the arguments for docker. It might be fine for now to allow the program to proceed and let it error out after the cluster is launched. Since we have allowed the change of run_options
for an existing cluster, a user can quickly fix it according to the error message. Wdyt?
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.
sounds good!
The error surfacing should be better now, by avoiding unnecessary retries and printing out the error:
Remove the problematic arguments, and Tested:
|
* Add docker run options * Add docs * Add warning for docker run options in kubernetes * Update docs/source/reference/config.rst Co-authored-by: Romil Bhardwaj <romil.bhardwaj@berkeley.edu> * update * update doc * Stream logs * allow changing the `run_options` --------- Co-authored-by: Romil Bhardwaj <romil.bhardwaj@berkeley.edu>
This PR adds a new field allowing users to customize the
run_options
for the docker image.TODO:
- [ ] propagate the(We cannot apply docker run_options to k8s pod containers)run_options
for k8s.Tested (run the relevant ones):
bash format.sh
sky launch -c test-dind --cloud aws --cpus 2 --image-id docker:continuumio/miniconda3:24.1.2-0 "apt update; apt install -y docker.io; docker run hello-world"
with config above.sky launch -c test-dind --cloud gcp --cpus 2 --image-id docker:continuumio/miniconda3:24.1.2-0 "apt update; apt install -y docker.io; docker run hello-world"
with config above.sky launch -c test-dind --cloud azure --cpus 2 --image-id docker:continuumio/miniconda3:24.1.2-0 "apt update; apt install -y docker.io; docker run hello-world"
with config above.pytest tests/test_smoke.py
pytest tests/test_smoke.py::test_fill_in_the_name
conda deactivate; bash -i tests/backward_compatibility_tests.sh