Skip to content
Open
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 .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "FogMachine development",
"name": "fogmachine development",
"build": {"context": "..", "dockerfile": "../Dockerfile"},
"remoteUser": "ubuntu",
"workspaceFolder": "/workspace",
Expand Down
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FogMachine engineering rules
# fogmachine engineering rules

Keep shared environment mechanics here and product semantics in their own repositories.
Read docs/architecture.md before changing the toolchain contract.
Expand All @@ -7,3 +7,5 @@ Run `python3 -m unittest discover -s tests` and `actionlint` before submitting w
User-facing changes require an Unreleased changelog entry; internal-only PRs require
both `no-changelog` and `Changelog exemption: <reason>` in the body.
Keep audit output free of secrets. Publish images only after the pilot matrix succeeds.

Use `fogmachine` in lowercase in all user-facing prose and labels.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## [Unreleased]

### Fixed

- Make maturin available through Python module invocation as required by Core builds.

### Changed

- Use lowercase fogmachine branding in developer UI labels, documentation, and command messages.

### Added

- Shared Rust/Node/Python/WASM development image and Core/MCP pilot adapters with retained verification reports.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ USER ubuntu
ENV PATH="/home/ubuntu/.cargo/bin:/home/ubuntu/.local/bin:${PATH}"
RUN RUST_VERSION=$(python3 /opt/fogmachine/scripts/pin.py rust) && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o /tmp/rustup.sh && sh /tmp/rustup.sh -y --default-toolchain "$RUST_VERSION" --profile minimal --component rustfmt --component clippy && rm /tmp/rustup.sh && rustup target add wasm32-unknown-unknown
RUN UV_VERSION=$(python3 /opt/fogmachine/scripts/pin.py uv) && curl -LsSf "https://astral.sh/uv/$UV_VERSION/install.sh" -o /tmp/uv.sh && sh /tmp/uv.sh && rm /tmp/uv.sh
RUN uv tool install "maturin==$(python3 /opt/fogmachine/scripts/pin.py maturin)" && cargo install wasm-bindgen-cli --version "$(python3 /opt/fogmachine/scripts/pin.py wasm_bindgen)" --locked
RUN python3 -m venv /home/ubuntu/.fogmachine-python && uv pip install --python /home/ubuntu/.fogmachine-python/bin/python "maturin==$(python3 /opt/fogmachine/scripts/pin.py maturin)"
ENV PATH="/home/ubuntu/.fogmachine-python/bin:${PATH}"
RUN cargo install wasm-bindgen-cli --version "$(python3 /opt/fogmachine/scripts/pin.py wasm_bindgen)" --locked
USER root
RUN mkdir -p /opt/fogmachine/browser /workspace && chown -R ubuntu:ubuntu /opt/fogmachine/browser /workspace
USER ubuntu
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FogMachine
# fogmachine

Shared development environments for DataFog Core and MCP. Initial pilot; see CI for qualification status.

Expand All @@ -25,7 +25,7 @@ implicit side effect of doctor. See [architecture](docs/architecture.md) and

Development images are published to `ghcr.io/datafog/fogmachine` only after Core
and MCP pass on the candidate image. Consumers pin the resulting digest; no
consumer should track `latest`. Private package access must be granted to consuming
repos, and developers need a registry credential with read:packages. No credentials
consumer should track `latest`. Package visibility is managed separately in GHCR. If the package is private, grant
consuming repos access and authenticate developers with read:packages. No credentials
are included in images. ARM64 qualification and native macOS/Windows lanes remain
separate from this initial Linux AMD64 pilot.
13 changes: 7 additions & 6 deletions dev
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ def validate_repo(root, profile):
if profile == "core":
toolchain = tomllib.loads((root / "rust-toolchain.toml").read_text())["toolchain"]
if toolchain["channel"] != PINS["rust"]:
raise ValueError("Core Rust pin differs from FogMachine; select a compatible environment")
raise ValueError("Core Rust pin differs from fogmachine; select a compatible environment")
if int((root / ".nvmrc").read_text().strip()) != PINS["node_major"]:
raise ValueError("Core Node pin differs from FogMachine")
raise ValueError("Core Node pin differs from fogmachine")
packages = tomllib.loads((root / "Cargo.lock").read_text())["package"]
versions = {p["version"] for p in packages if p["name"] == "wasm-bindgen"}
if versions != {PINS["wasm_bindgen"]}:
raise ValueError("Core wasm-bindgen pin differs from FogMachine")
raise ValueError("Core wasm-bindgen pin differs from fogmachine")
browser = json.loads((root / "bindings/wasm/package.json").read_text())
if browser["devDependencies"]["playwright"] != PINS["playwright"]:
raise ValueError("Core Playwright pin differs from FogMachine")
raise ValueError("Core Playwright pin differs from fogmachine")
elif (root / ".python-version").read_text().strip() != PINS["python"]:
raise ValueError("MCP Python pin differs from FogMachine")
raise ValueError("MCP Python pin differs from fogmachine")

def doctor_commands():
# Assertions make a mismatch fail instead of merely displaying versions.
Expand All @@ -57,6 +57,7 @@ def doctor_commands():
["bash", "-c", f"test \"$(uv --version | cut -d' ' -f2)\" = {PINS['uv']}"],
["bash", "-c", f"test \"$(maturin --version | cut -d' ' -f2)\" = {PINS['maturin']}"],
["bash", "-c", f"test \"$(wasm-bindgen --version | cut -d' ' -f2)\" = {PINS['wasm_bindgen']}"],
["python3", "-m", "maturin", "--version"],
["node", "--input-type=module", "-e", "import {chromium} from '/opt/fogmachine/browser/node_modules/playwright/index.mjs'; const browser=await chromium.launch(); console.log(await browser.version()); await browser.close();"]]

def main():
Expand All @@ -72,7 +73,7 @@ def main():
raise ValueError(f"Unsupported profile: {profile}")
validate_repo(root, profile)
except (OSError, ValueError, KeyError) as error:
parser.exit(1, f"FogMachine configuration: {error}\n")
parser.exit(1, f"fogmachine configuration: {error}\n")
steps = doctor_commands() if args.operation == "doctor" else commands(profile, args.operation)
if args.dry_run:
print(json.dumps(steps, indent=2))
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Environment contract

FogMachine owns the shared image, tool installation, pilot adapters, and environment
fogmachine owns the shared image, tool installation, pilot adapters, and environment
qualification. Product repositories own public behavior, tests, lockfiles, and their
supported runtime/platform matrices. An environment update must not rewrite those
contracts to get a green build.
Expand Down
6 changes: 3 additions & 3 deletions scripts/adopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def configuration(profile, image):
if not re.fullmatch(r"ghcr\.io/datafog/fogmachine@sha256:[0-9a-f]{64}", image):
raise ValueError("a qualified ghcr.io/datafog/fogmachine digest is required")
directories = [".venv"] if profile == "mcp" else ["target", "bindings/node/node_modules", "bindings/wasm/node_modules"]
config = {"name": "DataFog " + profile.upper() + " / FogMachine",
config = {"name": "DataFog " + profile.upper() + " / fogmachine",
"image": image, "remoteUser": "ubuntu", "workspaceFolder": "/workspace",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",
"containerEnv": {"FOGMACHINE_IMAGE": image},
Expand All @@ -21,10 +21,10 @@ def configuration(profile, image):
"postCreateCommand": "sudo chown -R ubuntu:ubuntu " + " ".join("/workspace/" + directory for directory in directories) + " && ./dev setup"}
files = {".devcontainer/devcontainer.json": json.dumps(config, indent=2) + "\n",
".fogmachine.json": json.dumps({"profile": profile}, indent=2) + "\n",
"dev": '#!/usr/bin/env bash\nset -euo pipefail\nif [[ ! -x /opt/fogmachine/dev ]]; then\n echo "Open this checkout in its FogMachine devcontainer first." >&2\n exit 1\nfi\nexec /opt/fogmachine/dev "$@"\n'}
"dev": '#!/usr/bin/env bash\nset -euo pipefail\nif [[ ! -x /opt/fogmachine/dev ]]; then\n echo "Open this checkout in its fogmachine devcontainer first." >&2\n exit 1\nfi\nexec /opt/fogmachine/dev "$@"\n'}
if profile == "core":
files[".cursor/Dockerfile"] = "FROM " + image + "\n"
files[".cursor/environment.json"] = json.dumps({"name": "DataFog Core / FogMachine", "build": {"dockerfile": "Dockerfile", "context": ".."}, "user": "ubuntu", "install": "./dev setup"}, indent=2) + "\n"
files[".cursor/environment.json"] = json.dumps({"name": "DataFog Core / fogmachine", "build": {"dockerfile": "Dockerfile", "context": ".."}, "user": "ubuntu", "install": "./dev setup"}, indent=2) + "\n"
return files


Expand Down
3 changes: 3 additions & 0 deletions tests/test_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def test_mcp_uses_frozen_lock_and_real_groups(self):
self.assertEqual(dev.commands("mcp", "setup"), [["uv", "sync", "--frozen", "--group", "dev", "--group", "ci"]])
self.assertIn(["uv", "run", "--frozen", "pytest"], dev.commands("mcp", "check"))

def test_doctor_checks_python_module_entrypoint(self):
self.assertIn(["python3", "-m", "maturin", "--version"], dev.doctor_commands())

def test_core_keeps_required_rust_checks(self):
self.assertIn(["cargo", "test", "--workspace", "--all-features"], dev.commands("core", "check"))

Expand Down
Loading