Skip to content

Commit

Permalink
WIP: build-images builds go components
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 b4612a3 commit 6afc055
Showing 1 changed file with 73 additions and 74 deletions.
147 changes: 73 additions & 74 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ jobs:
vm-kernel:
# nb: use format(..) to catch both inputs.skip = true AND inputs.skip = 'true'.
# if: ${{ format('{0}', inputs.skip) != 'true' }}
if: false
if: ${{ format('{0}', inputs.skip) != 'true' }}
uses: ./.github/workflows/vm-kernel.yaml
with:
tag: ${{ inputs.kernel-image || inputs.tag }}
Expand Down Expand Up @@ -225,88 +224,88 @@ jobs:
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
# 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
# TODO: SKIP WHILE KERNEL CACHING IS NOT SORTED OUT
# - name: Build and push neonvm-runner 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 }}
# 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 }}
# 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: 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 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 neonvm-controller image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/${{ matrix.arch }}
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 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 neonvm-vxlan-controller image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/${{ matrix.arch }}
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=${{ matrix.arch }}
- name: Build and push autoscale-scheduler image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/${{ matrix.arch }}
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/${{ matrix.arch }}
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 }}
# TODO: AUTOSCALER IMAGE IS HARDCODED FOR AMD
# - name: Build and push cluster-autoscaler image
# uses: docker/build-push-action@v6
# if: ${{ format('{0}', inputs.build-cluster-autoscaler) == 'true' }}
Expand Down

0 comments on commit 6afc055

Please sign in to comment.