Skip to content

Commit d926d79

Browse files
authored
Split 3.11 and devel build images and actualize 20250121 (#619)
* Split 3.12 and 3.11 build images and actualize them * In progress * Finalize changes * Fix clang-19 version for devel * Fix typo * Fix buildArangoDB312.fish to newer clang too * Fix typo * Add newer sccache required additional variable for S3 * Fix typo * Fix typo * Set libomp to proper versiol also
1 parent de88a1f commit d926d79

28 files changed

+533
-65
lines changed

containers/buildUbuntu311.docker

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# First rebuild glibc with a special option and provide some .deb files:
2+
3+
FROM ubuntu:24.04 as glibcdebs
4+
5+
COPY ./static /static
6+
RUN /static/prepare.sh
7+
RUN /static/rebuild_glibc.sh
8+
9+
# Now prepare a standard Ubuntu image and install the provided .deb files
10+
# for glibc as a preparation:
11+
12+
FROM ubuntu:24.04 as prepare
13+
14+
RUN apt-get update && apt-get upgrade -y && apt-get install -y libgd3 linux-libc-dev libcrypt-dev libnsl-dev rpcsvc-proto libtirpc-dev
15+
16+
COPY --from=glibcdebs /root/debs /debs
17+
RUN dpkg -i /debs/*.deb
18+
19+
# Now build V8:
20+
21+
#FROM ubuntu:24.04 as v81
22+
#
23+
#COPY ./tools/build_v8_arm64.sh /tools/build_v8_arm64.sh
24+
#RUN /tools/build_v8_arm64.sh
25+
#
26+
#FROM v81 as v8
27+
#
28+
#COPY ./tools/install_v8_arm64.sh /tools/install_v8_arm64.sh
29+
#RUN /tools/install_v8_arm64.sh
30+
31+
# Finally, build the actual build image based on the above preparation:
32+
33+
FROM prepare
34+
35+
MAINTAINER Max Neunhoeffer <[email protected]>
36+
37+
ARG ARCH="aarch64"
38+
ARG SCCACHE_VERSION="0.9.1"
39+
40+
# We provide gcc 13.2.0 as well as clang 16.0.6 from Ubunutu 24.04
41+
42+
ENV COMPILER_VERSION 13
43+
ENV CLANG_VERSION 16
44+
45+
RUN apt-get update --fix-missing && \
46+
apt-get install -y software-properties-common net-tools && \
47+
apt-get update && \
48+
apt-get upgrade -y
49+
50+
ENV DEBIAN_FRONTEND=noninteractive
51+
52+
RUN apt-get update --fix-missing && apt-get install -y build-essential gcc-${COMPILER_VERSION} g++-${COMPILER_VERSION} cmake make bison flex python3 ccache git libjemalloc-dev vim exuberant-ctags gdb fish psmisc sudo debhelper debconf jq wget libdb-dev curl gnupg2 gcovr prometheus bc tcpdump liburing-dev cppcheck clang-${CLANG_VERSION} lldb-${CLANG_VERSION} lld-${CLANG_VERSION} libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev libclang-common-${CLANG_VERSION}-dev libclang-rt-${CLANG_VERSION}-dev nodejs npm && apt-get clean
53+
54+
# yarn for UI build:
55+
RUN npm install -g yarn
56+
57+
# sccache for cloud compiler cache:
58+
59+
RUN curl -L https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-${ARCH}-unknown-linux-musl.tar.gz | tar xvz -C /tmp && mv /tmp/sccache-v${SCCACHE_VERSION}-${ARCH}-unknown-linux-musl/sccache /usr/bin/sccache && chmod +x /usr/bin/sccache && rm -rf /tmp/sccache-v${SCCACHE_VERSION}-${ARCH}-unknown-linux-musl
60+
61+
# Fetch V8:
62+
#COPY --from=v8 /opt/v8/lib /opt/v8/lib
63+
#COPY --from=v8 /opt/v8/include /opt/v8/include
64+
#COPY --from=v8 /opt/v8/third_party /opt/v8/third_party
65+
66+
# Build openssl and openldap libraries in specific versions and with static
67+
# libraries, install with prefix /opt:
68+
69+
COPY ./tools/* /tools/
70+
71+
RUN [ "/tools/install.sh", "3.4", "0" ]
72+
73+
COPY ./scripts /scripts
74+
75+
# Provide clang as "clang" and "clang++":
76+
77+
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} 100 && update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} 100
78+
79+
RUN /scripts/create-sccache-hardlinks.sh
80+
81+
RUN LC_ALL="C" update-ccache-symlinks
82+
83+
RUN git config --global --add safe.directory '*'
84+
85+
RUN apt-get install -y python3-pip && pip3 install py7zr psutil cppcheck-junit --break-system-packages
86+
87+
CMD [ "/usr/bin/fish" ]
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# First rebuild glibc with a special option and provide some .deb files:
2+
3+
FROM ubuntu:24.04 as glibcdebs
4+
5+
COPY ./static /static
6+
RUN /static/prepare.sh
7+
RUN /static/rebuild_glibc.sh
8+
9+
# Now prepare a standard Ubuntu image and install the provided .deb files
10+
# for glibc as a preparation:
11+
12+
FROM ubuntu:24.04 as prepare
13+
14+
RUN apt-get update && apt-get upgrade -y && apt-get install -y libgd3 linux-libc-dev libcrypt-dev libnsl-dev rpcsvc-proto libtirpc-dev
15+
16+
COPY --from=glibcdebs /root/debs /debs
17+
RUN dpkg -i /debs/*.deb
18+
19+
# Now build V8:
20+
21+
#FROM ubuntu:24.04 as v81
22+
#
23+
#COPY ./tools/build_v8.sh /tools/build_v8.sh
24+
#RUN /tools/build_v8.sh
25+
#
26+
#FROM v81 as v8
27+
#
28+
#COPY ./tools/install_v8.sh /tools/install_v8.sh
29+
#RUN /tools/install_v8.sh
30+
31+
# Finally, build the actual build image based on the above preparation:
32+
33+
FROM prepare
34+
35+
MAINTAINER Max Neunhoeffer <[email protected]>
36+
37+
ARG ARCH="x86_64"
38+
ARG SCCACHE_VERSION="0.9.1"
39+
40+
# We provide gcc 13.2.0 as well as clang 16.0.6 from Ubunutu 24.04
41+
42+
ENV COMPILER_VERSION 13
43+
ENV CLANG_VERSION 16
44+
45+
RUN apt-get update --fix-missing && \
46+
apt-get install -y software-properties-common net-tools && \
47+
apt-get update && \
48+
apt-get upgrade -y
49+
50+
ENV DEBIAN_FRONTEND=noninteractive
51+
52+
RUN apt-get update --fix-missing && apt-get install -y build-essential gcc-${COMPILER_VERSION} g++-${COMPILER_VERSION} cmake make bison flex python3 ccache git libjemalloc-dev vim exuberant-ctags gdb fish psmisc sudo debhelper debconf jq wget libdb-dev curl gnupg2 gcovr prometheus bc tcpdump liburing-dev cppcheck clang-${CLANG_VERSION} lldb-${CLANG_VERSION} lld-${CLANG_VERSION} libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev libclang-common-${CLANG_VERSION}-dev libclang-rt-${CLANG_VERSION}-dev nodejs npm && apt-get clean
53+
54+
# yarn for UI build:
55+
RUN npm install -g yarn
56+
57+
# sccache for cloud compiler cache:
58+
59+
RUN curl -L https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-${ARCH}-unknown-linux-musl.tar.gz | tar xvz -C /tmp && mv /tmp/sccache-v${SCCACHE_VERSION}-${ARCH}-unknown-linux-musl/sccache /usr/bin/sccache && chmod +x /usr/bin/sccache && rm -rf /tmp/sccache-v${SCCACHE_VERSION}-${ARCH}-unknown-linux-musl
60+
61+
# Fetch V8:
62+
#COPY --from=v8 /opt/v8/lib /opt/v8/lib
63+
#COPY --from=v8 /opt/v8/include /opt/v8/include
64+
#COPY --from=v8 /opt/v8/third_party /opt/v8/third_party
65+
66+
# Build openssl and openldap libraries in specific versions and with static
67+
# libraries, install with prefix /opt:
68+
69+
COPY ./tools/* /tools/
70+
71+
RUN [ "/tools/install.sh", "3.4", "0" ]
72+
73+
COPY ./scripts /scripts
74+
75+
# Provide clang as "clang" and "clang++":
76+
77+
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} 100 && update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} 100
78+
79+
RUN /scripts/create-sccache-hardlinks.sh
80+
81+
RUN LC_ALL="C" update-ccache-symlinks
82+
83+
RUN git config --global --add safe.directory '*'
84+
85+
RUN apt-get install -y python3-pip && pip3 install py7zr psutil cppcheck-junit lcov_cobertura --break-system-packages
86+
87+
CMD [ "/usr/bin/fish" ]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
IMAGE = arangodb/ubuntubuildarangodb-311
2+
TAG = $(shell ./latest-tag.sh)
3+
4+
all: amd64 arm64v8 manifest
5+
6+
tag:
7+
@if [ -z "$TAG" ]; then \
8+
echo "A new TAG was not provided explicitly or wasn't able to be guessed"\
9+
"from arangodb/ubuntubuildarangodb-311!"; exit 1; \
10+
fi
11+
12+
amd64: tag
13+
docker build -t ${IMAGE}:${TAG}-x86_64 -f Dockerfile.x86-64 .
14+
docker push ${IMAGE}:${TAG}-x86_64
15+
16+
arm64: tag
17+
docker build -t ${IMAGE}:${TAG}-arm64v8 -f Dockerfile.arm64 .
18+
docker push ${IMAGE}:${TAG}-arm64v8
19+
20+
manifest: tag
21+
./build-manifest.sh ${IMAGE} ${TAG}
22+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# What is this?
2+
3+
This directory contains everything to build an Ubuntu based build image.
4+
It is based on Ubuntu 23.10 and patches glibc with Then
5+
--enable-static-nss=yes
6+
option. Then we can do our "normal" build image.
7+
8+
Furthermore, this image contains a pre-built version of v8 Version
9+
12.1.165 under /opt/v8. This can be used to build devel based branches
10+
which have the option to use an external v8 engine.
11+
12+
Simply run
13+
14+
```
15+
make amd64
16+
```
17+
18+
on an `x86_64` machine and then
19+
20+
```
21+
make arm64
22+
```
23+
24+
on an `arm64` machine and then finally do
25+
26+
```
27+
make manifest
28+
```
29+
30+
and follow the instructions on the screen to push the manifest.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set -e
2+
3+
manifest=$1
4+
IMAGE_TAG=$2
5+
6+
[ -z manifest ] && manifest=arangodb/ubuntubuildarangodb-311
7+
# IMAGE_TAG is set within build-image_*.sh and expected to be equal there
8+
[ -z "$IMAGE_TAG" ] && IMAGE_TAG=$(git rev-parse --short HEAD)
9+
10+
echo "Creating docker multiarch manifest \"${manifest}:${IMAGE_TAG}\":"
11+
set +e; docker manifest rm -f ${manifest}:${IMAGE_TAG} 2>/dev/null; set -e
12+
docker manifest create ${manifest}:${IMAGE_TAG} \
13+
--amend ${manifest}:${IMAGE_TAG}-x86_64 \
14+
--amend ${manifest}:${IMAGE_TAG}-arm64v8 \
15+
|| ( echo "Error during docker multiarch manifest creation!"; exit 1 )
16+
17+
echo "To push the manifest please run:"
18+
echo " docker manifest push --purge ${manifest}:${IMAGE_TAG}"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repo="arangodb/ubuntubuildarangodb-devel"
2+
token=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull" | jq -r '.token')
3+
latest=$(curl -H "Authorization: Bearer $token" -s "https://registry-1.docker.io/v2/${repo}/tags/list" | jq -r '.tags | values[]' | grep -e "^[0-9]*$" | sort -n | tail -1)
4+
5+
test ! -z "$latest" && echo $(expr $latest + 1)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
ln /usr/bin/sccache /tools/clang
3+
ln /usr/bin/sccache /tools/clang++
4+
ln /usr/bin/sccache /tools/clang-16
5+
ln /usr/bin/sccache /tools/clang++-16
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A file to keep the directory.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- debian/rules.d/build.mk.orig 2023-12-05 20:49:26.513919555 +0100
2+
+++ debian/rules.d/build.mk 2023-12-05 20:49:47.054342582 +0100
3+
@@ -109,6 +109,7 @@
4+
--without-selinux \
5+
--enable-stackguard-randomization \
6+
--enable-stack-protector=strong \
7+
+ --enable-static-nss=yes \
8+
--with-pkgversion="Ubuntu GLIBC $(DEB_VERSION)" \
9+
--with-default-link=no \
10+
--with-bugurl="https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs" \

0 commit comments

Comments
 (0)