Skip to content

Commit ee5709b

Browse files
committed
[ci][docker] Tag tlcpackstaging images to tlcpack
See #11768, this PR changes the deploy workflow so that after a successful build with fallback images (see #11775), they get moved over to tlcpack automatically
1 parent ec39199 commit ee5709b

File tree

2 files changed

+134
-1
lines changed

2 files changed

+134
-1
lines changed

Jenkinsfile

Lines changed: 112 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/jenkins/Deploy.groovy.j2

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,28 @@ def deploy() {
8686
}
8787
}
8888
}
89+
if (env.BRANCH_NAME == 'main' && env.RETAG_STAGING_IMAGES == 'yes') {
90+
withCredentials([string(
91+
credentialsId: 'dockerhub-tlcpack-key',
92+
variable: 'TLCPACK_TOKEN',
93+
)]) {
94+
{% for image in images %}
95+
if ({{ image.name }}.contains("tlcpackstaging")) {
96+
// Push image to tlcpack
97+
def tag = {{ image.name }}.split(":")[1]
98+
sh(
99+
script: """
100+
set -eux
101+
CONTENT_TYPE="application/vnd.docker.distribution.manifest.v2+json"
102+
MANIFEST=\$(curl -H "Accept: \${CONTENT_TYPE}" "https://hub.docker.com/v2/tlcpackstaging/{{ image.name }}/manifests/${tag}")
103+
curl -X PUT -H "Authorization: Bearer \${TLCPACK_TOKEN}" -H "Content-Type: \${CONTENT_TYPE}" -d "\${MANIFEST}" "https://hub.docker.com/v2/tlcpack/{{ image.name.replace("_", "-") }}/manifests/${tag}"
104+
""",
105+
label: 'Tag tlcpackstaging image to tlcpack',
106+
)
107+
}
108+
{% endfor %}
109+
}
110+
}
89111
if (env.BRANCH_NAME == 'main' && env.DEPLOY_DOCKER_IMAGES == 'yes' && rebuild_docker_images && upstream_revision != null) {
90112
node('CPU') {
91113
ws({{ m.per_exec_ws('tvm/deploy-docker') }}) {

0 commit comments

Comments
 (0)