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

feat: add generic-worker metadata to pool configurations #179

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/ciadmin/generate/worker_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,16 @@ def get_azure_provider_config(
{"implementation": implementation},
)
worker_config = merge(worker_config, config.get("worker-config", {}))
gw_config = worker_config["genericWorker"]["config"]
if azure_config.get("wst_server_url"):
worker_config["genericWorker"]["config"].setdefault(
"wstServerURL", azure_config["wst_server_url"]
)
gw_config.setdefault("wstServerURL", azure_config["wst_server_url"])

try:
metadata = image.image_id(provider_id, "generic_worker_metadata")
gw_config.setdefault("workerTypeMetaData", metadata)
except KeyError:
pass

tags = config.get("tags", {})

launch_configs = []
Expand Down
5 changes: 3 additions & 2 deletions tests/ciadmin/test_generate_worker_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def inner(provider, extra_config=None):
"locations": ["us-east1"],
"image_resource_group": "rg",
"vmSizes": [{"vmSize": "Standard_F8s_v2"}],
"worker-config": {"genericWorker": {"config": {}}},
"worker-purpose": "test",
}
)
Expand Down Expand Up @@ -186,7 +187,7 @@ def assert_azure_basic(pool):
},
"subnetId": "/subscriptions/subscription_id/resourceGroups/rg-us-east1-test/providers/Microsoft.Network/virtualNetworks/vn-us-east1-test/subnets/sn-us-east1-test", # noqa: E501
"tags": {"deploymentId": "d_id"},
"workerConfig": {},
"workerConfig": {"genericWorker": {"config": {}}},
}


Expand All @@ -208,7 +209,7 @@ def assert_azure_version(pool):
},
"subnetId": "/subscriptions/subscription_id/resourceGroups/rg-us-east1-test/providers/Microsoft.Network/virtualNetworks/vn-us-east1-test/subnets/sn-us-east1-test", # noqa: E501
"tags": {"deploymentId": "d_id"},
"workerConfig": {},
"workerConfig": {"genericWorker": {"config": {}}},
}


Expand Down