Skip to content

Commit

Permalink
Merge pull request #87 from emqx/prepare-for-5.1-builder-images
Browse files Browse the repository at this point in the history
chore: prepare for 5.1 builder image
  • Loading branch information
zmstone authored Jun 1, 2023
2 parents 314dbfe + 3391a67 commit a920e04
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
emqx_minor:
base_image_vsn:
- "5.0"
platform:
- [ubuntu22.04 , "linux/amd64,linux/arm64"]
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
- uses: docker/metadata-action@v4
id: base_meta
with:
images: ghcr.io/${{ github.repository }}/base-${{ matrix.emqx_minor }}
images: ghcr.io/${{ github.repository }}/base-${{ matrix.base_image_vsn }}
tags: type=raw,value=${{ matrix.platform[0] }}
- name: Build base image
uses: docker/build-push-action@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
strategy:
fail-fast: false
matrix:
emqx_minor:
base_image_vsn:
- "5.0"
platform:
- [ubuntu22.04 , "linux/amd64,linux/arm64"]
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
- uses: docker/metadata-action@v4
id: base_meta
with:
images: ghcr.io/${{ github.repository }}/base-${{ matrix.emqx_minor }}
images: ghcr.io/${{ github.repository }}/base-${{ matrix.base_image_vsn }}
tags: type=raw,value=${{ matrix.platform[0] }}
- name: Build base image
uses: docker/build-push-action@v3
Expand All @@ -97,7 +97,7 @@ jobs:
strategy:
fail-fast: false
matrix:
emqx_minor:
base_image_vsn:
- "5.0"
otp: ${{ fromJSON(needs.prepare.outputs.otp) }}
elixir: ${{ fromJSON(needs.prepare.outputs.elixir) }}
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_FROM=ghcr.io/${{ github.repository }}/base-${{ matrix.emqx_minor }}:${{ matrix.platform[0] }}
BUILD_FROM=ghcr.io/${{ github.repository }}/base-${{ matrix.base_image_vsn }}:${{ matrix.platform[0] }}
OTP_VERSION=${{ matrix.otp }}
ELIXIR_VERSION=${{ matrix.elixir }}
file: ./Dockerfile
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

strategy:
matrix:
emqx_minor:
base_image_vsn:
- "5.0"
otp: ${{ fromJSON(needs.prepare.outputs.otp) }}
elixir: ${{ fromJSON(needs.prepare.outputs.elixir) }}
Expand Down Expand Up @@ -80,14 +80,14 @@ jobs:
with:
push: true
platforms: ${{ matrix.platform[1] }}
tags: localhost:5000/${{ github.repository }}/base-${{ matrix.emqx_minor }}:${{ matrix.platform[0] }}
tags: localhost:5000/${{ github.repository }}/base-${{ matrix.base_image_vsn }}:${{ matrix.platform[0] }}
file: ${{ matrix.platform[0] }}/Dockerfile
context: .
- uses: docker/build-push-action@v3
with:
platforms: ${{ matrix.platform[1] }}
build-args: |
BUILD_FROM=localhost:5000/${{ github.repository }}/base-${{ matrix.emqx_minor }}:${{ matrix.platform[0] }}
BUILD_FROM=localhost:5000/${{ github.repository }}/base-${{ matrix.base_image_vsn }}:${{ matrix.platform[0] }}
OTP_VERSION=${{ matrix.otp }}
ELIXIR_VERSION=${{ matrix.elixir }}
file: ./Dockerfile
Expand Down
19 changes: 2 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
NOTE: Must sync Dockerfile chages from main-4.4 branch!

# Docker images for EMQX Builder
# Docker images for building EMQX v5 or later packages

This repo holds the Dockerfile and build scripts to build
docker images which are used to build EMQX.

The `main-4.4` branch is for EMQX 4.4 series.
The `main` branch is for EMQX 5.0 series.
The `main` branch is for EMQX 5.x series.

## OTP repo https://github.com/emqx/otp.git

EMQX uses a forked Erlang/OTP with the tag scheme `<UPSTREAM_TAG>-N`
where `N` is the build number which includes bug fixes to Erlang/OTP source code.
For example: `OTP-24.1.5-1`

## Add new OTP / Elixir versions to build

When we need to support a new OTP or Elixir version for a bugfix
release, we should add a new OTP tag to the list in RELEASE.md

for example, after `5.0.0-otp24.1.5-1` is released, in case there is a
bug found in OTP which requires OTP `24.2-1`, we should add `+
OTP-24.2-1` to the list. For Elixir, once `1.13.2` is released, for
example, it should be added as `+ Elixir-1.13.2` to the list.

This list should be append-only in case we want to rebuild an old EMQX tag,
we can still find an up-to-date docker image for it.

## Image tag scheme

```
Expand Down
3 changes: 1 addition & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
New EMQX 5.0 Builder is Released
New EMQX v5 Builder is Released

OTP versions from emqx/otp.git:

+ OTP-24.3.4.2-3
+ OTP-25.3.2-1

Elixir versions from elixir-lang/elixir.git:
Expand Down
22 changes: 22 additions & 0 deletions show-latest-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

## This script prints out all the possible emqx-builder docker image tags built from the latest git tag

GREP='grep --color=never'
ALL_SYS="$($GREP -A20 'platform:' .github/workflows/main.yaml | \
$GREP -E '\-\s?\[.*\]$' | \
tr -d '\- []"' | \
sed -e '/^#.*/d' | \
cut -d',' -f1 | \
sort -u)"

GIT_TAG="$(git describe --abbrev=0 --tags)"
OTP_VERSIONS="$($GREP -E "^\+\sOTP-.*" ./RELEASE.md | sed 's/\+\sOTP-//g')"
ELIXIR_VERSIONS="$($GREP -E "^\+\sElixir-.*" ./RELEASE.md | sed 's/\+\sElixir-//g')"
for elixir in $ELIXIR_VERSIONS; do
for otp in $OTP_VERSIONS; do
for sys in $ALL_SYS; do
echo "ghcr.io/emqx/emqx-builder/${GIT_TAG}:${elixir}-${otp}-${sys}"
done
done
done

0 comments on commit a920e04

Please sign in to comment.