forked from PegaSysEng/pantheon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.benchmark
61 lines (55 loc) · 3.34 KB
/
Jenkinsfile.benchmark
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
properties([
parameters([
string(name: 'BENCHMARK_GITHUB_ORG', defaultValue: 'PegaSysEng', description: 'The user or org from which to checkout the benchmark repo', trim: true),
string(name: 'BENCHMARK_REPO', defaultValue: 'pantheon-benchmark', description: 'The benchmark repo to be checked out', trim: true),
string(name: 'BENCHMARK_BRANCH', defaultValue: 'master', description: 'The benchmark branch to be checked out', trim: true),
choice(name: 'NETWORK', choices: ['rinkeby', 'ropsten', 'goerli', 'mainnet'], description: 'The name of the network being tested', trim: true),
// For File Import
// choice(name: 'DATASET', choices: ['from-0-by-100k', 'from-0-to-1m', 'from-0', 'from-6784589'], description: 'Ropsten: choose from-0-by-100k or from-0-to-1m, Mainnet choose from-0 or from-from-6784589', trim: true),
// choice(name: 'IMPORT_FILE', choices: ['ropsten-000k-100k.blocks', 'ropsten-0-1M.blocks', '0-999.blocks', '6784590-6785589.blocks'], description: 'The name of the file to import, same ordial position as DATASET', trim: true)
// For Network Import
choice(name: 'PANTHEON_SYNC_MODE', choices: ['FULL', 'FAST'], description: 'The mode of network syncing to perform', trim: true),
string(name: 'PANTHEON_MIN_PEERS', defaultValue: '2', description: 'Minimum number of peers to wait for before gathering data', trim: true),
string(name: 'PANTHEON_BENCHMARK_DURATION', defaultValue: '30', description: 'Maximum number of minutes to run the benchmark (full sync ends the benchmark early)', trim: true),
])
])
pipeline {
agent {
docker {
// For File Import
// image "pantheon-benchmarks/${params.NETWORK}-${params.DATASET}-pantheon:latest"
// For Network Import
image "pantheon-benchmarks/mainnet-from-0-pantheon:latest"
label 'jenkins-benchmark-1'
args '-v /benchmarks/block-import:/benchmarks-data'
}
}
stages {
stage('Pull pantheon-benchmark') {
steps {
script {
// because of JENKINS-28447 we can't rely on late eval
def URL = '[email protected]:' + params.BENCHMARK_GITHUB_ORG + '/' + params.BENCHMARK_REPO + '.git'
def branch = '*/' + params.BENCHMARK_BRANCH
checkout([$class: 'GitSCM', branches: [[name: branch]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'pantheon-benchmarks']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'f3f67c22-eead-47db-a8c1-fe32b483583a', url: URL]]])
}
}
}
stage('Run benchmarks jenkinsfile') {
steps {
withEnv([
"DATA_DIR=/data",
"BENCHMARKS_DATA=/benchmarks-data",
"PANTHEON_SRC_DIR=${WORKSPACE}",
"DESCRIPTION=automatic"
]) {
dir('pantheon-benchmarks') {
script {
evaluate(readFile('jenkins/Jenkinsfile.pantheon-network-import'))
}
}
}
}
}
}
}