Lab 2.1 — Launch Your Dev Space

Welcome to Act 2. You are now the Developer — first day on a platform that will not send your source to a public LLM. Everything you need — editor, terminal, OpenCode, Qwen3.8 on the cluster — is in the browser through OpenShift Dev Spaces. No laptop install.

Estimated time: 10 minutes
Persona: Developer
What you need: The launch URL from Lab 1.4 and your cluster login

What is OpenShift Dev Spaces?

OpenShift Dev Spaces provides cloud-based developer workspaces — VS Code-compatible IDEs that run as pods in the cluster. Key benefits:

  • Zero local setup: the workspace comes pre-configured; just open a browser

  • Consistent environment: every developer gets the same tools, versions, and configuration

  • In-cluster access: your workspace calls Models-as-a-Service at https://maas.<apps-domain>/…​; with the injected sk-oai- key — same OpenAI API, governed quota

  • Persistent storage: your work is saved on a per-user PVC even if you close the browser

Get the Dev Spaces URL

Use the URL you printed in Lab 1.4. It clones the Go app template (go-app-template) — not this workshop repo — and creates a workspace from its devfile.yaml:

https://devspaces.apps.<cluster>/#https://github.com/fjcloud/go-app-template?ai-provider=opencodeai/opencode

The #<template-url> suffix tells Dev Spaces to clone the template and create a workspace from its devfile.yaml automatically. OpenCode is injected by the platform (AI tool registry) and already talks to Qwen3.8. The workspace comes pre-loaded with AGENTS.md, pipeline/, gitops/, and deploy/base/ — you only need to write the application code.

  1. Open that URL in your browser.

Log In and Create Your Workspace

  1. You will be redirected to OpenShift SSO. Log in with the same cluster user you used for oc.

  2. On the Create Workspace page, confirm that OpenCode is selected under AI Provider. That selection injects the CLI at start; you do not install it yourself. You will see a progress screen:

    Starting workspace...
    Pulling universal developer image...
    Injecting OpenCode...
    Running postStart commands...
      ✓ Installing the ephemeral Git client

    This takes approximately 2-3 minutes on first launch. Subsequent launches are faster — the image is cached.

  3. When the workspace is ready, a VS Code-like editor opens in the browser. You will see:

    • A file explorer on the left

    • A terminal at the bottom

    • OpenCode available on PATH (injected by Dev Spaces, not by the template)

      Do not sign in to GitHub Copilot. Che Code ships Copilot as a built-in; the platform disables it. Do not install Continue. The in-cluster model is OpenCode in the terminal.

Verify OpenCode is Running

  1. Open a terminal in the workspace (Terminal → New Terminal or press Ctrl+`).

  2. Check that OpenCode is on PATH (injected) and that ephemeral Git is configured ($GIT_SERVER):

    opencode --version && echo "GIT_SERVER=$GIT_SERVER"
    Sample Output
    opencode 0.x.x
    GIT_SERVER=https://git.<workshop-domain>
  3. Verify OpenCode can reach Models-as-a-Service. $OPENAI_BASE_URL is already in the workspace. The developer ServiceAccount cannot oc get gateway in openshift-ingress — take the hostname from that URL:

    MAAS_HOST="${OPENAI_BASE_URL#https://}"
    MAAS_HOST="${MAAS_HOST%%/*}"
    
    curl -sS "https://${MAAS_HOST}/v1/models" \
      -H "Authorization: Bearer $OPENAI_API_KEY" \
      | python3 -m json.tool
    Expected Output
    {
      "object": "list",
      "data": [
        {
          "id": "publishers/llm-serving/models/qwen3",
          "owned_by": "llm-serving/qwen3",
          "ready": true,
          "modelDetails": {
            "displayName": "Qwen3.8",
            "contextWindow": "262144"
          }
        }
      ]
    }

    $OPENAI_API_KEY is the MaaS sk-oai- key the platform minted into Secret ai-provider-openai-api-key. $OPENAI_BASE_URL is the live MaaS path (https://maas.<apps-domain>/llm-serving/qwen3/v1) — configure-platform.sh binds the Gateway cert to this cluster. OpenCode calls that URL so the API model id stays qwen3.

  4. Start OpenCode:

    opencode

    The OpenCode TUI (Terminal UI) launches. It reads AGENTS.md and connects to the Qwen3.8 LLM automatically. Two session modes are available: plan (read-only — no file writes) and build (writes files). Press Tab to switch from one to the other. Press q to exit OpenCode when needed.

Understanding the OpenCode Configuration

OpenCode reads project opencode.json first (it overrides the platform mount under ~/.config/opencode). Verify the file in the template:

cat ${PROJECT_SOURCE}/opencode.json

Expected content:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "qwen3": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Qwen3.8",
      "options": {
        "baseURL": "{env:OPENAI_BASE_URL}",
        "apiKey": "{env:OPENAI_API_KEY}",
        "chunkTimeout": 120000,
        "timeout": 600000
      },
      "models": {
        "qwen3": {
          "name": "Qwen3.8",
          "limit": {
            "context": 262144,
            "output": 32768
          }
        }
      }
    }
  },
  "model": "qwen3/qwen3",
  "autoupdate": false
}

OpenCode still reads AGENTS.md from the project directory at the start of every session. That is how the Platform Engineer’s rules are enforced.

limit.output must stay well below --max-model-len (262144). OpenCode’s default 32 768 output tokens now fits the native 256K window.

✅ Checkpoint

opencode --version && \
echo "GIT_SERVER=$GIT_SERVER" && \
MAAS_HOST="${OPENAI_BASE_URL#https://}" && \
MAAS_HOST="${MAAS_HOST%%/*}" && \
curl -sS "https://${MAAS_HOST}/v1/models" \
  -H "Authorization: Bearer $OPENAI_API_KEY" | \
  python3 -c "import sys,json; m=json.load(sys.stdin); print('LLM ready:', m['data'][0]['modelDetails']['displayName'])"
Expected Output
opencode 0.x.x
GIT_SERVER=https://git.<workshop-domain>
LLM ready: Qwen3.8

Your Dev Space is running, tools are installed, and the LLM is reachable. ✓

➡️ Move on to Lab 2.2: Prompt to Production.