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

refactor dir structure for helm #1360

Merged
merged 4 commits into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
57 changes: 36 additions & 21 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
required: true

jobs:
goreleaser:
name: Goreleaser
bump-version:
name: bump-version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.bump-version.outputs.tag }}
Expand All @@ -25,42 +25,57 @@ jobs:
WITH_V: true
CUSTOM_TAG: ${{ github.event.inputs.version }}
RELEASE_BRANCHES: master
- uses: actions/checkout@v2

helm-release:
name: Flyte helm release
runs-on: ubuntu-latest
needs: [ bump-version ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"

- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0

- name: Configure Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
- name: Preprare Flyte Helm Release
env:
VERSION: ${{ needs.bump-version.outputs.version }}
REPOSITORY: "https://flyteorg.github.io/flyte"
run: |
make prepare_artifacts
- name: Run chart-releaser
uses: stefanprodan/[email protected]
with:
token: "${{ secrets.FLYTE_BOT_PAT }}"
linting: off
yindia marked this conversation as resolved.
Show resolved Hide resolved


manifest-release:
name: Flyte manifest release
runs-on: ubuntu-latest
needs: [ bump-version ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"

- name: Preprare Flyte Release
env:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
VERSION: ${{ github.event.inputs.version }}
VERSION: ${{ needs.bump-version.outputs.version }}
run: |
grep -rlZ "version:[^P]*# VERSION" ./helm/Chart.yaml | xargs -0 sed -i "s/version:[^P]*# VERSION/version: ${VERSION} # VERSION/g"
sed -i "s/v0.1.10/${VERSION}/g" ./helm/README.md
VERSION=$VERSION make prepare_artifacts

make prepare_artifacts
git stash
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --release-notes=CHANGELOG/CHANGELOG-${{ github.event.inputs.version }}.md
env:
GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }}

- name: Release helm registry
env:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
VERSION: ${{ github.event.inputs.version }}
run: |
grep -rlZ "version:[^P]*# VERSION" ./helm/Chart.yaml | xargs -0 sed -i "s/version:[^P]*# VERSION/version: ${VERSION} # VERSION/g"
# Commit Chart registry to github gh-pages
bin/cr index --owner flyteorg --git-repo flyte --charts-repo="https://flyteorg.github.io/flyte" --push --token=${FLYTE_BOT_PAT} --release-name-template="{{ .Version }}"
GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }}
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ docs/searchindex.js
docs/
release/
__pycache__/
/helm/charts/
Chart.lock
/charts/flyte/charts
/charts/flyte/Chart.lock
**/*.bak-
.cr-release-packages/
.cr-index/
bin/-
bin/
.python-version
3 changes: 1 addition & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ release:
name_template: "Flyte v{{.Version}} milestone release"
disable: false
extra_files:
- glob: ./release/*
- glob: .cr-release-packages/
- glob: ./release/*
File renamed without changes.
File renamed without changes.
73 changes: 40 additions & 33 deletions helm/README.md → charts/flyte/README.md

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions script/generate_helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ DEPLOYMENT=${1:-sandbox eks gcp}

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

helm dep update ${DIR}/../helm/
helm dep update ${DIR}/../charts/flyte/

for deployment in ${DEPLOYMENT}; do
helm template flyte -n flyte ${DIR}/../helm/ -f ${DIR}/../helm/values-${deployment}.yaml > ${DIR}/../deployment/${deployment}/flyte_helm_generated.yaml
helm template flyte -n flyte ${DIR}/../charts/flyte/ -f ${DIR}/../charts/flyte/values-${deployment}.yaml > ${DIR}/../deployment/${deployment}/flyte_helm_generated.yaml
done

echo "Generating helm docs"
Expand All @@ -21,7 +21,7 @@ then
GO111MODULE=on go get github.com/norwoodj/helm-docs/cmd/helm-docs
fi

${GOPATH:-~/go}/bin/helm-docs -t ${DIR}/../helm/README.md.gotmpl ${DIR}/../helm/
${GOPATH:-~/go}/bin/helm-docs -t ${DIR}/../charts/flyte/README.md.gotmpl ${DIR}/../charts/flyte/

# This section is used by GitHub workflow to ensure that the generation step was run
if [ -n "$DELTA_CHECK" ]; then
Expand Down
21 changes: 5 additions & 16 deletions script/prepare_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,17 @@
set -e

# Create dir structure
mkdir -p release .cr-index .cr-release-packages
mkdir -p release

# Copy all deployment manifest in release directory
for file in ./deployment/**/flyte_generated.yaml; do
for file in ./deployment/**/flyte_generated.yaml; do
if [ -f "$file" ]; then
result=${file/#"./deployment/"}
result=${result/%"/flyte_generated.yaml"}
cp $file "./release/flyte_${result}_manifest.yaml"
fi
done

grep -rlZ "version:[^P]*# VERSION" ./helm/Chart.yaml | xargs -0 sed -i "s/version:[^P]*# VERSION/version: ${VERSION} # VERSION/g"

# Download helm chart releaser
wget -q -O /tmp/chart-releaser.tar.gz https://github.com/helm/chart-releaser/releases/download/v1.2.1/chart-releaser_1.2.1_linux_amd64.tar.gz
mkdir -p bin
tar -xf /tmp/chart-releaser.tar.gz -C bin
chmod +x bin/cr
rm /tmp/chart-releaser.tar.gz

# Package helm chart
bin/cr package helm

# Clean git history
git stash
grep -rlZ "version:[^P]*# VERSION" ./charts/flyte/Chart.yaml | xargs -0 sed -i "s/version:[^P]*# VERSION/version: ${VERSION} # VERSION/g"
sed "s/v0.1.10/${VERSION}/g" ./charts/flyte/README.md > temp.txt && mv temp.txt ./charts/flyte/README.md
helm dep update ./charts/flyte