Skip to content

Commit dc94cec

Browse files
committed
remove make
1 parent b8d1254 commit dc94cec

File tree

2 files changed

+114
-39
lines changed

2 files changed

+114
-39
lines changed

.github/workflows/mlflow-ci.yml

Lines changed: 101 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
name: MLflow CI
1+
name: MLflow CI (Direct Commands)
22

33
on:
44
pull_request:
55
paths:
66
- 'applications/mlflow/charts/**'
77
- 'applications/mlflow/kots/**'
88
- 'applications/mlflow/tests/**'
9-
- '.github/workflows/mlflow-ci.yml'
9+
- '.github/workflows/mlflow-ci-direct.yml'
1010
push:
1111
branches:
1212
- main
1313
paths:
1414
- 'applications/mlflow/charts/**'
1515
- 'applications/mlflow/kots/**'
1616
- 'applications/mlflow/tests/**'
17-
- '.github/workflows/mlflow-ci.yml'
17+
- '.github/workflows/mlflow-ci-direct.yml'
1818

1919
env:
2020
APP_SLUG: diamon-mlflow
@@ -40,18 +40,32 @@ jobs:
4040

4141
- name: Add Helm repositories
4242
run: |
43-
cd applications/mlflow
44-
make add-helm-repositories
43+
helm repo add cnpg https://cloudnative-pg.github.io/charts
44+
helm repo add minio https://operator.min.io/
45+
helm repo update
4546
4647
- name: Lint charts
4748
run: |
48-
cd applications/mlflow
49-
make lint
49+
echo "Linting Helm charts..."
50+
for chart in mlflow infra; do
51+
echo "Linting $chart chart..."
52+
helm lint applications/mlflow/charts/$chart
53+
done
54+
echo "Linting completed successfully."
5055
5156
- name: Template charts with SDK disabled
5257
run: |
5358
cd applications/mlflow
54-
make template
59+
echo "Templating Helm charts with Replicated SDK disabled..."
60+
mkdir -p ./rendered-templates
61+
62+
echo "Rendering templates for infra..."
63+
helm template ./charts/infra --output-dir ./rendered-templates/infra --debug
64+
65+
echo "Rendering templates for mlflow..."
66+
helm template ./charts/mlflow --output-dir ./rendered-templates/mlflow --set replicated.enabled=false --debug
67+
68+
echo "Templates rendered in ./rendered-templates directory."
5569
5670
- name: Upload templates (if templating failed)
5771
uses: actions/upload-artifact@v4
@@ -79,11 +93,11 @@ jobs:
7993
with:
8094
version: v3.13.3
8195

82-
# Add required Helm repositories
8396
- name: Add Helm repositories
8497
run: |
85-
cd applications/mlflow
86-
make add-helm-repositories
98+
helm repo add cnpg https://cloudnative-pg.github.io/charts
99+
helm repo add minio https://operator.min.io/
100+
helm repo update
87101
88102
- name: Package infra chart
89103
run: |
@@ -222,55 +236,103 @@ jobs:
222236

223237
- name: Add Helm repositories
224238
run: |
225-
cd applications/mlflow
226-
make add-helm-repositories
239+
helm repo add cnpg https://cloudnative-pg.github.io/charts
240+
helm repo add minio https://operator.min.io/
241+
helm repo update
227242
228243
# Authenticate with the Replicated registry
229244
- name: Login to Replicated registry
230245
run: |
231-
echo "Authenticating with Replicated registry using license ID from previous step"
232-
cd applications/mlflow
233-
# Print env var name to check it's set in the shell (without revealing value)
234-
if [ -n "$REPLICATED_LICENSE_ID" ]; then
235-
echo "REPLICATED_LICENSE_ID is set in the shell"
236-
else
237-
echo "ERROR: REPLICATED_LICENSE_ID is not set in the shell"
246+
echo "Authenticating with Replicated registry..."
247+
if [ -z "$REPLICATED_LICENSE_ID" ]; then
248+
echo "ERROR: REPLICATED_LICENSE_ID environment variable must be set"
238249
exit 1
239250
fi
240-
# Pass the env var directly to make
241-
REPLICATED_LICENSE_ID="$REPLICATED_LICENSE_ID" make registry-login
251+
252+
helm registry login registry.replicated.com \
253+
--username="$REPLICATED_LICENSE_ID" \
254+
--password="$REPLICATED_LICENSE_ID"
255+
echo "Registry login successful."
242256
env:
243257
REPLICATED_LICENSE_ID: ${{ steps.get-license.outputs.license_id }}
244258

245259
- name: Run Helm installation test with custom values
246260
run: |
247261
cd applications/mlflow
248-
# Save kubeconfig to a file
249-
KUBECONFIG_FILE="/tmp/kubeconfig-${{ github.run_id }}"
250-
echo "$KUBECONFIG" > "$KUBECONFIG_FILE"
251-
echo "Saved kubeconfig to $KUBECONFIG_FILE"
252262
253-
# Set up environment for the make target
254-
export KUBECONFIG="$KUBECONFIG_FILE"
255-
export REPLICATED_APP="${{ env.APP_SLUG }}"
256-
export REPLICATED_CHANNEL="${{ needs.create-release.outputs.channel-slug }}"
257-
export REPLICATED_LICENSE_ID="${{ steps.get-license.outputs.license_id }}"
263+
echo "Running Helm installation test with custom values..."
264+
265+
# Determine OCI URL - prefer direct OCI_URL if provided, otherwise construct from app/channel
266+
if [ -n "$OCI_URL" ]; then
267+
echo "Using provided OCI URL: $OCI_URL"
268+
else
269+
echo "No direct OCI_URL provided. Constructing from REPLICATED_APP and REPLICATED_CHANNEL"
270+
echo "Note: This requires REPLICATED_APP and REPLICATED_CHANNEL env vars."
271+
if [ -z "$REPLICATED_APP" ] || [ -z "$REPLICATED_CHANNEL" ]; then
272+
echo "ERROR: REPLICATED_APP and REPLICATED_CHANNEL must be set"
273+
exit 1
274+
fi
275+
OCI_URL="oci://registry.replicated.com/$REPLICATED_APP/$REPLICATED_CHANNEL"
276+
echo "Constructed OCI URL: $OCI_URL"
277+
fi
278+
279+
# Validate OCI_URL is set and not empty
280+
if [ -z "$OCI_URL" ]; then
281+
echo "ERROR: OCI_URL is empty. Check that REPLICATED_APP and REPLICATED_CHANNEL are correctly set and not being overridden."
282+
echo "REPLICATED_APP=$REPLICATED_APP"
283+
echo "REPLICATED_CHANNEL=$REPLICATED_CHANNEL"
284+
exit 1
285+
fi
286+
287+
# Prepare values arguments if provided
288+
MLFLOW_VALUES_ARGS=""
289+
if [ -n "$MLFLOW_VALUES" ]; then
290+
echo "Using MLflow values file: $MLFLOW_VALUES"
291+
# Check if values file exists
292+
if [ ! -f "$MLFLOW_VALUES" ]; then
293+
echo "ERROR: Values file '$MLFLOW_VALUES' does not exist"
294+
exit 1
295+
fi
296+
MLFLOW_VALUES_ARGS="--values $MLFLOW_VALUES"
297+
echo "Values args: $MLFLOW_VALUES_ARGS"
298+
else
299+
echo "No custom values file provided. Using default values."
300+
fi
258301
259-
# Construct OCI URL manually for verification and as a fallback
260-
export OCI_URL="oci://registry.replicated.com/$REPLICATED_APP/$REPLICATED_CHANNEL"
261-
echo "Constructed OCI URL: $OCI_URL"
302+
# Create namespace if it doesn't exist
303+
kubectl create namespace values-test 2>/dev/null || true
262304
263-
# Use test-specific values file
264-
export MLFLOW_VALUES="${{ matrix.config.values_file }}"
265-
echo "Running test '${{ matrix.config.name }}' with MLflow values file: $MLFLOW_VALUES"
305+
# Install infra chart from Replicated registry
306+
echo "Installing infra chart from Replicated registry..."
307+
echo "Chart path: $OCI_URL/infra"
308+
helm upgrade --install infra-values-test $OCI_URL/infra \
309+
--namespace values-test \
310+
--wait --timeout 5m --debug || {
311+
echo "ERROR: Failed to install infra chart from $OCI_URL/infra"
312+
echo "Please check that registry login was successful and the chart exists in the registry."
313+
exit 1
314+
}
266315
267-
# Run direct Helm installation
268-
make test-replicated-helm-with-values
316+
# Install MLflow chart from Replicated registry with custom values
317+
echo "Installing mlflow chart from Replicated registry with custom values..."
318+
echo "Chart path: $OCI_URL/mlflow"
319+
echo "Using values args: $MLFLOW_VALUES_ARGS"
320+
helm upgrade --install mlflow-values-test $OCI_URL/mlflow \
321+
--namespace values-test \
322+
$MLFLOW_VALUES_ARGS \
323+
--wait --timeout 5m --debug || {
324+
echo "ERROR: Failed to install mlflow chart from $OCI_URL/mlflow"
325+
echo "Please check that registry login was successful and the chart exists in the registry."
326+
exit 1
327+
}
328+
echo "Helm installation with custom values completed successfully."
269329
env:
270330
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
271331
REPLICATED_APP: ${{ env.APP_SLUG }}
272332
REPLICATED_CHANNEL: ${{ needs.create-release.outputs.channel-slug }}
273333
REPLICATED_LICENSE_ID: ${{ steps.get-license.outputs.license_id }}
334+
MLFLOW_VALUES: ${{ matrix.config.values_file }}
335+
OCI_URL: "oci://registry.replicated.com/${{ env.APP_SLUG }}/${{ needs.create-release.outputs.channel-slug }}"
274336

275337
# Application testing with our consolidated test file
276338
- name: Run Application Tests

applications/mlflow/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# ==================================================================================
2+
# WARNING: This Makefile is maintained for LOCAL DEVELOPMENT PURPOSES ONLY.
3+
# It should NOT be used in CI workflows. The GitHub Actions workflows now use
4+
# direct shell commands instead of Make targets to avoid environment variable
5+
# passing issues between Make and CI environments.
6+
#
7+
# For CI-related changes, please modify the workflow files directly:
8+
# - .github/workflows/mlflow-ci.yml (primary workflow)
9+
# - .github/workflows/mlflow-ci-direct.yml (new direct commands workflow)
10+
#
11+
# See applications/mlflow/docs/makefile-to-ci-migration.md for details.
12+
# ==================================================================================
13+
114
manifests_dir := $(shell pwd)/kots
215
chart_archives := $(wildcard $(manifests_dir)/*.tgz)
316

0 commit comments

Comments
 (0)