-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (71 loc) · 3.05 KB
/
build-and-push-image.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build the LLM Finetuning Docker image
on:
push:
tags:
- v*
branches:
- update-workflow
permissions:
id-token: write
contents: read
concurrency:
group: build-llm-finetune-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_SHA: ${{ github.sha }}
TAG_PREFIX: "v"
jobs:
set_version_tags:
name: Set version tags
runs-on: ubuntu-latest
outputs:
version_tag: ${{ steps.set_version_tags.outputs.version_tag }}
jupyter_version_tag: ${{ steps.set_version_tags.outputs.jupyter_version_tag }}
alt_version_tag: ${{ steps.set_version_tags.outputs.alt_version_tag }}
steps:
- name: Set version tags
id: set_version_tags
run: |
echo "Ref name is ${{ github.ref_name }}"
echo "TAG_PREFIX is ${{ env.TAG_PREFIX }}"
REF_NAME=${{ github.ref_name }}
TAG_PREFIX=${{ env.TAG_PREFIX }}
VERSION_TAG=$(echo $REF_NAME | awk -F$TAG_PREFIX '{print $2}')
echo "Setting VERSION_TAG to $VERSION_TAG"
echo "version_tag=$VERSION_TAG" >> $GITHUB_OUTPUT
JUPYTER_VERSION_TAG=$(echo $REF_NAME | cut -d $TAG_PREFIX -f 2-)-jupyter
echo "Setting JUPYTER VERSION_TAG equal to JUPYTER_VERSION_TAG"
echo "jupyter_version_tag=JUPYTER_VERSION_TAG" >> $GITHUB_OUTPUT
ALT_VERSION_TAG=$(echo $VERSION_TAG | awk -F- '{print $1}')-${GITHUB_SHA::7}
echo "Setting ALT_VERSION_TAG equal to $ALT_VERSION_TAG"
echo "alt_version_tag=$ALT_VERSION_TAG" >> $GITHUB_OUTPUT
build_finetune_image:
- name: Build and Push llm-finetune image
needs: set_version_tags
uses: truefoundry/workflows/.github/workflows/[email protected]
with:
image_tag: ${{ github.sha }}
extra_image_tag: |
${{ needs.set_version_tags.outputs.version_tag }}
${{ needs.set_version_tags.outputs.alt_version_tag }}
platforms: linux/amd64
free_disk_space: true
image_artifact_name: ${{ github.event.repository.name }}
artifactory_registry_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_REGISTRY_URL }}
artifactory_repository_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_REPOSITORY }}
secrets:
artifactory_username: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_USERNAME }}
artifactory_password: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_PASSWORD }}
build_jupyter_image:
- name: Build and Push jupyter image
uses: truefoundry/workflows/.github/workflows/[email protected]
with:
image_tag: ${{ needs.set_version_tags.outputs.jupyter_version_tag }}
platforms: linux/amd64
free_disk_space: true
image_artifact_name: ${{ github.event.repository.name }}
artifactory_registry_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_REGISTRY_URL }}
artifactory_repository_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_REPOSITORY }}
secrets:
artifactory_username: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_USERNAME }}
artifactory_password: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_PASSWORD }}