Skip to content
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

[Provisioner] Accept both w/ server prefix and w/o server prefix for private docker registry #2574

Merged
merged 7 commits into from
Sep 18, 2023

Conversation

cblmemo
Copy link
Collaborator

@cblmemo cblmemo commented Sep 18, 2023

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh

@cblmemo cblmemo mentioned this pull request Sep 18, 2023
5 tasks
Comment on lines 146 to 148
server_prefix = f'{docker_login_config.server}/'
if not specific_image.startswith(server_prefix):
specific_image = f'{server_prefix}{specific_image}'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we handle this here or the _with_docker_login_config in resources?
Pro for latter: we can assume the information provided to the node_provider or new provisioner always correct.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks!

@cblmemo cblmemo force-pushed the fix-docker-login-image-id branch from a840626 to ae32801 Compare September 18, 2023 07:38
Copy link
Collaborator

@Michaelvll Michaelvll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @cblmemo! LGTM with a question.

sky/task.py Show resolved Hide resolved
sky/task.py Outdated Show resolved Hide resolved
logger.warning(f'{colorama.Fore.YELLOW}Docker login configs '
f'{", ".join(constants.DOCKER_LOGIN_ENV_VARS)} '
'are provided, but no docker image is specified '
'in `image_id`. The login configs will be '
f'ignored.{colorama.Style.RESET_ALL}')
return resources
return resources.copy(_docker_login_config=docker_login_config)
# Already checked in extract_docker_image
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remind me why we do not allow multiple regions in image_id when docker is specified?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I don't remember why... And I just finished a quick review, it seems possible to add this feature, though arguably this feature is a little bit unusual. IIUC the main reason we support multiple regions is image on AWS is not cross region?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mix of image and docker image seems possible too - just using the corresponding image when we make_deploy_resources_variables will work iiuc. Let me file an issue to track on this

cblmemo and others added 2 commits September 18, 2023 01:17
Co-authored-by: Zhanghao Wu <[email protected]>
Co-authored-by: Zhanghao Wu <[email protected]>
@cblmemo cblmemo merged commit 487adb6 into master Sep 18, 2023
18 checks passed
@cblmemo cblmemo deleted the fix-docker-login-image-id branch September 18, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants