Skip to content

Commit

Permalink
azure: add 'tags' argument to provision_instance (#630)
Browse files Browse the repository at this point in the history
I found this issue after seeing the latest integration test fail on GH
actions:
https://github.com/skyplane-project/skyplane/actions/runs/3293577856

---

Also adds `autoflake` to poetry dev deps
  • Loading branch information
phi-line authored Oct 24, 2022
1 parent 537ccac commit 6388037
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 6 deletions.
54 changes: 52 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ sphinx-click = "^4.3.0"
sphinx-copybutton = "^0.5.0"
Sphinx = ">=4.4,!=5.1"
sphinxext-opengraph = "^0.6.3"
autoflake = "^1.7.6"

[build-system]
requires = ["setuptools", "poetry-core>=1.0.0"]
Expand Down
9 changes: 5 additions & 4 deletions skyplane/compute/azure/azure_cloud_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def provision_instance(
uname: str = "skyplane",
use_spot_instances: bool = False,
instance_os: str = "ubuntu",
tags={"skyplane": "true"},
) -> AzureServer:
assert ":" not in location, "invalid colon in Azure location"

Expand Down Expand Up @@ -275,7 +276,7 @@ def provision_instance(
AzureServer.nsg_name(name),
{
"location": location,
"tags": {"skyplane": "true"},
"tags": tags,
"security_rules": [
{
"name": name + "-allow-all",
Expand Down Expand Up @@ -308,7 +309,7 @@ def provision_instance(
AzureServer.ip_name(name),
{
"location": location,
"tags": {"skyplane": "true"},
"tags": tags,
"sku": {"name": "Standard"},
"public_ip_allocation_method": "Static",
"public_ip_address_version": "IPV4",
Expand All @@ -325,7 +326,7 @@ def provision_instance(
AzureServer.nic_name(name),
{
"location": location,
"tags": {"skyplane": "true"},
"tags": tags,
"ip_configurations": [
{"name": name + "-ip", "subnet": {"id": subnet_result.id}, "public_ip_address": {"id": public_ip_result.id}}
],
Expand All @@ -343,7 +344,7 @@ def provision_instance(
AzureServer.vm_name(name),
{
"location": location,
"tags": {"skyplane": "true"},
"tags": tags,
"hardware_profile": {"vm_size": self.lookup_valid_instance(location, vm_size)},
"storage_profile": {
# "image_reference": {
Expand Down

0 comments on commit 6388037

Please sign in to comment.