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

[GCP] Fix machine image for cluster creation #3030

Merged
merged 6 commits into from
Jan 28, 2024
Merged

Conversation

Michaelvll
Copy link
Collaborator

@Michaelvll Michaelvll commented Jan 25, 2024

Fixes #3027

The bulkInsert API fails to create VMs using machineImage along with disk parameter override, as it does a check for the source of the disk, which should not be applied when machineImage is specified (bug of GCP API).
This PR makes it fallback to the regular insert API instead to support the creation of instances using machine image.

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
    • sky launch -c test-machine-image2 --cloud gcp --disk-size 256 --num-nodes 2 --gpus A100-80GB:8; correctly failover through multiple regions
    • sky launch -c test-machine-image5 --cloud gcp --image-id p rojects/skypilot-375900/global/machineImages/test-machine-image --disk-size 256 --cpus 2 --num-nodes 4, successfully create the cluster
    • sky launch -c test-machine-image5 --cloud gcp --image-id projects/skypilot-375900/global/machineImages/test-machine-image --disk-size 256 --num-nodes 2 --gpus A100-80GB:8 successfuly failver through zones/regions.
  • All smoke tests: pytest tests/test_smoke.py --gcp
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh

Copy link
Collaborator

@cblmemo cblmemo 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 fix! Left several comments 🫡

sky/provision/gcp/instance_utils.py Show resolved Hide resolved
sky/provision/gcp/instance_utils.py Outdated Show resolved Hide resolved
sky/provision/gcp/instance_utils.py Outdated Show resolved Hide resolved
sky/provision/gcp/instance_utils.py Show resolved Hide resolved
Copy link
Collaborator

@cblmemo cblmemo left a comment

Choose a reason for hiding this comment

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

LGTM. A nit: should we modify the function name here to sth like _provision? Though I'm happy with the current implementation since most of the time it won't trigger single inserts.

def _bulk_provision(

@Michaelvll
Copy link
Collaborator Author

LGTM. A nit: should we modify the function name here to sth like _provision? Though I'm happy with the current implementation since most of the time it won't trigger single inserts.

def _bulk_provision(

Thanks for the suggestion @cblmemo! I suppose the _bulk_provision is more about provisioning multiple instances in a single function, it might be fine to keep it this way. : )

@Michaelvll Michaelvll merged commit 708e6dc into master Jan 28, 2024
19 checks passed
@Michaelvll Michaelvll deleted the fix-machine-image branch January 28, 2024 23:53
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.

[GCP] The new provisioner dropped the support for machine image
2 participants