Skip to content

Commit

Permalink
push metaprovisioner chart
Browse files Browse the repository at this point in the history
  • Loading branch information
denarsh committed Aug 20, 2024
1 parent 2bf4393 commit 8ce07ed
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 176 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/branch-naming-convention.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@ jobs:
allowed_prefixes: 'DEV-,weekly-rc-,DEVOPS-,quality-' # All branches should start with the given prefix
ignore: master,main,saas # Ignore exactly matching branch names from convention
min_length: 5 # Min length of the branch name
max_length: 300 # Max length of the branch name
max_length: 300 # Max length of the branch name
- name: Package and release helm
env:
CHARTMUSEUM_USER: ${{ secrets.CHARTMUSEUM_USER }}
CHARTMUSEUM_PASSWORD: ${{ secrets.CHARTMUSEUM_PASSWORD }}
run: |
helm plugin install https://github.com/chartmuseum/helm-push.git
helm repo add cnvrg https://charts.slim.cnvrg.io/cnvrg
# helm dependency build charts/mlops
helm cm-push charts/metastorageprovisioner -f cnvrg -u=${CHARTMUSEUM_USER} -p=${CHARTMUSEUM_PASSWORD} --context-path /cnvrg
341 changes: 170 additions & 171 deletions .github/workflows/docker-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Docker Image CI

on:
push:
workflow_dispatch:
inputs:
msg:
description: "Msg instead of commit log"
required: true
default: 'false'
# workflow_dispatch:
# inputs:
# msg:
# description: "Msg instead of commit log"
# required: true
# default: 'false'
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -40,176 +40,175 @@ jobs:
# run: |
# helm install cnvrg ./charts/cnvrg-operator --dry-run --namespace=cnvrg-system --debug
# helm install cnvrg ./charts/cnvrg-cap --dry-run --namespace=cnvrg --debug

- name: Bump version and push tag
uses: AccessibleAI/[email protected]
id: tag_bump
env:
MSG: ${{ github.event.inputs.msg }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRERELEASE_AUTOMATIC_BUMP: true
WITH_V: false

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: x64
if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}

- name: Extract repo/branch name
shell: bash
if: ${{ steps.tag_bump.outputs.bumped == 'true' }}
run: |
echo "::set-output name=docker_repo::cnvrg-operator"
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/*/})"
echo "##[set-output name=head;]$(git rev-parse --short HEAD)"
echo "##[set-output name=repo_url;]$(echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY)"
id: extract_info

- name: Login to Docker Hub
uses: docker/login-action@v1
if: ${{ steps.tag_bump.outputs.bumped == 'true' }}
with:
username: ${{ secrets.DOCKER_USER}}
password: ${{ secrets.DOCKER_PASSWORD}}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
if: ${{ steps.tag_bump.outputs.bumped == 'true' }}

- name: Build and push main latest
id: docker_build_main
uses: docker/build-push-action@v2
if: ${{ steps.tag_bump.outputs.bumped == 'true' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/main') }}
with:
context: ./
file: ./Dockerfile
push: true
tags: cnvrg/${{ steps.extract_info.outputs.docker_repo }}:latest
build-args: |
BUILD_SHA=${{ steps.extract_info.outputs.head }}
BUILD_VERSION=latest
- name: Build and push tagged image
id: docker_build_tag
uses: docker/build-push-action@v2
if: ${{ steps.tag_bump.outputs.bumped == 'true' && (github.ref == 'refs/heads/main') }}
with:
context: ./
file: ./Dockerfile
push: true
tags: cnvrg/${{ steps.extract_info.outputs.docker_repo }}:${{ steps.tag_bump.outputs.new_tag }}
build-args: |
BUILD_SHA=${{ steps.extract_info.outputs.head }}
BUILD_VERSION=${{ steps.tag_bump.outputs.new_tag }}
private_repo=github.com/AccessibleAI/cnvrg-operator
git_auth=${{ secrets.CNVRG_RUNNER_AUTH }}
- name: Build and push tagged image
id: docker_build_tag_branch
uses: docker/build-push-action@v2
if: ${{ steps.tag_bump.outputs.bumped == 'true' && (github.ref != 'refs/heads/main') }}
with:
context: ./
file: ./Dockerfile
push: true
tags: cnvrg/${{ steps.extract_info.outputs.docker_repo }}:${{ steps.tag_bump.outputs.new_tag }}
build-args: |
BUILD_SHA=${{ steps.extract_info.outputs.head }}
BUILD_VERSION=${{ steps.tag_bump.outputs.new_tag }}
private_repo=github.com/AccessibleAI/cnvrg-operator
git_auth=${{ secrets.CNVRG_RUNNER_AUTH }}
- name: Generate Cnvrg Changelog
uses: AccessibleAI/[email protected]
id: cnvrg_changelog
with:
from_version: ${{ steps.tag_bump.outputs.tag }}
to_version: ${{ steps.tag_bump.outputs.new_tag }}
jira_token: ${{ secrets.JIRA_TOKEN }}
slack_webhook_url: false
if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}

- name: Generate Non Cnvrg Changelog
id: changelog
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
head-ref: ${{ steps.tag_bump.outputs.tag }}
base-ref: ${{ steps.tag_bump.outputs.new_tag }}
if: ${{ steps.cnvrg_changelog.outputs.empty == 'true' && steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}

- name: Generate changelog
id: changelog_final
if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}
run: |
set -o noglob
if ${{ steps.cnvrg_changelog.outputs.empty }}; then
log=$(cat << "EOF"
${{ steps.changelog.outputs.changelog }}
EOF
)
else
log=$(cat << "EOF"
${{ steps.cnvrg_changelog.outputs.changelog }}
EOF
)
fi
log="${log//'%'/'%25'}"
log="${log//$'\n'/'%0A'}"
log="${log//$'\r'/'%0D'}"
echo "::set-output name=changelog::$log"
- name: Print the final changelog
if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}
run: |
cat << "EOF"
${{ steps.changelog_final.outputs.changelog }}
EOF
- name: Changelog Release
uses: softprops/action-gh-release@v1
with:
body: ${{steps.changelog_final.outputs.changelog}}
tag_name: ${{ steps.tag_bump.outputs.new_tag }}
prerelease: ${{ steps.tag_bump.outputs.prerelease }}
generate_release_notes: true
if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}

- name: Change Chart Version
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
run: |
sed -i 's#5.1.0#${{ steps.tag_bump.outputs.new_tag }}#g' charts/mlops/Chart.yaml
cat charts/mlops/Chart.yaml
#
# - name: Bump version and push tag
# uses: AccessibleAI/[email protected]
# id: tag_bump
# env:
# MSG: ${{ github.event.inputs.msg }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PRERELEASE_AUTOMATIC_BUMP: true
# WITH_V: false
#
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.9'
# architecture: x64
# if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}
#
# - name: Extract repo/branch name
# shell: bash
# if: ${{ steps.tag_bump.outputs.bumped == 'true' }}
# run: |
# echo "::set-output name=docker_repo::cnvrg-operator"
# echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/*/})"
# echo "##[set-output name=head;]$(git rev-parse --short HEAD)"
# echo "##[set-output name=repo_url;]$(echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY)"
# id: extract_info
#
# - name: Login to Docker Hub
# uses: docker/login-action@v1
# if: ${{ steps.tag_bump.outputs.bumped == 'true' }}
# with:
# username: ${{ secrets.DOCKER_USER}}
# password: ${{ secrets.DOCKER_PASSWORD}}
#
# - name: Set up Docker Buildx
# id: buildx
# uses: docker/setup-buildx-action@v1
# if: ${{ steps.tag_bump.outputs.bumped == 'true' }}
#
# - name: Build and push main latest
# id: docker_build_main
# uses: docker/build-push-action@v2
# if: ${{ steps.tag_bump.outputs.bumped == 'true' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/main') }}
# with:
# context: ./
# file: ./Dockerfile
# push: true
# tags: cnvrg/${{ steps.extract_info.outputs.docker_repo }}:latest
# build-args: |
# BUILD_SHA=${{ steps.extract_info.outputs.head }}
# BUILD_VERSION=latest
#
# - name: Build and push tagged image
# id: docker_build_tag
# uses: docker/build-push-action@v2
# if: ${{ steps.tag_bump.outputs.bumped == 'true' && (github.ref == 'refs/heads/main') }}
# with:
# context: ./
# file: ./Dockerfile
# push: true
# tags: cnvrg/${{ steps.extract_info.outputs.docker_repo }}:${{ steps.tag_bump.outputs.new_tag }}
# build-args: |
# BUILD_SHA=${{ steps.extract_info.outputs.head }}
# BUILD_VERSION=${{ steps.tag_bump.outputs.new_tag }}
# private_repo=github.com/AccessibleAI/cnvrg-operator
# git_auth=${{ secrets.CNVRG_RUNNER_AUTH }}
#
# - name: Build and push tagged image
# id: docker_build_tag_branch
# uses: docker/build-push-action@v2
# if: ${{ steps.tag_bump.outputs.bumped == 'true' && (github.ref != 'refs/heads/main') }}
# with:
# context: ./
# file: ./Dockerfile
# push: true
# tags: cnvrg/${{ steps.extract_info.outputs.docker_repo }}:${{ steps.tag_bump.outputs.new_tag }}
# build-args: |
# BUILD_SHA=${{ steps.extract_info.outputs.head }}
# BUILD_VERSION=${{ steps.tag_bump.outputs.new_tag }}
# private_repo=github.com/AccessibleAI/cnvrg-operator
# git_auth=${{ secrets.CNVRG_RUNNER_AUTH }}
#
# - name: Generate Cnvrg Changelog
# uses: AccessibleAI/[email protected]
# id: cnvrg_changelog
# with:
# from_version: ${{ steps.tag_bump.outputs.tag }}
# to_version: ${{ steps.tag_bump.outputs.new_tag }}
# jira_token: ${{ secrets.JIRA_TOKEN }}
# slack_webhook_url: false
# if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}
#
# - name: Generate Non Cnvrg Changelog
# id: changelog
# uses: metcalfc/[email protected]
# with:
# myToken: ${{ secrets.GITHUB_TOKEN }}
# head-ref: ${{ steps.tag_bump.outputs.tag }}
# base-ref: ${{ steps.tag_bump.outputs.new_tag }}
# if: ${{ steps.cnvrg_changelog.outputs.empty == 'true' && steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}
#
# - name: Generate changelog
# id: changelog_final
# if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}
# run: |
# set -o noglob
# if ${{ steps.cnvrg_changelog.outputs.empty }}; then
# log=$(cat << "EOF"
# ${{ steps.changelog.outputs.changelog }}
# EOF
# )
# else
# log=$(cat << "EOF"
# ${{ steps.cnvrg_changelog.outputs.changelog }}
# EOF
# )
# fi
# log="${log//'%'/'%25'}"
# log="${log//$'\n'/'%0A'}"
# log="${log//$'\r'/'%0D'}"
# echo "::set-output name=changelog::$log"
#
# - name: Print the final changelog
# if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}
# run: |
# cat << "EOF"
# ${{ steps.changelog_final.outputs.changelog }}
# EOF
#
# - name: Changelog Release
# uses: softprops/action-gh-release@v1
# with:
# body: ${{steps.changelog_final.outputs.changelog}}
# tag_name: ${{ steps.tag_bump.outputs.new_tag }}
# prerelease: ${{ steps.tag_bump.outputs.prerelease }}
# generate_release_notes: true
# if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}
#
# - name: Change Chart Version
# if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
# run: |
# sed -i 's#5.1.0#${{ steps.tag_bump.outputs.new_tag }}#g' charts/mlops/Chart.yaml
# cat charts/mlops/Chart.yaml

- name: Package and release helm
if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}
env:
CHARTMUSEUM_USER: ${{ secrets.CHARTMUSEUM_USER }}
CHARTMUSEUM_PASSWORD: ${{ secrets.CHARTMUSEUM_PASSWORD }}
run: |
helm plugin install https://github.com/chartmuseum/helm-push.git
helm repo add cnvrg https://charts.slim.cnvrg.io/cnvrg
helm dependency build charts/mlops
helm cm-push charts/mlops -f cnvrg -u=${CHARTMUSEUM_USER} -p=${CHARTMUSEUM_PASSWORD} --context-path /cnvrg
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}
env:
SLACK_USERNAME: Github Actions
SLACK_WEBHOOK: ${{ secrets.SLACK_GITHUB_APP_TOKEN }}
SLACK_CHANNEL: "#release-notes"
SLACK_ICON: https://avatars.githubusercontent.com/u/44036562?s=48&v=4
SLACK_COLOR: ${{ job.status }}
SLACK_FOOTER: ""
MSG_MINIMAL: true
SLACK_TITLE: "Repo Name"
SLACK_MESSAGE: |
<${{ steps.extract_info.outputs.repo_url }}|${{github.event.repository.name}}>
*Docker Image: cnvrg/${{ steps.extract_info.outputs.docker_repo }}:${{ steps.tag_bump.outputs.new_tag }}*
*Version: ${{ steps.tag_bump.outputs.new_tag }}*
<${{ steps.extract_info.outputs.repo_url }}/releases|Release Notes:>
${{steps.changelog_final.outputs.changelog}}
# helm dependency build charts/mlops
helm cm-push charts/metastorageprovisioner -f cnvrg -u=${CHARTMUSEUM_USER} -p=${CHARTMUSEUM_PASSWORD} --context-path /cnvrg
#
# - name: Slack Notification
# uses: rtCamp/action-slack-notify@v2
# if: ${{ steps.tag_bump.outputs.bumped == 'true' && steps.tag_bump.outputs.prerelease == 'false' }}
# env:
# SLACK_USERNAME: Github Actions
# SLACK_WEBHOOK: ${{ secrets.SLACK_GITHUB_APP_TOKEN }}
# SLACK_CHANNEL: "#release-notes"
# SLACK_ICON: https://avatars.githubusercontent.com/u/44036562?s=48&v=4
# SLACK_COLOR: ${{ job.status }}
# SLACK_FOOTER: ""
# MSG_MINIMAL: true
# SLACK_TITLE: "Repo Name"
# SLACK_MESSAGE: |
# <${{ steps.extract_info.outputs.repo_url }}|${{github.event.repository.name}}>
# *Docker Image: cnvrg/${{ steps.extract_info.outputs.docker_repo }}:${{ steps.tag_bump.outputs.new_tag }}*
# *Version: ${{ steps.tag_bump.outputs.new_tag }}*
# <${{ steps.extract_info.outputs.repo_url }}/releases|Release Notes:>
# ${{steps.changelog_final.outputs.changelog}}
4 changes: 2 additions & 2 deletions charts/metastorageprovisioner/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: metastorageprovisioner
description: A cnvrg.io storage provisioner
type: application
version: 5.1.0
appVersion: 5.1.0
version: 1.0.0
appVersion: 1.0.0
4 changes: 2 additions & 2 deletions charts/mlops/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ dependencies:
repository: https://charts.slim.cnvrg.io/cnvrg
condition: cvatdbs.enabled
- name: metastorageprovisioner
version: 5.1.0
repository: file://../metastorageprovisioner
version: 1.0.0
repository: https://charts.slim.cnvrg.io/cnvrg
condition: metastorageprovisioner.enabled


0 comments on commit 8ce07ed

Please sign in to comment.