Skip to content

Commit f342288

Browse files
committed
[ci] Use r5.large nodes for less-intensive jobs
This uses the `CPU-SMALL` label for certain jobs in CI, which is backed by r5.large instances in EC2 rather than c4.4xlarge instances which are much more expensive
1 parent 62b23de commit f342288

File tree

6 files changed

+42
-32
lines changed

6 files changed

+42
-32
lines changed

Jenkinsfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
// 'python3 jenkins/generate.py'
4646
// Note: This timestamp is here to ensure that updates to the Jenkinsfile are
4747
// always rebased on main before merging:
48-
// Generated at 2022-05-17T09:16:45.895372
48+
// Generated at 2022-05-17T09:16:58.363027
4949

5050
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
5151
// NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
@@ -688,7 +688,7 @@ stage('Build') {
688688
},
689689
'BUILD: Hexagon': {
690690
if (!skip_ci && is_docs_only_build != 1) {
691-
node('CPU') {
691+
node('CPU-SMALL') {
692692
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/build-hexagon") {
693693
init_git()
694694
sh (
@@ -845,7 +845,7 @@ stage('Test') {
845845
},
846846
'unittest: CPU': {
847847
if (!skip_ci && is_docs_only_build != 1) {
848-
node('CPU') {
848+
node('CPU-SMALL') {
849849
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-cpu") {
850850
timeout(time: max_time, unit: 'MINUTES') {
851851
try {
@@ -873,7 +873,7 @@ stage('Test') {
873873
},
874874
'python: i386 1 of 3': {
875875
if (!skip_ci && is_docs_only_build != 1) {
876-
node('CPU') {
876+
node('CPU-SMALL') {
877877
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-i386") {
878878
try {
879879
init_git()
@@ -904,7 +904,7 @@ stage('Test') {
904904
},
905905
'python: i386 2 of 3': {
906906
if (!skip_ci && is_docs_only_build != 1) {
907-
node('CPU') {
907+
node('CPU-SMALL') {
908908
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-i386") {
909909
try {
910910
init_git()
@@ -934,7 +934,7 @@ stage('Test') {
934934
},
935935
'python: i386 3 of 3': {
936936
if (!skip_ci && is_docs_only_build != 1) {
937-
node('CPU') {
937+
node('CPU-SMALL') {
938938
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-i386") {
939939
try {
940940
init_git()
@@ -964,7 +964,7 @@ stage('Test') {
964964
},
965965
'test: Hexagon 1 of 4': {
966966
if (!skip_ci && is_docs_only_build != 1) {
967-
node('CPU') {
967+
node('CPU-SMALL') {
968968
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
969969
try {
970970
init_git()
@@ -997,7 +997,7 @@ stage('Test') {
997997
},
998998
'test: Hexagon 2 of 4': {
999999
if (!skip_ci && is_docs_only_build != 1) {
1000-
node('CPU') {
1000+
node('CPU-SMALL') {
10011001
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
10021002
try {
10031003
init_git()
@@ -1029,7 +1029,7 @@ stage('Test') {
10291029
},
10301030
'test: Hexagon 3 of 4': {
10311031
if (!skip_ci && is_docs_only_build != 1) {
1032-
node('CPU') {
1032+
node('CPU-SMALL') {
10331033
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
10341034
try {
10351035
init_git()
@@ -1061,7 +1061,7 @@ stage('Test') {
10611061
},
10621062
'test: Hexagon 4 of 4': {
10631063
if (!skip_ci && is_docs_only_build != 1) {
1064-
node('CPU') {
1064+
node('CPU-SMALL') {
10651065
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
10661066
try {
10671067
init_git()
@@ -1093,7 +1093,7 @@ stage('Test') {
10931093
},
10941094
'test: QEMU': {
10951095
if (!skip_ci && is_docs_only_build != 1) {
1096-
node('CPU') {
1096+
node('CPU-SMALL') {
10971097
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") {
10981098
timeout(time: max_time, unit: 'MINUTES') {
10991099
try {

jenkins/Jenkinsfile.j2

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ stage('Build') {
605605
},
606606
'BUILD: Hexagon': {
607607
if (!skip_ci && is_docs_only_build != 1) {
608-
node('CPU') {
608+
node('CPU-SMALL') {
609609
ws({{ m.per_exec_ws('tvm/build-hexagon') }}) {
610610
init_git()
611611
sh (
@@ -681,7 +681,8 @@ stage('Test') {
681681
{% endcall %}
682682
{% call m.test_step(
683683
name="unittest: CPU",
684-
node="CPU", ws="tvm/ut-python-cpu",
684+
node="CPU-SMALL",
685+
ws="tvm/ut-python-cpu",
685686
platform="cpu",
686687
) %}
687688
unpack_lib('cpu', tvm_multilib_tsim)
@@ -696,11 +697,11 @@ stage('Test') {
696697
{% endcall %}
697698
{% call(shard_index, num_shards) m.sharded_test_step(
698699
name="python: i386",
699-
node="CPU",
700-
num_shards=3,
701-
ws="tvm/integration-python-i386",
702-
platform="i386",
703-
) %}
700+
node="CPU-SMALL",
701+
num_shards=3,
702+
ws="tvm/integration-python-i386",
703+
platform="i386",
704+
) %}
704705
unpack_lib('i386', tvm_multilib)
705706
ci_setup(ci_i386)
706707
{% if shard_index == 1 %}
@@ -715,7 +716,8 @@ stage('Test') {
715716
{% endcall %}
716717
{% call(shard_index, num_shards) m.sharded_test_step(
717718
name="test: Hexagon",
718-
node="CPU", ws="tvm/test-hexagon",
719+
node="CPU-SMALL",
720+
ws="tvm/test-hexagon",
719721
platform="hexagon",
720722
num_shards=4,
721723
) %}
@@ -735,7 +737,8 @@ stage('Test') {
735737
{% endcall %}
736738
{% call m.test_step(
737739
name="test: QEMU",
738-
node="CPU", ws="tvm/test-qemu",
740+
node="CPU-SMALL",
741+
ws="tvm/test-qemu",
739742
platform="qemu",
740743
) %}
741744
unpack_lib('qemu', tvm_lib)

tests/scripts/ci.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,11 +561,14 @@ def add_subparser(
561561
return subparser
562562

563563

564+
CPP_UNITTEST = ("run c++ unitests", ["./tests/scripts/task_cpp_unittest.sh"])
565+
564566
generated = [
565567
generate_command(
566568
name="gpu",
567569
help="Run GPU build and test(s)",
568570
options={
571+
"cpp": CPP_UNITTEST,
569572
"topi": ("run topi tests", ["./tests/scripts/task_python_topi.sh"]),
570573
"unittest": (
571574
"run unit tests",
@@ -582,6 +585,7 @@ def add_subparser(
582585
name="cpu",
583586
help="Run CPU build and test(s)",
584587
options={
588+
"cpp": CPP_UNITTEST,
585589
"integration": (
586590
"run integration tests",
587591
["./tests/scripts/task_python_integration.sh"],
@@ -601,6 +605,7 @@ def add_subparser(
601605
name="i386",
602606
help="Run i386 build and test(s)",
603607
options={
608+
"cpp": CPP_UNITTEST,
604609
"integration": (
605610
"run integration tests",
606611
[
@@ -619,40 +624,43 @@ def add_subparser(
619624
name="qemu",
620625
help="Run QEMU build and test(s)",
621626
options={
627+
"cpp": CPP_UNITTEST,
622628
"test": (
623629
"run microTVM tests",
624630
[
625631
"./tests/scripts/task_python_microtvm.sh",
626632
"./tests/scripts/task_demo_microtvm.sh",
627633
],
628-
)
634+
),
629635
},
630636
),
631637
generate_command(
632638
name="hexagon",
633639
help="Run Hexagon build and test(s)",
634640
options={
641+
"cpp": CPP_UNITTEST,
635642
"test": (
636643
"run Hexagon API/Python tests",
637644
[
638645
"./tests/scripts/task_build_hexagon_api.sh",
639646
"./tests/scripts/task_python_hexagon.sh",
640647
],
641-
)
648+
),
642649
},
643650
),
644651
generate_command(
645652
name="arm",
646653
help="Run ARM build and test(s) (native or via QEMU on x86)",
647654
precheck=check_arm_qemu,
648655
options={
656+
"cpp": CPP_UNITTEST,
649657
"python": (
650658
"run full Python tests",
651659
[
652660
"./tests/scripts/task_python_unittest.sh",
653661
"./tests/scripts/task_python_arm_compute_library.sh",
654662
],
655-
)
663+
),
656664
},
657665
),
658666
]

tests/scripts/task_build.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,22 @@
3737
env = {"VTA_HW_PATH": str(Path(os.getcwd()) / "3rdparty" / "vta-hw")}
3838
sccache_exe = shutil.which("sccache")
3939

40-
use_sccache = sccache_exe is not None and args.sccache_bucket is not None
40+
use_sccache = sccache_exe is not None
4141
build_dir = Path(os.getcwd()) / args.build_dir
4242
build_dir = build_dir.relative_to(REPO_ROOT)
4343

4444
if use_sccache:
45-
env["SCCACHE_BUCKET"] = args.sccache_bucket
45+
if args.sccache_bucket:
46+
env["SCCACHE_BUCKET"] = args.sccache_bucket
47+
logging.info(f"Using sccache bucket: {args.sccache_bucket}")
48+
else:
49+
logging.info(f"No sccache bucket set, using local cache")
4650
env["CXX"] = "/opt/sccache/c++"
4751
env["CC"] = "/opt/sccache/cc"
4852

49-
logging.info(f"Using sccache bucket: {args.sccache_bucket}")
5053
else:
5154
if sccache_exe is None:
5255
reason = "'sccache' executable not found"
53-
elif args.sccache_bucket is None:
54-
reason = "'sccache' executable not found"
5556
else:
5657
reason = "<unknown>"
5758
logging.info(f"Not using sccache, reason: {reason}")
@@ -71,6 +72,7 @@
7172
num_cpus = max(available_cpus, 1)
7273

7374
sh.run("cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo ..", cwd=build_dir)
75+
7476
target = ""
7577
if args.cmake_target:
7678
target = args.cmake_target

tests/scripts/task_config_build_hexagon.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ echo set\(USE_RPC ON\) >> config.cmake
2929
echo set\(USE_MICRO ON\) >> config.cmake
3030
echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake
3131
echo set\(USE_LLVM "${CLANG_LLVM_HOME}/bin/llvm-config"\) >> config.cmake
32-
echo set\(CMAKE_CXX_COMPILER "${CLANG_LLVM_HOME}/bin/clang++"\) >> config.cmake
32+
echo set\(CMAKE_CXX_COMPILER "/opt/sccache/clang++"\) >> config.cmake
3333
echo set\(USE_HEXAGON "ON"\) >> config.cmake
3434
echo set\(USE_HEXAGON_SDK "${HEXAGON_SDK_PATH}"\) >> config.cmake
3535
echo set\(USE_CCACHE OFF\) >> config.cmake

tests/scripts/task_lint.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ function shard1 {
3131
echo "Convert scripts to Python..."
3232
tests/scripts/task_convert_scripts_to_python.sh
3333

34-
# TODO: Remove this ad-hoc pip install once https://github.com/apache/tvm/pull/11265
35-
# is added to the ci_lint Docker image
36-
python3 -m pip install --user -r jenkins/requirements.txt
3734
echo "Check Jenkinsfile generation"
3835
python3 jenkins/generate.py --check
3936

0 commit comments

Comments
 (0)