-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
63 lines (58 loc) · 2 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
def show_node_info() {
sh """
echo "NODE_NAME = \$NODE_NAME" || true
lsb_release -sd || true
uname -r || true
cat /sys/module/amdgpu/version || true
ls /opt/ -la || true
"""
}
def get_nodes(arch){
if(arch == 'MI'){
return "migraphx && gfx90a"
} else if(arch == 'Navi') {
return "migraphx && gfx1101"
} else {
return "migraphx"
}
}
def runTests() {
def targetNode = get_nodes("${arch}")
echo "The value of targetNode is: ${targetNode}"
node(targetNode) {
show_node_info()
checkout scm
gitStatusWrapper(credentialsId: "${env.status_wrapper_creds}", gitHubContext: "Jenkins - pytest-${arch}", account: 'ROCmSoftwarePlatform', repo: 'torch_migraphx') {
sh '''
docker_tag=$(sha256sum ./ci/base.Dockerfile | awk '{print $1}')
docker run --rm --network=host --device=/dev/kfd --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v=`pwd`:/workspace/torch_migraphx rocm/torch-migraphx-ci-ubuntu:$docker_tag bash -c \
'cd /workspace/torch_migraphx/py ; export TORCH_CMAKE_PATH=$(python -c "import torch; print(torch.utils.cmake_prefix_path)") ; python -m pip install . ; cd /workspace/torch_migraphx/tests/ ; pytest'
'''
}
}
}
pipeline {
agent { label 'build-only' }
stages {
stage('matrix') {
matrix {
axes {
axis {
name 'arch'
//values 'MI', 'Navi'
values 'Any'
}
}
stages {
stage('unit-tests'){
steps {
script {
runTests()
}
}
}
}
}
}
}
}