Skip to content

Commit 6dc66d5

Browse files
committed
stop using chart-testing
1 parent bccd9bb commit 6dc66d5

File tree

4 files changed

+55
-96
lines changed

4 files changed

+55
-96
lines changed

.github/workflows/mlflow-ci.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ jobs:
3838
with:
3939
python-version: 3.12
4040

41-
- name: Set up chart-testing
42-
uses: helm/[email protected]
43-
4441
- name: Add Helm repositories
4542
run: |
4643
cd applications/mlflow
@@ -170,9 +167,6 @@ jobs:
170167
with:
171168
python-version: 3.12
172169

173-
- name: Set up chart-testing
174-
uses: helm/[email protected]
175-
176170
# Install jq via apt-get
177171
- name: Install jq
178172
run: |
@@ -248,7 +242,7 @@ jobs:
248242
env:
249243
REPLICATED_LICENSE_ID: ${{ steps.get-license.outputs.license_id }}
250244

251-
- name: Run Helm installation test with chart-testing
245+
- name: Run Helm installation test with custom values
252246
run: |
253247
cd applications/mlflow
254248
# Save kubeconfig to a file
@@ -267,7 +261,7 @@ jobs:
267261
268262
echo "Running test '${{ matrix.config.name }}' with MLflow values file: $MLFLOW_VALUES"
269263
270-
# Run chart testing installation using our updated make target that uses 'ct'
264+
# Run direct Helm installation
271265
make test-replicated-helm-with-values
272266
env:
273267
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}

applications/mlflow/Makefile

Lines changed: 47 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ add-helm-repositories:
4545
helm repo add minio https://operator.min.io/; \
4646
helm repo update
4747

48-
# Target to lint Helm charts using chart-testing
48+
# Target to lint Helm charts using direct Helm commands
4949
.PHONY: lint
5050
lint: add-helm-repositories
5151
echo "Linting Helm charts..."; \
52-
if [ -f ./ct.yaml ]; then \
53-
ct lint --config ./ct.yaml --chart-dirs $(HELM_CHARTS_DIR) --charts $(HELM_CHARTS_DIR)/mlflow $(HELM_CHARTS_DIR)/infra; \
54-
else \
55-
echo "Warning: ct.yaml not found. Using default configuration."; \
56-
ct lint --chart-dirs $(HELM_CHARTS_DIR) --charts $(HELM_CHARTS_DIR)/mlflow $(HELM_CHARTS_DIR)/infra; \
57-
fi; \
52+
for chart in $(CHARTS); do \
53+
echo "Linting $$chart chart..."; \
54+
helm lint $(HELM_CHARTS_DIR)/$$chart; \
55+
done; \
5856
echo "Linting completed successfully."
5957

6058
# Target to template Helm charts (render templates without installing)
@@ -78,18 +76,27 @@ template: add-helm-repositories
7876
test: lint template
7977
echo "Running full chart installation test..."; \
8078
echo "Note: This requires a connected Kubernetes cluster."; \
81-
if [ -f ./ct.yaml ]; then \
82-
ct install --config ./ct.yaml --chart-dirs $(HELM_CHARTS_DIR) \
83-
--charts $(HELM_CHARTS_DIR)/infra && \
84-
ct install --config ./ct.yaml --chart-dirs $(HELM_CHARTS_DIR) \
85-
--charts $(HELM_CHARTS_DIR)/mlflow --set replicated.enabled=false; \
86-
else \
87-
echo "Warning: ct.yaml not found. Using default configuration."; \
88-
ct install --chart-dirs $(HELM_CHARTS_DIR) \
89-
--charts $(HELM_CHARTS_DIR)/infra && \
90-
ct install --chart-dirs $(HELM_CHARTS_DIR) \
91-
--charts $(HELM_CHARTS_DIR)/mlflow --set replicated.enabled=false; \
92-
fi; \
79+
\
80+
# Create namespace if it doesn't exist
81+
kubectl create namespace mlflow-test 2>/dev/null || true; \
82+
\
83+
# Install infra chart
84+
echo "Installing infra chart..."; \
85+
helm upgrade --install infra-test $(HELM_CHARTS_DIR)/infra \
86+
--namespace mlflow-test \
87+
--wait --timeout 5m --debug; \
88+
\
89+
# Install MLflow chart with SDK disabled
90+
echo "Installing mlflow chart..."; \
91+
helm upgrade --install mlflow-test $(HELM_CHARTS_DIR)/mlflow \
92+
--namespace mlflow-test \
93+
--set replicated.enabled=false \
94+
--wait --timeout 5m --debug; \
95+
\
96+
# Test the installation
97+
echo "Verifying installation..."; \
98+
kubectl get pods -n mlflow-test; \
99+
\
93100
echo "Full installation test completed successfully."
94101

95102
# Target to login to the Replicated registry
@@ -105,77 +112,44 @@ registry-login:
105112
--password="$$REPLICATED_LICENSE_ID"; \
106113
echo "Registry login successful."
107114

108-
# Target to test Helm installation with charts from Replicated registry
109-
.PHONY: test-replicated-helm
110-
test-replicated-helm: registry-login
111-
echo "Running Helm installation test with charts from Replicated registry..."; \
112-
echo "Note: This requires REPLICATED_APP and REPLICATED_CHANNEL env vars."; \
113-
if [ -z "$$REPLICATED_APP" ] || [ -z "$$REPLICATED_CHANNEL" ]; then \
114-
echo "ERROR: REPLICATED_APP and REPLICATED_CHANNEL must be set"; \
115-
exit 1; \
116-
fi; \
117-
OCI_URL="oci://registry.replicated.com/$$REPLICATED_APP/$$REPLICATED_CHANNEL"; \
118-
echo "Creating temporary ct-oci.yaml config file..."; \
119-
echo "chart-repos:" > ct-oci.yaml; \
120-
echo " - replicated=$$OCI_URL" >> ct-oci.yaml; \
121-
echo "debug: true" >> ct-oci.yaml; \
122-
cat ct-oci.yaml; \
123-
echo "Listing available charts in the registry..."; \
124-
helm search repo replicated || true; \
125-
echo "Attempting chart installation using chart-testing..."; \
126-
if ct install --config ct-oci.yaml \
127-
--charts "infra" \
128-
--namespace default \
129-
--release-label "ci-test" && \
130-
ct install --config ct-oci.yaml \
131-
--charts "mlflow" \
132-
--namespace default \
133-
--release-label "ci-test"; then \
134-
echo "Chart-testing installation successful"; \
135-
else \
136-
echo "Chart-testing install failed, falling back to direct helm install..."; \
137-
helm install infra-direct $$OCI_URL/infra --wait --timeout 5m --debug --namespace default; \
138-
helm install mlflow-direct $$OCI_URL/mlflow --wait --timeout 5m --debug --namespace default; \
139-
fi; \
140-
rm -f ct-oci.yaml; \
141-
echo "Replicated Helm installation test completed successfully."
142-
143-
# Target for testing with chart-testing (ct) and custom values
115+
# Target for testing with custom values
144116
.PHONY: test-replicated-helm-with-values
145117
test-replicated-helm-with-values: registry-login
146-
echo "Running Helm installation test with custom values using chart-testing..."; \
118+
echo "Running Helm installation test with custom values..."; \
147119
echo "Note: This requires REPLICATED_APP and REPLICATED_CHANNEL env vars."; \
148120
if [ -z "$$REPLICATED_APP" ] || [ -z "$$REPLICATED_CHANNEL" ]; then \
149121
echo "ERROR: REPLICATED_APP and REPLICATED_CHANNEL must be set"; \
150122
exit 1; \
151123
fi; \
152124
OCI_URL="oci://registry.replicated.com/$$REPLICATED_APP/$$REPLICATED_CHANNEL"; \
153-
echo "Creating temporary ct-oci.yaml config file with custom values..."; \
154-
echo "chart-repos:" > ct-oci.yaml; \
155-
echo " - replicated=$$OCI_URL" >> ct-oci.yaml; \
156-
echo "debug: true" >> ct-oci.yaml; \
157125
\
158126
# Prepare values arguments if provided
127+
MLFLOW_VALUES_ARGS=""; \
159128
if [ -n "$$MLFLOW_VALUES" ]; then \
160129
echo "Using MLflow values file: $$MLFLOW_VALUES"; \
161-
echo "helm-extra-args: --values $$MLFLOW_VALUES" >> ct-oci.yaml; \
130+
MLFLOW_VALUES_ARGS="--values $$MLFLOW_VALUES"; \
162131
fi; \
163132
\
164-
cat ct-oci.yaml; \
133+
# Create namespace if it doesn't exist
134+
kubectl create namespace values-test 2>/dev/null || true; \
135+
\
136+
# Install infra chart from Replicated registry
137+
echo "Installing infra chart from Replicated registry..."; \
138+
helm upgrade --install infra-values-test $$OCI_URL/infra \
139+
--namespace values-test \
140+
--wait --timeout 5m --debug; \
165141
\
166-
echo "Installing infra chart with chart-testing..."; \
167-
ct install --config ct-oci.yaml \
168-
--charts "infra" \
169-
--namespace default \
170-
--release-label "ci-test"; \
142+
# Install MLflow chart from Replicated registry with custom values
143+
echo "Installing mlflow chart from Replicated registry with custom values..."; \
144+
helm upgrade --install mlflow-values-test $$OCI_URL/mlflow \
145+
--namespace values-test \
146+
$$MLFLOW_VALUES_ARGS \
147+
--wait --timeout 5m --debug; \
171148
\
172-
echo "Installing mlflow chart with chart-testing..."; \
173-
ct install --config ct-oci.yaml \
174-
--charts "mlflow" \
175-
--namespace default \
176-
--release-label "ci-test"; \
149+
# Test the installation
150+
echo "Verifying installation..."; \
151+
kubectl get pods -n values-test; \
177152
\
178-
rm -f ct-oci.yaml; \
179153
echo "Helm installation with custom values completed successfully."
180154

181155
# Example target to check versions (optional)

applications/mlflow/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ make test
2727
# Login to Replicated registry
2828
make registry-login
2929

30-
# Install charts from the Replicated registry (SDK enabled)
31-
make test-replicated-helm
30+
# Install charts from the Replicated registry with custom values (SDK enabled)
31+
make test-replicated-helm-with-values
3232
```
3333

3434
### Environment Variables for Registry Testing
@@ -38,6 +38,9 @@ For testing with charts from the Replicated registry, set:
3838
- `REPLICATED_CHANNEL` - The channel slug
3939
- `REPLICATED_LICENSE_ID` - Your Replicated license ID (required for registry authentication)
4040

41+
For the `test-replicated-helm-with-values` target, you can also set:
42+
- `MLFLOW_VALUES` - Path to a custom values file for MLflow
43+
4144
### Registry Authentication
4245

4346
The `registry-login` target handles registry authentication using your license ID:
@@ -64,7 +67,7 @@ The pipeline workflow:
6467
4. `kots-install-test`: Tests KOTS installation
6568
5. `cleanup-test-release`: Cleans up test resources
6669

67-
> Note: Chart-testing (ct) is set up automatically by the GitHub Action `helm/chart-testing[email protected]` in the CI pipeline. When running locally, ensure you have chart-testing installed.
70+
The pipeline uses direct Helm commands for installation and testing, ensuring reliable and consistent behavior across environments.
6871

6972
The pipeline is triggered on:
7073
- Pull requests affecting the MLflow application

applications/mlflow/ct.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)