-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to make-env for build env managment, add script to run in dock…
…erfile
- Loading branch information
Showing
10 changed files
with
722 additions
and
235 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 |
---|---|---|
|
@@ -17,16 +17,10 @@ env: | |
|
||
HELM_REPO: "oci://ghcr.io/${{ github.repository }}/charts" | ||
|
||
GO_VERSION: 1.20.4 | ||
|
||
GOPRIVATE: 'github.com/meln5674/*' | ||
|
||
HELM_VERSION: v3.12.0 | ||
|
||
COSIGN_VERSION: v1.13.0 | ||
|
||
YQ_VERSION: v4.27.2 | ||
|
||
jobs: | ||
lint: | ||
# runs-on: ubuntu-latest | ||
|
@@ -38,37 +32,19 @@ jobs: | |
# Checkout | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Install deps | ||
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: '${{ env.HELM_VERSION }}' | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '^${{ env.GO_VERSION }}' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
make deps | ||
make -j deps all-helm-tools chart-deps | ||
# Run Linter | ||
- name: Lint standalone chart | ||
run: | | ||
cd deploy/helm/mlflow-oidc-proxy | ||
../../../bin/helm dependency build | ||
../../../bin/helm-hog test --no-apply --batch --auto-remove-success --parallel=0 | ||
- name: Lint omnibus dependencies chart | ||
run: | | ||
cd deploy/helm/mlflow-multitenant-deps | ||
../../../bin/helm lint . | ||
../../../bin/helm template . | ||
- name: Lint omnibus chart | ||
run: | | ||
cd deploy/helm/mlflow-multitenant | ||
../../../bin/helm dependency build | ||
../../../bin/helm-hog test --no-apply --batch --auto-remove-success --parallel=0 | ||
make helm-hog | ||
test: | ||
# runs-on: ubuntu-latest | ||
|
@@ -83,36 +59,25 @@ jobs: | |
with: | ||
submodules: true | ||
|
||
|
||
# Install Deps | ||
|
||
# Workaround: https://github.com/docker/build-push-action/issues/461 | ||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf | ||
|
||
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: '${{ env.HELM_VERSION }}' | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '^${{ env.GO_VERSION }}' | ||
- name: Setup Build Environment | ||
run: | | ||
./build-env.sh echo Done | ||
- name: Install Dependencies | ||
run: | | ||
make deps | ||
bin/helm dependency build deploy/helm/mlflow-oidc-proxy | ||
bin/helm dependency build deploy/helm/mlflow-multitenant | ||
bin/helm dependency build deploy/helm/mlflow-multitenant-deps | ||
./build-env.sh make -j deps all-test-tools all-e2e-tools chart-deps | ||
# Tests | ||
- name: Unit Tests | ||
run: | | ||
make test | ||
./build-env.sh make test | ||
- name: End-to-End Tests | ||
run: | | ||
make e2e IS_CI=1 | ||
./build-env.sh make e2e IS_CI=1 | ||
|
||
docker: | ||
|
@@ -148,22 +113,6 @@ jobs: | |
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf | ||
|
||
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: '${{ env.HELM_VERSION }}' | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '^${{ env.GO_VERSION }}' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
make deps | ||
# Configuration/metdata | ||
|
||
# Login against a Docker registry except on PR | ||
# https://github.com/docker/login-action | ||
- name: Log into registry ${{ env.REGISTRY }} | ||
|
@@ -244,54 +193,34 @@ jobs: | |
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Setup Build Environment | ||
run: | | ||
./build-env.sh echo Done | ||
# Install Deps | ||
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: '${{ env.HELM_VERSION }}' | ||
|
||
- name: Install YQ | ||
uses: chrisdickinson/setup-yq@latest | ||
with: | ||
yq-version: '${{ env.YQ_VERSION }}' | ||
- name: Install Dependencies | ||
run: | | ||
./build-env.sh make -j all-helm-tools | ||
./build-env.sh helm repo add jetstack https://charts.jetstack.io | ||
./build-env.sh helm repo add zalando https://opensource.zalando.com/postgres-operator/charts/postgres-operator | ||
./build-env.sh make -j chart-deps | ||
- name: Log into Registry | ||
run: | | ||
./build-env.sh helm registry login "${REGISTRY}" -u "${GITHUB_ACTOR}" -p "${GITHUB_TOKEN}" | ||
- name: Package Charts | ||
env: | ||
GIT_TAG: '${{ steps.tagName.outputs.tag }}' | ||
run: | | ||
./build-env.sh ./set-chart-versions "${HELM_REPO}" "${GIT_TAG}" "${GITHUB_SHA}" | ||
./build-env.sh make -j charts | ||
# Release charts | ||
- name: Push Charts | ||
env: | ||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | ||
run: | | ||
set -x | ||
helm registry login "${REGISTRY}" -u "${GITHUB_ACTOR}" -p "${GITHUB_TOKEN}" | ||
GIT_TAG="${{ steps.tagName.outputs.tag }}" | ||
CHART_APPVERSION="${GIT_TAG:-${GITHUB_SHA}}" | ||
if [ -n "${GIT_TAG}" ]; then | ||
NEW_VERSION_EXPR='"'"${GIT_TAG}"'"' | ||
else | ||
NEW_VERSION_EXPR='.version + "-'"${GITHUB_SHA}"'"' | ||
fi | ||
mkdir -p deploy/helm | ||
for chart in mlflow-oidc-proxy mlflow-multitenant-deps mlflow-multitenant; do | ||
yq -i '.version = '"${NEW_VERSION_EXPR}"'' "deploy/helm/${chart}/Chart.yaml" | ||
for chart in bin/charts/*.tgz ; do | ||
helm push "${chart}" "${HELM_REPO}" | ||
done | ||
yq -i '.appVersion = "'"${CHART_APPVERSION}"'"' "deploy/helm/mlflow-oidc-proxy/Chart.yaml" | ||
STANDALONE_CHART_VERSION="$(yq '.version' 'deploy/helm/mlflow-oidc-proxy/Chart.yaml')" | ||
yq -i '(.dependencies[] | select(.name == "mlflow-oidc-proxy")).version |= "'"${STANDALONE_CHART_VERSION}"'"' 'deploy/helm/mlflow-multitenant/Chart.yaml' | ||
yq -i '(.dependencies[] | select(.name == "mlflow-oidc-proxy")).repository |= "'"${HELM_REPO}"'"' 'deploy/helm/mlflow-multitenant/Chart.yaml' | ||
helm repo add jetstack https://charts.jetstack.io | ||
helm repo add zalando https://opensource.zalando.com/postgres-operator/charts/postgres-operator | ||
helm dependency build deploy/helm/mlflow-multitenant-deps | ||
helm package deploy/helm/mlflow-oidc-proxy/ --destination bin | ||
helm package deploy/helm/mlflow-multitenant-deps/ --destination bin | ||
helm push bin/mlflow-oidc-proxy-*.tgz "${HELM_REPO}" | ||
helm push bin/mlflow-multitenant-deps-*.tgz "${HELM_REPO}" | ||
rm -rf bin/*.tgz # The wildcard below matches the deps chart, this is a hack-y workaround | ||
helm dependency build deploy/helm/mlflow-multitenant | ||
helm package deploy/helm/mlflow-multitenant/ --destination bin | ||
helm push bin/mlflow-multitenant-*.tgz "${HELM_REPO}" | ||
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.