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
30 changes: 19 additions & 11 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ on:
push:
branches: [main]
paths:
- 'pyproject.toml'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment on this file: have to tested that it works?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, good question for Michael too. The only way to test it really is to push to main I think, though I can also look into ways that it might be simulated?

- 'pixi.lock'
- 'src/**'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what circumstances should we rebuild the container? Maybe talk to Michael about this? I don't have strong opinions, but it isn't cost free to rebuild.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should rebuild on release, which is what this sets up, but we could also build more frequently? Previously we were rebuilding every time one of these files were changed, which will get a bit excessive potentially especially a bit later on.

- 'scripts/**'
- 'Dockerfile'
- 'docker-entrypoint.sh'
- '.github/workflows/docker.yml'
tags:
- 'v*.*.*'
Comment on lines 9 to +16
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this workflow runs on both pushes to main and v*.*.* tag pushes, any Dockerfile-only change merged to main will publish new images as well (even if no release tag is created). If the intent is “publish only on releases”, consider removing the branches: [main] trigger and relying solely on tag pushes.

Copilot uses AI. Check for mistakes.
workflow_dispatch:

env:
Expand All @@ -30,29 +28,39 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# The Dockerfile uses COPY --from=diffuseproject/sampleworks-checkpoints:latest
# which Docker automatically pulls from Docker Hub during the build.
# No checkpoint files are needed in the CI build context.

- name: Docker metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.DOCKERHUB_ORG }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metadata config always emits a latest tag. If this workflow also runs on main pushes, those branch builds can overwrite latest even when no release tag is produced. Consider emitting latest only for semver tag builds, and using a separate tag (e.g. main/edge) for branch builds.

Suggested change
type=raw,value=latest
type=raw,value=latest,enable={{is_tag && matches(tag, '^v[0-9]+\\.[0-9]+\\.[0-9]+$')}}
type=raw,value=edge,enable={{is_default_branch}}

Copilot uses AI. Check for mistakes.
type=sha,prefix=
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix doesn't seem to have an associated value, should it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously there was no prefix to the sha256 value in the image, but the new metadata action version by default includes "sha" as the prefix so that's why I set to empty here

type=semver,pattern={{version}}
type=semver,pattern=v{{version}}
- name: Build and push Docker image
id: build-push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: |
${{ env.DOCKERHUB_ORG }}/${{ env.IMAGE_NAME }}:latest
${{ env.DOCKERHUB_ORG }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
push:
branches: [main]

permissions:
contents: read

jobs:
release:
runs-on: ubuntu-latest
concurrency: release
permissions:
contents: write

steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.ref_name }}
fetch-depth: 0
fetch-tags: true

- run: git reset --hard ${{ github.sha }}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Semantic Release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_committer_name: "github-actions"
git_committer_email: "[email protected]"

Comment thread
k-chrispens marked this conversation as resolved.
- name: Publish to GitHub Releases
if: steps.release.outputs.released == 'true'
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ repos:
additional_dependencies:
- toml-sort==0.24.3

- repo: https://github.com/commitizen-tools/commitizen
rev: v4.13.9
hooks:
- id: commitizen
stages: [commit-msg]
Comment thread
k-chrispens marked this conversation as resolved.

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
hooks:
Expand Down
74 changes: 74 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,80 @@ pixi run -e boltz-dev prek run -a # Run all hooks on all files

Note: `ty` type checking is split per environment — Boltz files are checked in `boltz-dev`, Protenix files in `protenix-dev`, RF3 files in `rf3-dev`. See `.pre-commit-config.yaml` for the file routing rules.

## Release Process

Releases are fully automated via [python-semantic-release](https://python-semantic-release.readthedocs.io/) (PSR v10). No manual version bumps or changelog edits are needed.

### Conventional Commits (Required)

All commit messages **must** follow the [Conventional Commits](https://www.conventionalcommits.org/) format:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should start squashing commits and generating a good single commit message for each PR (and reject PRs that try to do too much at once)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will change the merge requirements on the repo


```
<type>(<optional scope>): <summary>

[optional body]

[optional footer(s)]
```
Comment thread
k-chrispens marked this conversation as resolved.

**Types and their effect on versioning:**

| Type | Description | Version bump |
|------|-------------|-------------|
| `feat` | New feature | Minor (0.x.0) |
| `fix` | Bug fix | Patch (0.x.x) |
| `docs` | Documentation only | None |
| `refactor` | Code change (no new feature or fix) | None |
| `test` | Adding/updating tests | None |
| `chore` | Maintenance (CI, deps, tooling) | None |
| `perf` | Performance improvement | Patch (0.x.x) |

**Breaking changes** (append `!` after type, e.g. `feat!:`) bump the minor version while we're in 0.x (`major_on_zero = false`).

**Examples:**
```bash
feat(rewards): add cryo-EM image stack reward function
fix(boltz): correct atom reconciler index mapping for OXT atoms
docs: update AGENTS.md with new model wrapper example
refactor(scalers)!: rename StepScaler to StepGuide
chore(ci): pin Docker build action to v5
```

A **commitizen** pre-commit hook validates commit messages locally. Install it with:
```bash
pixi run -e boltz-dev prek install --hook-type commit-msg
```
Comment thread
coderabbitai[bot] marked this conversation as resolved.

### How Releases Work

1. Push/merge to `main` with `feat:` or `fix:` commits
2. The **Release** workflow runs PSR, which:
- Analyzes commits since the last tag
- Determines the version bump (or skips if no releasable commits)
- Updates `version` in `pyproject.toml`
- Updates `CHANGELOG.md`
- Creates a version commit and `v{version}` tag
- Pushes the commit and tag
3. The **Docker** workflow triggers on the new `v*.*.*` tag and builds images tagged with the version

### What Does NOT Trigger a Release

Commits with types `docs`, `refactor`, `test`, `chore`, `ci`, or `style` do not bump the version. They will appear in the next changelog under their respective sections when a releasable commit is included.

### Version Strategy

We use `major_on_zero = false`, meaning breaking changes bump minor (not major) while the version is 0.x. This will change when we decide to release 1.0.

### Merge Strategy

Use **squash merge** for all PRs. This collapses a PR's commits into a single commit on `main`, with the PR title as the commit message. The PR title **must** follow Conventional Commits format and controls the version bump:

- `feat(rewards): add cryo-EM image stack reward` → minor bump
- `fix(boltz): correct OXT atom mapping` → patch bump
- `docs: update installation guide` → no release

This keeps the changelog clean (one entry per PR), the version history predictable (one potential bump per PR), and requires no discipline around individual commit messages during development. PRs should be focused on a single logical change — avoid PRs that bundle unrelated features and fixes.

## Testing Philosophy

Write black-box tests that verify **behavior**, not implementation. Test public interfaces with realistic inputs. Verify outputs match contracts — shapes, value ranges, mathematical properties.
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CHANGELOG

<!--next-version-placeholder-->
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ pixi run test-all # run all tests across all environments

```bash
pixi run -e [model]-dev prek install
pixi run -e [model]-dev prek install --hook-type commit-msg
pixi run -e [model]-dev prek run --all-files
```

Expand All @@ -171,3 +172,14 @@ To develop on OS X, ensure you have [homebrew](https://brew.sh/) installed and r
There are different (and as yet untested) environments for `boltz`. `protenix` won't currently work on a Mac due to
the strict requirement of `triton` which requires an NVIDIA GPU. You may find similar issues with other environments.
Debug as needed.


## Commit Messages

This project uses [Conventional Commits](https://www.conventionalcommits.org/) to automate versioning and changelog generation. Format:

```
<type>(<scope>): <summary>
```
Comment thread
k-chrispens marked this conversation as resolved.

Common types: `feat`, `fix`, `docs`, `refactor`, `chore`, `test`, `perf`. A commitizen pre-commit hook validates messages at commit time. See [AGENTS.md](AGENTS.md#release-process) for full details.
Loading
Loading