Skip to content
This repository has been archived by the owner on Feb 20, 2020. It is now read-only.

Bug 1587554 - Migrate generic-worker CI to community cluster and implement decision task #246

Merged
merged 3 commits into from
Dec 7, 2019

Conversation

petemoore
Copy link
Member

Migrating generic-worker CI to community cluster.

See bug 1587554 for context.

@petemoore petemoore self-assigned this Oct 17, 2019
@taskcluster taskcluster deleted a comment from coveralls Dec 3, 2019
@taskcluster taskcluster deleted a comment from community-tc-integration bot Dec 3, 2019
@taskcluster taskcluster deleted a comment from community-tc-integration bot Dec 3, 2019
@petemoore petemoore changed the title Bug 1587554 - provisionerId pmoore-test -> proj-taskcluster Bug 1587554 - Migrate generic-worker CI to community cluster and implement decision task Dec 5, 2019
@petemoore
Copy link
Member Author

petemoore commented Dec 5, 2019

In essence there are three parts to this PR:

  1. Decision Task

The huge .taskcluster.yml is gone and replaced with a single decision task. I did this to reduce the risk of inconsistencies in CI between the different platforms (no more copy/paste between task definitions), and to pave the way for us to introduce a try commit syntax in a future PR.

  1. No more hardcoded taskIds integration task dependencies

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 taskcluster.net deployment, three different tasks were created, that tests depended on. These tasks had some artifacts that the integration tests could mount, for example. Migrating to the new cluster broke these tests.

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 taskIds in the past now don't have the hardcoded taskId, but instead call a method that generates the task if it doesn't exist, or just return the taskId if it does exist.

  1. Migration to the new community-tc cluster

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.

Copy link
Contributor

@milescrabill milescrabill left a 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)
Copy link
Contributor

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?

Copy link
Member Author

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)
Copy link
Contributor

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))
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants