Skip to content

Commit

Permalink
Add Ubuntu 24.04 target (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans authored Jul 3, 2024
1 parent e5f99f1 commit e21ca53
Show file tree
Hide file tree
Showing 7 changed files with 423 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ SUPPORTED_TARGETS = \
ubuntu-focal \
ubuntu-hirsute \
ubuntu-jammy \
ubuntu-noble \
centos-7 \
centos-8 \
rockylinux-9 \
Expand Down
248 changes: 248 additions & 0 deletions integration/linux/build/ubuntu-noble/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#

FROM buildpack-deps:noble

ENV PATH /usr/local/bin:$PATH
ENV LANG C.UTF-8

RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install -y --no-install-recommends \
libssl-dev \
tk-dev \
sudo \
bison \
flex \
patchelf \
zstd \
&& rm -rf /var/lib/apt/lists/*

ENV PYTHON_VERSION 3.9.19
ENV RUSTUP_HOME /usr/local/rustup
ENV CARGO_HOME /usr/local/cargo
ENV PATH /usr/local/cargo/bin:$PATH
ENV RUST_VERSION 1.76.0
ENV NODE_VERSION 16.16.0
ENV YARN_VERSION 1.22.19

RUN set -ex \
\
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& echo "disable-ipv6" >> "${GNUPGHOME}/dirmngr.conf" \
&& for key in \
E3FF2839C048B25C084DEBE9B26995E310250568 \
a035c8c19219ba821ecea86b64e628f8d684696d \
; do \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \
done \
&& for key in \
4ED778F539E3634C779C87C6D7062848A1AB005C \
141F07595B7B3FFE74309A937405533BE57C7D57 \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
74F12602B6F1C4E913FAA37AD3A89613643B6201 \
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
A48C2BEE680E841632CD4E44F07496B3EB3C1762 \
108F52B48DB57BB0CC439B2997B01419BD92F80A \
B9E2F5981AA6E0CD28160D9FF13993A75599653C \
; do \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \
done \
&& for key in \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \
done \
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
&& rm -rf python.tar.xz.asc \
&& mkdir -p /usr/src/python \
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
&& rm python.tar.xz \
\
&& cd /usr/src/python \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& ./configure \
--build="$gnuArch" \
--enable-loadable-sqlite-extensions \
--enable-shared \
--with-system-expat \
--with-system-ffi \
--without-ensurepip \
&& make -j "$(nproc)" \
&& make install \
&& ldconfig \
\
&& find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests \) \) \
-o \
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
\) -exec rm -rf '{}' + \
&& cd / \
&& rm -rf /usr/src/python \
\
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- \
-y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION \
&& chmod -R a+w $RUSTUP_HOME $CARGO_HOME \
\
&& dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) ARCH='x64';; \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
i386) ARCH='x86';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& mkdir -p /opt \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \
&& rm -rf "$GNUPGHOME" \
\
&& python3 --version \
&& rustc --version \
&& node --version \
&& npm --version \
&& yarn --version

# make some useful symlinks that are expected to exist
RUN cd /usr/local/bin \
&& ln -s idle3 idle \
&& ln -s pydoc3 pydoc \
&& ln -s python3 python \
&& ln -s python3-config python-config

# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 24.0

RUN set -ex; \
\
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
\
python get-pip.py \
--disable-pip-version-check \
"pip==$PYTHON_PIP_VERSION" \
; \
pip --version; \
\
find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests \) \) \
-o \
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
\) -exec rm -rf '{}' +; \
rm -f get-pip.py

RUN /bin/echo -e '#!/bin/bash\n\
\n\
set -Exeo pipefail\n\
\n\
: "${CARGO_HOME:=$HOME/.cargo}"\n\
\n\
mkdir -p ~/.cache/cargo/{git,registry}\n\
mkdir -p "$CARGO_HOME"\n\
rm -rf "${CARGO_HOME}"/{git,registry}\n\
ln -s ~/.cache/cargo/registry "${CARGO_HOME}/registry"\n\
ln -s ~/.cache/cargo/git "${CARGO_HOME}/git"\n\
\n\
python -m pip install -U git+https://github.com/edgedb/edgedb-pkg\n\
\n\
if [ -n "${METAPKG_PATH}" ]; then\n\
p=$(python -c '\''import metapkg;print(metapkg.__path__[0])'\'')\n\
rm -rf "${p}"\n\
ln -s "${METAPKG_PATH}" "${p}"\n\
ls -al "${p}"\n\
fi\n\
\n\
extraopts=\n\
if [ -n "${SRC_REF}" ]; then\n\
extraopts+=" --source-ref=${SRC_REF}"\n\
fi\n\
\n\
if [ -n "${BUILD_IS_RELEASE}" ]; then\n\
extraopts+=" --release"\n\
fi\n\
\n\
if [ -n "${PKG_REVISION}" ]; then\n\
if [ "${PKG_REVISION}" = "<current-date>" ]; then\n\
PKG_REVISION="$(date --utc +%Y%m%d%H%M)"\n\
fi\n\
extraopts+=" --pkg-revision=${PKG_REVISION}"\n\
fi\n\
\n\
if [ -n "${PKG_SUBDIST}" ]; then\n\
extraopts+=" --pkg-subdist=${PKG_SUBDIST}"\n\
fi\n\
\n\
if [ -n "${PKG_TAGS}" ]; then\n\
extraopts+=" --pkg-tags=${PKG_TAGS}"\n\
fi\n\
\n\
if [ -n "${EXTRA_OPTIMIZATIONS}" ]; then\n\
extraopts+=" --extra-optimizations"\n\
fi\n\
\n\
if [ -n "${BUILD_GENERIC}" ]; then\n\
extraopts+=" --generic"\n\
fi\n\
\n\
if [ -n "${PKG_BUILD_JOBS}" ]; then\n\
extraopts+=" --jobs=${PKG_BUILD_JOBS}"\n\
fi\n\
\n\
dest="artifacts"\n\
if [ -n "${PKG_PLATFORM}" ]; then\n\
dest+="/${PKG_PLATFORM}"\n\
fi\n\
if [ -n "${PKG_PLATFORM_LIBC}" ]; then\n\
dest+="${PKG_PLATFORM_LIBC}"\n\
extraopts+=" --libc=${PKG_PLATFORM_LIBC}"\n\
fi\n\
if [ -n "${PKG_PLATFORM_VERSION}" ]; then\n\
dest+="-${PKG_PLATFORM_VERSION}"\n\
fi\n\
if [ -n "${PKG_PLATFORM_ARCH}" ]; then\n\
extraopts+=" --arch=${PKG_PLATFORM_ARCH}"\n\
fi\n\
\n\
if [ -z "${PACKAGE}" ]; then\n\
PACKAGE="edgedbpkg.edgedb:EdgeDB"\n\
fi\n\
\n\
if [ "$1" == "bash" ] || [ "${GET_SHELL}" == "true" ]; then\n\
echo python -m metapkg build --dest="${dest}" ${extraopts} "${PACKAGE}"\n\
exec /bin/bash\n\
else\n\
python -m metapkg build -vvv --dest="${dest}" ${extraopts} "${PACKAGE}"\n\
ls -al "${dest}"\n\
fi\n\' >/entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
1 change: 1 addition & 0 deletions integration/linux/build/ubuntu-noble/action.yml
110 changes: 110 additions & 0 deletions integration/linux/test/ubuntu-noble/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "mkdockerfile.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#

FROM ubuntu:noble
RUN /bin/echo -e '#!/bin/bash\n\
\n\
set -ex\n\
\n\
dest="artifacts"\n\
if [ -n "${PKG_PLATFORM}" ]; then\n\
dest+="/${PKG_PLATFORM}"\n\
fi\n\
if [ -n "${PKG_PLATFORM_VERSION}" ]; then\n\
dest+="-${PKG_PLATFORM_VERSION}"\n\
fi\n\
\n\
dist="${PKG_PLATFORM_VERSION}"\n\
\n\
export DEBIAN_FRONTEND="noninteractive"\n\
\n\
apt-get update\n\
apt-get install -y curl gnupg apt-transport-https jq\n\
\n\
mkdir -p /usr/local/share/keyrings\n\
curl --proto '\''=https'\'' --tlsv1.2 -sSf \\\n\
-o /usr/local/share/keyrings/edgedb-keyring.gpg \\\n\
https://packages.edgedb.com/keys/edgedb-keyring.gpg\n\
echo deb [signed-by=/usr/local/share/keyrings/edgedb-keyring.gpg] \\\n\
https://packages.edgedb.com/apt "${dist}" main \\\n\
> "/etc/apt/sources.list.d/edgedb.list"\n\
if [ -n "${PKG_SUBDIST}" ]; then\n\
echo deb [signed-by=/usr/local/share/keyrings/edgedb-keyring.gpg] \\\n\
https://packages.edgedb.com/apt "${dist}" "${PKG_SUBDIST}" \\\n\
> "/etc/apt/sources.list.d/edgedb-${PKG_SUBDIST}.list"\n\
fi\n\
\n\
try=1\n\
while [ $try -le 30 ]; do\n\
apt-get update && apt-get install -y edgedb-cli && s=0 break || s=$?\n\
try=$(( $try + 1 ))\n\
echo "Retrying in 10 seconds (try #${try})" >&2\n\
sleep 10\n\
done\n\
\n\
if [ $s -ne 0 ]; then\n\
echo "could not install edgedb-cli" >&2\n\
exit $s\n\
fi\n\
\n\
slot=\n\
deb=\n\
for pack in ${dest}/*.tar; do\n\
if [ -e "${pack}" ]; then\n\
slot=$(tar -xOf "${pack}" "build-metadata.json" \\\n\
| jq -r ".version_slot")\n\
deb=$(tar -xOf "${pack}" "build-metadata.json" \\\n\
| jq -r ".contents | keys[]" \\\n\
| grep "^edgedb-server.*\\.deb$")\n\
if [ -n "${deb}" ]; then\n\
break\n\
fi\n\
fi\n\
done\n\
\n\
if [ -z "${deb}" ]; then\n\
echo "${dest} does not seem to contain an edgedb-server .deb" >&2\n\
exit 1\n\
fi\n\
\n\
if [ -z "${slot}" ]; then\n\
echo "could not determine version slot from build metadata" >&2\n\
exit 1\n\
fi\n\
\n\
machine=$(uname -m)\n\
tmpdir=$(mktemp -d)\n\
tar -x -C "${tmpdir}" -f "${pack}" "${deb}"\n\
apt-get install -y "${tmpdir}/${deb}"\n\
rm -rf "${tmpdir}"\n\
\n\
edgedb-server-${slot} --version\n\
\n\
if [ "$1" == "bash" ]; then\n\
echo su edgedb -c \\\n\
"/usr/lib/${machine}-linux-gnu/edgedb-server-${slot}/bin/python3 \\\n\
-m edb.tools --no-devmode test \\\n\
/usr/share/edgedb-server-${slot}/tests \\\n\
-e cqa_ -e tools_ \\\n\
--verbose"\n\
exec "$@"\n\
else\n\
if [ -n "${PKG_TEST_JOBS}" ]; then\n\
dash_j="-j${PKG_TEST_JOBS}"\n\
else\n\
dash_j=""\n\
fi\n\
su edgedb -c \\\n\
"/usr/lib/${machine}-linux-gnu/edgedb-server-${slot}/bin/python3 \\\n\
-m edb.tools --no-devmode test \\\n\
/usr/share/edgedb-server-${slot}/tests \\\n\
-e cqa_ -e tools_ \\\n\
--verbose ${dash_j}"\n\
echo "Success!"\n\
fi\n\' >/entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
1 change: 1 addition & 0 deletions integration/linux/test/ubuntu-noble/action.yml
Loading

0 comments on commit e21ca53

Please sign in to comment.