Skip to content

Commit 64d4ca0

Browse files
committed
Add openvscode-server flavor of the CPU image
Layer Gitpod's openvscode-server on top of ghcr.io/boettiger-lab/k8s:latest and point jupyter-vscode-proxy at it via CODE_EXECUTABLE, published as the :openvscode tag. Tests whether openvscode's closer-to-upstream WebSocket layer works under iOS WebKit, where code-server's patched layer leaves the terminal, files, and Claude extension dead (shell renders, nothing connects).
1 parent 3cbdb1c commit 64d4ca0

3 files changed

Lines changed: 125 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: openvscode Image
2+
on:
3+
workflow_dispatch: null
4+
schedule:
5+
# Weekly, like the default CPU image, so this flavor tracks :latest.
6+
- cron: '0 0 * * 0'
7+
push:
8+
# Trigger on the files this flavor consumes. It layers on the published
9+
# :latest image, so it does NOT depend on the base Dockerfile / install-*.sh
10+
# here — only on its own Dockerfile, install script, and this workflow.
11+
paths:
12+
- 'images/Dockerfile.openvscode'
13+
- 'images/install-openvscode.sh'
14+
- '.github/workflows/docker-openvscode-image.yml'
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
permissions: write-all
19+
steps:
20+
- name: cleanup disk space
21+
run: |
22+
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc
23+
df -h
24+
- uses: actions/checkout@v3
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v3
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
- name: Login to GitHub Container Registry
30+
if: github.repository == 'boettiger-lab/k8s'
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{github.actor}}
35+
password: ${{secrets.GITHUB_TOKEN}}
36+
- name: Build and push
37+
if: github.repository == 'boettiger-lab/k8s'
38+
uses: docker/build-push-action@v6
39+
with:
40+
context: images/
41+
file: images/Dockerfile.openvscode
42+
platforms: linux/amd64,linux/arm64
43+
push: true
44+
tags: ghcr.io/boettiger-lab/k8s:openvscode

images/Dockerfile.openvscode

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# openvscode-server "flavor" of the default CPU image.
2+
#
3+
# Built as a thin layer ON TOP of the already-published default image
4+
# (images/Dockerfile -> ghcr.io/boettiger-lab/k8s:latest) rather than a full
5+
# rebuild, and pushed as the :openvscode tag. That keeps it identical to the
6+
# default image except for the one variable under test: it adds Gitpod's
7+
# openvscode-server and points jupyter-vscode-proxy at it via CODE_EXECUTABLE,
8+
# so the "VS Code" launcher tile spawns openvscode-server instead of code-server.
9+
# Purpose: check whether openvscode's closer-to-upstream WebSocket/reconnection
10+
# layer survives iOS WebKit, where code-server's patched layer leaves the
11+
# terminal, files, and Claude extension dead.
12+
FROM ghcr.io/boettiger-lab/k8s:latest
13+
14+
USER root
15+
COPY install-openvscode.sh /tmp/install-openvscode.sh
16+
RUN bash /tmp/install-openvscode.sh && rm /tmp/install-openvscode.sh
17+
18+
# Make jupyter-vscode-proxy launch openvscode-server instead of code-server.
19+
ENV CODE_EXECUTABLE=openvscode-server
20+
21+
USER ${NB_USER}

images/install-openvscode.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# openvscode-server is Gitpod's build of VS Code's *upstream* web server, offered
5+
# as an alternative backend to code-server (Coder's fork) for jupyter-vscode-proxy.
6+
# The proxy chooses the backend from $CODE_EXECUTABLE and launches whichever of
7+
# `code-server` / `openvscode-server` is named; both accept --port/--socket and
8+
# --extensions-dir, so the "VS Code" launcher tile is otherwise unchanged.
9+
#
10+
# Why we test it: terminal, file explorer, and the Claude extension all hang off
11+
# code-server's WebSocket + reconnection layer, which is one of the most heavily
12+
# *patched* parts of Coder's fork. Under iOS/iPadOS WebKit (which every iOS
13+
# browser is forced to use) that layer fails — the shell renders but nothing
14+
# interactive connects. openvscode-server stays close to the upstream VS Code-web
15+
# code Microsoft actually exercises on Safari for vscode.dev, so swapping it in
16+
# isolates that single variable.
17+
18+
# Pin with OPENVSCODE_VERSION (e.g. 1.109.5); the default resolves the latest
19+
# release tag so the test image tracks upstream without a hardcoded version.
20+
VERSION="${OPENVSCODE_VERSION:-latest}"
21+
if [ "${VERSION}" = "latest" ]; then
22+
TAG="$(curl -fsSL https://api.github.com/repos/gitpod-io/openvscode-server/releases/latest \
23+
| grep '"tag_name"' | head -1 \
24+
| sed -E 's/.*"openvscode-server-v([^"]+)".*/\1/')"
25+
else
26+
TAG="${VERSION}"
27+
fi
28+
[ -n "${TAG}" ] || { echo "ERROR: could not resolve openvscode-server version" >&2; exit 1; }
29+
30+
# Map Docker's arch to the release asset suffix. The CI workflow builds
31+
# linux/amd64,linux/arm64 just like the other images, so both must resolve.
32+
case "$(uname -m)" in
33+
x86_64) ARCH=x64 ;;
34+
aarch64) ARCH=arm64 ;;
35+
*) echo "ERROR: unsupported arch $(uname -m)" >&2; exit 1 ;;
36+
esac
37+
38+
NAME="openvscode-server-v${TAG}-linux-${ARCH}"
39+
URL="https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v${TAG}/${NAME}.tar.gz"
40+
echo "Installing ${NAME}"
41+
42+
mkdir -p /opt
43+
curl -fsSL "${URL}" | tar -xz -C /opt
44+
mv "/opt/${NAME}" /opt/openvscode-server
45+
ln -sf /opt/openvscode-server/bin/openvscode-server /usr/local/bin/openvscode-server
46+
47+
# Fail the build loudly if the binary doesn't run on this arch, rather than
48+
# shipping an image whose "VS Code" tile dies at spawn time.
49+
openvscode-server --version
50+
51+
# The base CPU image already installed Anthropic.claude-code into the shared
52+
# extensions dir that jupyter-vscode-proxy passes via --extensions-dir
53+
# (${CODE_EXTENSIONSDIR}). openvscode-server reads that same dir with the same
54+
# standard VSIX layout, so the Claude extension is inherited — no reinstall here
55+
# (avoids a marketplace round-trip in CI). Confirm it's present so a missing
56+
# extension surfaces at build time, not when a user opens the panel on a tablet.
57+
EXT_DIR="${CODE_EXTENSIONSDIR:-/opt/share/code-server}"
58+
ls "${EXT_DIR}" | grep -qi 'anthropic.claude-code' \
59+
|| { echo "ERROR: Anthropic.claude-code not found in ${EXT_DIR}" >&2; \
60+
ls -la "${EXT_DIR}" 2>&1 || true; exit 1; }

0 commit comments

Comments
 (0)