Skip to content

Commit 3c47888

Browse files
committed
refactor taskfile
1 parent cabdc3f commit 3c47888

File tree

3 files changed

+101
-77
lines changed

3 files changed

+101
-77
lines changed

.github/workflows/mlflow-ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ jobs:
5555
working-directory: applications/mlflow
5656
run: |
5757
# Use Taskfile to add Helm repos, lint charts and generate templates
58-
task add:helm:repos
59-
task update:helm:deps
58+
task add:repos:helm
59+
task update:deps:helm
6060
task lint
6161
task template
6262
@@ -99,18 +99,18 @@ jobs:
9999
working-directory: applications/mlflow
100100
run: |
101101
# Update and package charts
102-
task add:helm:repos
103-
task update:helm:deps
104-
task update:versions
105-
task package
102+
task add:repos:helm
103+
task update:deps:helm
104+
task update:versions:chart
105+
task package:charts
106106
107107
# Extract MLflow chart version for reference
108108
- name: Extract MLflow chart version
109109
id: chart-version
110110
working-directory: applications/mlflow
111111
run: |
112112
# Extract MLflow chart version using taskfile variable
113-
CHART_VERSION=$(task -s version:extract)
113+
CHART_VERSION=$(task -s extract:version:chart)
114114
echo "chart_version=$CHART_VERSION" >> $GITHUB_OUTPUT
115115
echo "Using MLflow chart version: $CHART_VERSION"
116116
@@ -195,7 +195,7 @@ jobs:
195195
196196
# Get license ID using the task - capture only the last line of output
197197
echo "Getting license ID..."
198-
INSTALLATION_ID=$(CUSTOMER_NAME="$CUSTOMER_NAME" task customer:get-license-id | tail -n 1)
198+
INSTALLATION_ID=$(CUSTOMER_NAME="$CUSTOMER_NAME" task get:license-id:customer | tail -n 1)
199199
200200
# Check if we got a result
201201
if [ -z "$INSTALLATION_ID" ]; then
@@ -241,7 +241,7 @@ jobs:
241241
echo "$KUBECONFIG" > "$KUBECONFIG_FILE"
242242
243243
# Run task to test Helm installation
244-
KUBECONFIG="$KUBECONFIG_FILE" MLFLOW_VALUES="${{ matrix.config.values_file }}" task test:helm
244+
KUBECONFIG="$KUBECONFIG_FILE" MLFLOW_VALUES="${{ matrix.config.values_file }}" task test:install:helm
245245
env:
246246
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
247247
REPLICATED_APP: ${{ env.APP_SLUG }}
@@ -255,7 +255,7 @@ jobs:
255255
working-directory: applications/mlflow
256256
run: |
257257
# Run task to test application
258-
task test:run-app-tests
258+
task run:tests:app
259259
env:
260260
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
261261
PORT: 5000
@@ -349,7 +349,7 @@ jobs:
349349
# Try to download license
350350
echo "Attempting to download license..."
351351
set +e
352-
CUSTOMER_NAME="$CUSTOMER_NAME" task customer:download-license
352+
CUSTOMER_NAME="$CUSTOMER_NAME" task download:license:customer
353353
DOWNLOAD_RESULT=$?
354354
set -e
355355
@@ -515,7 +515,7 @@ jobs:
515515
working-directory: applications/mlflow
516516
run: |
517517
# Run task to test application
518-
task test:run-app-tests
518+
task run:tests:app
519519
env:
520520
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
521521
PORT: 5000

applications/mlflow/README.md

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -88,40 +88,43 @@ The MLflow application includes a Taskfile.yml that allows running the same test
8888
- Existing Kubernetes cluster configured in your current context
8989
- kubectl, helm, and python3 installed
9090

91-
### Common Testing Tasks
91+
### Common Development Tasks
92+
93+
Tasks in our Taskfile follow a `verb:resource[:subresource]` naming convention that clearly describes their purpose.
9294

9395
```bash
9496
# Show available tasks
9597
task
9698

97-
# Lint charts
98-
task lint
99-
100-
# Template charts (render to stdout)
101-
task template
102-
103-
# Package charts
104-
task package
99+
# Lint and validate charts
100+
task lint # Lint Helm charts
101+
task template # Render templates to stdout (SDK disabled)
102+
task check:versions # Verify Chart.yaml and KOTS manifest versions match
105103

106-
# Run a local test with local charts (no Replicated registry)
107-
task test:local
104+
# Repository and dependency management
105+
task add:repos:helm # Add required Helm repositories
106+
task update:deps:helm # Update Helm chart dependencies
108107

109-
# Run tests with charts from Replicated registry
110-
# Requires: REPLICATED_LICENSE_ID, REPLICATED_APP, REPLICATED_CHANNEL env vars
111-
task test:helm
108+
# Packaging and versioning
109+
task update:versions:chart # Update chart version refs in KOTS manifests
110+
task package:charts # Package Helm charts for distribution
111+
task extract:version:chart # Extract current MLflow chart version
112112

113-
# Run application tests against a running MLflow instance
114-
task test:run-app-tests
113+
# Installation testing
114+
task test:install:helm # Install charts from Replicated registry
115+
task test:install:local # Install charts from local directory (no registry)
116+
task test:install:kots # Install application via KOTS
115117

116-
# Extract MLflow chart version from KOTS manifest
117-
task version:extract
118+
# Application testing
119+
task run:tests:app # Run application tests against running MLflow
120+
task run:tests:all # Run all tests (Helm install + app tests)
118121

119-
# Create a release in Replicated (after packaging charts)
120-
# Optional env vars: REPLICATED_APP, CHANNEL
121-
task release:create
122+
# Release management
123+
task create:release # Create a Replicated release
122124

123-
# Clean up generated files
124-
task clean
125+
# Cleanup
126+
task clean:files:charts # Clean packaged chart files
127+
task clean:all # Clean all generated files
125128
```
126129

127130
### Testing Charts from Replicated Registry
@@ -130,16 +133,24 @@ To test charts from the Replicated registry:
130133

131134
1. Ensure you have a running Kubernetes cluster and your kubectl context is set correctly
132135

133-
2. Set required environment variables:
136+
2. Login to the registry and set up required environment variables:
134137
```bash
135138
export REPLICATED_LICENSE_ID=your_license_id
136139
export REPLICATED_APP=app_slug
137140
export REPLICATED_CHANNEL=channel_name
141+
142+
# Login to the registry
143+
task login:registry
138144
```
139145

140-
3. Run the Helm test:
146+
3. Run the Helm installation test:
141147
```bash
142-
task test:helm
148+
task test:install:helm
149+
```
150+
151+
4. Run application tests against the deployed instance:
152+
```bash
153+
task run:tests:app
143154
```
144155

145156
### Local Development Testing
@@ -148,13 +159,18 @@ For local development without using the Replicated registry:
148159

149160
1. Ensure you have a running Kubernetes cluster and your kubectl context is set correctly
150161

151-
2. Run the local test:
162+
2. Run the local installation test:
152163
```bash
153164
# Run test with local charts
154-
task test:local
165+
task test:install:local
155166

156167
# Optionally specify a custom values file
157-
MLFLOW_VALUES=./my-values.yaml task test:local
168+
MLFLOW_VALUES=./my-values.yaml task test:install:local
169+
```
170+
171+
3. Run application tests against the deployed instance:
172+
```bash
173+
task run:tests:app
158174
```
159175

160176
This allows rapid iteration on chart changes without needing to publish to the Replicated registry.
@@ -165,16 +181,16 @@ The Taskfile provides tasks for packaging charts and creating releases in Replic
165181

166182
```bash
167183
# Package the charts (updates the version in the KOTS manifests)
168-
task package
184+
task package:charts
169185

170186
# Extract the current chart version
171-
task version:extract
187+
task extract:version:chart
172188

173189
# Create a release with the default app and channel
174-
task release:create
190+
task create:release
175191

176192
# Create a release with custom app and channel
177-
REPLICATED_APP=myapp CHANNEL=beta task release:create
193+
REPLICATED_APP=myapp REPLICATED_CHANNEL=beta task create:release
178194
```
179195

180196
This enables you to package and publish releases directly from your local environment.

0 commit comments

Comments
 (0)