-
Notifications
You must be signed in to change notification settings - Fork 26
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
Publish images via pulse rather than dockerhub. #378
Draft
tomprince
wants to merge
1
commit into
mozilla-releng:main
Choose a base branch
from
tp-tc:pulse-images
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,3 @@ jobs: | |
definition: node | ||
args: | ||
NODE_VERSION: "14" | ||
skopeo: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
taskcluster/shipit_taskgraph/transforms/cloudops_deploy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
""" | ||
Deployment secret related environment variables | ||
""" | ||
|
||
from __future__ import absolute_import, print_function, unicode_literals | ||
|
||
from six import text_type | ||
from voluptuous import Required, Optional | ||
|
||
from taskgraph.transforms.base import TransformSequence | ||
from taskgraph.transforms.task import task_description_schema | ||
from taskgraph.util.schema import Schema, taskref_or_string | ||
|
||
transforms = TransformSequence() | ||
|
||
deploy_schema = Schema( | ||
{ | ||
Required('name'): text_type, | ||
Required('job-from'): task_description_schema['job-from'], | ||
Required("description"): task_description_schema['job-from'], | ||
Required("project"): text_type, | ||
Required("image-task-id"): taskref_or_string, | ||
Optional("variant"): text_type, | ||
Required("dependencies"): {text_type: text_type}, | ||
} | ||
) | ||
|
||
transforms.add_validate(deploy_schema) | ||
|
||
|
||
CLOUDOPS_DEPLOY_ROUTE = "cloudops.deploy.v1.{project}.{environment}" | ||
|
||
|
||
@transforms.add | ||
def build_task(config, jobs): | ||
"""Set the environment variables for the push to docker hub task.""" | ||
for job in jobs: | ||
# skip the task if we don't need to push the image | ||
if not config.params.get("deploy"): | ||
continue | ||
|
||
route = CLOUDOPS_DEPLOY_ROUTE.format( | ||
project=job["project"], environment=config.params["deployment_branch"], | ||
) | ||
deploy = { | ||
"image-task-id": job["image-task-id"], | ||
} | ||
if "variant" in job: | ||
deploy["variant"] = job["variant"] | ||
|
||
task = { | ||
'name': job['name'], | ||
"description": job["description"], | ||
"worker-type": "succeed", | ||
"dependencies": job["dependencies"], | ||
"extra": {"cloudops-deploy": deploy}, | ||
"routes": [route], | ||
} | ||
yield task |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We might be able to parameterize this in the k8s-image task, and use single_dep to create a push-image task per k8s-image task. I don't think that's a massive win with 2 k8s-image tasks, so I think this is a perfectly fine implementation.
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.
Yeah, I was definitely thinking more about the shape of the resulting tasks, than taskgraph details. Your idea of encoding it in the build task makes sense. If we do that, we could also use that as a check in
cloudops-infra-deploylib
, that the image was intended to be used for where the hook is telling it to use it. I suspect that would make secops happy; I know that when @ajvb was reviewing the hg stuff for ci-admin, having checks for the info received via pulse was desirable.