diff --git a/.github/workflows/base.yaml b/.github/workflows/base.yaml index c6d1935..7f573a0 100644 --- a/.github/workflows/base.yaml +++ b/.github/workflows/base.yaml @@ -18,23 +18,18 @@ jobs: base_image_vsn: - "5.0" platform: - - [ubuntu22.04fdb, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [ubuntu22.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [ubuntu22.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [ubuntu20.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [ubuntu20.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [ubuntu18.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [ubuntu18.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - - [ubuntu16.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] - - [ubuntu16.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [debian12, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [debian12, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [debian11, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [debian11, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [debian10, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [debian10, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - - [debian9, linux/amd64, [self-hosted, linux, x64, ephemeral]] - - [debian9, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [el9, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [el9, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [el8, linux/amd64, [self-hosted, linux, x64, ephemeral]] diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c75980b..1e2ff26 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -37,23 +37,18 @@ jobs: base_image_vsn: - "5.0" platform: - - [ubuntu22.04fdb, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [ubuntu22.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [ubuntu22.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [ubuntu20.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [ubuntu20.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [ubuntu18.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [ubuntu18.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - - [ubuntu16.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] - - [ubuntu16.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [debian12, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [debian12, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [debian11, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [debian11, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [debian10, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [debian10, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - - [debian9, linux/amd64, [self-hosted, linux, x64, ephemeral]] - - [debian9, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [el9, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [el9, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [el8, linux/amd64, [self-hosted, linux, x64, ephemeral]] diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e90fd68..2c06a47 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -55,23 +55,18 @@ jobs: otp: ${{ fromJSON(needs.prepare.outputs.otp) }} elixir: ${{ fromJSON(needs.prepare.outputs.elixir) }} platform: - - [ubuntu22.04fdb, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [ubuntu22.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [ubuntu22.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [ubuntu20.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [ubuntu20.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [ubuntu18.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [ubuntu18.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - - [ubuntu16.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] - - [ubuntu16.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [debian12, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [debian12, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [debian11, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [debian11, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [debian10, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [debian10, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - - [debian9, linux/amd64, [self-hosted, linux, x64, ephemeral]] - - [debian9, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [el9, linux/amd64, [self-hosted, linux, x64, ephemeral]] - [el9, linux/arm64, [self-hosted, linux, arm64, ephemeral]] - [el8, linux/amd64, [self-hosted, linux, x64, ephemeral]] diff --git a/Dockerfile b/Dockerfile index 3e65d2b..1f15cd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,34 +3,20 @@ FROM ${BUILD_FROM} ENV EMQX_BUILDER_IMAGE=${BUILD_FROM} -ARG OTP_VERSION - -COPY get-otp.sh /get-otp.sh -RUN /get-otp.sh ${OTP_VERSION} - -ARG ELIXIR_VERSION - -COPY get-elixir.sh /get-elixir.sh -RUN /get-elixir.sh ${ELIXIR_VERSION} - -RUN mkdir /tools - -ARG EMQTT_BENCH_REF - -COPY get-emqtt-bench.sh /get-emqtt-bench.sh -RUN /get-emqtt-bench.sh "${EMQTT_BENCH_REF:-0.4.17}" - -ARG LUX_REF -ENV LUX_REF=${LUX_REF:-lux-2.9.1} - -RUN git clone --depth=1 --branch=${LUX_REF} https://github.com/hawk/lux /tools/lux \ - && cd /tools/lux \ - && autoconf \ - && ./configure \ - && make \ - && make install \ - && cd /tools \ - && rm -rf lux +ARG OTP_VERSION=26.2.3-1 +ARG ELIXIR_VERSION=1.15.7 +ARG FDB_VERSION=7.3.27 +ARG EMQTT_BENCH_REF=0.4.17 +ARG LUX_REF=lux-2.9.1 + +COPY get-otp.sh get-elixir.sh get-fdb.sh get-emqtt-bench.sh get-lux.sh / + +RUN /get-otp.sh ${OTP_VERSION} && \ + /get-elixir.sh ${ELIXIR_VERSION} && \ + env FDB_VERSION=${FDB_VERSION} /get-fdb.sh && \ + env EMQTT_BENCH_REF=${EMQTT_BENCH_REF} /get-emqtt-bench.sh && \ + env LUX_REF=${LUX_REF} /get-lux.sh && \ + rm /get-otp.sh /get-elixir.sh /get-fdb.sh /get-emqtt-bench.sh /get-lux.sh WORKDIR / CMD [ "/bin/bash" ] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..567af79 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +IMAGES = alpine3.15 amzn2 amzn2023 debian10 debian11 debian12 el7 el8 el9 ubuntu18.04 ubuntu20.04 ubuntu22.04 + +.PHONY: all +all: $(IMAGES) + +.PHONY: $(IMAGES) +define gen-build-image-target +$1: + @docker build -t ghcr.io/emqx/emqx-builder:$1-base $1 + @docker build --build-arg BUILD_FROM=ghcr.io/emqx/emqx-builder:$1-base -t ghcr.io/emqx/emqx-builder:$1 . +endef +$(foreach img,$(IMAGES),$(eval $(call gen-build-image-target,$(img)))) + +.PHONY: $(IMAGES:%=%-push) +define gen-push-image-target +$1-push: + @docker push ghcr.io/emqx/emqx-builder:$1-base + @docker push ghcr.io/emqx/emqx-builder:$1 +endef +$(foreach img,$(IMAGES),$(eval $(call gen-push-image-target,$(img)))) diff --git a/RELEASE.md b/RELEASE.md index 3ee2334..fa4f256 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -3,6 +3,7 @@ List per major version used by EMQX, quic, rocksdb builds OTP version from emqx/otp.git: + OTP-25.3.2-2 ++ OTP-26.2.1-2 + OTP-26.2.3-1 Elixir version from elixir-lang/elixir.git: diff --git a/get-emqtt-bench.sh b/get-emqtt-bench.sh index eb2b8bb..5eb1c98 100755 --- a/get-emqtt-bench.sh +++ b/get-emqtt-bench.sh @@ -4,14 +4,19 @@ set -xeuo pipefail VSN="${1:-0.4.17}" -if grep -q -i 'rhel' /etc/os-release; then +. /etc/os-release +if [[ "${ID_LIKE:-}" =~ rhel|fedora ]]; then DIST='el' - VERSION_ID="$(rpm --eval '%{rhel}')" -else - DIST="$(sed -n '/^ID=/p' /etc/os-release | sed -r 's/ID=(.*)/\1/g' | sed 's/"//g')" - VERSION_ID="$(sed -n '/^VERSION_ID=/p' /etc/os-release | sed -r 's/VERSION_ID=(.*)/\1/g' | sed 's/"//g')" + case ${ID} in + amzn) + VERSION_ID="7" + ;; + *) + VERSION_ID="${VERSION_ID%%.*}" + ;; + esac fi -SYSTEM="$(echo "${DIST}${VERSION_ID}" | sed -r 's/([a-zA-Z]*)-.*/\1/g')" +SYSTEM="${ID}${VERSION_ID}" # no quic on raspbian9 and centos7 case "$SYSTEM" in diff --git a/get-fdb.sh b/get-fdb.sh new file mode 100755 index 0000000..06ba7a6 --- /dev/null +++ b/get-fdb.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +set -euo pipefail + +ARCH=$(arch) +if [ "${ARCH}" != "x86_64" ]; then + echo "Unsupported architecture: ${ARCH}" + exit 0 +fi + +BASE_URL="https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}" +. /etc/os-release +if [[ "${ID_LIKE:-}" =~ rhel|fedora ]]; then + DIST='el' + case ${ID} in + amzn) + VERSION_ID="7" + ;; + *) + VERSION_ID="${VERSION_ID%%.*}" + ;; + esac + SYSTEM="${DIST}${VERSION_ID}" + case ${SYSTEM} in + el7) + wget "${BASE_URL}/foundationdb-clients-${FDB_VERSION}-1.${SYSTEM}.${ARCH}.rpm" -O ./foundationdb-clients.rpm + rpm -i ./foundationdb-clients.rpm + rm ./foundationdb-clients.rpm + ;; + *) + echo "Unsupported system: ${SYSTEM}" + exit 0 + ;; + esac +elif [[ "${ID:-}" =~ debian|ubuntu ]]; then + ARCH=$(dpkg --print-architecture) + SYSTEM="${ID}${VERSION_ID}" + case ${SYSTEM} in + debian11 | debian12 | ubuntu20.04 | ubuntu22.04) + wget "${BASE_URL}/foundationdb-clients_${FDB_VERSION}-1_${ARCH}.deb" -O foundationdb-clients.deb + dpkg -i foundationdb-clients.deb + rm foundationdb-clients.deb + ;; + *) + echo "Unsupported system: ${SYSTEM}" + exit 0 + ;; + esac +fi diff --git a/get-lux.sh b/get-lux.sh new file mode 100755 index 0000000..dce9f0f --- /dev/null +++ b/get-lux.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -xeuo pipefail + +LUX_REF="${LUX_REF:-lux-2.9.1}" + +mkdir -p /tools +git clone --depth=1 --branch=${LUX_REF} https://github.com/hawk/lux /tools/lux +cd /tools/lux +autoconf +./configure +make +make install +cd /tools +rm -rf lux diff --git a/ubuntu22.04fdb/Dockerfile b/ubuntu22.04fdb/Dockerfile deleted file mode 100644 index 421217d..0000000 --- a/ubuntu22.04fdb/Dockerfile +++ /dev/null @@ -1,62 +0,0 @@ -ARG BUILD_FROM=public.ecr.aws/ubuntu/ubuntu:22.04 -FROM ${BUILD_FROM} - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && apt-get install -y \ - apt-transport-https \ - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - debhelper \ - expect \ - flex \ - git \ - inotify-tools \ - jq \ - krb5-admin-server \ - krb5-kdc \ - libffi-dev \ - libkrb5-3 \ - libkrb5-dev \ - libncurses5-dev \ - libsasl2-2 \ - libsasl2-dev \ - libsasl2-modules-gssapi-mit \ - libssl-dev \ - libtool \ - python3 \ - python3-pip \ - software-properties-common \ - unixodbc \ - unixodbc-dev \ - unzip \ - vim \ - wget \ - zip \ - zlib1g-dev \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -RUN wget https://github.com/apple/foundationdb/releases/download/7.1.43/foundationdb-clients_7.1.43-1_amd64.deb \ - && dpkg -i foundationdb-clients_7.1.43-1_amd64.deb \ - && rm foundationdb-clients_7.1.43-1_amd64.deb - -RUN ln -sf /usr/bin/python3 /usr/bin/python && \ - ln -sf /usr/bin/pip3 /usr/bin/pip - -RUN cmake --version - -WORKDIR / - -# Elixir complains if runs without UTF-8 -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 - -WORKDIR / -CMD [ "/bin/bash" ]