diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 6028da5a0..58659c058 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -1,51 +1,51 @@ name: build-images -on: {} - # workflow_call: - # inputs: - # # 'skip' is kind of silly. it exists because we can't actually *skip* this job from e2e-test, - # # otherwise the follow-up job that needs it wouldn't be able to run. So instead we pretend the - # # job completed successfully, but actually do nothing... - # skip: - # description: 'Changes this action to perform a no-op' - # type: boolean - # required: false - # tag: - # description: 'Tag to use for the Docker images' - # type: string - # required: true - # kernel-image: - # description: 'Kernel image for the VMs embedded in neonvm-runner. If not specified, a kernel will be built from source' - # type: string - # required: false - # build-cluster-autoscaler: - # description: 'Build the custom cluster-autoscaler image' - # type: boolean - # required: false - # controller-preserve-runner-pods: - # description: 'ONLY USE FOR E2E TESTS: Set neonvm-controller to never delete VM runner pods' - # type: boolean - # required: false - # upload-to-ecr: - # description: 'Should images be uploaded to neon ECR' - # type: boolean - # required: false - # outputs: - # controller: - # description: 'neonvm-controller image' - # value: ${{ jobs.tags.outputs.controller }} - # vxlan-controller: - # description: 'neonvm-vxlan-controller image' - # value: ${{ jobs.tags.outputs.vxlan-controller }} - # runner: - # description: 'neonvm-runner image' - # value: ${{ jobs.tags.outputs.runner }} - # scheduler: - # description: 'autoscale-scheduler image' - # value: ${{ jobs.tags.outputs.scheduler }} - # autoscaler-agent: - # description: 'autoscaler-agent image' - # value: ${{ jobs.tags.outputs.autoscaler-agent }} +on: + workflow_call: + inputs: + # 'skip' is kind of silly. it exists because we can't actually *skip* this job from e2e-test, + # otherwise the follow-up job that needs it wouldn't be able to run. So instead we pretend the + # job completed successfully, but actually do nothing... + skip: + description: 'Changes this action to perform a no-op' + type: boolean + required: false + tag: + description: 'Tag to use for the Docker images' + type: string + required: true + kernel-image: + description: 'Kernel image for the VMs embedded in neonvm-runner. If not specified, a kernel will be built from source' + type: string + required: false + build-cluster-autoscaler: + description: 'Build the custom cluster-autoscaler image' + type: boolean + required: false + controller-preserve-runner-pods: + description: 'ONLY USE FOR E2E TESTS: Set neonvm-controller to never delete VM runner pods' + type: boolean + required: false + upload-to-ecr: + description: 'Should images be uploaded to neon ECR' + type: boolean + required: false + outputs: + controller: + description: 'neonvm-controller image' + value: ${{ jobs.tags.outputs.controller }} + vxlan-controller: + description: 'neonvm-vxlan-controller image' + value: ${{ jobs.tags.outputs.vxlan-controller }} + runner: + description: 'neonvm-runner image' + value: ${{ jobs.tags.outputs.runner }} + scheduler: + description: 'autoscale-scheduler image' + value: ${{ jobs.tags.outputs.scheduler }} + autoscaler-agent: + description: 'autoscaler-agent image' + value: ${{ jobs.tags.outputs.autoscaler-agent }} env: IMG_CONTROLLER: "neondatabase/neonvm-controller" @@ -65,7 +65,7 @@ env: # See https://github.com/moby/buildkit/issues/2343 for more information. GO_BASE_IMG: "localhost:5000/neondatabase/autoscaling-go-base:dev" # Default architecture to build. In future it would be changed to multi-arch build or separate builds for each arch - TARGET_ARCH: "amd64" + TARGET_ARCH: "amd64" # move to matrix strategy defaults: run: @@ -91,24 +91,28 @@ jobs: echo "autoscaler-agent=${{ env.IMG_AUTOSCALER_AGENT }}:${{ inputs.tag }}" | tee -a $GITHUB_OUTPUT echo "cluster-autoscaler=${{ env.IMG_CLUSTER_AUTOSCALER }}:${{ inputs.tag }}" | tee -a $GITHUB_OUTPUT - 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 }} - 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 }} + # secrets: inherit build: # nb: use format(..) to catch both inputs.skip = true AND inputs.skip = 'true'. if: ${{ format('{0}', inputs.skip) != 'true' }} - needs: [ tags, vm-kernel ] - runs-on: [ self-hosted, large ] + needs: [ tags ] # vm-kernel ] permissions: contents: read # This is required for actions/checkout id-token: write # This is required for aws-actions/configure-aws-credentials + strategy: + matrix: + arch: [ 'amd64'] # 'arm64' ] + runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }} + services: registry: image: registry:2 @@ -165,170 +169,171 @@ jobs: username: ${{ secrets.NEON_CI_DOCKERCACHE_USERNAME }} password: ${{ secrets.NEON_CI_DOCKERCACHE_PASSWORD }} - - 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: 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: 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: 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: Check dependencies run: | docker version docker buildx version - - name: Load VM kernel - env: - IMAGE: ${{ needs.vm-kernel.outputs.image }} - run: | - docker pull --quiet $IMAGE - ID=$(docker create $IMAGE true) - docker cp ${ID}:/vmlinuz neonvm-kernel/vmlinuz - docker rm -f ${ID} - - - name: Build go dependencies image - uses: docker/build-push-action@v6 - id: build-go-dependencies-image - with: - context: . - platforms: linux/amd64 - push: true - file: Dockerfile.go-base - cache-from: type=registry,ref=cache.neon.build/autoscaling-go-base:cache - cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/autoscaling-go-base:cache,mode=max' || '' }} - tags: ${{ env.GO_BASE_IMG }} - - - name: Build and push neonvm-runner image - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64 - push: true - file: neonvm-runner/Dockerfile - cache-from: type=registry,ref=cache.neon.build/neonvm-runner:cache - cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/neonvm-runner:cache,mode=max' || '' }} - tags: ${{ needs.tags.outputs.runner }} - build-args: | - GO_BASE_IMG=${{ env.GO_BASE_IMG }} - - - name: Generate neonvm-controller build tags - id: controller-build-tags - env: - PRESERVE_RUNNER_PODS: ${{ inputs.controller-preserve-runner-pods }} - run: | - if [ "$PRESERVE_RUNNER_PODS" = 'true' ]; then - echo "buildtags=nodelete" | tee -a $GITHUB_OUTPUT - else - echo "buildtags=" | tee -a $GITHUB_OUTPUT - fi - - - name: Build and push neonvm-controller image - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64 - push: true - file: neonvm-controller/Dockerfile - cache-from: type=registry,ref=cache.neon.build/neonvm-controller:cache - cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/neonvm-controller:cache,mode=max' || '' }} - tags: ${{ needs.tags.outputs.controller }} - build-args: | - GO_BASE_IMG=${{ env.GO_BASE_IMG }} - VM_RUNNER_IMAGE=${{ needs.tags.outputs.runner }} - BUILDTAGS=${{ steps.controller-build-tags.outputs.buildtags }} - - - name: Build and push neonvm-vxlan-controller image - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64 - push: true - file: neonvm-vxlan-controller/Dockerfile - cache-from: type=registry,ref=cache.neon.build/neonvm-vxlan-controller:cache - cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/neonvm-vxlan-controller:cache,mode=max' || '' }} - tags: ${{ needs.tags.outputs.vxlan-controller }} - build-args: | - GO_BASE_IMG=${{ env.GO_BASE_IMG }} - TARGET_ARCH=${{ env.TARGET_ARCH }} - - - name: Build and push autoscale-scheduler image - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64 - push: true - file: autoscale-scheduler/Dockerfile - cache-from: type=registry,ref=cache.neon.build/autoscale-scheduler:cache - cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/autoscale-scheduler:cache,mode=max' || '' }} - tags: ${{ needs.tags.outputs.scheduler }} - build-args: | - GO_BASE_IMG=${{ env.GO_BASE_IMG }} - GIT_INFO=${{ steps.get-git-info.outputs.info }}:${{ inputs.tag }} - - - name: Build and push autoscaler-agent image - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64 - push: true - file: autoscaler-agent/Dockerfile - cache-from: type=registry,ref=cache.neon.build/autoscaler-agent:cache - cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/autoscaler-agent:cache,mode=max' || '' }} - tags: ${{ needs.tags.outputs.autoscaler-agent }} - build-args: | - GO_BASE_IMG=${{ env.GO_BASE_IMG }} - GIT_INFO=${{ steps.get-git-info.outputs.info }} - - - name: Build and push cluster-autoscaler image - uses: docker/build-push-action@v6 - if: ${{ format('{0}', inputs.build-cluster-autoscaler) == 'true' }} - with: - context: cluster-autoscaler - platforms: linux/amd64 - push: true - tags: ${{ needs.tags.outputs.cluster-autoscaler }} - cache-from: type=registry,ref=cache.neon.build/cluster-autoscaler-neonvm:cache - cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/cluster-autoscaler-neonvm:cache,mode=max' || '' }} - build-args: | - CA_GIT_TAG=${{ steps.get-ca-tag.outputs.tag }} - - - 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: Load VM kernel + # env: + # IMAGE: ${{ needs.vm-kernel.outputs.image }} + # run: | + # docker pull --quiet $IMAGE + # ID=$(docker create $IMAGE true) + # docker cp ${ID}:/vmlinuz neonvm-kernel/vmlinuz + # docker rm -f ${ID} + - run: uname -a + - run: echo "${{ matrix.arch }}" + # - name: Build go dependencies image + # uses: docker/build-push-action@v6 + # id: build-go-dependencies-image + # with: + # context: . + + # push: true + # file: Dockerfile.go-base + # cache-from: type=registry,ref=cache.neon.build/autoscaling-go-base:cache + # cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/autoscaling-go-base:cache,mode=max' || '' }} + # tags: ${{ env.GO_BASE_IMG }} + + # - name: Build and push neonvm-runner image + # uses: docker/build-push-action@v6 + # with: + # context: . + + # push: true + # file: neonvm-runner/Dockerfile + # cache-from: type=registry,ref=cache.neon.build/neonvm-runner:cache + # cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/neonvm-runner:cache,mode=max' || '' }} + # tags: ${{ needs.tags.outputs.runner }} + # build-args: | + # GO_BASE_IMG=${{ env.GO_BASE_IMG }} + + # - name: Generate neonvm-controller build tags + # id: controller-build-tags + # env: + # PRESERVE_RUNNER_PODS: ${{ inputs.controller-preserve-runner-pods }} + # run: | + # if [ "$PRESERVE_RUNNER_PODS" = 'true' ]; then + # echo "buildtags=nodelete" | tee -a $GITHUB_OUTPUT + # else + # echo "buildtags=" | tee -a $GITHUB_OUTPUT + # fi + + # - name: Build and push neonvm-controller image + # uses: docker/build-push-action@v6 + # with: + # context: . + + # push: true + # file: neonvm-controller/Dockerfile + # cache-from: type=registry,ref=cache.neon.build/neonvm-controller:cache + # cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/neonvm-controller:cache,mode=max' || '' }} + # tags: ${{ needs.tags.outputs.controller }} + # build-args: | + # GO_BASE_IMG=${{ env.GO_BASE_IMG }} + # VM_RUNNER_IMAGE=${{ needs.tags.outputs.runner }} + # BUILDTAGS=${{ steps.controller-build-tags.outputs.buildtags }} + + # - name: Build and push neonvm-vxlan-controller image + # uses: docker/build-push-action@v6 + # with: + # context: . + + # push: true + # file: neonvm-vxlan-controller/Dockerfile + # cache-from: type=registry,ref=cache.neon.build/neonvm-vxlan-controller:cache + # cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/neonvm-vxlan-controller:cache,mode=max' || '' }} + # tags: ${{ needs.tags.outputs.vxlan-controller }} + # build-args: | + # GO_BASE_IMG=${{ env.GO_BASE_IMG }} + # TARGET_ARCH=${{ env.TARGET_ARCH }} + + # - name: Build and push autoscale-scheduler image + # uses: docker/build-push-action@v6 + # with: + # context: . + + # push: true + # file: autoscale-scheduler/Dockerfile + # cache-from: type=registry,ref=cache.neon.build/autoscale-scheduler:cache + # cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/autoscale-scheduler:cache,mode=max' || '' }} + # tags: ${{ needs.tags.outputs.scheduler }} + # build-args: | + # GO_BASE_IMG=${{ env.GO_BASE_IMG }} + # GIT_INFO=${{ steps.get-git-info.outputs.info }}:${{ inputs.tag }} + + # - name: Build and push autoscaler-agent image + # uses: docker/build-push-action@v6 + # with: + # context: . + + # push: true + # file: autoscaler-agent/Dockerfile + # cache-from: type=registry,ref=cache.neon.build/autoscaler-agent:cache + # cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/autoscaler-agent:cache,mode=max' || '' }} + # tags: ${{ needs.tags.outputs.autoscaler-agent }} + # build-args: | + # GO_BASE_IMG=${{ env.GO_BASE_IMG }} + # GIT_INFO=${{ steps.get-git-info.outputs.info }} + + # - name: Build and push cluster-autoscaler image + # uses: docker/build-push-action@v6 + # if: ${{ format('{0}', inputs.build-cluster-autoscaler) == 'true' }} + # with: + # context: cluster-autoscaler + + # push: true + # tags: ${{ needs.tags.outputs.cluster-autoscaler }} + # cache-from: type=registry,ref=cache.neon.build/cluster-autoscaler-neonvm:cache + # cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/cluster-autoscaler-neonvm:cache,mode=max' || '' }} + # build-args: | + # CA_GIT_TAG=${{ steps.get-ca-tag.outputs.tag }} + + # - 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/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 9d9fb4180..94ef18ce2 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -1,32 +1,32 @@ name: e2e-test -on: {} - # pull_request: - # push: - # branches: - # - main - # workflow_dispatch: - # inputs: - # kernel-image: - # type: string - # description: 'The kernel image to use for the VMs. If not specified, a kernel will be built from source' - # required: false - # cluster: - # type: choice - # description: 'The cluster to run the tests on' - # options: - # - k3d - # - kind - # default: k3d - # workflow_call: - # inputs: - # tag: - # type: string - # description: 'Tag to use for images, skipping building' - # required: false - # push-yamls: - # type: boolean - # description: 'If true, pushes a tarball containing the rendered yaml manifests as an artifact' - # required: false +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + inputs: + kernel-image: + type: string + description: 'The kernel image to use for the VMs. If not specified, a kernel will be built from source' + required: false + cluster: + type: choice + description: 'The cluster to run the tests on' + options: + - k3d + - kind + default: k3d + workflow_call: + inputs: + tag: + type: string + description: 'Tag to use for images, skipping building' + required: false + push-yamls: + type: boolean + description: 'If true, pushes a tarball containing the rendered yaml manifests as an artifact' + required: false env: IMG_E2E_TEST: vm-postgres:15-bullseye @@ -64,207 +64,207 @@ jobs: controller-preserve-runner-pods: true secrets: inherit - build-test-vm: - needs: get-tag - uses: ./.github/workflows/build-test-vm.yaml - with: - skip: ${{ inputs.tag != '' }} - tag: ${{ inputs.tag || needs.get-tag.outputs.tag }} - secrets: inherit + # build-test-vm: + # needs: get-tag + # uses: ./.github/workflows/build-test-vm.yaml + # with: + # skip: ${{ inputs.tag != '' }} + # tag: ${{ inputs.tag || needs.get-tag.outputs.tag }} + # secrets: inherit - e2e-tests: - needs: [ build-images, build-test-vm ] - strategy: - fail-fast: false - matrix: - cluster: - - ${{ inputs.cluster || 'k3d' }} - runs-on: [ self-hosted, gen3, large ] - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # fetch all, so that we also include tags + # e2e-tests: + # needs: [ build-images, build-test-vm ] + # strategy: + # fail-fast: false + # matrix: + # cluster: + # - ${{ inputs.cluster || 'k3d' }} + # runs-on: [ self-hosted, gen3, large ] + # steps: + # - uses: actions/checkout@v4 + # with: + # fetch-depth: 0 # fetch all, so that we also include tags - - uses: actions/setup-go@v5 - with: - go-version-file: 'go.mod' - # Disable cache on self-hosted runners to avoid /usr/bin/tar errors, see https://github.com/actions/setup-go/issues/403 - cache: false - # Sometimes setup-go gets stuck. Without this, it'll keep going until the job gets killed - timeout-minutes: 10 + # - uses: actions/setup-go@v5 + # with: + # go-version-file: 'go.mod' + # # Disable cache on self-hosted runners to avoid /usr/bin/tar errors, see https://github.com/actions/setup-go/issues/403 + # cache: false + # # Sometimes setup-go gets stuck. Without this, it'll keep going until the job gets killed + # timeout-minutes: 10 - - name: Install dependencies - run: | - sudo apt install -y python3-venv - make e2e-tools - echo $(pwd)/bin >> $GITHUB_PATH + # - name: Install dependencies + # run: | + # sudo apt install -y python3-venv + # make e2e-tools + # echo $(pwd)/bin >> $GITHUB_PATH - - name: Check dependencies - run: | - kubectl version --client --output=yaml - k3d version - kind version - kuttl version - docker version + # - name: Check dependencies + # run: | + # kubectl version --client --output=yaml + # k3d version + # kind version + # kuttl version + # docker version - - run: make render-release - env: - IMG_CONTROLLER: ${{ needs.build-images.outputs.controller }} - IMG_VXLAN_CONTROLLER: ${{ needs.build-images.outputs.vxlan-controller }} - IMG_RUNNER: ${{ needs.build-images.outputs.runner }} - IMG_SCHEDULER: ${{ needs.build-images.outputs.scheduler }} - IMG_AUTOSCALER_AGENT: ${{ needs.build-images.outputs.autoscaler-agent }} + # - run: make render-release + # env: + # IMG_CONTROLLER: ${{ needs.build-images.outputs.controller }} + # IMG_VXLAN_CONTROLLER: ${{ needs.build-images.outputs.vxlan-controller }} + # IMG_RUNNER: ${{ needs.build-images.outputs.runner }} + # IMG_SCHEDULER: ${{ needs.build-images.outputs.scheduler }} + # IMG_AUTOSCALER_AGENT: ${{ needs.build-images.outputs.autoscaler-agent }} - - 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' }} - uses: actions/upload-artifact@v4 - with: - name: rendered_manifests - # nb: prefix before wildcard is removed from the uploaded files, so the artifact should - # contain e.g. - # - autoscale-scheduler.yaml - # - autoscaler-agent.yaml - # ... - # ref https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions - path: rendered_manifests/* - if-no-files-found: error - retention-days: 2 # minimum is 1 day; 0 is default. These are only used temporarily. + # - 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' }} + # uses: actions/upload-artifact@v4 + # with: + # name: rendered_manifests + # # nb: prefix before wildcard is removed from the uploaded files, so the artifact should + # # contain e.g. + # # - autoscale-scheduler.yaml + # # - autoscaler-agent.yaml + # # ... + # # ref https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions + # path: rendered_manifests/* + # if-no-files-found: error + # retention-days: 2 # minimum is 1 day; 0 is default. These are only used temporarily. - - name: set custom docker config directory - uses: ./.github/actions/set-docker-config-dir + # - name: set custom docker config directory + # uses: ./.github/actions/set-docker-config-dir - - uses: docker/login-action@v3 - with: - username: ${{ secrets.NEON_DOCKERHUB_USERNAME }} - password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }} + # - uses: docker/login-action@v3 + # with: + # username: ${{ secrets.NEON_DOCKERHUB_USERNAME }} + # password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }} - # https://docs.k3s.io/installation/private-registry#registries-configuration-file - # https://github.com/neondatabase/autoscaling/issues/975 - - name: set k3d registries.yaml - # TODO: Implement an equivalent for kind? - # Relevant docs seem to be here: https://kind.sigs.k8s.io/docs/user/private-registries - if: ${{ matrix.cluster == 'k3d' }} - env: - DOCKERHUB_USERNAME: ${{ secrets.NEON_DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.NEON_DOCKERHUB_PASSWORD }} - run: | - { - echo "configs:" - echo " registry-1.docker.io:" - echo " auth:" - echo " username: $DOCKERHUB_USERNAME" - echo " password: $DOCKERHUB_PASSWORD" - } >> $(pwd)/k3d/registries.yaml + # # https://docs.k3s.io/installation/private-registry#registries-configuration-file + # # https://github.com/neondatabase/autoscaling/issues/975 + # - name: set k3d registries.yaml + # # TODO: Implement an equivalent for kind? + # # Relevant docs seem to be here: https://kind.sigs.k8s.io/docs/user/private-registries + # if: ${{ matrix.cluster == 'k3d' }} + # env: + # DOCKERHUB_USERNAME: ${{ secrets.NEON_DOCKERHUB_USERNAME }} + # DOCKERHUB_PASSWORD: ${{ secrets.NEON_DOCKERHUB_PASSWORD }} + # run: | + # { + # echo "configs:" + # echo " registry-1.docker.io:" + # echo " auth:" + # echo " username: $DOCKERHUB_USERNAME" + # echo " password: $DOCKERHUB_PASSWORD" + # } >> $(pwd)/k3d/registries.yaml - - run: make ${{ matrix.cluster }}-setup - env: - USE_REGISTRIES_FILE: true + # - run: make ${{ matrix.cluster }}-setup + # env: + # USE_REGISTRIES_FILE: true - - name: deploy components - timeout-minutes: 3 - run: | - rendered () { echo "rendered_manifests/$1"; } + # - name: deploy components + # timeout-minutes: 3 + # run: | + # rendered () { echo "rendered_manifests/$1"; } - kubectl apply -f $(rendered multus-amd64.yaml) - kubectl -n kube-system rollout status daemonset kube-multus-ds - kubectl apply -f $(rendered whereabouts-amd64.yaml) - kubectl -n kube-system rollout status daemonset whereabouts - kubectl apply -f $(rendered neonvm-runner-image-loader.yaml) - kubectl -n neonvm-system rollout status daemonset neonvm-runner-image-loader - kubectl apply -f $(rendered neonvm.yaml) - kubectl -n neonvm-system rollout status daemonset neonvm-device-plugin - kubectl apply -f $(rendered neonvm-controller.yaml) - kubectl -n neonvm-system rollout status deployment neonvm-controller - kubectl apply -f $(rendered neonvm-vxlan-controller.yaml) - kubectl -n neonvm-system rollout status daemonset neonvm-vxlan-controller - kubectl apply -f $(rendered autoscale-scheduler.yaml) - kubectl -n kube-system rollout status deployment autoscale-scheduler - kubectl apply -f $(rendered autoscaler-agent.yaml) - kubectl -n kube-system rollout status daemonset autoscaler-agent + # kubectl apply -f $(rendered multus-amd64.yaml) + # kubectl -n kube-system rollout status daemonset kube-multus-ds + # kubectl apply -f $(rendered whereabouts-amd64.yaml) + # kubectl -n kube-system rollout status daemonset whereabouts + # kubectl apply -f $(rendered neonvm-runner-image-loader.yaml) + # kubectl -n neonvm-system rollout status daemonset neonvm-runner-image-loader + # kubectl apply -f $(rendered neonvm.yaml) + # kubectl -n neonvm-system rollout status daemonset neonvm-device-plugin + # kubectl apply -f $(rendered neonvm-controller.yaml) + # kubectl -n neonvm-system rollout status deployment neonvm-controller + # kubectl apply -f $(rendered neonvm-vxlan-controller.yaml) + # kubectl -n neonvm-system rollout status daemonset neonvm-vxlan-controller + # kubectl apply -f $(rendered autoscale-scheduler.yaml) + # kubectl -n kube-system rollout status deployment autoscale-scheduler + # kubectl apply -f $(rendered autoscaler-agent.yaml) + # kubectl -n kube-system rollout status daemonset autoscaler-agent - - name: load e2e test vm image - env: - TEST_IMAGE: ${{ needs.build-test-vm.outputs.vm-postgres-16-bullseye }} - timeout-minutes: 2 - run: | - # Pull the docker image so we can re-tag it, because using a consistent tag inside the - # cluster means we can avoid dynamically editing the image used in the kuttl files. - docker pull "$TEST_IMAGE" - docker image tag "$TEST_IMAGE" "$IMG_E2E_TEST" - make load-example-vms + # - name: load e2e test vm image + # env: + # TEST_IMAGE: ${{ needs.build-test-vm.outputs.vm-postgres-16-bullseye }} + # timeout-minutes: 2 + # run: | + # # Pull the docker image so we can re-tag it, because using a consistent tag inside the + # # cluster means we can avoid dynamically editing the image used in the kuttl files. + # docker pull "$TEST_IMAGE" + # docker image tag "$TEST_IMAGE" "$IMG_E2E_TEST" + # make load-example-vms - - run: make e2e - timeout-minutes: 15 + # - run: make e2e + # timeout-minutes: 15 - - name: Get k8s logs and events - if: always() - run: | - if ! kubectl config current-context; then - echo "skipping cluster logs because no cluster found in kubectl context" - exit 0 - fi + # - name: Get k8s logs and events + # if: always() + # run: | + # if ! kubectl config current-context; then + # echo "skipping cluster logs because no cluster found in kubectl context" + # exit 0 + # fi - namespaces=$(kubectl get namespaces -o jsonpath='{.items[*].metadata.name}') - for namespace in $namespaces; do - if [[ "$namespace" == "neonvm-system" ]] || [[ "$namespace" == kuttl-test-* ]]; then - tee_if_needed=$GITHUB_STEP_SUMMARY - else - tee_if_needed=/dev/null - fi + # namespaces=$(kubectl get namespaces -o jsonpath='{.items[*].metadata.name}') + # for namespace in $namespaces; do + # if [[ "$namespace" == "neonvm-system" ]] || [[ "$namespace" == kuttl-test-* ]]; then + # tee_if_needed=$GITHUB_STEP_SUMMARY + # else + # tee_if_needed=/dev/null + # fi - { - echo "
" - echo "Namespace=$namespace" - } | tee -a $tee_if_needed + # { + # echo "
" + # echo "Namespace=$namespace" + # } | tee -a $tee_if_needed - pods=$(kubectl get pods -n $namespace -o jsonpath='{.items[*].metadata.name}') - for pod in $pods; do - { - echo "
" - echo "- Namespace=$namespace Pod=$pod Logs" - echo "
"
-              } | tee -a $tee_if_needed
+  #           pods=$(kubectl get pods -n $namespace -o jsonpath='{.items[*].metadata.name}')
+  #           for pod in $pods; do
+  #             {
+  #               echo "
" + # echo "- Namespace=$namespace Pod=$pod Logs" + # echo "
"
+  #             } | tee -a $tee_if_needed
 
-              restarts=$(
-                kubectl get pod -n $namespace $pod -o jsonpath='{.status.containerStatuses[0].restartCount}' || echo '0'
-              )
-              {
-                if [ "$restarts" -ne 0 ]; then
-                  echo "CONTAINER RESTARTED $restarts TIME(S)"
-                  echo "Previous logs:"
-                  kubectl logs -n $namespace -p $pod || echo 'Error getting logs'
-                  echo "Current logs:"
-                  kubectl logs -n $namespace $pod || echo 'Error getting logs'
-                else
-                  echo "Logs:"
-                  kubectl logs -n $namespace $pod || echo 'Error getting logs'
-                fi
-              } | tee -a $tee_if_needed
-              {
-                echo "
" - echo "
" - } | tee -a $tee_if_needed + # restarts=$( + # kubectl get pod -n $namespace $pod -o jsonpath='{.status.containerStatuses[0].restartCount}' || echo '0' + # ) + # { + # if [ "$restarts" -ne 0 ]; then + # echo "CONTAINER RESTARTED $restarts TIME(S)" + # echo "Previous logs:" + # kubectl logs -n $namespace -p $pod || echo 'Error getting logs' + # echo "Current logs:" + # kubectl logs -n $namespace $pod || echo 'Error getting logs' + # else + # echo "Logs:" + # kubectl logs -n $namespace $pod || echo 'Error getting logs' + # fi + # } | tee -a $tee_if_needed + # { + # echo "
" + # echo "
" + # } | tee -a $tee_if_needed - { - echo "
" - echo "- Namespace=$namespace Pod=$pod Events" - echo "
"
-              } | tee -a $tee_if_needed
+  #             {
+  #               echo "
" + # echo "- Namespace=$namespace Pod=$pod Events" + # echo "
"
+  #             } | tee -a $tee_if_needed
 
-              (kubectl get events --namespace $namespace --field-selector involvedObject.name=$pod || echo 'Error getting events') | tee -a $tee_if_needed
+  #             (kubectl get events --namespace $namespace --field-selector involvedObject.name=$pod || echo 'Error getting events') | tee -a $tee_if_needed
 
-              {
-                echo "
" - echo "
" - echo "
" - } | tee -a $tee_if_needed - done + # { + # echo "" + # echo "" + # echo "
" + # } | tee -a $tee_if_needed + # done - echo "
" | tee -a $tee_if_needed - done + # echo "" | tee -a $tee_if_needed + # done - - name: Cleanup - if: always() - run: make ${{ matrix.cluster }}-destroy + # - name: Cleanup + # if: always() + # run: make ${{ matrix.cluster }}-destroy