diff --git a/.github/workflows/build-pr-artifacts.yml b/.github/workflows/build-pr-artifacts.yml index b0187beb85..022afcd9f4 100644 --- a/.github/workflows/build-pr-artifacts.yml +++ b/.github/workflows/build-pr-artifacts.yml @@ -43,7 +43,7 @@ jobs: uses: ./.github/workflows/build-push-docker-image.yml with: build_tag: rudderstack/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} - push_tags: rudderstack/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }},rudderlabs/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} + push_tags: rudderstack/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} img_tag: ${{ needs.generate-tag-names.outputs.tag_name }} dockerfile: Dockerfile load_target: development @@ -59,7 +59,7 @@ jobs: uses: ./.github/workflows/build-push-docker-image.yml with: build_tag: rudderstack/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} - push_tags: rudderstack/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }},rudderlabs/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} + push_tags: rudderstack/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} img_tag: ${{ needs.generate-tag-names.outputs.tag_name_ut }} dockerfile: Dockerfile-ut-func load_target: development diff --git a/.github/workflows/build-push-docker-image.yml b/.github/workflows/build-push-docker-image.yml index 7e36beba76..f65aa0c8ce 100644 --- a/.github/workflows/build-push-docker-image.yml +++ b/.github/workflows/build-push-docker-image.yml @@ -29,9 +29,9 @@ env: DOCKERHUB_USERNAME: rudderlabs jobs: - build-transformer-image: - name: Build Transformer Docker Image - runs-on: ubuntu-latest + build-transformer-image-arm64: + name: Build Transformer Docker Image ARM64 + runs-on: [self-hosted, Linux, ARM64] steps: - name: Checkout uses: actions/checkout@v3.5.3 @@ -55,12 +55,12 @@ jobs: target: ${{ inputs.load_target }} load: true tags: ${{ inputs.build_tag }} - cache-from: type=gha - cache-to: type=gha,mode=max + # cache-from: type=gha + # cache-to: type=gha,mode=max - name: Run Tests run: | - docker run ${{ inputs.build_tag }} npm run test:js:ci + docker run ${{ inputs.build_tag }} npm run test:js:ci docker run ${{ inputs.build_tag }} npm run test:ts:ci - name: Build and Push Multi-platform Images @@ -70,12 +70,80 @@ jobs: file: ${{ inputs.dockerfile }} target: ${{ inputs.push_target }} push: true - tags: ${{ inputs.push_tags }} + tags: ${{ inputs.push_tags }}-arm64 platforms: | - linux/amd64 linux/arm64 build-args: | - version=${{ inputs.img_tag }} + version=${{ inputs.img_tag }}-arm64 GIT_COMMIT_SHA=${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max + # cache-from: type=gha + # cache-to: type=gha,mode=max + + build-transformer-image-amd64: + name: Build Transformer Docker Image AMD64 + runs-on: [self-hosted, Linux, X64] + steps: + - name: Checkout + uses: actions/checkout@v3.5.3 + with: + fetch-depth: 1 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v2.9.1 + + - name: Login to DockerHub + uses: docker/login-action@v2.1.0 + with: + username: ${{ env.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + + - name: Build Docker Image + uses: docker/build-push-action@v4.1.1 + with: + context: . + file: ${{ inputs.dockerfile }} + target: ${{ inputs.load_target }} + load: true + tags: ${{ inputs.build_tag }} + # cache-from: type=gha + # cache-to: type=gha,mode=max + + - name: Run Tests + run: | + docker run ${{ inputs.build_tag }} npm run test:js:ci + docker run ${{ inputs.build_tag }} npm run test:ts:ci + + - name: Build and Push Multi-platform Images + uses: docker/build-push-action@v4.1.1 + with: + context: . + file: ${{ inputs.dockerfile }} + target: ${{ inputs.push_target }} + push: true + tags: ${{ inputs.push_tags }}-amd64 + platforms: | + linux/amd64 + build-args: | + version=${{ inputs.img_tag }}-amd64 + GIT_COMMIT_SHA=${{ github.sha }} + # cache-from: type=gha + # cache-to: type=gha,mode=max + + create-manifest: + name: Create multi-arch manifest + runs-on: ubuntu-latest + needs: [build-transformer-image-amd64, build-transformer-image-arm64] + + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.9.1 + + - name: Login to DockerHub + uses: docker/login-action@v2.1.0 + with: + username: ${{ env.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + + - name: Create multi-arch manifest + run: | + docker buildx imagetools create -t ${{ inputs.push_tags }} ${{ inputs.push_tags }}-amd64 ${{ inputs.push_tags }}-arm64 diff --git a/.github/workflows/prepare-for-dev-deploy.yml b/.github/workflows/prepare-for-dev-deploy.yml index 636ba5a6d8..d45f760c66 100644 --- a/.github/workflows/prepare-for-dev-deploy.yml +++ b/.github/workflows/prepare-for-dev-deploy.yml @@ -51,7 +51,7 @@ jobs: uses: ./.github/workflows/build-push-docker-image.yml with: build_tag: rudderstack/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} - push_tags: rudderstack/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }},rudderlabs/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} + push_tags: rudderstack/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} img_tag: ${{ needs.generate-tag-names.outputs.tag_name }} dockerfile: Dockerfile load_target: development @@ -67,7 +67,7 @@ jobs: uses: ./.github/workflows/build-push-docker-image.yml with: build_tag: rudderstack/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} - push_tags: rudderstack/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }},rudderlabs/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} + push_tags: rudderstack/develop-rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} img_tag: ${{ needs.generate-tag-names.outputs.tag_name_ut }} dockerfile: Dockerfile-ut-func load_target: development