Skip to content

Commit

Permalink
CD workflow update (opea-project#1221)
Browse files Browse the repository at this point in the history
Signed-off-by: chensuyue <[email protected]>
  • Loading branch information
chensuyue authored Dec 2, 2024
1 parent c9caf1c commit 240054a
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 4 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/manual-reset-local-registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

name: Clean up Local Registry on manual event
on:
workflow_dispatch:
inputs:
nodes:
default: "gaudi,xeon"
description: "Hardware to clean up"
required: true
type: string

env:
EXAMPLES: ${{ vars.NIGHTLY_RELEASE_EXAMPLES }}

jobs:
get-build-matrix:
runs-on: ubuntu-latest
outputs:
examples: ${{ steps.get-matrix.outputs.examples }}
nodes: ${{ steps.get-matrix.outputs.nodes }}
steps:
- name: Create Matrix
id: get-matrix
run: |
examples=($(echo ${EXAMPLES} | tr ',' ' '))
examples_json=$(printf '%s\n' "${examples[@]}" | sort -u | jq -R '.' | jq -sc '.')
echo "examples=$examples_json" >> $GITHUB_OUTPUT
nodes=($(echo ${{ inputs.nodes }} | tr ',' ' '))
nodes_json=$(printf '%s\n' "${nodes[@]}" | sort -u | jq -R '.' | jq -sc '.')
echo "nodes=$nodes_json" >> $GITHUB_OUTPUT
clean-up:
needs: get-build-matrix
strategy:
matrix:
node: ${{ fromJson(needs.get-build-matrix.outputs.nodes) }}
fail-fast: false
runs-on: "docker-build-${{ matrix.node }}"
steps:
- name: Clean Up Local Registry
run: |
echo "Cleaning up local registry on ${{ matrix.node }}"
bash /home/sdp/workspace/fully_registry_cleanup.sh
docker ps | grep registry
build:
needs: [get-build-matrix, clean-up]
strategy:
matrix:
example: ${{ fromJson(needs.get-build-matrix.outputs.examples) }}
node: ${{ fromJson(needs.get-build-matrix.outputs.nodes) }}
fail-fast: false
uses: ./.github/workflows/_example-workflow.yml
with:
node: ${{ matrix.node }}
example: ${{ matrix.example }}
secrets: inherit
9 changes: 5 additions & 4 deletions .github/workflows/nightly-docker-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ name: Nightly build/publish latest docker images

on:
schedule:
- cron: "30 13 * * *" # UTC time
- cron: "30 14 * * *" # UTC time
workflow_dispatch:

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

Expand All @@ -32,7 +32,7 @@ jobs:
echo "TAG=$TAG" >> $GITHUB_OUTPUT
echo "PUBLISH_TAGS=$PUBLISH_TAGS" >> $GITHUB_OUTPUT
build:
build-and-test:
needs: get-build-matrix
strategy:
matrix:
Expand All @@ -42,6 +42,7 @@ jobs:
with:
node: gaudi
example: ${{ matrix.example }}
test_compose: true
secrets: inherit

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

publish:
needs: [get-build-matrix, get-image-list, build]
needs: [get-build-matrix, get-image-list, build-and-test]
strategy:
matrix:
image: ${{ fromJSON(needs.get-image-list.outputs.matrix) }}
Expand Down

0 comments on commit 240054a

Please sign in to comment.