Skip to content

Commit

Permalink
UPSTREAM: <carry>: transfer actions from dsp tekton.
Browse files Browse the repository at this point in the history
Signed-off-by: Humair Khan <[email protected]>
  • Loading branch information
HumairAK committed Jan 19, 2024
1 parent c49ae1f commit 193a0b6
Show file tree
Hide file tree
Showing 7 changed files with 599 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/add-issues-to-dsp-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Add Issues to ODH Data Science Pipelines Planning Project
on:
issues:
types:
- opened
jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/opendatahub-io/projects/43
github-token: ${{ secrets.GH_TOKEN_PROJECT_EDIT }}
14 changes: 14 additions & 0 deletions .github/workflows/add-issues-to-odh-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Add Issues to ODH Feature Tracking Project
on:
issues:
types:
- opened
jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/opendatahub-io/projects/40
github-token: ${{ secrets.GH_TOKEN_PROJECT_EDIT }}
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

0 comments on commit 193a0b6

Please sign in to comment.