From 5c65a2bf0663dd3b352d926781ae424a6ae3e4da Mon Sep 17 00:00:00 2001 From: driazati Date: Fri, 18 Nov 2022 22:36:28 -0800 Subject: [PATCH] [ci][docs] Fix docs deploy The docs deploy is broken following #13335: https://ci.tlcpack.ai/blue/organizations/jenkins/tvm/detail/main/4754/pipeline This avoids downloading the whole docs directory (which is just used to host documentation previews for PRs) and just grabs the `docs.tgz` which is actually used to deploy the docs. --- Jenkinsfile | 9 ++++----- ci/jenkins/Deploy.groovy.j2 | 5 ++++- ci/scripts/jenkins/s3.py | 7 ++++++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dfa9a7eda284..23c022abd335 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,7 +45,7 @@ // 'python3 jenkins/generate.py' // Note: This timestamp is here to ensure that updates to the Jenkinsfile are // always rebased on main before merging: -// Generated at 2022-11-17T23:53:21.059864 +// Generated at 2022-11-19T01:24:31.191996 import org.jenkinsci.plugins.pipeline.modeldefinition.Utils // NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. --> @@ -3646,10 +3646,9 @@ def deploy() { timeout(time: max_time, unit: 'MINUTES') { init_git() sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/docs", - label: 'Download artifacts from S3', - ) - + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/docs --items docs.tgz", + label: 'Download docs folder from S3', + ) deploy_docs() } } diff --git a/ci/jenkins/Deploy.groovy.j2 b/ci/jenkins/Deploy.groovy.j2 index 9bb6257f7a74..5cfffc7caef3 100644 --- a/ci/jenkins/Deploy.groovy.j2 +++ b/ci/jenkins/Deploy.groovy.j2 @@ -91,7 +91,10 @@ def deploy() { ws="tvm/deploy-docs", ) %} init_git() - {{ m.download_artifacts(tag='docs') }} + sh( + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/docs --items docs.tgz", + label: 'Download docs folder from S3', + ) deploy_docs() {% endcall %} {% call m.deploy_step( diff --git a/ci/scripts/jenkins/s3.py b/ci/scripts/jenkins/s3.py index f5aa535df8c4..63fbaac5fafc 100755 --- a/ci/scripts/jenkins/s3.py +++ b/ci/scripts/jenkins/s3.py @@ -129,7 +129,12 @@ def s3(source: str, destination: str, recursive: bool) -> List[str]: for item in items: if action == Action.DOWNLOAD: - stdout = s3(source=s3_path, destination=item, recursive=True) + source = s3_path + recursive = True + if item != ".": + source = s3_path + "/" + item + recursive = False + stdout = s3(source=source, destination=item, recursive=recursive) files = parse_output_files(stdout) chmod(files) for file in files: