Skip to content

Commit 24e550f

Browse files
author
Spenser Gilliland
committed
Merged in SIM-3882 (pull request apache#17)
SIM-3882: rename: Jenkinsfile Approved-by: Lam Nguyen
2 parents 063487c + 9513ee2 commit 24e550f

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

ci_jobs/Jenkinsfile

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!groovy
2+
library('sima-jenkins-lib')
3+
4+
def main() {
5+
def job_name = env.JOB_NAME.split('/')[1]
6+
7+
properties([
8+
parameters([
9+
booleanParam(
10+
name: 'SKIP_N2A_COMPILER_BUILD',
11+
description: 'Skips building n2a_compiler',
12+
defaultValue: false
13+
),
14+
booleanParam(name: "PACKAGE_ONLY", defaultValue: false, description: 'Only package don\'t run tests')
15+
]),
16+
])
17+
18+
node("docker") {
19+
stage("Checkout") {
20+
utils.checkoutBitbucket()
21+
utils.setBuildMetadataFromVersionIn("python/VERSION.in")
22+
}
23+
24+
def image
25+
stage("DockerBuild") {
26+
image = utils.dockerBuild("docker/Dockerfile", 'simaai/' + job_name, "docker_creds", "docker_build.log", {})
27+
}
28+
29+
parallel push: {
30+
stage("DockerPush") {
31+
image['post']()
32+
}
33+
}, build: {
34+
image["image"].inside("-m 32g -c 8") {
35+
utils.cmakeBuild("build", "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache", {}, { src_dir ->
36+
stage("Python Bindings") {
37+
dir("${env.WORKSPACE}/python") {
38+
utils.setPythonBuildEnv([], {
39+
sh """#!/bin/bash -ex
40+
rm -rf dist build
41+
python3 setup.py bdist_wheel
42+
"""
43+
}, 'sima')
44+
}
45+
dir("${env.WORKSPACE}/topi/python") {
46+
utils.setPythonBuildEnv([], {
47+
sh """#!/bin/bash -ex
48+
rm -rf dist build
49+
python3 setup.py bdist_wheel
50+
"""
51+
}, 'sima')
52+
}
53+
}
54+
}, "../sima-regres.cmake", "clean all")
55+
stage("Package") {
56+
tvm_pkg_dir = "python/dist/*.whl"
57+
archiveArtifacts(tvm_pkg_dir)
58+
utils.uploadPythonPackages('jenkins_user', 'sima-pypi', tvm_pkg_dir, 3)
59+
topi_pkg_dir = "topi/python/dist/*.whl"
60+
archiveArtifacts(topi_pkg_dir)
61+
utils.uploadPythonPackages('jenkins_user', 'sima-pypi', topi_pkg_dir, 3)
62+
}
63+
}
64+
}
65+
66+
stage("Promotion") {
67+
if (env.BRANCH_NAME=="sima") {
68+
utils.docker_promote(image['image'], 'docker_creds', '')
69+
}
70+
}
71+
72+
}
73+
74+
stage("Upstream") {
75+
utils.buildUpstream("n2a_compiler", params.SKIP_N2A_COMPILER_BUILD, [
76+
booleanParam(name: 'PACKAGE_ONLY', value: params.PACKAGE_ONLY)
77+
])
78+
}
79+
}
80+
81+
utils.job_wrapper( {
82+
main()
83+
})
84+
85+
return this

0 commit comments

Comments
 (0)