Просмотр исходного кода

Merge pull request #12648 from id/0503-prep-5.5.1-rc.3

prep 5.5.1 rc.3
Ivan Dyachkov 1 год назад
Родитель
Сommit
3d3f3b96d1

+ 42 - 13
.github/workflows/build_and_push_docker_images.yaml

@@ -81,14 +81,6 @@ jobs:
         profile:
         profile:
           - ${{ inputs.profile }}
           - ${{ inputs.profile }}
           - ${{ inputs.profile }}-elixir
           - ${{ inputs.profile }}-elixir
-        registry:
-          - 'docker.io'
-          - 'public.ecr.aws'
-        exclude:
-          - profile: emqx-enterprise
-            registry: 'public.ecr.aws'
-          - profile: emqx-enterprise-elixir
-            registry: 'public.ecr.aws'
 
 
     steps:
     steps:
     - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
     - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -101,14 +93,14 @@ jobs:
 
 
     - name: Login to hub.docker.com
     - name: Login to hub.docker.com
       uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
       uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
-      if: matrix.registry == 'docker.io'
+      if: inputs.publish || github.repository_owner != 'emqx'
       with:
       with:
         username: ${{ secrets.DOCKER_HUB_USER }}
         username: ${{ secrets.DOCKER_HUB_USER }}
         password: ${{ secrets.DOCKER_HUB_TOKEN }}
         password: ${{ secrets.DOCKER_HUB_TOKEN }}
 
 
     - name: Login to AWS ECR
     - name: Login to AWS ECR
       uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
       uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
-      if: matrix.registry == 'public.ecr.aws'
+      if: inputs.publish || github.repository_owner != 'emqx'
       with:
       with:
         registry: public.ecr.aws
         registry: public.ecr.aws
         username: ${{ secrets.AWS_ACCESS_KEY_ID }}
         username: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -118,17 +110,54 @@ jobs:
     - name: Build docker image
     - name: Build docker image
       env:
       env:
         PROFILE: ${{ matrix.profile }}
         PROFILE: ${{ matrix.profile }}
-        DOCKER_REGISTRY: ${{ matrix.registry }}
+        DOCKER_REGISTRY: 'docker.io,public.ecr.aws'
         DOCKER_ORG: ${{ github.repository_owner }}
         DOCKER_ORG: ${{ github.repository_owner }}
         DOCKER_LATEST: ${{ inputs.latest }}
         DOCKER_LATEST: ${{ inputs.latest }}
-        DOCKER_PUSH: ${{ inputs.publish == 'true' || inputs.publish || github.repository_owner != 'emqx' }}
+        DOCKER_PUSH: false
         DOCKER_BUILD_NOCACHE: true
         DOCKER_BUILD_NOCACHE: true
         DOCKER_PLATFORMS: linux/amd64,linux/arm64
         DOCKER_PLATFORMS: linux/amd64,linux/arm64
-        EMQX_RUNNER: 'debian:11-slim'
+        DOCKER_LOAD: true
+        EMQX_RUNNER: 'public.ecr.aws/debian/debian:11-slim@sha256:22cfb3c06a7dd5e18d86123a73405664475b9d9fa209cbedcf4c50a25649cc74'
         EMQX_DOCKERFILE: 'deploy/docker/Dockerfile'
         EMQX_DOCKERFILE: 'deploy/docker/Dockerfile'
         PKG_VSN: ${{ inputs.version }}
         PKG_VSN: ${{ inputs.version }}
         EMQX_BUILDER_VERSION: ${{ inputs.builder_vsn }}
         EMQX_BUILDER_VERSION: ${{ inputs.builder_vsn }}
         EMQX_BUILDER_OTP: ${{ inputs.otp_vsn }}
         EMQX_BUILDER_OTP: ${{ inputs.otp_vsn }}
         EMQX_BUILDER_ELIXIR: ${{ inputs.elixir_vsn }}
         EMQX_BUILDER_ELIXIR: ${{ inputs.elixir_vsn }}
+        EMQX_SOURCE_TYPE: tgz
       run: |
       run: |
         ./build ${PROFILE} docker
         ./build ${PROFILE} docker
+        echo "Built tags:"
+        echo "==========="
+        cat .emqx_docker_image_tags
+        echo "==========="
+        echo "_EMQX_DOCKER_IMAGE_TAG=$(head -n 1 .emqx_docker_image_tags)" >> $GITHUB_ENV
+
+    - name: smoke test
+      timeout-minutes: 1
+      run: |
+        for tag in $(cat .emqx_docker_image_tags); do
+          CID=$(docker run -d -P $tag)
+          HTTP_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "18083/tcp") 0).HostPort}}' $CID)
+          ./scripts/test/emqx-smoke-test.sh localhost $HTTP_PORT
+          docker rm -f $CID
+        done
+    - name: dashboard tests
+      working-directory: ./scripts/ui-tests
+      timeout-minutes: 5
+      run: |
+        set -eu
+        docker compose up --abort-on-container-exit --exit-code-from selenium
+        docker compose rm -fsv
+    - name: test node_dump
+      run: |
+        CID=$(docker run -d -P $_EMQX_DOCKER_IMAGE_TAG)
+        docker exec -t -u root -w /root $CID bash -c 'apt-get -y update && apt-get -y install net-tools'
+        docker exec -t -u root $CID node_dump
+        docker rm -f $CID
+    - name: push images
+      if: inputs.publish || github.repository_owner != 'emqx'
+      run: |
+        for tag in $(cat .emqx_docker_image_tags); do
+          echo "Pushing tag $tag"
+          docker push $tag
+        done

+ 3 - 3
.github/workflows/build_packages.yaml

@@ -221,9 +221,9 @@ jobs:
         set -eu
         set -eu
         cd packages/${{ matrix.profile }}
         cd packages/${{ matrix.profile }}
         # fix the .sha256 file format
         # fix the .sha256 file format
-        for var in $(ls | grep emqx | grep -v sha256); do
-          dos2unix $var.sha256
-          echo "$(cat $var.sha256) $var" | sha256sum -c || exit 1
+        for f in *.sha256; do
+          dos2unix $f
+          echo "$(cat $f) ${f%.*}" | sha256sum -c || exit 1
         done
         done
         cd -
         cd -
     - uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
     - uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1

+ 2 - 2
apps/emqx/include/emqx_release.hrl

@@ -32,10 +32,10 @@
 %% `apps/emqx/src/bpapi/README.md'
 %% `apps/emqx/src/bpapi/README.md'
 
 
 %% Opensource edition
 %% Opensource edition
--define(EMQX_RELEASE_CE, "5.5.1").
+-define(EMQX_RELEASE_CE, "5.5.1-rc.3").
 
 
 %% Enterprise edition
 %% Enterprise edition
--define(EMQX_RELEASE_EE, "5.5.1").
+-define(EMQX_RELEASE_EE, "5.5.1-rc.3").
 
 
 %% The HTTP API version
 %% The HTTP API version
 -define(EMQX_API_VERSION, "5.0").
 -define(EMQX_API_VERSION, "5.0").

+ 27 - 3
build

@@ -385,6 +385,16 @@ docker_cleanup() {
     [ -f ./.dockerignore.bak ] && mv ./.dockerignore.bak ./.dockerignore >/dev/null || true
     [ -f ./.dockerignore.bak ] && mv ./.dockerignore.bak ./.dockerignore >/dev/null || true
 }
 }
 
 
+function is_ecr_and_enterprise() {
+  local registry="$1"
+  local profile="$2"
+  if [[ "$registry" == public.ecr.aws* ]] && [[ "$profile" == *enterprise* ]]; then
+    return 0
+  else
+    return 1
+  fi
+}
+
 ## Build the default docker image based on debian 11.
 ## Build the default docker image based on debian 11.
 make_docker() {
 make_docker() {
     local EMQX_BUILDER_VERSION="${EMQX_BUILDER_VERSION:-5.3-2}"
     local EMQX_BUILDER_VERSION="${EMQX_BUILDER_VERSION:-5.3-2}"
@@ -450,6 +460,13 @@ make_docker() {
        --tag "${EMQX_IMAGE_TAG}" \
        --tag "${EMQX_IMAGE_TAG}" \
        --pull
        --pull
     )
     )
+    :> ./.emqx_docker_image_tags
+    for r in "${DOCKER_REGISTRIES[@]}"; do
+        if ! is_ecr_and_enterprise "$r" "$PROFILE"; then
+            DOCKER_BUILDX_ARGS+=(--tag "$r/${EMQX_IMAGE_TAG}")
+            echo "$r/${EMQX_IMAGE_TAG}" >> ./.emqx_docker_image_tags
+        fi
+    done
     if [ "${DOCKER_BUILD_NOCACHE:-false}" = true ]; then
     if [ "${DOCKER_BUILD_NOCACHE:-false}" = true ]; then
         DOCKER_BUILDX_ARGS+=(--no-cache)
         DOCKER_BUILDX_ARGS+=(--no-cache)
     fi
     fi
@@ -457,9 +474,16 @@ make_docker() {
         DOCKER_BUILDX_ARGS+=(--label org.opencontainers.image.elixir.version="${EMQX_BUILDER_ELIXIR}")
         DOCKER_BUILDX_ARGS+=(--label org.opencontainers.image.elixir.version="${EMQX_BUILDER_ELIXIR}")
     fi
     fi
     if [ "${DOCKER_LATEST:-false}" = true ]; then
     if [ "${DOCKER_LATEST:-false}" = true ]; then
-        DOCKER_BUILDX_ARGS+=(--tag "${EMQX_BASE_DOCKER_TAG}:latest${SUFFIX}")
-        DOCKER_BUILDX_ARGS+=(--tag "${EMQX_BASE_DOCKER_TAG}:${VSN_MAJOR}.${VSN_MINOR}${SUFFIX}")
-        DOCKER_BUILDX_ARGS+=(--tag "${EMQX_BASE_DOCKER_TAG}:${VSN_MAJOR}.${VSN_MINOR}.${VSN_PATCH}${SUFFIX}")
+        for r in "${DOCKER_REGISTRIES[@]}"; do
+            if ! is_ecr_and_enterprise "$r" "$PROFILE"; then
+                DOCKER_BUILDX_ARGS+=(--tag "$r/${EMQX_BASE_DOCKER_TAG}:latest${SUFFIX}")
+                echo "$r/${EMQX_BASE_DOCKER_TAG}:latest${SUFFIX}" >> ./.emqx_docker_image_tags
+                DOCKER_BUILDX_ARGS+=(--tag "$r/${EMQX_BASE_DOCKER_TAG}:${VSN_MAJOR}.${VSN_MINOR}${SUFFIX}")
+                echo "$r/${EMQX_BASE_DOCKER_TAG}:${VSN_MAJOR}.${VSN_MINOR}${SUFFIX}" >> ./.emqx_docker_image_tags
+                DOCKER_BUILDX_ARGS+=(--tag "$r/${EMQX_BASE_DOCKER_TAG}:${VSN_MAJOR}.${VSN_MINOR}.${VSN_PATCH}${SUFFIX}")
+                echo "$r/${EMQX_BASE_DOCKER_TAG}:${VSN_MAJOR}.${VSN_MINOR}.${VSN_PATCH}${SUFFIX}" >> ./.emqx_docker_image_tags
+            fi
+        done
     fi
     fi
     if [ "${DOCKER_PLATFORMS:-default}" != 'default' ]; then
     if [ "${DOCKER_PLATFORMS:-default}" != 'default' ]; then
         DOCKER_BUILDX_ARGS+=(--platform "${DOCKER_PLATFORMS}")
         DOCKER_BUILDX_ARGS+=(--platform "${DOCKER_PLATFORMS}")

+ 1 - 3
changes/e5.5.1.en.md

@@ -8,8 +8,6 @@
 
 
 - [#12471](https://github.com/emqx/emqx/pull/12471) Fixed an issue that data integration configurations failed to load correctly during upgrades from EMQX version 5.0.2 to newer releases.
 - [#12471](https://github.com/emqx/emqx/pull/12471) Fixed an issue that data integration configurations failed to load correctly during upgrades from EMQX version 5.0.2 to newer releases.
 
 
-- [#12542](https://github.com/emqx/emqx/pull/12542) Redacted authorization headers to exclude basic authorization credentials from debug logs in the HTTP Server connector, mitigating potential security risks.
-
 - [#12598](https://github.com/emqx/emqx/pull/12598) Fixed an issue that users were unable to subscribe to or unsubscribe from shared topic filters via HTTP API.
 - [#12598](https://github.com/emqx/emqx/pull/12598) Fixed an issue that users were unable to subscribe to or unsubscribe from shared topic filters via HTTP API.
 
 
   The affected APIs include:
   The affected APIs include:
@@ -26,7 +24,7 @@
 
 
 - [#12620](https://github.com/emqx/emqx/pull/12620) Fixed an issue when sensitive headers for HTTP connector may be printed in the `debug` level log.
 - [#12620](https://github.com/emqx/emqx/pull/12620) Fixed an issue when sensitive headers for HTTP connector may be printed in the `debug` level log.
 
 
-- [#12632](https://github.com/emqx/emqx/pull/12632) Fix an issue when rule engine SQL built-in function `date_to_unix_ts` produced incorrect results for dates starting from 1st of March on leap years.
+- [#12632](https://github.com/emqx/emqx/pull/12632) Fixed an issue where the rule engine's SQL built-in function `date_to_unix_ts` produced incorrect results for dates starting from March 1st on leap years.
 
 
 - [#12608](https://github.com/emqx/emqx/pull/12608) Fixed a `function_clause` error in the IoTDB action caused by the absence of a `payload` field in query data.
 - [#12608](https://github.com/emqx/emqx/pull/12608) Fixed a `function_clause` error in the IoTDB action caused by the absence of a `payload` field in query data.
 
 

+ 2 - 3
changes/v5.5.1.en.md

@@ -4,8 +4,6 @@
 
 
 - [#12471](https://github.com/emqx/emqx/pull/12471) Fixed an issue that data integration configurations failed to load correctly during upgrades from EMQX version 5.0.2 to newer releases.
 - [#12471](https://github.com/emqx/emqx/pull/12471) Fixed an issue that data integration configurations failed to load correctly during upgrades from EMQX version 5.0.2 to newer releases.
 
 
-- [#12542](https://github.com/emqx/emqx/pull/12542) Redacted authorization headers to exclude basic authorization credentials from debug logs in the HTTP Server connector, mitigating potential security risks.
-
 - [#12598](https://github.com/emqx/emqx/pull/12598) Fixed an issue that users were unable to subscribe to or unsubscribe from shared topic filters via HTTP API.
 - [#12598](https://github.com/emqx/emqx/pull/12598) Fixed an issue that users were unable to subscribe to or unsubscribe from shared topic filters via HTTP API.
 
 
   The affected APIs include:
   The affected APIs include:
@@ -22,4 +20,5 @@
 
 
 - [#12620](https://github.com/emqx/emqx/pull/12620) Fixed an issue when sensitive headers for HTTP connector may be printed in the `debug` level log.
 - [#12620](https://github.com/emqx/emqx/pull/12620) Fixed an issue when sensitive headers for HTTP connector may be printed in the `debug` level log.
 
 
-- [#12632](https://github.com/emqx/emqx/pull/12632) Fix an issue when rule engine SQL built-in function `date_to_unix_ts` produced incorrect results for dates starting from 1st of March on leap years.
+- [#12632](https://github.com/emqx/emqx/pull/12632) Fixed an issue where the rule engine's SQL built-in function `date_to_unix_ts` produced incorrect results for dates starting from March 1st on leap years.
+

+ 2 - 2
deploy/charts/emqx-enterprise/Chart.yaml

@@ -14,8 +14,8 @@ type: application
 
 
 # This is the chart version. This version number should be incremented each time you make changes
 # This is the chart version. This version number should be incremented each time you make changes
 # to the chart and its templates, including the app version.
 # to the chart and its templates, including the app version.
-version: 5.5.1
+version: 5.5.1-rc.3
 
 
 # This is the version number of the application being deployed. This version number should be
 # This is the version number of the application being deployed. This version number should be
 # incremented each time you make changes to the application.
 # incremented each time you make changes to the application.
-appVersion: 5.5.1
+appVersion: 5.5.1-rc.3

+ 2 - 2
deploy/charts/emqx/Chart.yaml

@@ -14,8 +14,8 @@ type: application
 
 
 # This is the chart version. This version number should be incremented each time you make changes
 # This is the chart version. This version number should be incremented each time you make changes
 # to the chart and its templates, including the app version.
 # to the chart and its templates, including the app version.
-version: 5.5.1
+version: 5.5.1-rc.3
 
 
 # This is the version number of the application being deployed. This version number should be
 # This is the version number of the application being deployed. This version number should be
 # incremented each time you make changes to the application.
 # incremented each time you make changes to the application.
-appVersion: 5.5.1
+appVersion: 5.5.1-rc.3