support defining metadata in worker pool definition
Categories
(Taskcluster :: Services, enhancement)
Tracking
(Not tracked)
People
(Reporter: grenade, Unassigned)
Details
when attempting to define metadata in a worker pool definition an error is returned stating:
Schema Validation Failed! Rejecting Schema: https://schemas.taskcluster.net/worker-manager/v1/config-google.json# Errors:
data should NOT have additional properties: "metadata"
since metadata attributes are where the instance startup script is defined, it is important that we are able to set these values. additionally, it is useful for occ to have some way to determine certain characteristics of its environment from the instance metadata. eg:
...
"metadata": {
"items": [
{
"key": "windows-startup-script-url",
"value": "gs://open-cloud-config/gcloud-startup.ps1"
},
{
"key": "workerType",
"value": "gecko-1-b-win2012-gamma"
},
{
"key": "sourceOrg",
"value": "mozilla-releng"
},
{
"key": "sourceRepo",
"value": "OpenCloudConfig"
},
{
"key": "sourceRevision",
"value": "gamma"
}
]
},
...
Comment 1•7 years ago
|
||
This is supported as-is via the workerConfig field (here).
We don't let you set metadata directly because worker-manager has to set things in that field as well. If you want to read it directly, we can help with that process or worker-runner natively understands it.
Basically it just shows up in a metadata field called config.workerConfig.
I guess this doesn't work with a startup script but why do we want to do that dynamically instead of baking it in?
Comment 2•7 years ago
|
||
We could also support startup scripts via a new field that worker-runner knows how to run at boot?
| Reporter | ||
Comment 3•7 years ago
|
||
to get windows workers unblocked for now, i have set attributes at the project level. eg:
for project_name in fx-workers-tier1-prod fx-workers-tier3-prod fx-workers-test-prod; do
gcloud compute project-info add-metadata --project ${project_name} --metadata windows-startup-script-url=gs://open-cloud-config/gcloud-startup.ps1,sourceOrg=mozilla-releng,sourceRepo=OpenCloudConfig,sourceRevision=gamma
done
Comment 4•7 years ago
|
||
This should be supported now. Just set the metadata keys like usual and we'll override just the ones we need.
Description
•