diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 88d08d0..ee477ec 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,8 +13,5 @@ updates: groups: github-actions: patterns: ["*"] - labels: - - automation - - gha-update # TODO: Add web app python dependencies diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index bdb32d1..656d872 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -10,7 +10,7 @@ on: - ready_for_review - reopened branches: - - master + - main # Use the head ref for workflow concurrency, with cancellation # This should mean that any previous workflows for a PR get cancelled when a new commit is pushed @@ -57,6 +57,14 @@ jobs: with: cluster_name: ${{ env.CLUSTER_NAME }} + # NOTE(scott): Since the local Chart.yaml uses "appVersion: latest" and this + # only gets overwritten to the correct commit SHA during Helm chart build, + # we need to pull these published images and load them into the kind cluster + # with the tag correct tag. + - name: Load tagged container images into kind cluster + run: ./kind-images.sh ${{ github.event.pull_request.head.sha }} ${{ env.CLUSTER_NAME }} + working-directory: web-apps + - name: Add Helm repos for dependencies run: | helm repo add stakater https://stakater.github.io/stakater-charts diff --git a/charts/azimuth-chat/Chart.yaml b/charts/azimuth-chat/Chart.yaml index 9902e93..df9de4f 100644 --- a/charts/azimuth-chat/Chart.yaml +++ b/charts/azimuth-chat/Chart.yaml @@ -9,7 +9,7 @@ type: application # The version and appVersion are updated by the chart build script version: 0.1.0 -appVersion: master +appVersion: local icon: https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg diff --git a/charts/azimuth-image-analysis/Chart.yaml b/charts/azimuth-image-analysis/Chart.yaml index 3cc52f2..bb497b1 100644 --- a/charts/azimuth-image-analysis/Chart.yaml +++ b/charts/azimuth-image-analysis/Chart.yaml @@ -9,7 +9,7 @@ type: application # The version and appVersion are updated by the chart build script version: 0.1.0 -appVersion: master +appVersion: local icon: https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg diff --git a/charts/azimuth-llm/Chart.yaml b/charts/azimuth-llm/Chart.yaml index 182ba2f..457f523 100644 --- a/charts/azimuth-llm/Chart.yaml +++ b/charts/azimuth-llm/Chart.yaml @@ -9,7 +9,7 @@ type: application # The version and appVersion are updated by the chart build script version: 0.1.0 -appVersion: master +appVersion: local icon: https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg diff --git a/web-apps/build.sh b/web-apps/build.sh index 0dd5d4a..86deb9e 100755 --- a/web-apps/build.sh +++ b/web-apps/build.sh @@ -1,14 +1,7 @@ #!/bin/bash set -e -build() { - if [[ -f $1/Dockerfile ]]; then - echo Building $1 docker image - docker build . -t ghcr.io/stackhpc/azimuth-llm-$1 -f $1/Dockerfile - else - echo No Dockerfile found for $1 - fi -} +source functions.sh # If a single app is provided as a # script arg then just build that image, @@ -16,9 +9,7 @@ build() { if [[ ! -z $1 ]]; then build $1 else - for item in $(ls); do - if [[ -d $item ]]; then - build $item - fi + for image in $(find_images .); do + build $image done fi diff --git a/web-apps/functions.sh b/web-apps/functions.sh new file mode 100755 index 0000000..f82fa22 --- /dev/null +++ b/web-apps/functions.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +find_images() { + images="" + for dir in $(ls $1); do + if [[ -f $1/$dir/Dockerfile ]]; then + images+="$dir " + fi + done + echo $images +} + +build() { + if [[ -f $1/Dockerfile ]]; then + echo Building $1 docker image + docker build . -t ghcr.io/stackhpc/azimuth-llm-$1-ui -f $1/Dockerfile + else + echo No Dockerfile found for $1 + fi +} diff --git a/web-apps/kind-images.sh b/web-apps/kind-images.sh new file mode 100755 index 0000000..4a63498 --- /dev/null +++ b/web-apps/kind-images.sh @@ -0,0 +1,20 @@ +set -e + +source functions.sh + +if [[ -z $1 ]]; then + echo "Published image tag must be provided as sole command line arg" + exit 1 +fi + +REMOTE_TAG=$1 +CLUSTER_NAME=${2:-kind} +echo Kind cluster name: $CLUSTER_NAME +KIND_TAG=local +for image in $(find_images .); do + full_name=ghcr.io/stackhpc/azimuth-llm-$image-ui + echo $full_name + docker pull $full_name:$REMOTE_TAG + docker image tag $full_name:$REMOTE_TAG $full_name:$KIND_TAG + kind load docker-image -n $CLUSTER_NAME $full_name:$KIND_TAG +done