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] Avoid backward compatibility issue with provisioner #2682

Merged
merged 7 commits into from
Oct 10, 2023

Conversation

Michaelvll
Copy link
Collaborator

@Michaelvll Michaelvll commented Oct 9, 2023

Previously, the cloud-specific provisioner will only be imported when the sky.provision.<cloud> is used for termination and stop for spot jobs (when provisioning logic is not implemented for the cloud). It will cause backward compatibility issue, when the following happens:

  1. sky spot launch on master (job id: 1)
  2. a new commit updated sky.provision.<cloud>
  3. sky spot launch another job, which updates the skypilot library on the spot controller
  4. sky spot cancel -a, which will load the latest sky.provision.<cloud>, which may not be compatible with other old code the spot job 1 used.

In this PR, we import the provision modules in advance to avoid the backward compatibility issue for any changes in sky.provision and sky.adaptors.<cloud> after this PR.

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
    • sky launch --cloud aws --cpus 2 -i 0 echo hi with only aws dependency installed.
    • sky launch --cloud gcp --cpus 2 -i 0 echo hi; sky status -r; sky down cluster-name with only gcp dependency installed.
    • sky launch --cloud azure --cpus 2 -i 0 echo hi with only azure dependency installed.
  • All smoke tests: pytest tests/test_smoke.py --aws
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh for aws
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh for gcp

Copy link
Collaborator

@concretevitamin concretevitamin left a comment

Choose a reason for hiding this comment

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

LGTM, may need this in soon as a hot fix. @suquark should take a look asap/after?

@Michaelvll Michaelvll merged commit d38b4b4 into master Oct 10, 2023
18 checks passed
@Michaelvll Michaelvll deleted the refactor-adaptors branch October 10, 2023 05:54
from sky.provision import common
from sky.provision import gcp
Copy link
Collaborator

Choose a reason for hiding this comment

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

later we may scan over the directory to import all modules automatically. I am fine with the current implementation though.

Copy link
Collaborator

@suquark suquark left a comment

Choose a reason for hiding this comment

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

LGTM

jc9123 pushed a commit to jc9123/skypilot that referenced this pull request Oct 11, 2023
…ypilot-org#2682)

* import cloud provisioners in advance instead of importing it online

* Fix lower

* format

* bump skylet version

* Add comment

* Add a comment for skylet version
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.

None yet

3 participants