Skip to content

Commit 1d218b8

Browse files
committed
remove kind tasks
1 parent 8097c49 commit 1d218b8

File tree

3 files changed

+10
-127
lines changed

3 files changed

+10
-127
lines changed

applications/mlflow/.docker/entrypoint.sh

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,10 @@ trap 'exit 0' EXIT
1212
# Basic initialization
1313
echo "Initializing development environment..."
1414

15-
# Function to create a Kind cluster if needed
16-
setup_kind_cluster() {
17-
echo "Setting up Kind Kubernetes cluster..."
18-
# Check if kind is installed
19-
if ! command -v kind &> /dev/null; then
20-
echo "Error: kind not found. Cannot create cluster."
21-
return 1
22-
fi
23-
24-
# Create a basic kind config
25-
cat > /tmp/kind-config.yaml << EOF
26-
kind: Cluster
27-
apiVersion: kind.x-k8s.io/v1alpha4
28-
nodes:
29-
- role: control-plane
30-
extraPortMappings:
31-
- containerPort: 30080
32-
hostPort: 30080
33-
EOF
34-
35-
# Create the cluster
36-
echo "Creating kind cluster 'mlflow-dev'..."
37-
kind create cluster --name mlflow-dev --config /tmp/kind-config.yaml --wait 2m
38-
39-
# Update kubeconfig
40-
mkdir -p ~/.kube
41-
kind get kubeconfig --name mlflow-dev > ~/.kube/config
42-
chmod 600 ~/.kube/config
43-
44-
echo "✅ Kind cluster 'mlflow-dev' created and configured."
45-
echo "Kubernetes context set to kind-mlflow-dev"
46-
}
47-
48-
# Check for kube config and offer to create kind cluster if none found
15+
# Check for kube config and warn if none found
4916
if [ ! -f ~/.kube/config ]; then
5017
echo "Warning: No Kubernetes config file found."
51-
52-
# Check if USE_KIND is set to true
53-
if [ "${USE_KIND:-}" = "true" ]; then
54-
echo "USE_KIND is set, creating local Kind cluster..."
55-
setup_kind_cluster
56-
else
57-
echo "To use a local Kind cluster, restart with:"
58-
echo "USE_KIND=true task dev:shell"
59-
echo ""
60-
echo "Alternatively, ensure ~/.kube/config is mounted from host."
61-
fi
18+
echo "Ensure ~/.kube/config is mounted from host."
6219
else
6320
echo "Found Kubernetes config. Using existing configuration."
6421
fi
@@ -82,10 +39,10 @@ MLflow Development Environment
8239
- All required tools are pre-installed:
8340
* task, helm, kubectl, yq, jq, etc.
8441
- Use 'task --list' to see available tasks
85-
- Directories from host are mounted in /app
42+
- Directories from host are mounted in /workspace
8643
8744
Kubernetes Setup:
88-
$(if [ "${USE_KIND:-}" = "true" ]; then echo "- Using local Kind cluster 'mlflow-dev'"; else echo "- Using host's Kubernetes config"; fi)
45+
- Using host's Kubernetes config
8946
9047
Networking:
9148
- ${NETWORK_MODE}

applications/mlflow/DEVELOPMENT.md

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Optional (for direct installation on your machine):
1313
- go (1.20+)
1414
- Helm
1515
- kubectl
16-
- [Kind](https://kind.sigs.k8s.io/) - Kubernetes in Docker (if running local Kubernetes)
1716

1817
## Development Workflow
1918

@@ -41,13 +40,6 @@ task dev:start
4140
task dev:shell
4241
```
4342

44-
For development with Kind (Kubernetes in Docker), use:
45-
46-
```bash
47-
# Enter the development container with Kind access
48-
task dev:shell:kind
49-
```
50-
5143
The tasks above will:
5244
1. Build the development Docker image if needed
5345
2. Start a container with the proper mounts and environment
@@ -68,7 +60,7 @@ task helm:lint
6860
# Template the chart (no values overrides)
6961
task helm:template
7062

71-
# Install the chart to a kind cluster
63+
# Install the chart to your Kubernetes cluster
7264
task helm:install-local
7365

7466
# Run application tests
@@ -135,22 +127,6 @@ If you encounter issues with the container:
135127
- Restart it: `task dev:restart`
136128
- Rebuild the image if needed: `task dev:build-image`
137129

138-
## Kubernetes Development with Kind
139-
140-
The `dev:shell:kind` task creates a privileged container that can run Kind (Kubernetes in Docker). This allows you to:
141-
142-
1. Create and manage a Kubernetes cluster inside the development container
143-
2. Test MLflow deployments in a realistic Kubernetes environment
144-
3. Use kubectl, helm, and other Kubernetes tools directly within the container
145-
146-
To create a Kind cluster once inside the container:
147-
148-
```bash
149-
kind create cluster --name mlflow-dev
150-
```
151-
152-
This cluster can then be used to test your MLflow deployments in a Kubernetes environment that closely resembles production.
153-
154130
## Creating a Release
155131

156132
When you're ready to publish your changes to the Replicated platform:
@@ -253,14 +229,6 @@ If you encounter issues with port forwarding:
253229
2. Try using a different port by specifying it when starting the service
254230
3. The development environment automatically tries ports 5000-5004 and will use the first available one
255231

256-
### Kind Cluster Issues
257-
258-
If you encounter issues with the Kind cluster:
259-
260-
1. Make sure you're using the `dev:shell:kind` task which provides the necessary privileges
261-
2. If the cluster fails to start, try deleting it first: `kind delete cluster --name mlflow-dev`
262-
3. Check docker resource limits if you experience performance issues
263-
264232
## CI/CD Pipeline Integration
265233

266234
For CI, we push the development image to ttl.sh with:

applications/mlflow/Taskfile.yml

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,8 @@ tasks:
9494
echo "All standard ports are in use. Using a random port."
9595
fi
9696
97-
# Add privileged mode if USE_KIND is true
98-
PRIVILEGED_ARG=""
99-
if [ "${USE_KIND:-false}" = "true" ]; then
100-
PRIVILEGED_ARG="--privileged"
101-
fi
102-
10397
# Start container with host networking for kubectl port-forward compatibility
104-
CONTAINER_ID=$(docker run --name mlflow-dev-container --network host --privileged -d \
98+
CONTAINER_ID=$(docker run --name mlflow-dev-container --network host -d \
10599
-v $(pwd):/workspace \
106100
-v ~/.kube:/home/devuser/.kube \
107101
-v ~/.helm:/home/devuser/.helm \
@@ -122,14 +116,6 @@ tasks:
122116
fi
123117
fi
124118
125-
dev:shell:
126-
desc: Attach to development container shell
127-
deps: [dev:ensure-running]
128-
silent: true
129-
cmds:
130-
- echo "Connecting to mlflow-dev-container..."
131-
- docker exec -it mlflow-dev-container /bin/bash
132-
133119
dev:ensure-running:
134120
desc: Ensure the development container is running
135121
internal: true
@@ -145,42 +131,14 @@ tasks:
145131
status:
146132
- docker ps | grep -q "mlflow-dev-container"
147133

148-
dev:shell:kind:
149-
desc: Start container with Kind Kubernetes cluster and attach to shell
150-
deps: [dev:prepare-kind]
134+
dev:shell:
135+
desc: Attach to development container shell
136+
deps: [dev:ensure-running]
151137
silent: true
152138
cmds:
153-
- echo "Entering development container with Kind Kubernetes cluster..."
139+
- echo "Connecting to mlflow-dev-container..."
154140
- docker exec -it mlflow-dev-container /bin/bash
155141

156-
dev:prepare-kind:
157-
desc: Prepare the development container for Kind usage
158-
internal: true
159-
silent: true
160-
cmds:
161-
- echo "Preparing development container with Kind Kubernetes cluster..."
162-
- |
163-
if docker ps | grep -q "mlflow-dev-container"; then
164-
echo "Container mlflow-dev-container is already running. Stopping it first..."
165-
docker stop mlflow-dev-container
166-
docker rm mlflow-dev-container
167-
elif docker ps -a | grep -q "mlflow-dev-container"; then
168-
echo "Container mlflow-dev-container exists but is not running. Removing it..."
169-
docker rm mlflow-dev-container
170-
fi
171-
172-
# Start container with host networking and privileged mode for Kind
173-
docker run --name mlflow-dev-container --network host --privileged -d \
174-
-v $(pwd):/workspace \
175-
-v ~/.replicated:/home/devuser/.replicated \
176-
-e SHELL=/bin/bash \
177-
-e HOME=/home/devuser \
178-
-e USER=devuser \
179-
-e USE_KIND=true \
180-
-e HOST_NETWORK=true \
181-
-w /workspace \
182-
{{.DEV_IMAGE}} sleep infinity
183-
184142
dev:stop:
185143
desc: Stop development container
186144
silent: true

0 commit comments

Comments
 (0)