Migrate riscv cross-compiles to docker container - #7004
Conversation
|
jenkins build riscv |
|
jenkins build riscv |
An error was seen in the riscv build: |
|
jenkins build riscv |
|
The scripting requires specific parameters to use the correct dockerfile. I've since added the parameters to the nightly and pr builds for riscv and this pr trigger for riscv should work as expected. Note that the first time the container is built on the machine it will be slower to build an image. A future improvement will be to create an image weekly, monthly or as needed with the nightly or pr builds performing a pull of this prebuilt image. |
|
I believe this is ready for review @babsingh. |
|
Looking at the job runs, I believe the build is running in wrong container: We may need to tweak diff --git a/buildenv/jenkins/omrbuild.groovy b/buildenv/jenkins/omrbuild.groovy
index c0d0437fd..8c8b309de 100644
--- a/buildenv/jenkins/omrbuild.groovy
+++ b/buildenv/jenkins/omrbuild.groovy
@@ -29,7 +29,6 @@ scmVars = null
customWorkspace = null
dockerImage = null
-dockerImageName = (params.IMAGE_NAME) ? params.IMAGE_NAME : "buildomr"
/**
* Move the below parameters into SPECS while implementing a generic
@@ -44,7 +43,6 @@ pullId = params.ghprbPullId
cgroupV1Specs = ["linux_x86"]
cgroupV2Specs = ["linux_x86-64", "linux_ppc-64_le_gcc"]
-dockerSpecs = ["linux_x86", "linux_x86-64"]
nodeLabels = []
runInDocker = false
@@ -167,6 +165,7 @@ SPECS = [
'environment' : [
'PATH+CCACHE=/usr/lib/ccache/'
],
+ 'dockerImageName' : 'riscv64',
'ccache' : true,
'buildSystem' : 'cmake',
'builds' : [
@@ -188,6 +187,7 @@ SPECS = [
'PATH+CCACHE=/usr/lib/ccache/',
'GTEST_COLOR=0'
],
+ 'dockerImageName' : 'buildomr',
'ccache' : true,
'buildSystem' : 'cmake',
'builds' : [
@@ -209,6 +209,7 @@ SPECS = [
'PATH+CCACHE=/usr/lib/ccache/',
'GTEST_COLOR=0'
],
+ 'dockerImageName' : 'buildomr',
'ccache' : true,
'buildSystem' : 'cmake',
'builds' : [
@@ -411,6 +412,10 @@ def test() {
}
}
+def dockerImageName() {
+ return (params.IMAGE_NAME) ? params.IMAGE_NAME : SPECS[buildSpec].dockerImageName
+}
+
def cleanDockerContainers() {
stage("Docker Remove Containers") {
println("Listing docker containers to attempt removal")
@@ -428,7 +433,7 @@ def cleanDockerContainers() {
def buildDockerImage() {
stage("Docker Build") {
dir("buildenv/docker/${arch}/${os}") {
- dockerImage = docker.build(dockerImageName)
+ dockerImage = docker.build(dockerImageName())
}
}
}
@@ -605,7 +610,7 @@ timestamps {
timeout(time: 8, unit: 'HOURS') {
stage('Queue') {
nodeLabels += SPECS[buildSpec].label
- runInDocker = dockerSpecs.contains(buildSpec)
+ runInDocker = dockerImageName() != null;
if (cgroupV1Specs.contains(buildSpec)) {
nodeLabels += "cgroup.v1" |
|
The most recent PR job landed on But reviewing the previous PR launch, you are definitely correct. The changes you detail would be part of the future improvement I eluded too that would able to pull a prebuilt image. |
There was a problem hiding this comment.
cleanDockerContainers only removes Docker containers. All Docker images will be named buildomr. We are using Ubuntu 20 x64 for two different buildspecs. If there is an existing Docker image created using a different Dockerfile, will the script create a new Docker image or update the old one?
|
@AdamBrousseau Can you also concurrently review these changes? |
| RUN groupadd -r jenkins \ | ||
| && useradd -rm -u 1000 -g jenkins jenkins \ | ||
| && mkdir -p /home/jenkins/.ssh \ | ||
| && echo "Host git.eclipse.org*\n\tStrictHostKeyChecking no\n" > /home/jenkins/.ssh/config \ |
There was a problem hiding this comment.
Do we have anything on git.eclipse.org used in these builds?
There was a problem hiding this comment.
I don't recall, but likely a c&p from another dockerfile and just not enough clean up so I'll remove.
6e224c3 to
5fc5233
Compare
|
jenkins build riscv |
|
re #7004 (review):
^^^ @jdekonin @AdamBrousseau If the above statement is true, then we will need a unique docker image name ( |
|
All docker images will be named If you want that code changes as part of this PR that fine and not future enhancement, thats fine I'll get there eventually. |
Then, these changes should work fine. The code LGTM. @jdekonin Can you please squash the commits? |
* Add recipe to create RISC-V 64 sysroot to Dockerfile so the sysroot is created as part of docker image build. - authored by janvrany ** The only drawback of this solution is that it contains hardcoded paths to RISC-V libfakeroot and libfakechroot packages, so whenever a new version is uploaded to Debian ports repository and old one is removed, the Dockefile has to be updated. * Add jenkins build pipeline dependencies and container updates Signed-off-by: Joe deKoning <joe_dekoning@ca.ibm.com>
|
@AdamBrousseau Do these changes look good to you? |
|
Final verification before merge: jenkins build riscv |
Signed-off-by: Joe deKoning <joe_dekoning@ca.ibm.com>
Revert copyright change performed in #7004
Signed-off-by: Joe deKoning <joe_dekoning@ca.ibm.com>
A recent loss of the debian 10 system that was used for riscv compiles pushed me into moving this to a container. Due so memory consumption issues @janvrany has an open PR to address (#6912), the hosts currently require ~10gb ram. Once #6912 has been reviewed/changed/merged...the hosts for riscv cross-compiles can be reduced in ram requirement.
Also needs a dependent jiro change. eclipse-cbi/jiro#277
** docker container also has a requirement on cgroup.v2 configuration on the host
fyi @babsingh @janvrany @AdamBrousseau