From df29a79a68139f295cfb9e15c2303875c373a65b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 8 Aug 2023 17:26:02 +0100 Subject: [PATCH 1/4] Attempting to get push by digest working correctly for single image build. --- .github/workflows/release-singleimage.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-singleimage.yml b/.github/workflows/release-singleimage.yml index a46099908b..6c0a873c8b 100644 --- a/.github/workflows/release-singleimage.yml +++ b/.github/workflows/release-singleimage.yml @@ -6,7 +6,6 @@ on: env: CI: true PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - REGISTRY_IMAGE: budibase/budibase jobs: build-multiarch: name: "build-multiarch" @@ -72,9 +71,9 @@ jobs: with: context: . platforms: ${{ matrix.platform }} - tags: budibase/budibase,budibase/budibase:v${{ env.RELEASE_VERSION }} + tags: budibase/budibase,budibase/budibase:${{ env.RELEASE_VERSION }} file: ./hosting/single/Dockerfile - outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=budibase/budibase,push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | mkdir -p /tmp/digests @@ -104,7 +103,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: ${{ env.REGISTRY_IMAGE }} + images: budibase/budibase - name: Login to Docker Hub uses: docker/login-action@v2 with: @@ -114,10 +113,10 @@ jobs: working-directory: /tmp/digests run: | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + $(printf 'budibase/budibase@sha256:%s ' *) - name: Inspect image run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} + docker buildx imagetools inspect budibase/budibase:${{ steps.meta.outputs.version }} build-aas: name: "build-aas" From e468ff066f85a74e36ed607fb117289be4be7010 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 8 Aug 2023 16:26:25 +0000 Subject: [PATCH 2/4] Bump version to 2.9.13 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 141491ae69..31ec0c9979 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.12", + "version": "2.9.13", "npmClient": "yarn", "packages": [ "packages/*" From f754691563bd02db803c64053fcb3004b4f6c2cb Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 8 Aug 2023 17:39:51 +0100 Subject: [PATCH 3/4] Reverting the changes to the single image build fully, adding in a workflow which should increase the storage capacity of the VM, almost doubling it (although it is a bit hacky, should get us by for a while). --- .github/workflows/release-singleimage.yml | 124 +++------------------- 1 file changed, 15 insertions(+), 109 deletions(-) diff --git a/.github/workflows/release-singleimage.yml b/.github/workflows/release-singleimage.yml index 6c0a873c8b..b81d04d089 100644 --- a/.github/workflows/release-singleimage.yml +++ b/.github/workflows/release-singleimage.yml @@ -1,4 +1,4 @@ -name: release-singleimage +name: Deploy Budibase Single Container Image to DockerHub on: workflow_dispatch: @@ -6,18 +6,20 @@ on: env: CI: true PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + REGISTRY_URL: registry.hub.docker.com jobs: - build-multiarch: - name: "build-multiarch" + build: + name: "build" runs-on: ubuntu-latest strategy: matrix: - node-version: - - 14.x - platform: - - linux/amd64 - - linux/arm64 + node-version: [14.x] steps: + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + root-reserve-mb: 512 + swap-size-mb: 1024 - name: Fail if not a tag run: | if [[ $GITHUB_REF != refs/tags/* ]]; then @@ -30,12 +32,14 @@ jobs: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} fetch-depth: 0 + - name: Fail if tag is not in master run: | if ! git merge-base --is-ancestor ${{ github.sha }} origin/master; then echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch" exit 1 fi + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: @@ -70,108 +74,10 @@ jobs: uses: docker/build-push-action@v2 with: context: . - platforms: ${{ matrix.platform }} + push: true + platforms: linux/amd64,linux/arm64 tags: budibase/budibase,budibase/budibase:${{ env.RELEASE_VERSION }} file: ./hosting/single/Dockerfile - outputs: type=image,name=budibase/budibase,push-by-digest=true,name-canonical=true,push=true - - name: Export digest - run: | - mkdir -p /tmp/digests - digest="${{ steps.build.outputs.digest }}" - touch "/tmp/digests/${digest#sha256:}" - - name: Upload digest - uses: actions/upload-artifact@v3 - with: - name: digests - path: /tmp/digests/* - if-no-files-found: error - retention-days: 1 - - merge: - runs-on: ubuntu-latest - needs: - - build-multiarch - steps: - - name: Download digests - uses: actions/download-artifact@v3 - with: - name: digests - path: /tmp/digests - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: budibase/budibase - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_API_KEY }} - - name: Create manifest list and push - working-directory: /tmp/digests - run: | - docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - $(printf 'budibase/budibase@sha256:%s ' *) - - name: Inspect image - run: | - docker buildx imagetools inspect budibase/budibase:${{ steps.meta.outputs.version }} - - build-aas: - name: "build-aas" - runs-on: ubuntu-latest - strategy: - matrix: - node-version: - - 14.x - steps: - - name: Fail if not a tag - run: | - if [[ $GITHUB_REF != refs/tags/* ]]; then - echo "Workflow Dispatch can only be run on tags" - exit 1 - fi - - name: "Checkout" - uses: actions/checkout@v2 - with: - submodules: true - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - fetch-depth: 0 - - name: Fail if tag is not in master - run: | - if ! git merge-base --is-ancestor ${{ github.sha }} origin/master; then - echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch" - exit 1 - fi - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Setup Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - name: Run Yarn - run: yarn - - name: Update versions - run: ./scripts/updateVersions.sh - - name: Runt Yarn Lint - run: yarn lint - - name: Update versions - run: ./scripts/updateVersions.sh - - name: Run Yarn Build - run: yarn build:docker:pre - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_API_KEY }} - - name: Get the latest release version - id: version - run: | - release_version=$(cat lerna.json | jq -r '.version') - echo $release_version - echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - name: Tag and release Budibase Azure App Service docker image uses: docker/build-push-action@v2 with: @@ -180,4 +86,4 @@ jobs: platforms: linux/amd64 build-args: TARGETBUILD=aas tags: budibase/budibase-aas,budibase/budibase-aas:${{ env.RELEASE_VERSION }} - file: ./hosting/single/Dockerfile + file: ./hosting/single/Dockerfile \ No newline at end of file From 85903a2a30d42b62eedd5d249089fcf3caf75f93 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 8 Aug 2023 16:59:53 +0000 Subject: [PATCH 4/4] Bump version to 2.9.14 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 31ec0c9979..93db547474 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.13", + "version": "2.9.14", "npmClient": "yarn", "packages": [ "packages/*"