Skip to content

Commit 33ce5f9

Browse files
claudejfpanisset
authored andcommitted
Add CLAUDE.md with comprehensive codebase guide for AI assistants
Documents repository structure, build system, development setup, testing commands, code conventions, CI/CD workflows, and key warnings about generated files. https://claude.ai/code/session_01JeYF2tTMCyqMGGjKwj3yfr Signed-off-by: Claude <noreply@anthropic.com>
1 parent d95cc87 commit 33ce5f9

1 file changed

Lines changed: 162 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# CLAUDE.md - AI Assistant Guide for aswf-docker
2+
3+
## Project Overview
4+
5+
**aswf-docker** builds and manages Docker CI images and Conan packages for the
6+
[Academy Software Foundation (ASWF)](https://www.aswf.io/) VFX Platform. It
7+
provides standardized build environments for VFX software across multiple
8+
platform years (2019-2026).
9+
10+
## Repository Structure
11+
12+
```
13+
aswf-docker/
14+
├── ci-*/ # Docker image directories (18 images)
15+
│ ├── Dockerfile # AUTO-GENERATED - do not edit manually
16+
│ ├── README.md # AUTO-GENERATED - do not edit manually
17+
│ └── image.yaml # Source specification for the image
18+
├── python/
19+
│ └── aswfdocker/ # Main Python package
20+
│ ├── cli/ # Click CLI entry point (aswfdocker.py)
21+
│ ├── data/ # Jinja2 templates, versions.yaml
22+
│ ├── tests/ # Unit tests (pytest)
23+
│ ├── builder.py # Docker buildx bake orchestration
24+
│ ├── dockergen.py # Jinja2 template rendering
25+
│ ├── index.py # Version/package index from YAML
26+
│ ├── releaser.py # GitHub release automation
27+
│ └── ...
28+
├── packages/
29+
│ ├── conan/recipes/ # 116+ Conan package recipes (vendored)
30+
│ ├── conan/settings/ # Conan profile settings
31+
│ └── common/ # Shared build utilities
32+
├── scripts/ # Shell utilities, VFX scripts, tests
33+
├── .github/workflows/ # CI: python.yml, docker-builds.yml, release.yml, python-sonar.yml
34+
├── versions.yaml # Symlink to python/aswfdocker/data/versions.yaml
35+
└── pyproject.toml # Python project config (uv, pytest, black)
36+
```
37+
38+
### Key Concepts
39+
40+
- **versions.yaml**: Central version registry defining package versions per VFX
41+
Platform year. Versions use inheritance (e.g., `2-clang10` inherits from `2`).
42+
- **image.yaml**: Per-image specs listing packages, base image, and metadata.
43+
- **Dockerfiles are generated**: From Jinja2 templates via `aswfdocker dockergen`.
44+
Never edit `ci-*/Dockerfile` or `ci-*/README.md` directly.
45+
- **Docker buildx bake**: Builds are orchestrated via JSON bake files generated
46+
by `python/aswfdocker/builder.py`.
47+
48+
## Development Setup
49+
50+
```bash
51+
# Install uv (if not already installed)
52+
curl -LsSf https://astral.sh/uv/install.sh | sh
53+
54+
# Install all dependencies (including dev)
55+
uv sync --all-extras
56+
57+
# Run the CLI
58+
uv run aswfdocker --help
59+
```
60+
61+
## Common Commands
62+
63+
### Testing & Linting
64+
65+
```bash
66+
# Run unit tests
67+
uv run pytest python/aswfdocker
68+
69+
# Type checking
70+
uv run mypy python/aswfdocker
71+
72+
# Linting (score must be >= 8.0)
73+
uv run pylint python/aswfdocker
74+
75+
# Formatting (Black, targets Python 3.10)
76+
uv run black python/ packages/conan/recipes/
77+
78+
# Run all pre-commit hooks
79+
uv run pre-commit run --all-files
80+
81+
# Verify generated Dockerfiles are up to date
82+
uv run aswfdocker dockergen --check
83+
```
84+
85+
### Building Images
86+
87+
```bash
88+
# Build a specific image group and version
89+
uv run aswfdocker build --ci-image-type IMAGE --group base --version 2026-clang20 --push NO
90+
91+
# Build Conan packages
92+
uv run aswfdocker build --ci-image-type PACKAGE --group common --version 2026-clang20 --push NO
93+
94+
# Dry run (show commands without executing)
95+
uv run aswfdocker build --ci-image-type IMAGE --group base --version 2026-clang20 --dry-run
96+
```
97+
98+
### Regenerating Dockerfiles
99+
100+
```bash
101+
# Regenerate all Dockerfiles and READMEs from templates
102+
uv run aswfdocker dockergen
103+
104+
# Check that generated files are up to date (used in CI)
105+
uv run aswfdocker dockergen --check
106+
```
107+
108+
## Code Conventions
109+
110+
### Python
111+
112+
- **Python >= 3.10** required
113+
- **Black** formatting (target: py310). Vendored Conan recipes in
114+
`packages/conan/recipes/` are excluded from Black.
115+
- **MyPy** strict type checking (Python 3.11 target)
116+
- **Pylint** with fail-under score of 8.0
117+
- **Naming**: PascalCase classes, snake_case functions/variables, UPPER_CASE constants
118+
- **Copyright header** on all files:
119+
`# Copyright (c) Contributors to the aswf-docker Project. All rights reserved.`
120+
`# SPDX-License-Identifier: Apache-2.0`
121+
122+
### Docker Images
123+
124+
- Image names: `ci-{name}` (e.g., `ci-base`, `ci-openexr`)
125+
- Tags: `{major_version}` or `{major_version}-clang{N}` (e.g., `2026-clang20`)
126+
- Docker orgs: `aswf` (production), `aswftesting` (testing), `aswflocaltesting` (local)
127+
- OCI metadata labels are set automatically from templates
128+
129+
### Version Management
130+
131+
- All package versions are defined in `versions.yaml`
132+
- Versions use parent inheritance: variant versions (e.g., `6-clang18`) inherit
133+
from base versions (e.g., `6`) and override specific fields
134+
- The `major_version` field maps to VFX Platform years
135+
136+
## CI/CD Workflows
137+
138+
| Workflow | Trigger | Purpose |
139+
|---|---|---|
140+
| `python.yml` | Push/PR | Pre-commit hooks: black, pytest, mypy, pylint, dockergen --check |
141+
| `docker-builds.yml` | Push/PR | Build Docker images and Conan packages (matrix by VFX year) |
142+
| `python-sonar.yml` | Push to main | Code quality analysis with SonarCloud |
143+
| `release.yml` | GitHub Release | Full build + push to Docker Hub |
144+
145+
## Git Conventions
146+
147+
- **Signed-off commits required**: Use `git commit -s`
148+
- **Rebase-only merging** (no squash/merge commits) for linear history
149+
- **Branch model**: OneFlow - all work on `main`, release branches for bug fixes
150+
- **Release tags**: `v{major}.{minor}.{patch}`
151+
- **Release branches**: `RB-{major}.{minor}`
152+
153+
## Important Warnings
154+
155+
1. **Never edit `ci-*/Dockerfile` or `ci-*/README.md` directly** - these are
156+
generated from Jinja2 templates. Edit the templates in
157+
`python/aswfdocker/data/` and the specs in `ci-*/image.yaml` instead, then
158+
run `uv run aswfdocker dockergen`.
159+
2. **Conan recipes in `packages/conan/recipes/` are vendored** from Conan Center
160+
Index. They are excluded from Black formatting and SonarCloud analysis.
161+
3. **`versions.yaml` is a symlink** to `python/aswfdocker/data/versions.yaml`.
162+
4. The `migrate` and `download` CLI commands are **deprecated**.

0 commit comments

Comments
 (0)