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

[Azure] Allow resource group specifiation for Azure instance provisioning #3764

Conversation

landscapepainter
Copy link
Collaborator

@landscapepainter landscapepainter commented Jul 19, 2024

This resolves #3659

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
    • Restart a stopped instance created with resource group specified.
    • Relaunch on existing running cluster that was created with resource group specified.
    • launch with storage_account along with resource_group_vm both specified at ~/.sky/config.yaml
    • Test Instance Deletion After Resource Group Switch
    1. create an instance, A, specifying one RG
    2. change the specified RG to another RG
    3. create another instance, B, with switched RG
    4. keep the RG used for B at config.yaml and remove A
    5. Check if A is removed successfully.
    • Check if replicas with sky serve up is created at the specified resource group.
  • All smoke tests: pytest tests/test_smoke.py
    • pytest tests/test_smoke.py --azure except:
    1. tests/test_smoke.py::test_cancel_pytorch
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Manual backward compatibility tests:
    • Ensure proper handling of Azure instances across different branches with and without resource group specification
    1. Create an Azure instance from master branch using default resource group name
    2. switch to resource group specification branch
    3. create an instance with resource_group_vm specified
    4. delete the instance created from master branch
      • check if it removes the entire RG
    5. delete the instance created from RG specification.
      • check if it removes the VM, attached resources, deployments, and role assignment without removing resource group.

@landscapepainter landscapepainter marked this pull request as draft July 19, 2024 05:07
@landscapepainter landscapepainter marked this pull request as ready for review August 12, 2024 02:21
@landscapepainter landscapepainter added this to the v0.7 milestone Oct 23, 2024
@romilbhardwaj
Copy link
Collaborator

@landscapepainter if we plan to get this in for 0.7, can we resolve merge conflicts so we can start reviewing?

@landscapepainter
Copy link
Collaborator Author

@yika-luo @michaelzhiluo Merged the master branch and re-ran smoke and manul tests as there were large changes from the master branch. This is ready for a look!

Copy link
Collaborator

@yika-luo yika-luo left a comment

Choose a reason for hiding this comment

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

Thank you for the thorough testing!

@landscapepainter landscapepainter added this pull request to the merge queue Oct 29, 2024
Merged via the queue into skypilot-org:master with commit 47ebae7 Oct 29, 2024
20 checks passed
@landscapepainter landscapepainter deleted the azure-instance-resource-group-specification branch October 29, 2024 05:31
yika-luo pushed a commit that referenced this pull request Oct 29, 2024
…ning (#3764)

* Allow resource group specifiation for Azure instance provisioning

* Add 'use_external_resource_group' under provider config

* nit

* attached resources deletion

* support deployment removal when terminating

* nit

* delete RoleAssignment when terminating

* update ARM config template

* nit

* nit

* delete role assignment with guid

* update role assignment removal logic

* Separate resource group region and VM, attached resources

* nit

* nit

* nit

* nit

* add error handling for deletion

* format

* deployment naming update

* test

* nit

* update deployment constant names

* update open_ports to wait for the nsg creation corresponding to the VM being provisioned

* format

* nit

* format

* update docstring

* add back deleted snippet

* format

* delete nic with retries

* error handle update
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.

Add option to select Azure resource group
3 participants