Kagome Builder | Ubuntu (24.04_LTS) #92
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright Quadrivium LLC | |
# All Rights Reserved | |
# SPDX-License-Identifier: Apache-2.0 | |
# | |
name: Kagome Builder | Ubuntu (24.04_LTS) | |
on: | |
# schedule: | |
# - cron: '0 2 * * 0' # Every Sunday at 2:00 AM | |
workflow_dispatch: | |
inputs: | |
kagome_image_rebuild: | |
description: 'Rebuild Kagome Builder image if exists' | |
required: false | |
default: 'false' | |
type: 'boolean' | |
runtime_cache_rebuild: | |
description: 'Rebuild Kagome Runtime cache' | |
required: false | |
default: 'false' | |
type: 'boolean' | |
builder_latest_tag: | |
description: 'Kagome Builder tag' | |
default: 'latest' | |
required: false | |
type: 'string' | |
zombie_tester_latest_tag: | |
description: 'Zombie Tester tag' | |
default: 'latest' | |
required: false | |
type: 'string' | |
env: | |
DOCKER_REGISTRY_PATH: ${{ secrets.GCP_REGISTRY }}/${{ secrets.GCP_PROJECT }}/kagome-dev/ | |
PROJECT_ID: ${{ secrets.GCP_PROJECT }} | |
BUILDER_LATEST_TAG: ${{ github.event.inputs.builder_latest_tag || 'latest' }} | |
TESTER_LATEST_TAG: ${{ github.event.inputs.zombie_tester_latest_tag || 'latest' }} | |
jobs: | |
build_kagome_builder: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: linux/amd64 | |
os: ubuntu-24.04 | |
- platform: linux/arm64 | |
os: ubuntu-24.04-arm | |
timeout-minutes: 60 | |
env: | |
PLATFORM: ${{ matrix.platform }} | |
steps: | |
- name: "Checkout repository" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: "Fetch master branch" | |
if: env.skip != 'true' | |
run: | | |
git fetch origin master:master | |
- name : "Authenticate with Google Cloud" | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} | |
- name: "Set up Cloud SDK" | |
uses: 'google-github-actions/setup-gcloud@v2' | |
- name: "Configure Docker for GCR" | |
run: | | |
gcloud auth configure-docker --quiet | |
gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet | |
- name: "Check if image tag exists" | |
id: check-tag | |
working-directory: ./housekeeping/docker/kagome-dev | |
run: | | |
make configure | |
exists=$(make kagome_builder_check_tag) | |
echo "Image Exists: $exists" | |
echo "exists=$exists" >> $GITHUB_ENV | |
- name: "Versions Info" | |
if: always() | |
working-directory: ./housekeeping/docker/kagome-dev | |
run: | | |
make kagome_builder_image_info | |
- name: "Build Kagome Builder" | |
working-directory: ./housekeeping/docker/kagome-dev | |
if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true' | |
run: | | |
make kagome_builder && \ | |
make kagome_builder_push | |
- name: "Login to Docker Hub" | |
uses: docker/login-action@v3 | |
if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true' | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: "Push Kagome Builder (DockerHub)" | |
working-directory: ./housekeeping/docker/kagome-dev | |
if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true' | |
run: | | |
make kagome_builder_push_dockerhub | |
docker_manifest: | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 60 | |
needs: [build_kagome_builder] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Fetch master branch | |
run: | | |
git fetch origin master:master | |
- name : "Authenticate with Google Cloud" | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} | |
- name: "Set up Cloud SDK" | |
uses: 'google-github-actions/setup-gcloud@v2' | |
- name: "Configure Docker for GCR" | |
run: | | |
gcloud auth configure-docker --quiet | |
gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet | |
- name: "Check if image tag exists using Makefile" | |
id: check-tag | |
working-directory: ./housekeeping/docker/kagome-dev | |
run: | | |
make configure | |
exists=$(make kagome_builder_check_tag) | |
echo "Image Exists: $exists" | |
echo "exists=$exists" >> $GITHUB_ENV | |
- name: "Versions Info" | |
if: always() | |
working-directory: ./housekeeping/docker/kagome-dev | |
run: | | |
make kagome_builder_image_info | |
- name: "Push Kagome Builder Manifest (GCR)" | |
working-directory: ./housekeeping/docker/kagome-dev | |
if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true' | |
run: | | |
make kagome_builder_push_manifest | |
- name: "Login to Docker Hub" | |
uses: docker/login-action@v3 | |
if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true' | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: "Push Kagome Builder Manifest (DockerHub)" | |
working-directory: ./housekeeping/docker/kagome-dev | |
if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true' | |
run: | | |
make kagome_builder_push_dockerhub_manifest | |
build_kagome_runtime: | |
runs-on: [ actions-runner-controller ] | |
timeout-minutes: 60 | |
steps: | |
- name: "Check if build runtime is required" | |
run: | | |
if [ "${{ github.event.inputs.runtime_cache_rebuild }}" != "true" ]; then | |
echo "Runtime Cache is not required" | |
echo "skip=true" >> $GITHUB_ENV | |
fi | |
- name: Checkout repository | |
if: env.skip != 'true' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name : "Authenticate with Google Cloud" | |
if: env.skip != 'true' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} | |
- name: "Set up Cloud SDK" | |
if: env.skip != 'true' | |
uses: 'google-github-actions/setup-gcloud@v2' | |
- name: "Configure Docker for GCR" | |
if: env.skip != 'true' | |
run: | | |
gcloud auth configure-docker --quiet | |
gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet | |
- name: "Build Runtime Cache" | |
working-directory: ./housekeeping/docker/kagome-dev | |
if: env.skip != 'true' | |
run: make runtime_cache \ | |
DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \ | |
TESTER_LATEST_TAG=${{ env.TESTER_LATEST_TAG }} | |
- name: "Push Runtime Cache" | |
working-directory: ./housekeeping/docker/kagome-dev | |
if: env.skip != 'true' | |
run: make upload_apt_package_runtime \ | |
DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} | |
- name: "Versions Info" | |
if: always() && env.skip != 'true' | |
working-directory: ./housekeeping/docker/kagome-dev | |
run: | | |
echo "Package name and version: kagome-dev-runtime $(python3 get_wasmedge_version.py)-$(date +'%y.%m.%d')" |