GitHub Codespaces
Mount an AIStor Memory Bucket in a Codespace, or any devcontainer.json host, from the public AIStor Memory release.
When a Codespace is deleted, everything the agent did in it goes too. AIStor Memory mounts a Memory Bucket in the Codespace, so the files the agent edits and the memory it keeps are stored in your AIStor. The next Codespace mounts the same bucket and starts where the last one stopped.
The same devcontainer.json works on any host that reads it: Codespaces,
VS Code Dev Containers, JetBrains Gateway, CodeSandbox, and Daytona.
Prerequisites
Use a Memory Bucket
aimem mounts only a Memory Bucket. See
Prerequisites.
- The GitHub CLI (
gh), to store the Codespaces secrets. - An AIStor endpoint that the Codespace can reach, and signing credentials for it.
Quick start
Store the settings as Codespaces secrets:
gh secret set -f - --user --app codespaces <<'EOF'
AIMEM_BUCKET=my-project
AIMEM_ENDPOINT=https://aistor.example.com
AIMEM_ACCESS_KEY=...
AIMEM_SECRET_KEY=...
EOFThen use this file as your project's .devcontainer/devcontainer.json, or
add its settings to the one you have:
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"capAdd": ["SYS_ADMIN"],
"securityOpt": ["apparmor:unconfined"],
"mounts": [{ "source": "/dev/fuse", "target": "/dev/fuse", "type": "bind" }],
"postCreateCommand": "sudo apt-get update && sudo apt-get install -y --no-install-recommends fuse3 && sudo curl -fsSL https://dl.min.io/aistor/aimem/release/linux-amd64/aimem -o /usr/local/bin/aimem && sudo curl -fsSL https://dl.min.io/aistor/aimem/release/linux-amd64/aimem-fusermount -o /usr/bin/aimem-fusermount && sudo chmod 755 /usr/local/bin/aimem && sudo chmod 4755 /usr/bin/aimem-fusermount",
"postStartCommand": "mkdir -p /workspaces/aimem /tmp/aimem-local && nohup aimem \"$AIMEM_BUCKET\" /workspaces/aimem --endpoint-url \"$AIMEM_ENDPOINT\" --local /tmp/aimem-local --foreground > /tmp/aimem-local/aimem.log 2>&1 &"
}Open the Codespace. Your Memory Bucket is mounted at /workspaces/aimem,
and it is mounted again each time the Codespace starts. If the mount does
not appear, read /tmp/aimem-local/aimem.log.
How it works
The FUSE settings (capAdd, securityOpt, mounts) let aimem mount
inside the container. aimem-fusermount is setuid root, so the non-root
Codespace user can complete the mount. Credentials stay in the Codespaces
secrets and never appear on the command line.