Skip to content
Closed
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
8 changes: 4 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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-05-17T17:26:21.660243
// Generated at 2022-05-19T12:40:13.340832

import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
// NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
Expand Down Expand Up @@ -80,7 +80,7 @@ properties([
upstream_revision = null

// command to start a docker container
docker_run = 'docker/bash.sh --env CI --env TVM_SHARD_INDEX --env TVM_NUM_SHARDS --env RUN_DISPLAY_URL --env PLATFORM'
docker_run = 'docker/bash.sh --env CI --env CI_NUM_EXECUTORS --env SCCACHE_BUCKET=tvm-sccache-prod --env TVM_SHARD_INDEX --env TVM_NUM_SHARDS --env RUN_DISPLAY_URL --env PLATFORM'
docker_build = 'docker/build.sh'
// timeout in minutes
max_time = 180
Expand Down Expand Up @@ -553,14 +553,14 @@ def fsim_test(image) {

def cmake_build(image, path, make_flag) {
sh (
script: "${docker_run} --env CI_NUM_EXECUTORS ${image} ./tests/scripts/task_build.py --sccache-bucket tvm-sccache-prod",
script: "${docker_run} ${image} ./tests/scripts/task_build.py",
label: 'Run cmake build',
)
}

def cpp_unittest(image) {
sh (
script: "${docker_run} --env CI_NUM_EXECUTORS ${image} ./tests/scripts/task_cpp_unittest.sh",
script: "${docker_run} ${image} ./tests/scripts/task_cpp_unittest.sh",
label: 'Build and run C++ tests',
)
}
Expand Down
6 changes: 3 additions & 3 deletions jenkins/Jenkinsfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ properties([
upstream_revision = null

// command to start a docker container
docker_run = 'docker/bash.sh --env CI --env TVM_SHARD_INDEX --env TVM_NUM_SHARDS --env RUN_DISPLAY_URL --env PLATFORM'
docker_run = 'docker/bash.sh --env CI --env CI_NUM_EXECUTORS --env SCCACHE_BUCKET=tvm-sccache-prod --env TVM_SHARD_INDEX --env TVM_NUM_SHARDS --env RUN_DISPLAY_URL --env PLATFORM'
docker_build = 'docker/build.sh'
// timeout in minutes
max_time = 180
Expand Down Expand Up @@ -470,14 +470,14 @@ def fsim_test(image) {

def cmake_build(image, path, make_flag) {
sh (
script: "${docker_run} --env CI_NUM_EXECUTORS ${image} ./tests/scripts/task_build.py --sccache-bucket tvm-sccache-prod",
script: "${docker_run} ${image} ./tests/scripts/task_build.py",
label: 'Run cmake build',
)
}

def cpp_unittest(image) {
sh (
script: "${docker_run} --env CI_NUM_EXECUTORS ${image} ./tests/scripts/task_cpp_unittest.sh",
script: "${docker_run} ${image} ./tests/scripts/task_cpp_unittest.sh",
label: 'Build and run C++ tests',
)
}
Expand Down
14 changes: 3 additions & 11 deletions tests/scripts/task_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,25 @@
init_log()

parser = argparse.ArgumentParser(description="List pytest nodeids for a folder")
parser.add_argument("--sccache-bucket", required=False, help="sccache bucket name")
parser.add_argument("--build-dir", default="build", help="build folder")
parser.add_argument("--cmake-target", help="optional build target")
args = parser.parse_args()

env = {"VTA_HW_PATH": str(Path(os.getcwd()) / "3rdparty" / "vta-hw")}
sccache_exe = shutil.which("sccache")
sccache_bucket = os.getenv("SCCACHE_BUCKET")

use_sccache = sccache_exe is not None
build_dir = Path(os.getcwd()) / args.build_dir
build_dir = build_dir.relative_to(REPO_ROOT)

if use_sccache:
if args.sccache_bucket:
env["SCCACHE_BUCKET"] = args.sccache_bucket
if sccache_bucket is not None:
logging.info(f"Using sccache bucket: {args.sccache_bucket}")
else:
logging.info(f"No sccache bucket set, using local cache")
env["CXX"] = "/opt/sccache/c++"
env["CC"] = "/opt/sccache/cc"

else:
if sccache_exe is None:
reason = "'sccache' executable not found"
else:
reason = "<unknown>"
logging.info(f"Not using sccache, reason: {reason}")
logging.info(f"Not using sccache, executable not found")

sh = Sh(env)

Expand Down
4 changes: 1 addition & 3 deletions tests/scripts/task_cpp_unittest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ export TVM_BIND_THREADS=0
export OMP_NUM_THREADS=1

# Build cpptest suite
python3 tests/scripts/task_build.py \
--sccache-bucket tvm-sccache-prod \
--cmake-target cpptest
python3 tests/scripts/task_build.py --cmake-target cpptest

# crttest requires USE_MICRO to be enabled, which is currently the case
# with all CI configs
Expand Down