-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support to specify scheduler policy and release (#197)
Signed-off-by: vsoch <[email protected]> Co-authored-by: vsoch <[email protected]>
- Loading branch information
Showing
28 changed files
with
516 additions
and
112 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,142 @@ | ||
name: flux operator tag and release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_tag: | ||
description: Custom release tag | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
build-arm: | ||
runs-on: ubuntu-latest | ||
name: make and build arm | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Set tag | ||
run: | | ||
echo "Tag for release is ${{ inputs.release_tag }}" | ||
echo "tag=${{ inputs.release_tag }}" >> ${GITHUB_ENV} | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ^1.18.1 | ||
- name: GHCR Login | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Add custom buildx ARM builder | ||
run: | | ||
docker buildx create --name armbuilder | ||
docker buildx use armbuilder | ||
docker buildx inspect --bootstrap | ||
- name: Deploy Container | ||
env: | ||
tag: ${{ env.tag }} | ||
run: make arm-deploy ARMIMG=ghcr.io/flux-framework/flux-operator:${tag}-arm | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
command: [bundle, catalog, docker] | ||
name: make and build ${{ matrix.command }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ^1.18.1 | ||
- name: Set tag | ||
run: | | ||
echo "Tag for release is ${{ inputs.release_tag }}" | ||
echo "tag=${{ inputs.release_tag }}" >> ${GITHUB_ENV} | ||
- name: GHCR Login | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build Container | ||
env: | ||
tag: ${{ env.tag }} | ||
run: | | ||
image=ghcr.io/flux-framework/flux-operator-${{ matrix.command }}:v${tag} | ||
img=ghcr.io/flux-framework/flux-operator:v${tag} | ||
make ${{ matrix.command }}-build BUNDLE_IMG=${image} IMG=${img} CATALOG_IMG=${image} | ||
- name: Deploy Container | ||
env: | ||
tag: ${{ env.tag }} | ||
run: | | ||
image=ghcr.io/flux-framework/flux-operator-${{ matrix.command }}:v${tag} | ||
img=ghcr.io/flux-framework/flux-operator:v${tag} | ||
make ${{ matrix.command }}-push BUNDLE_IMG=${image} IMG=${img} CATALOG_IMG=${image} | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ^1.18.1 | ||
- name: Set tag | ||
run: | | ||
echo "Tag for release is ${{ inputs.release_tag }}" | ||
echo "tag=${{ inputs.release_tag }}" >> ${GITHUB_ENV} | ||
- name: Install | ||
run: conda create --quiet --name fo twine | ||
- name: Install dependencies | ||
run: | | ||
export PATH="/usr/share/miniconda/bin:$PATH" | ||
source activate fo | ||
pip install -e . | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USER }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }} | ||
tag: ${{ env.tag }} | ||
run: | | ||
export PATH="/usr/share/miniconda/bin:$PATH" | ||
source activate fo | ||
cd sdk/python/v1alpha1/ | ||
python setup.py sdist bdist_wheel | ||
cd dist | ||
wheelfile=$(ls fluxoperator-*.whl) | ||
wheelfile=$(echo "$wheelfile" | sed "s/fluxoperator-//") | ||
wheelfile=$(echo "$wheelfile" | sed "s/-py3-none-any.whl//") | ||
echo "Release for Python is ${wheelfile}" | ||
echo "Release for flux operator is ${tag}" | ||
if [[ "${wheelfile}" == "${tag}" ]]; then | ||
echo "Versions are correct, publishing." | ||
twine upload dist/* | ||
else | ||
echo "Versions are not correct, please fix and upload locally." | ||
fi | ||
- name: Build release manifests | ||
env: | ||
tag: ${{ env.tag }} | ||
run: | | ||
make build-config-arm ARMIMG=ghcr.io/flux-framework/flux-operator:${tag}-arm | ||
make build-config IMG=ghcr.io/flux-framework/flux-operator:v${tag} | ||
- name: Release Flux Operator | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: Flux Operator Release v${{ env.tag }} | ||
tag_name: ${{ env.tag }} | ||
body_path: CHANGELOG.md | ||
body: "flux operator release ${{ env.tag }}" | ||
files: | | ||
examples/dist/flux-operator-arm.yaml | ||
examples/dist/flux-operator.yaml | ||
env: | ||
GITHUB_REPOSITORY: flux-framework/flux-operator |
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
Oops, something went wrong.