Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
default: "3.9"
runner:
type: string
default: ubuntu-latest
default: ubuntu-24.04
run:
required: true
type: string
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release_exe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ jobs:
python -m pip install --upgrade pip
pip install .[dev,test]

# Hashes the committed file, not the checkout, so the .exe reports the same version as the
# script downloaded from the same commit even when the checkout converted line endings.
- name: Stamp the installer version
run: |
version=$(git show HEAD:dk-installer.py | md5sum | cut -d' ' -f1)
sed -i "s/^BUNDLED_INSTALLER_VERSION = None/BUNDLED_INSTALLER_VERSION = \"${version}\"/" dk-installer.py
grep -q "^BUNDLED_INSTALLER_VERSION = \"${version}\"" dk-installer.py

- name: Build the executable
run: pyinstaller --onefile --exclude demo dk-installer.py

Expand Down
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ Core abstractions (all in `dk-installer.py`):
- **`MultiStepAction`** — `Action` subclass that declares a `steps: list[type[Step]]`. Each `Step` has `pre_execute` (run for all steps before any executes — validation phase) then `execute` (the actual work). On any step failure, remaining steps are skipped and `on_action_fail` runs in reverse order; on success, `on_action_success` runs in reverse order. **Most install/upgrade actions are `MultiStepAction`s** — when adding a new install phase, write a new `Step` class and add it to the list.
- **`Step`** — unit of work inside a `MultiStepAction`. Steps share state via `action.ctx` (a dict on the parent action). Raising `SkipStep` from `execute` marks it SKIPPED; raising any other exception marks it FAILED and aborts the action if `required = True`.
- **`ComposeActionMixin` / `ComposeDeleteAction` / `ComposePullImagesStep` / `ComposeStartStep` / `CreateComposeFileStepBase`** — shared building blocks for both products. `Obs*` and `TestGen*` classes specialize these.
- **`AnalyticsWrapper`** — sends anonymous Mixpanel events for each action (disabled with `--no-analytics` or `DK_INSTALLER_ANALYTICS=no`). Instance ID is persisted to `.dk-installer/instance.txt`. Don't log PII here.
- **`AnalyticsWrapper`** — sends anonymous Mixpanel events for each action (disabled with `--no-analytics` or `DK_INSTALLER_ANALYTICS=no`). Instance ID is persisted to `.dk-installer/instance.txt`. Events describe errors with codes, class names, and command names only (`abort_reason`, `failed_step`, `failed_optional_steps`, `error_types`, `failed_cmd`, `cmd_exit_code`), never exception messages or full command lines, which carry paths, user names, and secrets. Give every new `raise AbortAction` a `reason` from `AbortReason`.
- **Run the installer with `DK_INSTALLER_ANALYTICS=no`** whenever you run it outside the test suite (trying a change, reproducing a bug, scripting it). Its Mixpanel token is public, so every run sends a production event. Under pytest it sends nothing.
- **`Console`** (global `CONSOLE`) — all user-facing output goes through this; don't use bare `print` for user messages (the menu code and `collect_user_input` are the exceptions).
- **`Menu`** / `show_menu` — only used when the frozen Windows `.exe` is launched with no arguments (double-click). Not part of the CLI flow on Unix.

Expand Down
Loading
Loading