Repository navigation
Expand file tree
/
Copy pathdevfile.yaml
More file actions
110 lines (104 loc) · 3.96 KB
/
Copy pathdevfile.yaml
File metadata and controls
110 lines (104 loc) · 3.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
schemaVersion: 2.2.2
metadata:
name: ocp-provisioning
displayName: OCP Provisioning
description: Ansible day-2 automation and Operations Dashboard for OpenShift
language: Python
tags:
- Python
- Ansible
- OpenShift
components:
- name: tooling
container:
image: registry.redhat.io/devspaces/udi-rhel9:latest
memoryRequest: 1Gi
memoryLimit: 6Gi
cpuRequest: 200m
cpuLimit: "2"
mountSources: true
env:
- name: NPM_CONFIG_PREFIX
value: /home/user/.npm-global
- name: PATH
value: /home/user/.npm-global/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
commands:
- id: install-claude-cli
exec:
component: tooling
commandLine: >-
npm config set prefix /home/user/.npm-global &&
npm install -g @anthropic-ai/claude-code &&
claude --version
label: Install Claude Code CLI
- id: configure-continue
exec:
component: tooling
label: Point the Continue extension at OpenShift AI
# LITELLM_API_KEY / LITELLM_BASE_URL arrive as environment variables from
# the litellm-workspace-credentials Secret, which Che copies into the
# user namespace and the DevWorkspace Operator mounts here. The key is
# written at runtime inside the workspace, never committed.
commandLine: |
if [ -z "$LITELLM_API_KEY" ]; then
echo "LITELLM_API_KEY not set - skipping Continue config."
exit 0
fi
mkdir -p "$HOME/.continue"
cat > "$HOME/.continue/config.yaml" <<EOF
name: OpenShift AI
version: 0.0.1
schema: v1
models:
# There is no "agent" role. Continue greys out Agent mode unless the
# model advertises tool_use, and its autodetection keys off provider
# plus model name - it has never heard of these two behind LiteLLM,
# so without the override both stay chat/edit only.
- name: Qwen3-4B
provider: openai
model: qwen3-4b
apiBase: ${LITELLM_BASE_URL}
apiKey: ${LITELLM_API_KEY}
roles: [chat, edit, apply]
capabilities: [tool_use]
- name: Mistral-Small-4-119B
provider: openai
model: Mistral-Small-4-119B-2603
apiBase: ${LITELLM_BASE_URL}
apiKey: ${LITELLM_API_KEY}
roles: [chat, edit, apply]
capabilities: [tool_use]
mcpServers:
# Cluster tools for the agent, on top of Continue's built-in file and
# terminal tools. No Authorization header: the server answers core
# toolset calls with its own mcp-viewer ServiceAccount. Sending the
# workspace token instead would bake a ~1h projected token into this
# file and break once kubelet rotated it.
# Second label is the namespace, and must track
# mcp_server_namespace in roles/openshift_ai/defaults/main.yml.
# Dev Spaces reads this file straight from git, so Ansible cannot
# template it - a namespace change has to be made here by hand or
# the agent loses its cluster tools with no error worth noticing.
- name: openshift
type: streamable-http
url: http://openshift-mcp-server.mcp-servers.svc.cluster.local:8080/mcp
EOF
chmod 600 "$HOME/.continue/config.yaml"
echo "Continue configured against $LITELLM_BASE_URL"
- id: install-python-deps
exec:
component: tooling
workingDir: ${PROJECT_SOURCE}
commandLine: pip install --user ansible kubernetes
label: Install Ansible and Kubernetes client
- id: run-dashboard
exec:
component: tooling
workingDir: ${PROJECT_SOURCE}/dashboard
commandLine: pip install --user -r requirements.txt && python app.py
label: Run Operations Dashboard locally
events:
postStart:
- install-claude-cli
- install-python-deps
- configure-continue