Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transfer actions from dsp tekton. #6

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Build images from sources.
run-name: Build images from sources.
on:
workflow_call:
inputs:
src_branch:
type: string
default: 'v1.0.x'
description: 'Source branch to build DSP from'
required: true
target_tag:
type: string
default: 'vx.y.z'
description: 'Target Image Tag'
required: true
quay_org:
type: string
default: 'opendatahub'
description: 'Quay Organization'
required: true
overwrite_imgs:
type: string
default: 'true'
description: 'Overwrite images in quay if they already exist for this release.'
required: true
fail_fast:
type: string
default: 'true'
description: 'Stop running entire Workflow if a single build fails'
required: true

workflow_dispatch:
inputs:
src_branch:
type: string
default: 'v1.0.x'
description: 'Source branch to build DSP from'
required: true
target_tag:
type: string
default: 'vx.y.z'
description: 'Target Image Tag'
required: true
quay_org:
type: string
default: 'opendatahub'
description: 'Quay Organization'
required: true
overwrite_imgs:
type: string
default: 'true'
description: 'Overwrite images in quay if they already exist for this release.'
required: true
fail_fast:
type: string
default: 'true'
description: 'Stop running entire Workflow if a single build fails'
required: true
env:
SOURCE_BRANCH: ${{ inputs.src_branch }}
QUAY_ORG: ${{ inputs.quay_org }}
QUAY_ID: ${{ secrets.QUAY_ROBOT_USERNAME }}
QUAY_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }}
TARGET_IMAGE_TAG: ${{ inputs.target_tag }}
OVERWRITE_IMAGES: ${{ inputs.overwrite_imgs }}
jobs:
build-images-with-tag:
continue-on-error: false
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: ${{ inputs.fail_fast == 'true' }}
matrix:
include:
- image: ds-pipelines-api-server
dockerfile: backend/Dockerfile
- image: ds-pipelines-frontend
dockerfile: frontend/Dockerfile
- image: ds-pipelines-cacheserver
dockerfile: backend/Dockerfile.cacheserver
- image: ds-pipelines-persistenceagent
dockerfile: backend/Dockerfile.persistenceagent
- image: ds-pipelines-scheduledworkflow
dockerfile: backend/Dockerfile.scheduledworkflow
- image: ds-pipelines-viewercontroller
dockerfile: backend/Dockerfile.viewercontroller
- image: ds-pipelines-artifact-manager
dockerfile: backend/artifact_manager/Dockerfile
- image: ds-pipelines-metadata-writer
dockerfile: backend/metadata_writer/Dockerfile
- image: ds-pipelines-metadata-grpc
dockerfile: third_party/ml-metadata/Dockerfile
- image: ds-pipelines-metadata-envoy
dockerfile: third_party/metadata_envoy/Dockerfile
- image: ds-pipelines-driver
dockerfile: backend/Dockerfile.driver
- image: ds-pipelines-launcher
dockerfile: backend/Dockerfile.launcher
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build
name: Build Image
with:
IMAGE_REPO: ${{ matrix.image }}
DOCKERFILE: ${{ matrix.dockerfile }}
GH_REPO: ${{ github.repository }}
OVERWRITE: ${{ env.OVERWRITE_IMAGES }}
77 changes: 77 additions & 0 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build images for Master branch
on:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
env:
QUAY_ORG: opendatahub
QUAY_ID: ${{ secrets.QUAY_ROBOT_USERNAME }}
QUAY_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }}
SOURCE_BRANCH: master
jobs:
build-master-images:
continue-on-error: false
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- image: ds-pipelines-api-server
dockerfile: backend/Dockerfile
- image: ds-pipelines-frontend
dockerfile: frontend/Dockerfile
- image: ds-pipelines-cacheserver
dockerfile: backend/Dockerfile.cacheserver
- image: ds-pipelines-persistenceagent
dockerfile: backend/Dockerfile.persistenceagent
- image: ds-pipelines-scheduledworkflow
dockerfile: backend/Dockerfile.scheduledworkflow
- image: ds-pipelines-viewercontroller
dockerfile: backend/Dockerfile.viewercontroller
- image: ds-pipelines-artifact-manager
dockerfile: backend/artifact_manager/Dockerfile
- image: ds-pipelines-metadata-writer
dockerfile: backend/metadata_writer/Dockerfile
- image: ds-pipelines-metadata-grpc
dockerfile: third_party/ml-metadata/Dockerfile
- image: ds-pipelines-metadata-envoy
dockerfile: third_party/metadata_envoy/Dockerfile
- image: ds-pipelines-driver
dockerfile: backend/Dockerfile.driver
- image: ds-pipelines-launcher
dockerfile: backend/Dockerfile.launcher
steps:
- uses: actions/checkout@v3
- name: Generate Tag
shell: bash
id: tags
env:
SOURCE_BRANCH: ${{ env.SOURCE_BRANCH }}
run: |
commit_sha=${{ github.event.after }}
tag=${SOURCE_BRANCH}-${commit_sha:0:7}
echo "tag=${tag}" >> $GITHUB_OUTPUT
- name: Build Image
uses: ./.github/actions/build
env:
IMG: quay.io/${{ env.QUAY_ORG }}/${{ matrix.image }}:${{ steps.tags.outputs.tag }}
TARGET_IMAGE_TAG: ${{ steps.tags.outputs.tag }}
with:
OVERWRITE: true
IMAGE_REPO: ${{ matrix.image }}
DOCKERFILE: ${{ matrix.dockerfile }}
GH_REPO: ${{ github.repository }}
- name: Tag latest
shell: bash
env:
IMG: quay.io/${{ env.QUAY_ORG }}/${{ matrix.image }}
NEWEST_TAG: ${{ steps.tags.outputs.tag }}
SOURCE_BRANCH: ${{ env.SOURCE_BRANCH }}
run: |
podman tag ${IMG}:${NEWEST_TAG} ${IMG}:latest
podman push ${IMG}:latest
podman tag ${IMG}:${NEWEST_TAG} ${IMG}:${SOURCE_BRANCH}
podman push ${IMG}:${SOURCE_BRANCH}
33 changes: 33 additions & 0 deletions .github/workflows/build-prs-trigger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Trigger build images for PRs
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'guides/**'
- 'images/**'
- '**/README.md'
types:
- opened
- reopened
- closed
- synchronize
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
upload-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Save PR payload
shell: bash
run: |
mkdir -p ./pr
echo ${{ github.event.pull_request.number }} >> ./pr/pr_number
echo ${{ github.event.pull_request.state }} >> ./pr/pr_state
echo ${{ github.event.pull_request.head.sha }} >> ./pr/head_sha
echo ${{ github.event.action }} >> ./pr/event_action
- uses: actions/upload-artifact@v2
with:
name: pr
path: pr/
Loading
Loading