-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor build image workflows with common action.yml (#525)
Signed-off-by: Yingchun Guo <[email protected]>
- Loading branch information
1 parent
17b9676
commit e22d413
Showing
10 changed files
with
243 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# this file should be run in the root of the repo | ||
services: | ||
audioqna: | ||
build: | ||
context: docker | ||
dockerfile: ./Dockerfile | ||
image: ${REGISTRY}opea/audioqna:${TAG:-latest} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# this file should be run in the root of the repo | ||
services: | ||
chatqna: | ||
build: | ||
context: docker | ||
dockerfile: ./Dockerfile | ||
image: ${REGISTRY}opea/chatqna:${TAG:-latest} | ||
chatqna-ui: | ||
build: | ||
context: docker/ui | ||
dockerfile: ./docker/Dockerfile | ||
image: ${REGISTRY}opea/chatqna-ui:${TAG:-latest} | ||
chatqna-conversation-ui: | ||
build: | ||
context: docker/ui | ||
dockerfile: ./docker/Dockerfile.react | ||
image: ${REGISTRY}opea/chatqna-conversation-ui:${TAG:-latest} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# this file should be run in the root of the repo | ||
services: | ||
codegen: | ||
build: | ||
context: docker | ||
dockerfile: ./Dockerfile | ||
image: ${REGISTRY}opea/codegen:${TAG:-latest} | ||
codegen-ui: | ||
build: | ||
context: docker/ui | ||
dockerfile: ./docker/Dockerfile | ||
image: ${REGISTRY}opea/codegen-ui:${TAG:-latest} | ||
codegen-react-ui: | ||
build: | ||
context: docker/ui | ||
dockerfile: ./docker/Dockerfile.react | ||
image: ${REGISTRY}opea/codegen-conversation-ui:${TAG:-latest} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# this file should be run in the root of the repo | ||
services: | ||
codetrans: | ||
build: | ||
context: docker | ||
dockerfile: ./Dockerfile | ||
image: ${REGISTRY}opea/codetrans:${TAG:-latest} | ||
codetrans-ui: | ||
build: | ||
context: docker/ui | ||
dockerfile: ./docker/Dockerfile | ||
image: ${REGISTRY}opea/codetrans-ui:${TAG:-latest} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# this file should be run in the root of the repo | ||
services: | ||
docsum: | ||
build: | ||
context: docker | ||
dockerfile: ./Dockerfile | ||
image: ${REGISTRY}opea/docsum:${TAG:-latest} | ||
docsum-ui: | ||
build: | ||
context: docker/ui | ||
dockerfile: ./docker/Dockerfile | ||
image: ${REGISTRY}opea/docsum-ui:${TAG:-latest} | ||
docsum-react-ui: | ||
build: | ||
context: docker/ui | ||
dockerfile: ./docker/Dockerfile.react | ||
image: ${REGISTRY}opea/docsum-react-ui:${TAG:-latest} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# this file should be run in the root of the repo | ||
services: | ||
faqgen: | ||
build: | ||
context: docker | ||
dockerfile: ./Dockerfile | ||
image: ${REGISTRY}opea/faqgen:${TAG:-latest} | ||
faqgen-ui: | ||
build: | ||
context: docker/ui | ||
dockerfile: ./docker/Dockerfile | ||
image: ${REGISTRY}opea/faqgen-ui:${TAG:-latest} | ||
faqgen-react-ui: | ||
build: | ||
context: docker/ui | ||
dockerfile: ./docker/Dockerfile.react | ||
image: ${REGISTRY}opea/faqgen-react-ui:${TAG:-latest} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# this file should be run in the root of the repo | ||
services: | ||
searchqna: | ||
build: | ||
context: docker | ||
dockerfile: ./Dockerfile | ||
image: ${REGISTRY}opea/searchqna:${TAG:-latest} | ||
searchqna-ui: | ||
build: | ||
context: docker/ui | ||
dockerfile: ./docker/Dockerfile | ||
image: ${REGISTRY}opea/searchqna-ui:${TAG:-latest} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# this file should be run in the root of the repo | ||
services: | ||
translation: | ||
build: | ||
context: docker | ||
dockerfile: ./Dockerfile | ||
image: ${REGISTRY}opea/translation:${TAG:-latest} | ||
translation-ui: | ||
build: | ||
context: docker/ui | ||
dockerfile: ./docker/Dockerfile | ||
image: ${REGISTRY}opea/translation-ui:${TAG:-latest} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Build latest images on manual event | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
registry: | ||
default: "" | ||
description: "Registry to store images,e.g., docker.io, default is empty" | ||
required: false | ||
type: string | ||
services: | ||
default: "AudioQnA,ChatQnA,CodeGen,CodeTrans,DocSum,FaqGen,SearchQnA,Translation" | ||
description: "List of examples to build" | ||
required: true | ||
type: string | ||
tag: | ||
default: "latest" | ||
description: "Tag to apply to images" | ||
required: true | ||
type: string | ||
nodes: | ||
default: "docker-build-xeon,docker-build-gaudi" | ||
description: "List of node to run the build on" | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
get-build-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
services: ${{ steps.get-services.outputs.services }} | ||
nodes: ${{ steps.get-services.outputs.nodes }} | ||
steps: | ||
- name: Get test Services | ||
id: get-services | ||
run: | | ||
set -x | ||
service_list=($(echo ${{ github.event.inputs.services }} | tr ',' ' ')) | ||
services=$(printf '%s\n' "${service_list[@]}" | sort -u | jq -R '.' | jq -sc '.') | ||
echo "services=$services" >> $GITHUB_OUTPUT | ||
node_list=($(echo ${{ github.event.inputs.nodes }} | tr ',' ' ')) | ||
nodes=$(printf '%s\n' "${node_list[@]}" | sort -u | jq -R '.' | jq -sc '.') | ||
echo "nodes=$nodes" >> $GITHUB_OUTPUT | ||
image-build: | ||
needs: get-build-matrix | ||
strategy: | ||
matrix: | ||
service: ${{ fromJSON(needs.get-build-matrix.outputs.services) }} | ||
node: ${{ fromJSON(needs.get-build-matrix.outputs.nodes) }} | ||
runs-on: ${{ matrix.node }} | ||
continue-on-error: true | ||
steps: | ||
- name: Clean Up Working Directory | ||
run: | | ||
sudo rm -rf ${{github.workspace}}/* | ||
- name: Checkout out Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Config image repo | ||
run: | | ||
if [[ -z "${{ github.event.inputs.registry }}" ]]; then | ||
echo "image_repo=${OPEA_IMAGE_REPO}" >> $GITHUB_ENV | ||
else | ||
echo "image_repo=${{ github.event.inputs.registry }}/" >> $GITHUB_ENV | ||
fi | ||
- name: Build image | ||
uses: opea-project/validation/actions/image-build@main | ||
with: | ||
work_dir: ${{ github.workspace }}/${{ matrix.service }} | ||
docker_compose_path: ${{ github.workspace }}/.github/workflows/docker/compose/${{ matrix.service }}-compose.yaml | ||
registry: ${{ env.image_repo }} | ||
tag: ${{ github.event.inputs.tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters