Skip to content

Commit 1d8b9ac

Browse files
authored
Merge pull request #54 from stackhpc/refactor-workflows
Fix PR test job
2 parents 3ab2bfb + 69c05e4 commit 1d8b9ac

File tree

8 files changed

+55
-19
lines changed

8 files changed

+55
-19
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,5 @@ updates:
1313
groups:
1414
github-actions:
1515
patterns: ["*"]
16-
labels:
17-
- automation
18-
- gha-update
1916

2017
# TODO: Add web app python dependencies

.github/workflows/test-pr.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- ready_for_review
1111
- reopened
1212
branches:
13-
- master
13+
- main
1414

1515
# Use the head ref for workflow concurrency, with cancellation
1616
# This should mean that any previous workflows for a PR get cancelled when a new commit is pushed
@@ -57,6 +57,14 @@ jobs:
5757
with:
5858
cluster_name: ${{ env.CLUSTER_NAME }}
5959

60+
# NOTE(scott): Since the local Chart.yaml uses "appVersion: latest" and this
61+
# only gets overwritten to the correct commit SHA during Helm chart build,
62+
# we need to pull these published images and load them into the kind cluster
63+
# with the tag correct tag.
64+
- name: Load tagged container images into kind cluster
65+
run: ./kind-images.sh ${{ github.event.pull_request.head.sha }} ${{ env.CLUSTER_NAME }}
66+
working-directory: web-apps
67+
6068
- name: Add Helm repos for dependencies
6169
run: |
6270
helm repo add stakater https://stakater.github.io/stakater-charts

charts/azimuth-chat/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type: application
99

1010
# The version and appVersion are updated by the chart build script
1111
version: 0.1.0
12-
appVersion: master
12+
appVersion: local
1313

1414
icon: https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg
1515

charts/azimuth-image-analysis/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type: application
99

1010
# The version and appVersion are updated by the chart build script
1111
version: 0.1.0
12-
appVersion: master
12+
appVersion: local
1313

1414
icon: https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg
1515

charts/azimuth-llm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type: application
99

1010
# The version and appVersion are updated by the chart build script
1111
version: 0.1.0
12-
appVersion: master
12+
appVersion: local
1313

1414
icon: https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg
1515

web-apps/build.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
#!/bin/bash
22
set -e
33

4-
build() {
5-
if [[ -f $1/Dockerfile ]]; then
6-
echo Building $1 docker image
7-
docker build . -t ghcr.io/stackhpc/azimuth-llm-$1 -f $1/Dockerfile
8-
else
9-
echo No Dockerfile found for $1
10-
fi
11-
}
4+
source functions.sh
125

136
# If a single app is provided as a
147
# script arg then just build that image,
158
# otherwise try building all images.
169
if [[ ! -z $1 ]]; then
1710
build $1
1811
else
19-
for item in $(ls); do
20-
if [[ -d $item ]]; then
21-
build $item
22-
fi
12+
for image in $(find_images .); do
13+
build $image
2314
done
2415
fi

web-apps/functions.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
find_images() {
4+
images=""
5+
for dir in $(ls $1); do
6+
if [[ -f $1/$dir/Dockerfile ]]; then
7+
images+="$dir "
8+
fi
9+
done
10+
echo $images
11+
}
12+
13+
build() {
14+
if [[ -f $1/Dockerfile ]]; then
15+
echo Building $1 docker image
16+
docker build . -t ghcr.io/stackhpc/azimuth-llm-$1-ui -f $1/Dockerfile
17+
else
18+
echo No Dockerfile found for $1
19+
fi
20+
}

web-apps/kind-images.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
set -e
2+
3+
source functions.sh
4+
5+
if [[ -z $1 ]]; then
6+
echo "Published image tag must be provided as sole command line arg"
7+
exit 1
8+
fi
9+
10+
REMOTE_TAG=$1
11+
CLUSTER_NAME=${2:-kind}
12+
echo Kind cluster name: $CLUSTER_NAME
13+
KIND_TAG=local
14+
for image in $(find_images .); do
15+
full_name=ghcr.io/stackhpc/azimuth-llm-$image-ui
16+
echo $full_name
17+
docker pull $full_name:$REMOTE_TAG
18+
docker image tag $full_name:$REMOTE_TAG $full_name:$KIND_TAG
19+
kind load docker-image -n $CLUSTER_NAME $full_name:$KIND_TAG
20+
done

0 commit comments

Comments
 (0)