Skip to content
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
257 changes: 210 additions & 47 deletions Jenkinsfile

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions ci/jenkins/Build.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,24 @@ stage('Build') {
Utils.markStageSkippedForConditional('BUILD: Hexagon')
}
},
'BUILD: RISC-V': {
if (!skip_ci && is_docs_only_build != 1) {
node('CPU-SMALL') {
ws({{ m.per_exec_ws('tvm/build-riscv') }}) {
docker_init(ci_riscv)
init_git()
sh (
script: "${docker_run} ${ci_riscv} ./tests/scripts/task_config_build_riscv.sh build",
label: 'Create RISC-V cmake config',
)
make(ci_riscv, 'build', '-j2')
{{ m.upload_artifacts(tag='riscv', filenames=tvm_lib, folders=microtvm_template_projects) }}
}
}
} else {
Utils.markStageSkippedForConditional('BUILD: RISC-V')
}
},
)
}
}
20 changes: 20 additions & 0 deletions ci/jenkins/Test.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,26 @@
label: 'Run microTVM tests',
)
{% endcall %}
{% call(shard_index, num_shards) m.sharded_test_step(
name="test: RISC-V",
node="CPU-SMALL",
ws="tvm/test-riscv",
platform="riscv",
docker_image="ci_riscv",
num_shards=1,
test_method_names=test_method_names,
) %}
{{ m.download_artifacts(tag='riscv', filenames=tvm_lib, folders=microtvm_template_projects) }}
add_microtvm_permissions()
ci_setup(ci_riscv)
{% if shard_index == 1%}
cpp_unittest(ci_cortexm)
{% endif %}
sh (
script: "${docker_run} ${ci_riscv} ./tests/scripts/task_riscv_microtvm.sh",
label: 'Run microTVM tests',
)
{% endcall %}

def run_unittest_minimal() {
{% call m.test_step_body(
Expand Down
10 changes: 7 additions & 3 deletions ci/jenkins/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
"platform": "ARM",
},
{
"name": "ci_cpu",
"name": "ci_cortexm",
"platform": "CPU",
},
{
"name": "ci_minimal",
"name": "ci_cpu",
"platform": "CPU",
},
{
Expand All @@ -61,7 +61,11 @@
"platform": "CPU",
},
{
"name": "ci_cortexm",
"name": "ci_minimal",
"platform": "CPU",
},
{
"name": "ci_riscv",
"platform": "CPU",
},
{
Expand Down
14 changes: 14 additions & 0 deletions tests/scripts/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def docker(name: str, image: str, scripts: List[str], env: Dict[str, str], inter
"ci_cortexm",
"ci_arm",
"ci_hexagon",
"ci_riscv",
}

if image in sccache_images and os.getenv("USE_SCCACHE", "1") == "1":
Expand Down Expand Up @@ -673,6 +674,19 @@ def add_subparser(
),
},
),
generate_command(
name="riscv",
help="Run RISC-V build and test(s)",
options={
"cpp": CPP_UNITTEST,
"python": (
"run full Python tests",
[
"./tests/scripts/task_riscv_microtvm.sh",
],
),
},
),
]


Expand Down
35 changes: 35 additions & 0 deletions tests/scripts/task_config_build_riscv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

set -euxo pipefail

BUILD_DIR=$1
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
cp ../cmake/config.cmake .

echo set\(USE_SORT ON\) >> config.cmake
echo set\(USE_MICRO ON\) >> config.cmake
echo set\(USE_CMSISNN ON\) >> config.cmake
echo set\(USE_UMA ON\) >> config.cmake
echo set\(USE_PROFILER ON\) >> config.cmake
echo set\(USE_LLVM llvm-config-10\) >> config.cmake
echo set\(CMAKE_CXX_FLAGS -Werror\) >> config.cmake
echo set\(HIDE_PRIVATE_SYMBOLS ON\) >> config.cmake
echo set\(USE_CCACHE OFF\) >> config.cmake
echo set\(SUMMARIZE ON\) >> config.cmake
27 changes: 27 additions & 0 deletions tests/scripts/task_riscv_microtvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

set -euxo pipefail

source tests/scripts/setup-pytest-env.sh

make cython3

# NOTE: this exists to ensure some tests run on RISC-V image. Without it, Jenkins reports a configuration error.
# This line can be removed when RISC-V tests are added.
run_pytest ctypes riscv-platform-minimal-test-0 tests/python/all-platform-minimal-test