Skip to content

Commit 7832e4c

Browse files
committed
Install Basic Memory in devcontainer
1 parent 742a800 commit 7832e4c

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"image": "mcr.microsoft.com/devcontainers/javascript-node:4-24-trixie",
77
"features": {
88
"ghcr.io/devcontainers/features/github-cli:1": {},
9+
"ghcr.io/devcontainers/features/python:1": {
10+
"version": "3.12"
11+
},
912
"ghcr.io/devcontainers-extra/features/npm-package:1": {}
1013
},
1114
"runArgs": [
@@ -22,6 +25,10 @@
2225
// Use 'postCreateCommand' to run commands after the container is created.
2326
"postCreateCommand": "bash .devcontainer/post-create.sh",
2427

28+
"remoteEnv": {
29+
"PATH": "${containerWorkspaceFolder}/.venv/bin:${containerEnv:HOME}/.local/bin:${containerEnv:PATH}"
30+
},
31+
2532
// Configure tool-specific properties.
2633
// "customizations": {},
2734

.devcontainer/post-create.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,12 @@ if ! command -v jq >/dev/null 2>&1; then
66
sudo apt-get install -y jq
77
fi
88

9+
python3 -m venv .venv
10+
.venv/bin/python -m pip install --upgrade pip uv
11+
12+
export PATH="$PWD/.venv/bin:$HOME/.local/bin:$PATH"
13+
if ! command -v bm >/dev/null 2>&1; then
14+
uv tool install basic-memory
15+
fi
16+
917
npm ci

basic-memory/projects/firefoxcss-store/operations/Development Container Environment.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ permalink: firefoxcss-store/projects/firefoxcss-store/operations/development-con
1010

1111
# Development Container Environment
1212

13-
Local containerized development is configured through `.devcontainer/devcontainer.json` and `.devcontainer/post-create.sh`. The devcontainer installs Node, npm, GitHub CLI, and `jq`; Nushell is no longer required for catalog refresh.
13+
Local containerized development is configured through `.devcontainer/devcontainer.json` and `.devcontainer/post-create.sh`. The devcontainer installs Node, npm, Python, GitHub CLI, `jq`, `uv`, and Basic Memory tooling; Nushell is no longer required for catalog refresh.
1414

15-
The devcontainer bootstrap script runs from `postCreateCommand` to install project dependencies after container creation or rebuild. It also runs `npm ci` automatically, so rebuilds recreate `node_modules` without manual setup.
15+
The devcontainer bootstrap script runs from `postCreateCommand` to install project dependencies after container creation or rebuild. It creates a local `.venv`, installs `uv` with pip, installs Basic Memory with `uv tool install basic-memory` when `bm` is not already available, and runs `npm ci` automatically so rebuilds recreate `node_modules` without manual setup.
1616

1717
The devcontainer installs GitHub CLI through the `ghcr.io/devcontainers/features/github-cli:1` feature. The `gh` CLI still requires `gh auth login` or `GH_TOKEN` for GitHub API and Actions commands.
1818

19+
The devcontainer remote environment prepends `.venv/bin` and `$HOME/.local/bin` to `PATH` so interactive shells and follow-up commands can find `uv` and `bm` after bootstrap.
20+
1921
The devcontainer mounts `/tmp` as a `tmpfs` with mode `1777` through `runArgs` so VS Code Dev Containers can start under rootless Podman. Without this, the generated feature image can leave `/tmp` at `755` and fail when creating `/tmp/.X11-unix`.
2022

2123
## Observations
@@ -28,8 +30,11 @@ The devcontainer mounts `/tmp` as a `tmpfs` with mode `1777` through `runArgs` s
2830
- [github_cli] GitHub CLI is installed via `ghcr.io/devcontainers/features/github-cli:1` #gh
2931
- [auth_requirement] `gh` requires `gh auth login` or `GH_TOKEN` for GitHub API and Actions commands #auth
3032
- [podman_fix] `/tmp` is mounted as `tmpfs` with mode `1777` for rootless Podman compatibility #podman
33+
- [automation] Devcontainer bootstrap creates a local `.venv`, installs `uv` with pip, and installs Basic Memory with `uv tool install basic-memory` when `bm` is not already available #basic-memory
34+
- [tooling] The devcontainer declares the official Python feature so Basic Memory tooling can be installed during setup #python
35+
- [path] The post-create script and devcontainer remote environment prepend `.venv/bin` and `$HOME/.local/bin` to `PATH` so `uv` and `bm` are available during and after bootstrap #devcontainer
3136

3237
## Relations
3338
- supports [[Tooling and Validation]]
3439
- supports [[GitHub Actions Automation]]
35-
- governed_by [[Project Working Agreement]]
40+
- governed_by [[Project Working Agreement]]

0 commit comments

Comments
 (0)