Skip to content
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

[ci][docker] Tag tlcpackstaging images to tlcpack #11832

Merged
merged 2 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
285 changes: 223 additions & 62 deletions Jenkinsfile

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

63 changes: 52 additions & 11 deletions ci/jenkins/Deploy.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,21 @@ def deploy_docs() {

def deploy() {
stage('Deploy') {
if (env.BRANCH_NAME == 'main' && env.DOCS_DEPLOY_ENABLED == 'yes') {
node('CPU') {
ws({{ m.per_exec_ws('tvm/deploy-docs') }}) {
if (env.BRANCH_NAME == 'main') {
parallel(
{% call m.deploy_step(
name="Deploy Docs",
feature_flag="env.DOCS_DEPLOY_ENABLED == 'yes'",
ws="tvm/deploy-docs",
) %}
{{ m.download_artifacts(tag='docs', filenames=["docs.tgz"]) }}
deploy_docs()
}
}
}
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') }}) {
{% endcall %}
{% call m.deploy_step(
name="Upload built Docker images",
feature_flag="env.DEPLOY_DOCKER_IMAGES == 'yes' && rebuild_docker_images && upstream_revision != null",
ws="tvm/deploy-docker",
) %}
try {
withCredentials([string(
credentialsId: 'dockerhub-tlcpackstaging-key',
Expand All @@ -118,8 +122,45 @@ def deploy() {
label: 'Clean up login credentials'
)
}
}
}
{% endcall %}
{% call m.deploy_step(
name="Tag tlcpackstaging to tlcpack",
feature_flag="env.DOCS_DEPLOY_ENABLED == 'yes'",
ws="tvm/tag-images",
) %}
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'
)
}
}
{% endcall %}
)
}
}
}
Loading