Skip to content

Commit f90cb2f

Browse files
Add code-server support to auplc-installer env selection and image builds.
Wire auplc-code-cpu/gpu into catalog, Makefile all, overlay tagging, and the basic preset; rename the TUI to env selection with back navigation; and show build/pull progress during standalone img and dev quick flows. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a8e41b2 commit f90cb2f

8 files changed

Lines changed: 287 additions & 172 deletions

File tree

auplc_installer/catalog.py

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class Course:
4545
COURSE_CATALOG: tuple[Course, ...] = (
4646
Course("cpu", "auplc-default", False, "base-cpu", "Base CPU (Python Base Environment)"),
4747
Course("gpu", "auplc-base", True, "base-rocm", "Base GPU (GPU Base Environment)"),
48+
Course("code-cpu", "auplc-code-cpu", False, "code-cpu", "Code Server CPU Environment"),
49+
Course("code-gpu", "auplc-code-gpu", True, "code-gpu", "Code Server GPU Environment"),
4850
Course("Course-CV", "auplc-cv", True, "cv", "Computer Vision Course"),
4951
Course("Course-DL", "auplc-dl", True, "dl", "Deep Learning Course"),
5052
Course("Course-LLM", "auplc-llm", True, "llm", "Large Language Model Course"),
@@ -54,7 +56,7 @@ class Course:
5456
COURSE_KEYS_ALL: tuple[str, ...] = tuple(c.key for c in COURSE_CATALOG)
5557
COURSE_BY_KEY: dict[str, Course] = {c.key: c for c in COURSE_CATALOG}
5658

57-
COURSE_PRESET_BASIC: tuple[str, ...] = ("cpu", "gpu")
59+
COURSE_PRESET_BASIC: tuple[str, ...] = ("cpu", "gpu", "code-cpu", "code-gpu")
5860
COURSE_PRESET_ALL: tuple[str, ...] = COURSE_KEYS_ALL
5961

6062

@@ -78,12 +80,39 @@ class Course:
7880

7981

8082
BASE_TEAM_MAPPING: dict[str, list[str]] = {
81-
"cpu": ["cpu"],
82-
"gpu": ["Course-CV", "Course-DL", "Course-LLM", "Course-PhySim"],
83-
"official": ["cpu", "gpu", "Course-CV", "Course-DL", "Course-LLM", "Course-PhySim"],
83+
"cpu": ["cpu", "code-cpu"],
84+
"gpu": ["code-gpu", "Course-CV", "Course-DL", "Course-LLM", "Course-PhySim"],
85+
"official": [
86+
"cpu",
87+
"gpu",
88+
"code-cpu",
89+
"code-gpu",
90+
"Course-CV",
91+
"Course-DL",
92+
"Course-LLM",
93+
"Course-PhySim",
94+
],
8495
"AUP": ["Course-CV", "Course-DL", "Course-LLM", "Course-PhySim"],
85-
"native-users": ["Course-CV", "Course-DL", "Course-LLM", "Course-PhySim", "cpu", "gpu"],
86-
"github-users": ["cpu", "gpu", "Course-CV", "Course-DL", "Course-LLM", "Course-PhySim"],
96+
"native-users": [
97+
"code-cpu",
98+
"code-gpu",
99+
"Course-CV",
100+
"Course-DL",
101+
"Course-LLM",
102+
"Course-PhySim",
103+
"cpu",
104+
"gpu",
105+
],
106+
"github-users": [
107+
"cpu",
108+
"gpu",
109+
"code-cpu",
110+
"code-gpu",
111+
"Course-CV",
112+
"Course-DL",
113+
"Course-LLM",
114+
"Course-PhySim",
115+
],
87116
}
88117

89118

auplc_installer/cli.py

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
ensure_sudo_session,
4747
log,
4848
log_error,
49+
log_success,
4950
set_verbose,
5051
start_sudo_keepalive,
5152
)
@@ -99,7 +100,7 @@
99100
rt remove Remove JupyterHub runtime
100101
101102
img build [target...] Build custom images (default: all, or hub + selected courses)
102-
Targets: all, hub, base-cpu, base-rocm, cv, dl, llm, physim
103+
Targets: all, hub, base-cpu, base-rocm, code, code-cpu, code-gpu, cv, dl, llm, physim
103104
img pull Pull external images for offline use
104105
105106
detect-gpu Show detected GPU configuration
@@ -146,7 +147,7 @@
146147
unselected courses are hidden in the spawn UI. Empty (the
147148
default) keeps the historical "all courses" behaviour.
148149
all - every course
149-
basic - cpu base + gpu base only
150+
basic - cpu/gpu base + code-server (code-cpu, code-gpu)
150151
none - Hub only, no courses
151152
<list> - comma-separated keys, e.g. cpu,gpu,Course-CV
152153
Env: AUPLC_COURSES
@@ -176,7 +177,7 @@
176177
./auplc-installer install --gpu=strix-halo
177178
./auplc-installer install --gpu=auto --dry-run
178179
./auplc-installer install --gpu=phx --docker=0 # legacy flags
179-
./auplc-installer install --courses=basic # cpu + gpu only
180+
./auplc-installer install --courses=basic # base + code-server envs
180181
./auplc-installer install --courses=cpu,gpu,Course-CV
181182
./auplc-installer img build base-rocm --gpu=strix
182183
./auplc-installer install --mirror=mirror.example.com
@@ -565,17 +566,19 @@ def cmd_dev_quick(state: InstallerState) -> None:
565566
log("Dev quick cycle: build hub → restart pod")
566567
log("===========================================")
567568
detect_and_configure_gpu(state.gpu, gpu_type_override=state.gpu_type)
568-
local_image_build(
569-
["hub"],
570-
cfg=state.gpu,
571-
courses=state.courses,
572-
mirror_prefix=state.mirror_prefix,
573-
mirror_pip=state.mirror_pip,
574-
mirror_npm=state.mirror_npm,
575-
use_docker=state.use_docker,
576-
k3s_images_dir=state.k3s_images_dir,
577-
)
578-
dev_quick_rollout()
569+
with stage("Building Hub image", idx=1, total=2):
570+
local_image_build(
571+
["hub"],
572+
cfg=state.gpu,
573+
courses=state.courses,
574+
mirror_prefix=state.mirror_prefix,
575+
mirror_pip=state.mirror_pip,
576+
mirror_npm=state.mirror_npm,
577+
use_docker=state.use_docker,
578+
k3s_images_dir=state.k3s_images_dir,
579+
)
580+
with stage("Restarting Hub pod", idx=2, total=2):
581+
dev_quick_rollout()
579582

580583

581584
def cmd_dev_deploy(state: InstallerState) -> None:
@@ -686,25 +689,29 @@ def cmd_rt_reinstall(state: InstallerState) -> None:
686689

687690
def cmd_img_build(state: InstallerState, targets: Sequence[str]) -> None:
688691
detect_and_configure_gpu(state.gpu, gpu_type_override=state.gpu_type)
689-
local_image_build(
690-
targets,
691-
cfg=state.gpu,
692-
courses=state.courses,
693-
mirror_prefix=state.mirror_prefix,
694-
mirror_pip=state.mirror_pip,
695-
mirror_npm=state.mirror_npm,
696-
use_docker=state.use_docker,
697-
k3s_images_dir=state.k3s_images_dir,
698-
)
692+
with stage("Building custom images", idx=1, total=1):
693+
local_image_build(
694+
targets,
695+
cfg=state.gpu,
696+
courses=state.courses,
697+
mirror_prefix=state.mirror_prefix,
698+
mirror_pip=state.mirror_pip,
699+
mirror_npm=state.mirror_npm,
700+
use_docker=state.use_docker,
701+
k3s_images_dir=state.k3s_images_dir,
702+
)
703+
log_success("Custom images built successfully.")
699704

700705

701706
def cmd_img_pull(state: InstallerState) -> None:
702-
pull_external_images(
703-
skip_build_only=False,
704-
use_docker=state.use_docker,
705-
k3s_images_dir=state.k3s_images_dir,
706-
mirror_prefix=state.mirror_prefix,
707-
)
707+
with stage("Pulling external images", idx=1, total=1):
708+
pull_external_images(
709+
skip_build_only=False,
710+
use_docker=state.use_docker,
711+
k3s_images_dir=state.k3s_images_dir,
712+
mirror_prefix=state.mirror_prefix,
713+
)
714+
log_success("External images pulled successfully.")
708715

709716

710717
# ---------------------------------------------------------------------------
@@ -871,7 +878,7 @@ def _dispatch(
871878
else:
872879
log_error(
873880
"Usage: auplc-installer img {build [target...]|pull}. "
874-
"Targets: all, hub, base-cpu, base-rocm, cv, dl, llm, physim"
881+
"Targets: all, hub, base-cpu, base-rocm, code, code-cpu, code-gpu, cv, dl, llm, physim"
875882
)
876883
sys.exit(1)
877884
return

auplc_installer/overlay.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
# so YAML emission is deterministic.
3030
_RESOURCE_IMAGE_BASE: dict[str, str] = {
3131
"gpu": "auplc-base",
32+
"code-gpu": "auplc-code-gpu",
3233
"Course-CV": "auplc-cv",
3334
"Course-DL": "auplc-dl",
3435
"Course-LLM": "auplc-llm",
@@ -62,7 +63,7 @@ def emit_overlay(
6263
if not homogeneous_target:
6364
targets = " ".join(s.gpu_target for s in cfg.skus)
6465
buf.write(f"# Mixed gfx targets: {targets}\n")
65-
buf.write(f"# Course selection : {courses.description()}\n")
66+
buf.write(f"# Env selection : {courses.description()}\n")
6667
buf.write("# Regenerated on install/upgrade.\n")
6768
buf.write("custom:\n")
6869

@@ -188,7 +189,7 @@ def generate_values_overlay(
188189
# header by :func:`emit_overlay`. Used by upgrade flows so that a bare
189190
# ``rt upgrade`` (no ``--courses=`` flag) preserves whatever the user
190191
# originally installed with instead of silently expanding to "all".
191-
_COURSE_HEADER_RE = re.compile(r"^# Course selection\s*:\s*(.+?)\s*$")
192+
_COURSE_HEADER_RE = re.compile(r"^# (?:Env selection|Course selection)\s*:\s*(.+?)\s*$")
192193

193194

194195
def try_load_courses_from_overlay(overlay_path: Path) -> CourseSelection | None:

auplc_installer/summary.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def format_configuration_summary(state: InstallerState, *, image_source_label: s
6868
lines.append(f" Registry mirror : {state.mirror_prefix or '(none)'}")
6969
lines.append(f" PyPI mirror : {state.mirror_pip or '(default)'}")
7070
lines.append(f" npm mirror : {state.mirror_npm or '(default)'}")
71-
lines.append(f" Courses : {state.courses.description()}")
71+
lines.append(f" Environments : {state.courses.description()}")
7272
return "\n".join(lines)
7373

7474

@@ -104,5 +104,5 @@ def row(key: str, value: str, *, accent: bool = False, faint: bool = False) -> s
104104
lines.append(row("npm mirror", state.mirror_npm))
105105
else:
106106
lines.append(row("npm mirror", "(default)", faint=True))
107-
lines.append(row("Courses", state.courses.description(), accent=True))
107+
lines.append(row("Environments", state.courses.description(), accent=True))
108108
return "\n".join(lines)

0 commit comments

Comments
 (0)