Skip to content

Commit

Permalink
WIP: runner image
Browse files Browse the repository at this point in the history
Signed-off-by: Misha Sakhnov <[email protected]>
  • Loading branch information
mikhail-sakhnov committed Oct 28, 2024
1 parent 84ee7ca commit b4612a3
Showing 1 changed file with 38 additions and 37 deletions.
75 changes: 38 additions & 37 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ env:
#
# Otherwise, if we just try to use a local image, it fails trying to pull it from dockerhub.
# See https://github.com/moby/buildkit/issues/2343 for more information.
GO_BASE_IMG: "localhost:5000/neondatabase/autoscaling-go-base:dev"
# GO_BASE_IMG_PREFIX: "localhost:5000/neondatabase/autoscaling-go-base"
# Default architecture to build. In future it would be changed to multi-arch build or separate builds for each arch
TARGET_ARCH: "amd64" # move to matrix strategy

Expand Down Expand Up @@ -93,7 +93,8 @@ jobs:
vm-kernel:
# nb: use format(..) to catch both inputs.skip = true AND inputs.skip = 'true'.
if: ${{ format('{0}', inputs.skip) != 'true' }}
# if: ${{ format('{0}', inputs.skip) != 'true' }}
if: false
uses: ./.github/workflows/vm-kernel.yaml
with:
tag: ${{ inputs.kernel-image || inputs.tag }}
Expand All @@ -103,7 +104,9 @@ jobs:
build:
# nb: use format(..) to catch both inputs.skip = true AND inputs.skip = 'true'.
if: ${{ format('{0}', inputs.skip) != 'true' }}
needs: [ tags , vm-kernel ]
needs: [ tags ]
env:
GO_BASE_IMG: ${{ format('localhost:5000/neondatabase/autoscaling-go-base-{0}:dev', matrix.arch) }}
permissions:
contents: read # This is required for actions/checkout
id-token: write # This is required for aws-actions/configure-aws-credentials
Expand Down Expand Up @@ -202,41 +205,39 @@ jobs:
docker version
docker buildx version
- name: Load VM kernel
env:
IMAGE: ${{ matrix.arch == 'amd64' && needs.vm-kernel.outputs.image_amd64 || needs.vm-kernel.outputs.image_arm64 }}
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: .
# - name: Load VM kernel
# env:
# IMAGE: ${{ matrix.arch == 'amd64' && needs.vm-kernel.outputs.image_amd64 || needs.vm-kernel.outputs.image_arm64 }}
# 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: .

# 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 }}
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
platforms: linux/${{ matrix.arch }}
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
Expand Down

0 comments on commit b4612a3

Please sign in to comment.