Skip to content

chore(deps): bump the all-other-deps group across 4 directories with 3 updates #151

chore(deps): bump the all-other-deps group across 4 directories with 3 updates

chore(deps): bump the all-other-deps group across 4 directories with 3 updates #151

Workflow file for this run

name: MLflow CI
on:
pull_request:
paths:
- 'applications/mlflow/charts/**'
- 'applications/mlflow/kots/**'
- 'applications/mlflow/tests/**'
- 'applications/mlflow/Taskfile.yml'
- '.github/workflows/mlflow-ci.yml'
push:
branches:
- main
paths:
- 'applications/mlflow/charts/**'
- 'applications/mlflow/kots/**'
- 'applications/mlflow/tests/**'
- 'applications/mlflow/Taskfile.yml'
- '.github/workflows/mlflow-ci.yml'
env:
APP_SLUG: diamon-mlflow
REPLICATED_APP: diamon-mlflow
YQ_VERSION: v4.44.6
jobs:
lint-and-template:
runs-on: ubuntu-22.04
outputs:
helm-cache-key: ${{ steps.helm-deps.outputs.cache-key }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4.3.0
with:
version: v3.13.3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install yq
run: |
wget -q https://github.com/mikefarah/yq/releases/download/${{ env.YQ_VERSION }}/yq_linux_amd64 -O /usr/local/bin/yq
chmod +x /usr/local/bin/yq
- name: Cache Helm dependencies
id: helm-deps
uses: actions/cache@v4
with:
path: |
applications/mlflow/charts/mlflow/charts/
applications/mlflow/charts/infra/charts/
key: helm-deps-${{ hashFiles('applications/mlflow/charts/*/Chart.lock') }}
restore-keys: helm-deps-
- name: Run Lint and Template
working-directory: applications/mlflow
run: |
task helm:update-deps
task helm:lint
task helm:template
- name: Upload rendered templates
if: failure()
uses: actions/upload-artifact@v4
with:
name: mlflow-rendered-templates
path: applications/mlflow/charts/.rendered-templates/
retention-days: 7
- name: Check Version Consistency
working-directory: applications/mlflow
run: |
task versions:verify
create-release:
runs-on: ubuntu-22.04
needs: [lint-and-template]
outputs:
customer-id: ${{ steps.create-customer.outputs.customer-id }}
channel-slug: ${{ steps.create-release.outputs.channel-slug }}
chart-version: ${{ steps.chart-version.outputs.chart_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4.3.0
with:
version: v3.13.3
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install yq
run: |
wget -q https://github.com/mikefarah/yq/releases/download/${{ env.YQ_VERSION }}/yq_linux_amd64 -O /usr/local/bin/yq
chmod +x /usr/local/bin/yq
- name: Restore Helm dependency cache
uses: actions/cache@v4
with:
path: |
applications/mlflow/charts/mlflow/charts/
applications/mlflow/charts/infra/charts/
key: helm-deps-${{ hashFiles('applications/mlflow/charts/*/Chart.lock') }}
restore-keys: helm-deps-
- name: Package and Update Versions
working-directory: applications/mlflow
run: |
task helm:update-deps
task release:update-versions
task helm:package
- name: Extract MLflow chart version
id: chart-version
working-directory: applications/mlflow
run: |
CHART_VERSION=$(task -s extract:version:chart)
echo "chart_version=$CHART_VERSION" >> $GITHUB_OUTPUT
echo "Using MLflow chart version: $CHART_VERSION"
- name: Create release
id: create-release
uses: replicatedhq/replicated-actions/create-release@v1.17.0
with:
app-slug: ${{ env.APP_SLUG }}
api-token: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN }}
yaml-dir: applications/mlflow/release/
promote-channel: ci-automation-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
version: ${{ steps.chart-version.outputs.chart_version }}
- name: Create customer
id: create-customer
uses: replicatedhq/replicated-actions/create-customer@main
with:
app-slug: ${{ env.APP_SLUG }}
api-token: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN }}
customer-name: automated-${{ github.run_id }}
customer-email: testcustomer@replicated.com
license-type: dev
channel-slug: ${{ steps.create-release.outputs.channel-slug }}
is-kots-install-enabled: "true"
helm-install-test:
runs-on: ubuntu-22.04
needs: [create-release]
strategy:
fail-fast: false
matrix:
cluster:
- distribution: k3s
version: 1.32
nodes: 1
- distribution: gke
version: 1.32
nodes: 3
config:
- name: nodeport-ingress-disabled
values_file: tests/helm/nodeport-ingress-disabled.yaml
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4.3.0
with:
version: v3.13.3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install yq
run: |
wget -q https://github.com/mikefarah/yq/releases/download/${{ env.YQ_VERSION }}/yq_linux_amd64 -O /usr/local/bin/yq
chmod +x /usr/local/bin/yq
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-smoke-${{ runner.os }}-py3.12-requests
- name: Get License ID
id: get-license
working-directory: applications/mlflow
run: |
mkdir -p /tmp/replicated
CUSTOMER_NAME="${{ needs.create-release.outputs.customer-id }}"
echo "Using customer name: $CUSTOMER_NAME"
echo "Getting license ID..."
INSTALLATION_ID=$(CUSTOMER_NAME="$CUSTOMER_NAME" task license:get-id | tail -n 1)
if [ -z "$INSTALLATION_ID" ]; then
echo "ERROR: Got empty license ID"
exit 1
fi
echo "License ID retrieved successfully"
echo "license_id=$INSTALLATION_ID" >> $GITHUB_OUTPUT
env:
REPLICATED_API_TOKEN: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN }}
- name: Create Cluster
id: create-cluster
uses: replicatedhq/replicated-actions/create-cluster@v1.17.0
with:
api-token: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN }}
kubernetes-distribution: ${{ matrix.cluster.distribution }}
kubernetes-version: ${{ matrix.cluster.version }}
cluster-name: mlflow-ci-${{ github.run_id }}-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }}-${{ matrix.config.name }}
disk: 100
nodes: ${{ matrix.cluster.nodes }}
ttl: 1h
export-kubeconfig: true
- name: Setup Namespace
working-directory: applications/mlflow
run: |
KUBECONFIG_FILE="/tmp/kubeconfig-helm-test-${{ github.run_id }}"
echo "$KUBECONFIG" > "$KUBECONFIG_FILE"
KUBECONFIG="$KUBECONFIG_FILE" task namespaces:create
env:
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
- name: Run Helm Test
working-directory: applications/mlflow
run: |
KUBECONFIG_FILE="/tmp/kubeconfig-helm-test-${{ github.run_id }}"
echo "$KUBECONFIG" > "$KUBECONFIG_FILE"
KUBECONFIG="$KUBECONFIG_FILE" MLFLOW_VALUES="${{ matrix.config.values_file }}" task helm:test-install
env:
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
REPLICATED_APP: ${{ env.APP_SLUG }}
REPLICATED_CHANNEL: ${{ needs.create-release.outputs.channel-slug }}
REPLICATED_LICENSE_ID: ${{ steps.get-license.outputs.license_id }}
TIMEOUT: 5m
WAIT_RETRIES: 30
RETRY_INTERVAL: 10
- name: Run Application Tests
working-directory: applications/mlflow
run: |
pip install --quiet requests
python tests/smoke_test.py localhost:$PORT --protocol http --connection-timeout 120 --debug
env:
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
PORT: 5000
- name: Install troubleshoot
run: curl -L https://github.com/replicatedhq/troubleshoot/releases/latest/download/support-bundle_linux_amd64.tar.gz | tar xzvf -
if: failure()
- name: Collect bundle
run: |
KUBECONFIG_FILE="/tmp/kubeconfig-helm-bundle-${{ github.run_id }}"
echo "$KUBECONFIG" > "$KUBECONFIG_FILE"
echo "Saved kubeconfig to $KUBECONFIG_FILE"
./support-bundle --kubeconfig="$KUBECONFIG_FILE" --interactive=false -o ci-bundle-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }}-${{ matrix.config.name }} https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml
if: failure()
env:
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
- name: Upload support bundle artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: mlflow-bundle-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }}-${{ matrix.config.name }}
path: 'ci-bundle-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }}-${{ matrix.config.name }}.tar.gz'
- name: Remove Cluster
uses: replicatedhq/replicated-actions/remove-cluster@v1.17.0
if: ${{ always() && steps.create-cluster.outputs.cluster-id != '' }}
with:
api-token: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN }}
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}
kots-install-test:
runs-on: ubuntu-22.04
needs: [create-release]
strategy:
fail-fast: false
matrix:
cluster:
- distribution: k3s
version: 1.32
nodes: 1
- distribution: gke
version: 1.32
nodes: 3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install yq
run: |
wget -q https://github.com/mikefarah/yq/releases/download/${{ env.YQ_VERSION }}/yq_linux_amd64 -O /usr/local/bin/yq
chmod +x /usr/local/bin/yq
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-smoke-${{ runner.os }}-py3.12-requests
- name: Create Cluster
id: create-cluster
uses: replicatedhq/replicated-actions/create-cluster@v1.17.0
with:
api-token: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN }}
kubernetes-distribution: ${{ matrix.cluster.distribution }}
kubernetes-version: ${{ matrix.cluster.version }}
cluster-name: mlflow-kots-${{ github.run_id }}-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }}
disk: 100
nodes: ${{ matrix.cluster.nodes }}
ttl: 1h
export-kubeconfig: true
# Download license using task
- name: Download license
id: download-license
working-directory: applications/mlflow
run: |
mkdir -p /tmp/replicated
CUSTOMER_NAME="${{ needs.create-release.outputs.customer-id }}"
echo "Using customer name: $CUSTOMER_NAME for license download"
echo "Attempting to download license..."
set +e
CUSTOMER_NAME="$CUSTOMER_NAME" task license:download
DOWNLOAD_RESULT=$?
set -e
if [ $DOWNLOAD_RESULT -ne 0 ]; then
echo "Failed to download license. Error code: $DOWNLOAD_RESULT"
echo "Checking if license file exists..."
ls -la /tmp/replicated || true
exit 1
fi
if [ ! -f "/tmp/replicated/license.yaml" ] || [ ! -s "/tmp/replicated/license.yaml" ]; then
echo "License file is missing or empty!"
exit 1
fi
echo "License file downloaded successfully to /tmp/replicated/license.yaml"
LICENSE_CONTENT=$(cat /tmp/replicated/license.yaml)
echo "license<<EOF" >> $GITHUB_OUTPUT
echo "$LICENSE_CONTENT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
env:
REPLICATED_API_TOKEN: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN }}
# Verify license file is valid
- name: Verify License File
run: |
echo "Saving license file for validation..."
LICENSE_FILE="/tmp/replicated/license-ci.yaml"
mkdir -p /tmp/replicated
cat << 'EOF' > $LICENSE_FILE
${{ steps.download-license.outputs.license }}
EOF
echo "License file content (first 10 lines):"
head -n 10 $LICENSE_FILE
echo "Validating license file..."
yq eval . $LICENSE_FILE > /dev/null
if [ $? -ne 0 ]; then
echo "ERROR: License file is not valid YAML"
exit 1
else
echo "License file is valid YAML"
fi
# Install using KOTS
- name: KOTS Install
uses: replicatedhq/replicated-actions/kots-install@v1.17.0
with:
kubeconfig: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
kots-version: latest
app-slug: ${{ env.APP_SLUG }}/${{ needs.create-release.outputs.channel-slug }}
app-version-label: ${{ needs.create-release.outputs.chart-version }}
license-file: ${{ steps.download-license.outputs.license }}
namespace: default
wait-duration: 10m
shared-password: 'replicatedmlflow'
# Set up port forwarding after KOTS installation is complete
- name: Set up port forwarding
id: port-forward
run: |
KUBECONFIG_FILE="/tmp/kubeconfig-kots-test-${{ github.run_id }}"
echo "$KUBECONFIG" > "$KUBECONFIG_FILE"
PORT="5000"
echo "Waiting for MLflow deployment to be created..."
for i in $(seq 1 30); do
if KUBECONFIG="$KUBECONFIG_FILE" kubectl get deployment -l app.kubernetes.io/name=mlflow -n default -o name 2>/dev/null | grep -q .; then
echo "MLflow deployment found."
break
fi
echo "MLflow deployment not found yet (attempt $i/30), waiting..."
sleep 10
done
if ! KUBECONFIG="$KUBECONFIG_FILE" kubectl get deployment -l app.kubernetes.io/name=mlflow -n default -o name 2>/dev/null | grep -q .; then
echo "ERROR: MLflow deployment was not created within the expected time"
KUBECONFIG="$KUBECONFIG_FILE" kubectl get deployments,pods -n default || true
exit 1
fi
echo "Waiting for MLflow rollout to complete..."
KUBECONFIG="$KUBECONFIG_FILE" kubectl rollout status deployment/mlflow \
--timeout=10m \
-n default || {
echo "ERROR: MLflow deployment did not complete rollout within 10m"
KUBECONFIG="$KUBECONFIG_FILE" kubectl get pods -n default || true
KUBECONFIG="$KUBECONFIG_FILE" kubectl describe deployment/mlflow -n default || true
exit 1
}
echo "Setting up port forwarding..."
nohup bash -c "KUBECONFIG='$KUBECONFIG_FILE' kubectl port-forward -n default svc/mlflow $PORT:5000 &>/tmp/port-forward-kots-${{ github.run_id }}.log" &
echo "port_forward_pid=$!" >> $GITHUB_OUTPUT
echo "hostname=localhost:$PORT" >> $GITHUB_OUTPUT
echo "Waiting for port-forward to become ready..."
sleep 10
success=false
for i in $(seq 1 30); do
if curl -sf http://localhost:$PORT/health >/dev/null 2>&1; then
echo "MLflow is reachable"
success=true
break
fi
sleep 5
done
if [ "$success" != "true" ]; then
echo "ERROR: MLflow never became reachable via port-forward after 30s"
echo "==== Port-forward log ===="
cat "/tmp/port-forward-kots-${{ github.run_id }}.log" || true
echo "==== MLflow pods ===="
KUBECONFIG="$KUBECONFIG_FILE" kubectl get pods -l app.kubernetes.io/name=mlflow -n default || true
pod_name="$(KUBECONFIG="$KUBECONFIG_FILE" kubectl get pods -l app.kubernetes.io/name=mlflow -n default -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || echo "")"
if [ -n "$pod_name" ]; then
echo "==== Logs for pod $pod_name ===="
KUBECONFIG="$KUBECONFIG_FILE" kubectl logs "$pod_name" -n default || true
fi
exit 1
fi
env:
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
- name: Run Application Tests
working-directory: applications/mlflow
run: |
pip install --quiet requests
python tests/smoke_test.py localhost:$PORT --protocol http --connection-timeout 120 --debug
env:
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
PORT: 5000
- name: Install troubleshoot
run: curl -L https://github.com/replicatedhq/troubleshoot/releases/latest/download/support-bundle_linux_amd64.tar.gz | tar xzvf -
if: failure()
- name: Collect bundle
run: |
KUBECONFIG_FILE="/tmp/kubeconfig-kots-bundle-${{ github.run_id }}"
echo "$KUBECONFIG" > "$KUBECONFIG_FILE"
echo "Saved kubeconfig to $KUBECONFIG_FILE"
./support-bundle --kubeconfig="$KUBECONFIG_FILE" --interactive=false -o kots-ci-bundle-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }} https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml
if: failure()
env:
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
- name: Upload support bundle artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: mlflow-kots-bundle-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }}
path: 'kots-ci-bundle-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }}.tar.gz'
- name: Remove Cluster
uses: replicatedhq/replicated-actions/remove-cluster@v1.17.0
if: ${{ always() && steps.create-cluster.outputs.cluster-id != '' }}
with:
api-token: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN }}
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}
cleanup-test-release:
runs-on: ubuntu-22.04
needs: [create-release, kots-install-test, helm-install-test]
if: always()
steps:
- name: Archive Customer
if: ${{ always() && needs.create-release.outputs.customer-id != '' }}
uses: replicatedhq/replicated-actions/archive-customer@v1.17.0
with:
api-token: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN }}
customer-id: ${{ needs.create-release.outputs.customer-id }}
- name: Archive Channel
if: ${{ always() && needs.create-release.outputs.channel-slug != '' }}
uses: replicatedhq/replicated-actions/archive-channel@v1.17.0
with:
app-slug: ${{ env.APP_SLUG }}
api-token: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN }}
channel-slug: ${{ needs.create-release.outputs.channel-slug }}