-
Notifications
You must be signed in to change notification settings - Fork 29
Bug 1587554 - Migrate generic-worker CI to community cluster and implement decision task #246
Conversation
…oduce decision task
In essence there are three parts to this PR:
The huge
Rather than integration tests depending on pre-run tasks in the cluster, the integration tests now generate the test dependency on the fly if it doesn't exist. When the CI lived in Rather than just recreate them in the new cluster, I decided it was better to generate them on the fly if they don't exist. The tasks were documented already (those docs get deleted as part of this PR), but generating-on-the-fly seems better. So all the tasks that depended on these hardcoded
Obviously, everything needed to be ported to the new cluster. This PR includes all the changes for that to happen. See the worker overview page to see the new workers in action. At the same time I've extended test coverage to include Windows 10 on ARM, and Linux on ARM too (using a raspberry pi) and migrated the mac stadium worker to the new cluster too. We've lost Windows 7 support for now, but when we have a solution for Windows 7 (32 bit) we can add it back by reverting 0809c37. I've also manually set up a Windows 10 worker in Azure to give us Windows 10 coverage until we have an Azure provider that can spawn instances for us in Worker Manager. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, nice work! There's some magic in here but it's well commented.
return nil, fmt.Errorf("Could not read decision task YAML config file %q: %s", absYAMLPath, err) | ||
} | ||
// JSON is valid YAML, so we can safely convert, even if it is already JSON | ||
rawJSON, err := yaml.YAMLToJSON(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the reason for using github.com/ghodss/yaml
here over go-yaml is that we respect the json
struct tags above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly!
// anyway. | ||
remainingTime := time.Time(tdr.Expires).Sub(time.Now()) | ||
if remainingTime.Seconds() < 120 { | ||
t.Fatalf("You've been extremely unlucky. This test depends on task %q that was created six months ago but is due to expire in less than two minutes (%v). Wait a few minutes and try again!", taskID, remainingTime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this error, nice! 😂
v4uuid[0] &= 0x7f | ||
|
||
// Convert to a string taskID | ||
taskID = slugid.Encode(uuid.UUID(v4uuid)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is interesting, I didn't realize you could choose your own task ID to have other things depend on a fixed ID like this.
Migrating generic-worker CI to community cluster.
See bug 1587554 for context.