Closed
Bug 1371343
Opened 8 years ago
Closed 8 years ago
Create a mechanism that will update the workerId during deployment of TaskCluster Hardware Windows workers
Categories
(Infrastructure & Operations :: RelOps: General, task)
Infrastructure & Operations
RelOps: General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: markco, Assigned: markco)
Details
Currently the config file is being deployed from MDT due to secrets.
| Assignee | ||
Updated•8 years ago
|
Summary: Create a mechanism that will update the workerId for during deployment of TaskCluster Hardware Windows workers → Create a mechanism that will update the workerId during deployment of TaskCluster Hardware Windows workers
| Assignee | ||
Comment 1•8 years ago
|
||
grenade: pmoore: Any suggestion or thoughts on how to go about this?
Flags: needinfo?(rthijssen)
Flags: needinfo?(pmoore)
Comment 2•8 years ago
|
||
if the generic worker doesn't already do this, my suggestion would be that it should be patched to use the hostname from the environment if workerId is missing from the config. pmoore will know if this is already the case.
if not and we don't want to change gw, something like the following in the manifest could work (i didn't test this):
{
"ComponentName": "jqInstall",
"ComponentType": "FileDownload",
"Source": "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-win64.exe",
"Target": "C:\\Windows\\System32\\jq.exe"
},
{
"ComponentName": "UpdateWorkerId",
"ComponentType": "CommandRun",
"Command": "C:\\Windows\\System32\\jq.exe",
"Arguments": [
"\". | .workerId=%COMPUTERNAME%\"",
"C:\\generic-worker\\file-without-worker-id.config",
">C:\\generic-worker\\generic-worker.config"
],
"DependsOn": [
{
"ComponentType": "FileDownload",
"ComponentName": "jqInstall"
}
]
}
Flags: needinfo?(rthijssen)
Comment 3•8 years ago
|
||
The generic worker will expect to have a config file with the workerId specified.
I remember there was a plan to have a service in scl3 for configuring the worker, which ran prior to worker start-up. This was going to take care of fetching worker credentials. IIRC dustin / jhford were working on something here. They might be able to advise if this was also going to be responsible for configuring workerId, or whether it was strictly for providing worker TC credentials.
If this service isn't meant to configure the workerId, I agree with Rob that this would be a job for the environment setup (i.e. OCC would be a good place to put this).
Flags: needinfo?(pmoore)
Flags: needinfo?(jhford)
Flags: needinfo?(dustin)
Comment 4•8 years ago
|
||
taskcluster-host-secrets only provides temporary credentials, so I think this should be in OCC.
Flags: needinfo?(jhford)
Flags: needinfo?(dustin)
| Assignee | ||
Updated•8 years ago
|
Assignee: relops → mcornmesser
| Assignee | ||
Comment 5•8 years ago
|
||
(In reply to Rob Thijssen (:grenade - UTC+3) from comment #2)
> if the generic worker doesn't already do this, my suggestion would be that
> it should be patched to use the hostname from the environment if workerId is
> missing from the config. pmoore will know if this is already the case.
>
> if not and we don't want to change gw, something like the following in the
> manifest could work (i didn't test this):
>
> {
> "ComponentName": "jqInstall",
> "ComponentType": "FileDownload",
> "Source":
> "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-win64.exe",
> "Target": "C:\\Windows\\System32\\jq.exe"
> },
> {
> "ComponentName": "UpdateWorkerId",
> "ComponentType": "CommandRun",
> "Command": "C:\\Windows\\System32\\jq.exe",
> "Arguments": [
> "\". | .workerId=%COMPUTERNAME%\"",
> "C:\\generic-worker\\file-without-worker-id.config",
> ">C:\\generic-worker\\generic-worker.config"
> ],
> "DependsOn": [
> {
> "ComponentType": "FileDownload",
> "ComponentName": "jqInstall"
> }
> ]
> }
rob: I wasn't able to square this away before PTO. could you take a look at implementing this next week? If it is problematic I can do this with a powershell script doing a string replace at the time the file is deployed by MDT.
Flags: needinfo?(rthijssen)
Comment 6•8 years ago
|
||
implemented: https://github.com/mozilla-releng/OpenCloudConfig/commit/bb1738729375a7aac00184a916f8ac7e82e91a06
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(rthijssen)
Resolution: --- → FIXED
| Assignee | ||
Comment 7•8 years ago
|
||
As is we end up with a blank generic-worker.config file.
Grenade: let's chat about this during tomorrow's Windows meeting.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 8•8 years ago
|
||
Changed the name of the original MDT managed file to master-generic-worker.json, and changed the command in the bat file to:
cat C:\generic-worker\master-generic-worker.json | jq ". | .workerId=\"%COMPUTERNAME%\"" > C:\generic-worker\gen_worker.config
It seems that the original file needs to have the .json extension. If it is .config it will not work.
Also the target file needed to be gen_worker.config. If not we end up with this error:
2017/07/26 20:13:55 Error loading configuration from file 'C:\generic-worker\gen_worker.config'
Status: REOPENED → RESOLVED
Closed: 8 years ago → 8 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•