Skip to content

Commit 5eaf76c

Browse files
committed
ci: use linux dockerfile as base for the linux pipeline
Referenced issue: * status-im/infra-ci#188
1 parent f6393b6 commit 5eaf76c

File tree

4 files changed

+407
-0
lines changed

4 files changed

+407
-0
lines changed

ci/Jenkinsfile.linux

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
#!/usr/bin/env groovy
2+
/* beacon_chain
3+
* Copyright (c) 2025 Status Research & Development GmbH
4+
* Licensed and distributed under either of
5+
* * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
6+
* * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
7+
* at your option. This file may not be copied, modified, or distributed except according to those terms.
8+
*/
9+
library 'status-jenkins-lib@v1.9.2'
10+
11+
pipeline {
12+
agent {
13+
dockerfile {
14+
label 'linuxcontainer'
15+
filename 'linux.Dockerfile'
16+
dir 'ci'
17+
}
18+
}
19+
20+
parameters {
21+
choice(
22+
name: 'VERBOSITY',
23+
description: 'Value for the V make flag to increase log verbosity',
24+
choices: [0, 1, 2]
25+
)
26+
string(
27+
name: 'NIM_COMMIT',
28+
description: 'Value for the NIM_COMMIT make flag to choose Nim commit',
29+
defaultValue: nimCommitForJob(),
30+
)
31+
}
32+
33+
options {
34+
disableRestartFromStage()
35+
timestamps()
36+
ansiColor('xterm')
37+
/* This also includes wait time in the queue. */
38+
timeout(time: 24, unit: 'HOURS')
39+
/* Limit builds retained. */
40+
buildDiscarder(logRotator(
41+
numToKeepStr: '5',
42+
daysToKeepStr: '30',
43+
artifactNumToKeepStr: '3',
44+
))
45+
/* Throttle number of concurrent builds. */
46+
throttleJobProperty(
47+
throttleEnabled: true,
48+
throttleOption: 'category',
49+
categories: ['nimbus-eth2'],
50+
maxConcurrentPerNode: 1,
51+
maxConcurrentTotal: 9
52+
)
53+
/* Abort old builds for non-main branches. */
54+
disableConcurrentBuilds(
55+
abortPrevious: !isMainBranch()
56+
)
57+
}
58+
59+
environment {
60+
NPROC = Runtime.getRuntime().availableProcessors()
61+
MAKEFLAGS = "V=${params.VERBOSITY} NIM_COMMIT=${params.NIM_COMMIT} -j${env.NPROC}"
62+
XDG_CACHE_HOME = "${env.WORKSPACE_TMP}/.cache"
63+
}
64+
65+
stages {
66+
stage('Deps') {
67+
steps {
68+
timeout(20) {
69+
script {
70+
/* To allow the following parallel stages. */
71+
sh 'make QUICK_AND_DIRTY_COMPILER=1 update'
72+
/* Allow the following parallel stages. */
73+
sh 'make deps'
74+
/* Download test vectors. */
75+
sh './scripts/setup_scenarios.sh'
76+
}
77+
}
78+
}
79+
}
80+
81+
stage('Build') {
82+
steps {
83+
timeout(50) {
84+
script {
85+
sh 'make LOG_LEVEL=TRACE'
86+
}
87+
}
88+
}
89+
}
90+
91+
stage('Check Docs') {
92+
steps {
93+
script {
94+
sh './scripts/check_docs_help_msg.sh'
95+
}
96+
}
97+
}
98+
99+
stage('Tests') {
100+
parallel {
101+
stage('General') {
102+
steps {
103+
timeout(60) {
104+
script {
105+
sh 'make DISABLE_TEST_FIXTURES_SCRIPT=1 NIMFLAGS="--passC:\"-fno-lto\" --passL:\"-fno-lto\"" test'
106+
sh 'git diff --exit-code --ignore-submodules=all'
107+
}
108+
}
109+
}
110+
}
111+
112+
stage('REST') {
113+
steps {
114+
timeout(5) {
115+
script {
116+
sh 'make restapi-test'
117+
}
118+
}
119+
}
120+
post { always {
121+
sh 'tar cjf restapi-test.tar.gz resttest0_data/*.txt'
122+
} }
123+
}
124+
}
125+
post { always { timeout(5) {
126+
archiveArtifacts(artifacts: '*.tar.gz', allowEmptyArchive: true)
127+
} } }
128+
}
129+
130+
stage('Finalizations') {
131+
stages { /* parallel builds of minimal / mainnet not yet supported */
132+
stage('minimal') {
133+
steps {
134+
timeout(26) {
135+
script {
136+
sh 'make local-testnet-minimal'
137+
}
138+
}
139+
}
140+
post { always {
141+
sh 'tar cjf local-testnet-minimal.tar.gz local-testnet-minimal/logs/*'
142+
} }
143+
}
144+
145+
stage('mainnet') {
146+
steps {
147+
timeout(62) {
148+
script {
149+
sh 'make local-testnet-mainnet'
150+
}
151+
}
152+
}
153+
post { always {
154+
sh 'tar cjf local-testnet-mainnet.tar.gz local-testnet-mainnet/logs/*'
155+
} }
156+
}
157+
}
158+
post {
159+
always { timeout(10) {
160+
/* DEBUG: Show file sizes to catch too big ones. */
161+
sh 'ls -hl *.tar.gz'
162+
archiveArtifacts(
163+
artifacts: '*.tar.gz',
164+
excludes: '**/geth-*.tar.gz', /* `scripts/geth_binaries.sh` */
165+
allowEmptyArchive: true
166+
)
167+
} }
168+
}
169+
}
170+
}
171+
172+
post {
173+
always {
174+
cleanWs(
175+
disableDeferredWipeout: true,
176+
deleteDirs: true
177+
)
178+
}
179+
}
180+
}
181+
182+
def isMainBranch() {
183+
return ['stable', 'testing', 'unstable'].contains(env.BRANCH_NAME)
184+
}
185+
186+
def nimCommitForJob() {
187+
return JOB_NAME.contains('nimv2_2') ? 'upstream/version-2-2' : ''
188+
}

ci/Jenkinsfile.macos

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
#!/usr/bin/env groovy
2+
/* beacon_chain
3+
* Copyright (c) 2019-2025 Status Research & Development GmbH
4+
* Licensed and distributed under either of
5+
* * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
6+
* * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
7+
* at your option. This file may not be copied, modified, or distributed except according to those terms.
8+
*/
9+
library 'status-jenkins-lib@v1.9.2'
10+
11+
pipeline {
12+
/* This way we run the same Jenkinsfile on different platforms. */
13+
agent { label 'macos && aarch64' }
14+
15+
parameters {
16+
choice(
17+
name: 'VERBOSITY',
18+
description: 'Value for the V make flag to increase log verbosity',
19+
choices: [0, 1, 2]
20+
)
21+
string(
22+
name: 'NIM_COMMIT',
23+
description: 'Value for the NIM_COMMIT make flag to choose Nim commit',
24+
defaultValue: nimCommitForJob(),
25+
)
26+
}
27+
28+
options {
29+
disableRestartFromStage()
30+
timestamps()
31+
ansiColor('xterm')
32+
/* This also includes wait time in the queue. */
33+
timeout(time: 24, unit: 'HOURS')
34+
/* Limit builds retained. */
35+
buildDiscarder(logRotator(
36+
numToKeepStr: '5',
37+
daysToKeepStr: '30',
38+
artifactNumToKeepStr: '3',
39+
))
40+
/* Throttle number of concurrent builds. */
41+
throttleJobProperty(
42+
throttleEnabled: true,
43+
throttleOption: 'category',
44+
categories: ['nimbus-eth2'],
45+
maxConcurrentPerNode: 1,
46+
maxConcurrentTotal: 9
47+
)
48+
/* Abort old builds for non-main branches. */
49+
disableConcurrentBuilds(
50+
abortPrevious: !isMainBranch()
51+
)
52+
}
53+
54+
environment {
55+
NPROC = Runtime.getRuntime().availableProcessors()
56+
MAKEFLAGS = "V=${params.VERBOSITY} NIM_COMMIT=${params.NIM_COMMIT} -j${env.NPROC}"
57+
XDG_CACHE_HOME = "${env.WORKSPACE_TMP}/.cache"
58+
}
59+
60+
stages {
61+
stage('Setup') {
62+
steps { script {
63+
def brew_prefix = brew.prefix()
64+
/* Explicit PATH to avoid using HomeBrew LLVM. */
65+
env.PATH = "/usr/local/bin:/usr/sbin:/usr/bin:/bin:${brew_prefix}/bin"
66+
/* Newer Clang 18.0 from Homebrew on macOS, XCode provides 15.0.
67+
* Temp fix for BLST issue: https://github.com/supranational/blst/issues/209 */
68+
if (utils.arch() == 'arm64') {
69+
env.PATH = "${brew_prefix}/opt/llvm/bin:$PATH"
70+
env.LDFLAGS = "-L${brew_prefix}/opt/llvm/lib"
71+
env.CPPFLAGS = "-I${brew_prefix}/opt/llvm/include"
72+
}
73+
} }
74+
}
75+
76+
stage('Deps') {
77+
steps { timeout(20) {
78+
/* To allow the following parallel stages. */
79+
sh 'make QUICK_AND_DIRTY_COMPILER=1 update'
80+
/* Allow the following parallel stages. */
81+
sh 'make deps'
82+
/* Download test vectors. */
83+
sh './scripts/setup_scenarios.sh'
84+
} }
85+
}
86+
87+
stage('Build') {
88+
steps { timeout(50) {
89+
sh 'make LOG_LEVEL=TRACE'
90+
} }
91+
}
92+
93+
stage('Check Docs') {
94+
steps {
95+
sh './scripts/check_docs_help_msg.sh'
96+
}
97+
}
98+
99+
stage('Tests') {
100+
parallel {
101+
stage('General') {
102+
steps { timeout(60) {
103+
sh 'make DISABLE_TEST_FIXTURES_SCRIPT=1 test'
104+
sh 'git diff --exit-code --ignore-submodules=all' /* Check no uncommitted changes. */
105+
} }
106+
}
107+
108+
stage('REST') {
109+
steps { timeout(5) {
110+
sh 'make restapi-test'
111+
} }
112+
post { always {
113+
sh 'tar cjf restapi-test.tar.gz resttest0_data/*.txt'
114+
} }
115+
}
116+
}
117+
post { always { timeout(5) {
118+
archiveArtifacts(artifacts: '*.tar.gz', allowEmptyArchive: true)
119+
} } }
120+
}
121+
122+
stage('Finalizations') {
123+
stages { /* parallel builds of minimal / mainnet not yet supported */
124+
stage('minimal') {
125+
steps { timeout(26) {
126+
sh 'make local-testnet-minimal'
127+
} }
128+
post { always {
129+
sh 'tar cjf local-testnet-minimal.tar.gz local-testnet-minimal/logs/*'
130+
} }
131+
}
132+
133+
stage('mainnet') {
134+
steps { timeout(62) {
135+
sh 'make local-testnet-mainnet'
136+
} }
137+
post { always {
138+
sh 'tar cjf local-testnet-mainnet.tar.gz local-testnet-mainnet/logs/*'
139+
} }
140+
}
141+
}
142+
post {
143+
always { timeout(10) {
144+
/* DEBUG: Show file sizes to catch too big ones. */
145+
sh 'ls -hl *.tar.gz'
146+
archiveArtifacts(
147+
artifacts: '*.tar.gz',
148+
excludes: '**/geth-*.tar.gz', /* `scripts/geth_binaries.sh` */
149+
allowEmptyArchive: true
150+
)
151+
} }
152+
}
153+
}
154+
}
155+
156+
post {
157+
always {
158+
cleanWs(
159+
disableDeferredWipeout: true,
160+
deleteDirs: true
161+
)
162+
}
163+
}
164+
}
165+
166+
def isMainBranch() {
167+
return ['stable', 'testing', 'unstable'].contains(env.BRANCH_NAME)
168+
}
169+
170+
def nimCommitForJob() {
171+
return JOB_NAME.contains('nimv2_2') ? 'upstream/version-2-2' : ''
172+
}

0 commit comments

Comments
 (0)