From 4ea3ade0fbada57d00b7dcb516d946bec6085400 Mon Sep 17 00:00:00 2001 From: James Willis Date: Mon, 9 Mar 2026 12:19:32 +0000 Subject: [PATCH 1/2] feat: add Dockerfile.bootstrap and GitHub Actions workflow for bootstrap image --- .github/workflows/bootstrap.yml | 85 +++++++++++++++++++++++++++++++ platform/wab/Dockerfile.bootstrap | 11 ++++ 2 files changed, 96 insertions(+) create mode 100644 .github/workflows/bootstrap.yml create mode 100644 platform/wab/Dockerfile.bootstrap diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml new file mode 100644 index 000000000..751769193 --- /dev/null +++ b/.github/workflows/bootstrap.yml @@ -0,0 +1,85 @@ +name: Build Bootstrap Image + +on: + workflow_dispatch: + inputs: + environment: + description: 'Target environment' + required: true + type: choice + options: + - integration + - production + default: production + +jobs: + build-bootstrap: + name: Build Bootstrap Image + timeout-minutes: 15 + runs-on: ubuntu-latest + environment: ${{ inputs.environment }} + permissions: + contents: read + id-token: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} + aws-region: ${{ vars.AWS_REGION }} + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + + - name: Get currently deployed WAB image + id: deployed-image + env: + CLUSTER_NAME: plasmic-${{ inputs.environment }} + SERVICE_NAME: plasmic-${{ inputs.environment }}-wab + run: | + TASK_DEF_ARN=$(aws ecs describe-services \ + --cluster "$CLUSTER_NAME" \ + --services "$SERVICE_NAME" \ + --query 'services[0].taskDefinition' \ + --output text) + + DEPLOYED_IMAGE=$(aws ecs describe-task-definition \ + --task-definition "$TASK_DEF_ARN" \ + --query 'taskDefinition.containerDefinitions[0].image' \ + --output text) + + echo "::add-mask::$DEPLOYED_IMAGE" + echo "deployed_image=$DEPLOYED_IMAGE" >> $GITHUB_OUTPUT + + - name: Build and push bootstrap image + id: build-image + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: ${{ vars.ECR_REPOSITORY }} + IMAGE_TAG: bootstrap-${{ github.run_id }} + BASE_IMAGE: ${{ steps.deployed-image.outputs.deployed_image }} + run: | + docker build \ + --platform linux/amd64 \ + --build-arg BASE_IMAGE=$BASE_IMAGE \ + -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \ + -f platform/wab/Dockerfile.bootstrap \ + platform/ + + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG + + echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT + echo "Bootstrap image pushed: $IMAGE_TAG" + + - name: Summary + run: | + echo "### Bootstrap Image Built" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Image:** \`${{ steps.build-image.outputs.image }}\`" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "Update \`tasks/bootstrap/config/${{ inputs.environment == 'production' && 'prod-eu' || inputs.environment }}.tfvars\` with this image tag, then re-run \`terraform apply\` and \`aws ecs run-task\`." >> $GITHUB_STEP_SUMMARY diff --git a/platform/wab/Dockerfile.bootstrap b/platform/wab/Dockerfile.bootstrap new file mode 100644 index 000000000..96421fd81 --- /dev/null +++ b/platform/wab/Dockerfile.bootstrap @@ -0,0 +1,11 @@ +# Dockerfile for Bootstrap task +# Layers canvas-packages/hostlessList.json on top of the deployed WAB image +# so that BootstrapHostless.ts can read it at /app/canvas-packages/hostlessList.json +# +# Usage: docker build --build-arg BASE_IMAGE= ... + +ARG BASE_IMAGE +FROM ${BASE_IMAGE} + +# Copy hostless package list needed by BootstrapHostless.ts +COPY canvas-packages/hostlessList.json /app/canvas-packages/hostlessList.json From 99be459d2561c88f903bca559c5e47fd94a2ce8b Mon Sep 17 00:00:00 2001 From: James Willis Date: Mon, 9 Mar 2026 12:50:35 +0000 Subject: [PATCH 2/2] fix: add build-server artifacts to bootstrap image and remove GH Actions workflow --- .github/workflows/bootstrap.yml | 85 ------------------------------- platform/wab/Dockerfile.bootstrap | 3 +- 2 files changed, 2 insertions(+), 86 deletions(-) delete mode 100644 .github/workflows/bootstrap.yml diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml deleted file mode 100644 index 751769193..000000000 --- a/.github/workflows/bootstrap.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Build Bootstrap Image - -on: - workflow_dispatch: - inputs: - environment: - description: 'Target environment' - required: true - type: choice - options: - - integration - - production - default: production - -jobs: - build-bootstrap: - name: Build Bootstrap Image - timeout-minutes: 15 - runs-on: ubuntu-latest - environment: ${{ inputs.environment }} - permissions: - contents: read - id-token: write - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: ${{ vars.AWS_REGION }} - - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 - - - name: Get currently deployed WAB image - id: deployed-image - env: - CLUSTER_NAME: plasmic-${{ inputs.environment }} - SERVICE_NAME: plasmic-${{ inputs.environment }}-wab - run: | - TASK_DEF_ARN=$(aws ecs describe-services \ - --cluster "$CLUSTER_NAME" \ - --services "$SERVICE_NAME" \ - --query 'services[0].taskDefinition' \ - --output text) - - DEPLOYED_IMAGE=$(aws ecs describe-task-definition \ - --task-definition "$TASK_DEF_ARN" \ - --query 'taskDefinition.containerDefinitions[0].image' \ - --output text) - - echo "::add-mask::$DEPLOYED_IMAGE" - echo "deployed_image=$DEPLOYED_IMAGE" >> $GITHUB_OUTPUT - - - name: Build and push bootstrap image - id: build-image - env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - ECR_REPOSITORY: ${{ vars.ECR_REPOSITORY }} - IMAGE_TAG: bootstrap-${{ github.run_id }} - BASE_IMAGE: ${{ steps.deployed-image.outputs.deployed_image }} - run: | - docker build \ - --platform linux/amd64 \ - --build-arg BASE_IMAGE=$BASE_IMAGE \ - -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \ - -f platform/wab/Dockerfile.bootstrap \ - platform/ - - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - - echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT - echo "Bootstrap image pushed: $IMAGE_TAG" - - - name: Summary - run: | - echo "### Bootstrap Image Built" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**Image:** \`${{ steps.build-image.outputs.image }}\`" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "Update \`tasks/bootstrap/config/${{ inputs.environment == 'production' && 'prod-eu' || inputs.environment }}.tfvars\` with this image tag, then re-run \`terraform apply\` and \`aws ecs run-task\`." >> $GITHUB_STEP_SUMMARY diff --git a/platform/wab/Dockerfile.bootstrap b/platform/wab/Dockerfile.bootstrap index 96421fd81..011696023 100644 --- a/platform/wab/Dockerfile.bootstrap +++ b/platform/wab/Dockerfile.bootstrap @@ -7,5 +7,6 @@ ARG BASE_IMAGE FROM ${BASE_IMAGE} -# Copy hostless package list needed by BootstrapHostless.ts +# Copy hostless package list and build artifacts needed by BootstrapHostless.ts COPY canvas-packages/hostlessList.json /app/canvas-packages/hostlessList.json +COPY canvas-packages/build-server/ /app/canvas-packages/build-server/