diff --git a/.github/workflows/docker-debian.yaml b/.github/workflows/docker-debian.yaml new file mode 100644 index 00000000..24b661d2 --- /dev/null +++ b/.github/workflows/docker-debian.yaml @@ -0,0 +1,194 @@ +name: Bondy Debian OTP 26 +on: + workflow_dispatch: + push: + branches : [master, develop] + tags: + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+.[0-9]+' + +jobs: + + build-push-arm64: + runs-on: ubuntu-24-arm64-4x + + steps: + # Not strictly required as it should default based on runner) + - name: Set Platform to arm64 + run: echo "DOCKER_DEFAULT_PLATFORM=linux/arm64" >> $GITHUB_ENV + + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Context for Buildx + id: buildx-context + run: | + docker context create builders + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: latest + endpoint: builders + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # without registry name, we will add it in the build-push-action as + # each registry has diff namespace at the moment + images: | + bondy + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + flavor: | + latest=false + prefix= + suffix= + labels: | + maintainer=Leapsight + org.opencontainers.image.title=Bondy + org.opencontainers.image.description=Bondy is an open source, always-on and scalable application networking platform connecting all elements of a distributed application—offering event and service mesh capabilities combined. From web and mobile apps to IoT devices and backend microservices, Bondy allows everything to talk using one simple communication protocol. + org.opencontainers.image.vendor=Leapsight + + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + context: . + file: ./deployment/Dockerfile + tags: leapsight/${{ steps.meta.outputs.tags }}-arm64 + + build-push-x64: + runs-on: ubuntu-latest + + steps: + # Not strictly required as it should default based on runner) + - name: Set Platform to amd64 + run: echo "DOCKER_DEFAULT_PLATFORM=linux/amd64" >> $GITHUB_ENV + + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Context for Buildx + id: buildx-context + run: | + docker context create builders + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: latest + endpoint: builders + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # without registry name, we will add it in the build-push-action as + # each registry has diff namespace at the moment + images: | + bondy + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + flavor: | + latest=false + prefix= + suffix= + labels: | + maintainer=Leapsight + org.opencontainers.image.title=Bondy + org.opencontainers.image.description=Bondy is an open source, always-on and scalable application networking platform connecting all elements of a distributed application—offering event and service mesh capabilities combined. From web and mobile apps to IoT devices and backend microservices, Bondy allows everything to talk using one simple communication protocol. + org.opencontainers.image.vendor=Leapsight + + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + context: . + file: ./deployment/Dockerfile + tags: leapsight/${{ steps.meta.outputs.tags }}-amd64 + labels: ${{ steps.meta.outputs.labels }} + + create-manifests: + runs-on: ubuntu-latest + needs: [build-push-x64, build-push-arm64] + + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # without registry name, we will add it in the build-push-action as + # each registry has diff namespace at the moment + images: | + bondy + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + flavor: | + latest=false + prefix= + suffix= + labels: | + maintainer=Leapsight + org.opencontainers.image.title=Bondy + org.opencontainers.image.description=Bondy is an open source, always-on and scalable application networking platform connecting all elements of a distributed application—offering event and service mesh capabilities combined. From web and mobile apps to IoT devices and backend microservices, Bondy allows everything to talk using one simple communication protocol. + org.opencontainers.image.vendor=Leapsight + + - name: Create branch/tag manifest and push + run: | + docker buildx imagetools create \ + -t leapsight/${{ steps.meta.outputs.tags }} \ + leapsight/${{ steps.meta.outputs.tags }}-amd64 \ + leapsight/${{ steps.meta.outputs.tags }}-arm64 + docker buildx imagetools inspect \ + leapsight/${{ steps.meta.outputs.tags }} + + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + - + # Copy multiplatform image from dockerhub to Github Registry + # without changing the image SHA + name: Copy Image to GitHub Container Registry + uses: akhilerm/tag-push-action@v2.1.0 + with: + src: docker.io/leapsight/${{ steps.meta.outputs.tags }} + dst: | + ghcr.io/bondy-io/${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index 685fac94..00000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,110 +0,0 @@ -name: Docker Build OTP 26 -on: - workflow_dispatch: - push: - branches : [develop, master] - tags: - - '[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+' - - '[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+.[0-9]+' - - '[0-9]+.[0-9]+.[0-9]+.[0-9]+' - -jobs: - docker: - runs-on: ubuntu-latest - name: Build an publish docker images to multiple registries - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: all - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ github.token }} - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - # without registry name, we will add it in the build-push-action as - # each registry has diff namespace at the moment - images: | - bondy - tags: | - type=ref,event=branch - type=semver,pattern={{version}} - flavor: | - latest=false - prefix= - suffix= - labels: | - maintainer=Leapsight - org.opencontainers.image.title=Bondy - org.opencontainers.image.description=Bondy is an open source, always-on and scalable application networking platform connecting all elements of a distributed application—offering event and service mesh capabilities combined. From web and mobile apps to IoT devices and backend microservices, Bondy allows everything to talk using one simple communication protocol. - org.opencontainers.image.vendor=Leapsight - - - name: Build, cache and push standard image - uses: docker/build-push-action@v6 - with: - context: . - file: ./deployment/Dockerfile - platforms: linux/amd64,linux/arm64 - push: true - tags: leapsight/${{ steps.meta.outputs.tags }},leapsight/${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=leapsight/${{ steps.meta.outputs.tags }}-buildcache - cache-to: type=registry,ref=leapsight/${{ steps.meta.outputs.tags }}-buildcache,mode=max - - - # Copy multiplatform image from dockerhub to multiple registries - # without changing the image SHA - name: Copy Image to multiple registries - uses: akhilerm/tag-push-action@v2.1.0 - with: - src: docker.io/leapsight/${{ steps.meta.outputs.tags }} - dst: | - ghcr.io/bondy-io/${{ steps.meta.outputs.tags }} - - - name: Build and push alpine image - uses: docker/build-push-action@v6 - with: - context: . - file: ./deployment/alpine.Dockerfile - platforms: linux/amd64,linux/arm64 - push: true - tags: leapsight/${{ steps.meta.outputs.tags }}-alpine,leapsight/${{ steps.meta.outputs.tags }}-alpine - labels: ${{ steps.meta.outputs.labels }} - - - # Copy multiplatform image from dockerhub to multiple registries - # without changing the image SHA - name: Copy Image to multiple registries - uses: akhilerm/tag-push-action@v2.1.0 - with: - src: docker.io/leapsight/${{ steps.meta.outputs.tags }}-alpine - dst: | - ghcr.io/bondy-io/${{ steps.meta.outputs.tags }}-alpine - - - # Copy multiplatform image from dockerhub to multiple registries - # without changing the image SHA - name: Copy Image to multiple registries - uses: akhilerm/tag-push-action@v2.1.0 - with: - src: docker.io/leapsight/${{ steps.meta.outputs.tags }}-alpine - dst: | - ghcr.io/bondy-io/${{ steps.meta.outputs.tags }}-alpine diff --git a/CHANGELOG.md b/CHANGELOG.md index f9c8e520..e05a5304 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,14 @@ # CHANGELOG + +## 1.0.0-rc.32 +* Updated Dockerfile + * Removed deprecated libraries + * Upgraded OS and Erlang/OTP versions + * New multi-arch Github action + ## 1.0.0-rc.31 -* Updated Dockerfile: removed deprecated libraries and uphgrade both Linux and Erlang versions -* Removed the OTP25 version of Bondy. +* Removed support for OTP25 +* Updated Github Actions ## 1.0.0-rc.30 ## Fixes diff --git a/Makefile b/Makefile index 0cc5f47b..9b1e644a 100644 --- a/Makefile +++ b/Makefile @@ -193,6 +193,19 @@ docker-build: -t "bondy-prod" \ -f deployment/Dockerfile . +docker-cloud-build: + docker buildx install + docker stop bondy-prod || true + docker rm bondy-prod || true + docker rmi bondy-prod || true + docker build \ + --builder cloud-leapsight-bondy-cloud-builder \ + --pull \ + --platform linux/$(DOCKER_PLATFORM) \ + --load \ + -t "bondy-prod" \ + -f deployment/Dockerfile . + docker-build-alpine: docker buildx install docker stop bondy-prod || true @@ -225,3 +238,4 @@ docker-run-prod: docker-scan-prod: docker scan bondy-prod + diff --git a/apps/bondy/src/bondy.app.src b/apps/bondy/src/bondy.app.src index 977e1e6c..0f2759d0 100644 --- a/apps/bondy/src/bondy.app.src +++ b/apps/bondy/src/bondy.app.src @@ -26,10 +26,10 @@ "Bondy implements the open Web Application Messaging Protocol (WAMP) " "and is written in Erlang." }, - {vsn, "1.0.0-rc.31"}, + {vsn, "1.0.0-rc.32"}, {registered, []}, %% We pass the version number in the bondy_app:start/2 arguments - {mod, {bondy_app, [{vsn, "1.0.0-rc.31"}]}}, + {mod, {bondy_app, [{vsn, "1.0.0-rc.32"}]}}, {applications,[ %% Erlang/OTP stdlib, diff --git a/apps/bondy_broker_bridge/src/bondy_broker_bridge.app.src b/apps/bondy_broker_bridge/src/bondy_broker_bridge.app.src index 8cf11b01..306aa6fd 100644 --- a/apps/bondy_broker_bridge/src/bondy_broker_bridge.app.src +++ b/apps/bondy_broker_bridge/src/bondy_broker_bridge.app.src @@ -2,7 +2,7 @@ {description, "Bondy Broker Bridge is an application that is part of Bondy and provides a way to integrate Events with external brokers and systems." }, - {vsn, "1.0.0-rc.31"}, + {vsn, "1.0.0-rc.32"}, {registered, []}, {mod, {bondy_broker_bridge_app, []}}, {applications, [ diff --git a/deployment/Dockerfile b/deployment/Dockerfile index cf8a3d6e..e2321c19 100644 --- a/deployment/Dockerfile +++ b/deployment/Dockerfile @@ -71,8 +71,8 @@ ENV HOME "/bondy" # We also create the /bondy/etc dir to avoid an issue when deploying in K8s # where the permissions are not assigned to the directory and Bondy will not # have permission to write. -RUN apt-get update \ - && apt-get -y install \ +RUN apt-get update && \ + apt-get -y install --no-install-recommends \ sudo bash procps iproute2 net-tools dnsutils curl jq nano \ openssl libsnappy-dev\ && rm -rf /var/lib/apt/lists/* \ diff --git a/deployment/alpine.Dockerfile b/deployment/alpine.Dockerfile index 615f9cd7..ff33a3eb 100644 --- a/deployment/alpine.Dockerfile +++ b/deployment/alpine.Dockerfile @@ -19,7 +19,6 @@ RUN --mount=type=cache,id=apk,sharing=locked,target=/var/cache/apk \ ncurses \ openssl \ snappy-dev \ - libsodium-dev \ jq \ curl \ bash \ @@ -75,7 +74,6 @@ ENV HOME "/bondy" # # We install the following required packages: # - openssl: required by Erlang crypto application -# - libsodium: required by enacl application # We setup the bondy group and user and the /bondy dir # We also create the /bondy/etc dir to avoid an issue when deploying in K8s # where the permissions are not assigned to the directory and Bondy will not @@ -85,7 +83,7 @@ RUN --mount=type=cache,id=apk,sharing=locked,target=/var/cache/apk \ && apk add --no-cache \ libstdc++ \ bash procps iproute2 net-tools curl jq nano \ - ncurses openssl libsodium-dev \ + ncurses openssl \ && addgroup --gid 1000 bondy \ && adduser \ --uid 1000 \ diff --git a/rebar.config b/rebar.config index d0540eb7..b6ddfd78 100644 --- a/rebar.config +++ b/rebar.config @@ -131,7 +131,7 @@ {relx, [ - {release, {bondy, "1.0.0-rc.31"},[ + {release, {bondy, "1.0.0-rc.32"},[ %% Erlang/OTP crypto, inets,