Skip to content

Commit

Permalink
[ci][docker] Tag tlcpackstaging images to tlcpack
Browse files Browse the repository at this point in the history
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
  • Loading branch information
driazati committed Aug 11, 2022
1 parent ecfd969 commit 74c537b
Show file tree
Hide file tree
Showing 2 changed files with 156 additions and 1 deletion.
124 changes: 123 additions & 1 deletion Jenkinsfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions ci/jenkins/Deploy.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,39 @@ def deploy() {
}
}
}
if (env.BRANCH_NAME == 'main' && env.RETAG_STAGING_IMAGES == 'yes') {
withCredentials([string(
credentialsId: 'dockerhub-tlcpack-key',
variable: 'TLCPACK_TOKEN',
)]) {
try {
sh(
script: 'echo $TLCPACK_TOKEN | docker login --username octomldriazati --password-stdin',
label: 'Log in to Docker Hub'
)
{% for image in images %}
if ({{ image.name }}.contains("tlcpackstaging")) {
// Push image to tlcpack
def tag = {{ image.name }}.split(":")[1]
sh(
script: """
set -eux
docker pull tlcpackstaging/{{ image.name }}:${tag}
docker tag tlcpackstaging/{{ image.name }}:${tag} tlcpack/{{ image.name.replace("_", "-") }}:${tag}
docker push tlcpack/{{ image.name.replace("_", "-") }}:${tag}
""",
label: 'Tag tlcpackstaging/{{ image.name }} image to tlcpack',
)
}
{% endfor %}
} finally {
sh(
script: 'docker logout',
label: 'Clean up login credentials'
)
}
}
}
if (env.BRANCH_NAME == 'main' && env.DEPLOY_DOCKER_IMAGES == 'yes' && rebuild_docker_images && upstream_revision != null) {
node('CPU') {
ws({{ m.per_exec_ws('tvm/deploy-docker') }}) {
Expand Down

0 comments on commit 74c537b

Please sign in to comment.