Skip to content

Commit

Permalink
feat: add fdb
Browse files Browse the repository at this point in the history
  • Loading branch information
id committed Apr 26, 2024
1 parent fe5fb42 commit 8c66d6f
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 111 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
42 changes: 14 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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))))
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 11 additions & 6 deletions get-emqtt-bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 49 additions & 0 deletions get-fdb.sh
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions get-lux.sh
Original file line number Diff line number Diff line change
@@ -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
62 changes: 0 additions & 62 deletions ubuntu22.04fdb/Dockerfile

This file was deleted.

0 comments on commit 8c66d6f

Please sign in to comment.