diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 52daa1115..f5a70cd7f 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -80,39 +80,23 @@ defaults: shell: bash -euo pipefail {0} jobs: - # tags: - # strategy: - # matrix: - # arch: [ 'amd64', 'arm64' ] - # outputs: - # controller: ${{ steps.show-tags.outputs.controller }} - # vxlan-controller: ${{ steps.show-tags.outputs.vxlan-controller }} - # runner: ${{ steps.show-tags.outputs.runner }} - # scheduler: ${{ steps.show-tags.outputs.scheduler }} - # autoscaler-agent: ${{ steps.show-tags.outputs.autoscaler-agent }} - # cluster-autoscaler: ${{ steps.show-tags.outputs.cluster-autoscaler }} - # runs-on: ubuntu-latest - # steps: - - # TODO: uncomment when the final PR version is ready - # vm-kernel: - # # nb: use format(..) to catch both inputs.skip = true AND inputs.skip = 'true'. - # if: ${{ format('{0}', inputs.skip) != 'true' }} - # uses: ./.github/workflows/vm-kernel.yaml - # with: - # tag: ${{ inputs.kernel-image || inputs.tag }} - # return-image-for-tag: ${{ inputs.kernel-image }} - # arch: ${{ matrix.arch }} - # strategy: - # matrix: - # arch: [ 'amd64', 'arm64' ] - # secrets: inherit + vm-kernel: + # nb: use format(..) to catch both inputs.skip = true AND inputs.skip = 'true'. + if: ${{ format('{0}', inputs.skip) != 'true' }} + uses: ./.github/workflows/vm-kernel.yaml + with: + tag: ${{ inputs.kernel-image || inputs.tag }} + return-image-for-tag: ${{ inputs.kernel-image }} + arch: ${{ matrix.arch }} + strategy: + matrix: + arch: [ 'amd64', 'arm64' ] + secrets: inherit build: # nb: use format(..) to catch both inputs.skip = true AND inputs.skip = 'true'. if: ${{ format('{0}', inputs.skip) != 'true' }} - # TODO: uncomment when the final PR version is ready - # needs: [ vm-kernel ] + needs: [ vm-kernel ] outputs: controller-amd64: ${{ steps.tags.outputs.controller-amd64 }} vxlan-controller-amd64: ${{ steps.tags.outputs.vxlan-controller-amd64 }} @@ -207,34 +191,33 @@ jobs: registry: cache.neon.build username: ${{ secrets.NEON_CI_DOCKERCACHE_USERNAME }} password: ${{ secrets.NEON_CI_DOCKERCACHE_PASSWORD }} - # TODO: uncomment when the final PR version is ready - # - name: Configure dev AWS credentials - # if: ${{ format('{0}', inputs.upload-to-ecr) == 'true' }} - # uses: aws-actions/configure-aws-credentials@v4 - # with: - # aws-region: eu-central-1 - # mask-aws-account-id: true - # role-to-assume: ${{ secrets.DEV_GHA_OIDC_ECR_ROLE }} + - name: Configure dev AWS credentials + if: ${{ format('{0}', inputs.upload-to-ecr) == 'true' }} + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: eu-central-1 + mask-aws-account-id: true + role-to-assume: ${{ secrets.DEV_GHA_OIDC_ECR_ROLE }} - # - name: Login to dev ECR - # if: ${{ format('{0}', inputs.upload-to-ecr) == 'true' }} - # uses: docker/login-action@v3 - # with: - # registry: ${{ env.ECR_DEV }} + - name: Login to dev ECR + if: ${{ format('{0}', inputs.upload-to-ecr) == 'true' }} + uses: docker/login-action@v3 + with: + registry: ${{ env.ECR_DEV }} - # - name: Configure prod AWS credentials - # if: ${{ format('{0}', inputs.upload-to-ecr) == 'true' }} - # uses: aws-actions/configure-aws-credentials@v4 - # with: - # aws-region: eu-central-1 - # mask-aws-account-id: true - # role-to-assume: ${{ secrets.PROD_GHA_OIDC_ECR_ROLE }} + - name: Configure prod AWS credentials + if: ${{ format('{0}', inputs.upload-to-ecr) == 'true' }} + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: eu-central-1 + mask-aws-account-id: true + role-to-assume: ${{ secrets.PROD_GHA_OIDC_ECR_ROLE }} - # - name: Login to prod ECR - # if: ${{ format('{0}', inputs.upload-to-ecr) == 'true' }} - # uses: docker/login-action@v3 - # with: - # registry: ${{ env.ECR_PROD }} + - name: Login to prod ECR + if: ${{ format('{0}', inputs.upload-to-ecr) == 'true' }} + uses: docker/login-action@v3 + with: + registry: ${{ env.ECR_PROD }} - name: Check dependencies run: | @@ -243,9 +226,8 @@ jobs: - name: Load VM kernel env: - # IMAGE: ${{format(needs.vm-kernel.outputs.image_placeholder, matrix.arch)}} - # TODO: temporary always use image from one of the previous runs to speedup the build during debug - IMAGE: ${{format('neondatabase/vm-kernel-{0}:3372e65.11573472293', matrix.arch)}} + IMAGE: ${{format(needs.vm-kernel.outputs.image_placeholder, matrix.arch)}} + # IMAGE: ${{format('neondatabase/vm-kernel-{0}:3372e65.11573472293', matrix.arch)}} run: | docker pull --quiet $IMAGE ID=$(docker create $IMAGE true) @@ -359,23 +341,22 @@ jobs: build-args: | CA_GIT_TAG=${{ steps.get-ca-tag.outputs.tag }} - # TODO: Uncomment when the final PR version is ready - # - name: Copy all images to ECR - # if: ${{ format('{0}', inputs.upload-to-ecr) == 'true' }} - # run: | - # for image in \ - # neonvm-controller \ - # neonvm-vxlan-controller \ - # neonvm-runner \ - # vm-kernel \ - # autoscale-scheduler \ - # autoscaler-agent \ - # cluster-autoscaler-neonvm \ - # ; do - # echo Copy ${image}:${{ inputs.tag }} to dev ECR - # docker buildx imagetools create -t ${{ env.ECR_DEV }}/${image}:${{ inputs.tag }} \ - # neondatabase/${image}:${{ inputs.tag }} - # echo Copy ${image}:${{ inputs.tag }} to prod ECR - # docker buildx imagetools create -t ${{ env.ECR_PROD }}/${image}:${{ inputs.tag }} \ - # neondatabase/${image}:${{ inputs.tag }} - # done + - name: Copy all images to ECR + if: ${{ format('{0}', inputs.upload-to-ecr) == 'true' }} + run: | + for image in \ + neonvm-controller \ + neonvm-vxlan-controller \ + neonvm-runner \ + vm-kernel \ + autoscale-scheduler \ + autoscaler-agent \ + cluster-autoscaler-neonvm \ + ; do + echo Copy ${image}:${{ inputs.tag }} to dev ECR + docker buildx imagetools create -t ${{ env.ECR_DEV }}/${image}:${{ inputs.tag }} \ + neondatabase/${image}:${{ inputs.tag }} + echo Copy ${image}:${{ inputs.tag }} to prod ECR + docker buildx imagetools create -t ${{ env.ECR_PROD }}/${image}:${{ inputs.tag }} \ + neondatabase/${image}:${{ inputs.tag }} + done diff --git a/.github/workflows/build-test-vm.yaml b/.github/workflows/build-test-vm.yaml index 218abfb8f..dd1d94ca8 100644 --- a/.github/workflows/build-test-vm.yaml +++ b/.github/workflows/build-test-vm.yaml @@ -50,7 +50,7 @@ jobs: daemon: ${{ steps.tags.outputs.daemon }} strategy: matrix: - arch: [ 'arm64' ] + arch: [ amd64, arm64 ] # TODO: do we need gen3 runners? to clarify with dev exp team runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }} steps: diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 3e12c0f94..7555b1b95 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -78,7 +78,8 @@ jobs: fail-fast: false matrix: cluster: [ k3d ] - arch: [ arm64 ] + # run tests on amd64 only, since scope of the PR is to build images, there is separate issue for e2e tests + arch: [ amd64 ] runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }} @@ -119,7 +120,7 @@ jobs: - name: upload manifests # nb: use format(..) to catch both inputs.push-yamls = true AND inputs.push-yamls = 'true'. - # if: ${{ format('{0}', inputs.push-yamls) == 'true'}} + if: ${{ format('{0}', inputs.push-yamls) == 'true'}} uses: actions/upload-artifact@v4 with: name: ${{ format('rendered_manifests-{0}', matrix.arch) }}