Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Debugging] multiarch builds #1479

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ pipeline {
description: "Pass STANCFLAGS to make/local, default none")
booleanParam(name:"run_slow_perf_tests", defaultValue: false, description:"Run additional 'slow' performance tests")
string(defaultValue: '', name: 'build_multiarch_docker_tag', description: "Docker tag for the multiarch image")
booleanParam(name:"build_multiarch", defaultValue: false, description:"Build multiarch images even when not on 'master'")

}
options {
parallelsAlwaysFailFast()
Expand All @@ -113,7 +115,7 @@ pipeline {
GIT_AUTHOR_EMAIL = '[email protected]'
GIT_COMMITTER_NAME = 'Stan Jenkins'
GIT_COMMITTER_EMAIL = '[email protected]'
MULTIARCH_DOCKER_TAG = 'multiarch-ocaml-4.14-v2'
MULTIARCH_DOCKER_TAG = 'multiarch-ocaml-4.14-cmdliner'
}
stages {
stage('Verify changes') {
Expand Down Expand Up @@ -749,7 +751,7 @@ pipeline {
beforeAgent true
allOf {
expression { !skipRebuildingBinaries }
anyOf { buildingTag(); branch 'master' }
anyOf { buildingTag(); branch 'master'; expression { params.build_multiarch } }
}
}
agent {
Expand Down Expand Up @@ -783,7 +785,7 @@ pipeline {
beforeAgent true
allOf {
expression { !skipRebuildingBinaries }
anyOf { buildingTag(); branch 'master' }
anyOf { buildingTag(); branch 'master'; expression { params.build_multiarch } }
}
}
agent {
Expand Down Expand Up @@ -814,7 +816,7 @@ pipeline {
beforeAgent true
allOf {
expression { !skipRebuildingBinaries }
anyOf { buildingTag(); branch 'master' }
anyOf { buildingTag(); branch 'master'; expression { params.build_multiarch } }
}
}
agent {
Expand Down Expand Up @@ -845,7 +847,7 @@ pipeline {
beforeAgent true
allOf {
expression { !skipRebuildingBinaries }
anyOf { buildingTag(); branch 'master' }
anyOf { buildingTag(); branch 'master'; expression { params.build_multiarch } }
}
}
agent {
Expand Down Expand Up @@ -876,7 +878,7 @@ pipeline {
beforeAgent true
allOf {
expression { !skipRebuildingBinaries }
anyOf { buildingTag(); branch 'master' }
anyOf { buildingTag(); branch 'master'; expression { params.build_multiarch } }
}
}
agent {
Expand Down Expand Up @@ -907,7 +909,7 @@ pipeline {
beforeAgent true
allOf {
expression { !skipRebuildingBinaries }
anyOf { buildingTag(); branch 'master' }
anyOf { buildingTag(); branch 'master'; expression { params.build_multiarch } }
}
}
agent {
Expand Down Expand Up @@ -998,7 +1000,7 @@ pipeline {
allOf {
expression { !skipRemainingStages }
expression { !skipRebuildingBinaries }
anyOf { buildingTag(); branch 'master' }
anyOf { buildingTag(); branch 'master'; expression { params.build_multiarch } }
}
}
agent {
Expand Down
4 changes: 3 additions & 1 deletion scripts/build_multiarch_stanc3.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
export PROFILE=static

# Architecture naming isn't consistent between QEMU and Docker, so lookup correct naming
if [ $1 = "mips64el" ]; then
export DOCK_ARCH="mips64le"
export DOCK_VARIANT=""
elif [ $1 = "arm64" ]; then
export PROFILE=release
export DOCK_ARCH="arm64"
export DOCK_VARIANT=""
elif [ $1 = "ppc64el" ]; then
Expand All @@ -28,4 +30,4 @@ SHA=$(skopeo inspect --raw docker://stanorg/stanc3:${DOCKER_IMAGE_TAG} | jq '.ma
# Register QEMU translation binaries
docker run --rm --privileged multiarch/qemu-user-static --reset

docker run --group-add=987 --group-add=980 --group-add=988 -v $(pwd):$(pwd):rw,z stanorg/stanc3:${DOCKER_IMAGE_TAG}@$SHA /bin/bash -c "cd $(pwd) && eval \$(opam env) && dune subst && dune build @install --profile static --root=."
docker run --group-add=987 --group-add=980 --group-add=988 -v $(pwd):$(pwd):rw,z stanorg/stanc3:${DOCKER_IMAGE_TAG}@$SHA /bin/bash -c "cd $(pwd) && eval \$(opam env) && dune subst && dune build @install --profile $PROFILE --root=."
8 changes: 4 additions & 4 deletions scripts/docker/static/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ RUN CONTAINERS_COMMON_VER=$(curl -s https://dl-cdn.alpinelinux.org/alpine/latest
apk add cont.apk && \
apk add skopeo.apk

#Switch back to the normal user
# Switch back to the normal user
USER jenkins

#Init opam, create and switch to 4.14.0, update shell environment
# Init opam, create and switch to 4.14.0, update shell environment
RUN opam init --disable-sandboxing --bare -y
RUN opam switch create 4.14.0
RUN opam switch 4.14.0
Expand All @@ -44,5 +44,5 @@ RUN opam update; bash -x install_build_deps.sh

RUN opam install odoc -y

#Specify our entrypoint
ENTRYPOINT [ "opam", "config", "exec", "--" ]
# Specify our entrypoint
ENTRYPOINT [ "opam", "config", "exec", "--" ]