Skip to content

Commit 240054a

Browse files
authored
CD workflow update (#1221)
Signed-off-by: chensuyue <suyue.chen@intel.com>
1 parent c9caf1c commit 240054a

File tree

2 files changed

+64
-4
lines changed

2 files changed

+64
-4
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright (C) 2024 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Clean up Local Registry on manual event
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
nodes:
9+
default: "gaudi,xeon"
10+
description: "Hardware to clean up"
11+
required: true
12+
type: string
13+
14+
env:
15+
EXAMPLES: ${{ vars.NIGHTLY_RELEASE_EXAMPLES }}
16+
17+
jobs:
18+
get-build-matrix:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
examples: ${{ steps.get-matrix.outputs.examples }}
22+
nodes: ${{ steps.get-matrix.outputs.nodes }}
23+
steps:
24+
- name: Create Matrix
25+
id: get-matrix
26+
run: |
27+
examples=($(echo ${EXAMPLES} | tr ',' ' '))
28+
examples_json=$(printf '%s\n' "${examples[@]}" | sort -u | jq -R '.' | jq -sc '.')
29+
echo "examples=$examples_json" >> $GITHUB_OUTPUT
30+
nodes=($(echo ${{ inputs.nodes }} | tr ',' ' '))
31+
nodes_json=$(printf '%s\n' "${nodes[@]}" | sort -u | jq -R '.' | jq -sc '.')
32+
echo "nodes=$nodes_json" >> $GITHUB_OUTPUT
33+
34+
clean-up:
35+
needs: get-build-matrix
36+
strategy:
37+
matrix:
38+
node: ${{ fromJson(needs.get-build-matrix.outputs.nodes) }}
39+
fail-fast: false
40+
runs-on: "docker-build-${{ matrix.node }}"
41+
steps:
42+
- name: Clean Up Local Registry
43+
run: |
44+
echo "Cleaning up local registry on ${{ matrix.node }}"
45+
bash /home/sdp/workspace/fully_registry_cleanup.sh
46+
docker ps | grep registry
47+
48+
build:
49+
needs: [get-build-matrix, clean-up]
50+
strategy:
51+
matrix:
52+
example: ${{ fromJson(needs.get-build-matrix.outputs.examples) }}
53+
node: ${{ fromJson(needs.get-build-matrix.outputs.nodes) }}
54+
fail-fast: false
55+
uses: ./.github/workflows/_example-workflow.yml
56+
with:
57+
node: ${{ matrix.node }}
58+
example: ${{ matrix.example }}
59+
secrets: inherit

.github/workflows/nightly-docker-build-publish.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ name: Nightly build/publish latest docker images
55

66
on:
77
schedule:
8-
- cron: "30 13 * * *" # UTC time
8+
- cron: "30 14 * * *" # UTC time
99
workflow_dispatch:
1010

1111
env:
12-
EXAMPLES: "AgentQnA,AudioQnA,ChatQnA,CodeGen,CodeTrans,DocIndexRetriever,DocSum,FaqGen,InstructionTuning,MultimodalQnA,ProductivitySuite,RerankFinetuning,SearchQnA,Translation,VideoQnA,VisualQnA"
12+
EXAMPLES: ${{ vars.NIGHTLY_RELEASE_EXAMPLES }}
1313
TAG: "latest"
1414
PUBLISH_TAGS: "latest"
1515

@@ -32,7 +32,7 @@ jobs:
3232
echo "TAG=$TAG" >> $GITHUB_OUTPUT
3333
echo "PUBLISH_TAGS=$PUBLISH_TAGS" >> $GITHUB_OUTPUT
3434
35-
build:
35+
build-and-test:
3636
needs: get-build-matrix
3737
strategy:
3838
matrix:
@@ -42,6 +42,7 @@ jobs:
4242
with:
4343
node: gaudi
4444
example: ${{ matrix.example }}
45+
test_compose: true
4546
secrets: inherit
4647

4748
get-image-list:
@@ -51,7 +52,7 @@ jobs:
5152
examples: ${{ needs.get-build-matrix.outputs.EXAMPLES }}
5253

5354
publish:
54-
needs: [get-build-matrix, get-image-list, build]
55+
needs: [get-build-matrix, get-image-list, build-and-test]
5556
strategy:
5657
matrix:
5758
image: ${{ fromJSON(needs.get-image-list.outputs.matrix) }}

0 commit comments

Comments
 (0)