Release OCR to Production¶
This guide shows how to release a new version of OCR to production.
Prerequisites¶
- Write access to the carbonplan/ocr repository
- Understanding of semantic versioning
- Changes merged to
mainbranch - Successful staging deployment verified
Overview¶
OCR uses release-drafter to automatically create draft releases as PRs are merged to main. The draft release includes:
- Auto-generated release notes from merged PRs
- Categorized changes (features, bug fixes, etc.)
- List of contributors
Your job: Review the draft and publish it.
Steps¶
1. Verify staging deployment¶
Before releasing, confirm the staging deployment is working correctly:
Verify that:
- Data loads correctly
- No errors in processing logs
- All expected regions are present
2. Review the draft release¶
- Go to github.com/carbonplan/ocr/releases
- Find the draft release at the top (usually labeled "Next Release")
- Review the auto-generated release notes:
- Check that all merged PRs are listed
- Verify categorization is correct
- Ensure contributor list is accurate
3. Edit release details¶
Click Edit draft and update:
-
Tag version: Set to next semantic version (e.g.,
v1.2.3)- Patch (
1.2.3→1.2.4): Bug fixes, minor changes - Minor (
1.2.3→1.3.0): New features, backward compatible - Major (
1.2.3→2.0.0): Breaking changes
- Patch (
-
Release title: Use format
vX.Y.Zor add description (e.g.,v1.2.3 - Fire Risk Updates) -
Release notes: Edit the auto-generated notes if needed:
- Add any important context or migration notes
- Highlight breaking changes (if major version)
- Note any known issues or limitations
-
Target branch: Ensure it's set to
main
4. Publish the release¶
- Review everything one final time
- Click Publish release
Publishing automatically creates the tag on main and triggers production deployment.
5. Monitor automated deployment¶
Publishing the release triggers the production deployment automatically.
What happens automatically:
- Tag creation: GitHub creates tag
vX.Y.Zonmainbranch -
Coiled environment creation (~5-10 min)
- Builds software environment named
ocr-vX.Y.Z
- Builds software environment named
-
Production deployment (~2-4 hours)
- Processes all regions across CONUS
- Generates aggregated statistics
- Creates PMTiles for visualization
- Writes output to
s3://carbonplan-ocr/output/fire-risk/tensor/production/vX.Y.Z/
Monitor progress:
# View GitHub Actions workflow
open https://github.com/carbonplan/ocr/actions/workflows/deploy.yaml
# Check Coiled dashboard
open https://cloud.coiled.io/
6. Verify production deployment¶
After deployment completes (check Actions page for ✓):
Verify:
- Version matches your release tag
- Data is accessible
- Map tiles load correctly
- Regional statistics are complete
What the automated workflow does¶
Release Drafter (runs on every merge to main):
- Automatically creates/updates a draft release
- Generates release notes from PR titles and labels
- Categorizes changes (features, fixes, documentation, etc.)
- Lists all contributors
Production Deployment (runs when you publish a release):
- Validates version: Ensures tag is valid semantic version (e.g.,
1.2.3) - Sets environment variables:
OCR_VERSION=X.Y.ZOCR_ENVIRONMENT=production
- Updates configuration: Injects version into
ocr-coiled-s3-production.env - Runs full pipeline:
- Processes all regions (
--all-region-ids) - Writes regional statistics
- Generates regional PMTiles
- Creates aggregated outputs
- Processes all regions (
- Deploys to S3: Outputs stored at versioned path
Manual production redeployment¶
If you need to redeploy an existing version (e.g., after an intermittent GitHub or Coiled failure):
- Go to github.com/carbonplan/ocr/actions/workflows/deploy.yaml
- Click Run workflow dropdown
- Select branch:
main - Fill in parameters:
- production_tag: Enter the existing version tag to redeploy (e.g.,
v1.2.3or1.2.3) - Leave other fields at defaults (they're ignored for production redeploy)
- production_tag: Enter the existing version tag to redeploy (e.g.,
- Click Run workflow
This redeploys the exact code from that existing release tag to production.
Note: This is only for redeploying existing releases. To create a new release, follow the main steps above.
Troubleshooting¶
Deployment fails during region processing¶
Symptoms: Some regions fail to process
Solution: The workflow automatically retries failed regions (5 attempts with backoff). Check logs for persistent failures.
Version validation error¶
Symptoms: "Not valid SemVer" error
Solution: Ensure tag follows format vX.Y.Z or X.Y.Z where X, Y, Z are numbers.
Deployment takes longer than expected¶
Symptoms: Workflow runs beyond 4 hours
Solution: This is expected for full CONUS processing. Check:
- Coiled cluster is running
- No AWS credential issues
- S3 buckets are accessible
Wrong version deployed¶
Symptoms: Production shows incorrect version
Solution:
- Check which tag was used in the deployment
- Redeploy correct version using manual workflow (see above)
Reference¶
- Production URL: ocr.carbonplan.org
- Staging URL: ocr.staging.carbonplan.org
- Workflow file:
.github/workflows/deploy.yaml - Deployment details: See deployment reference
Next steps¶
After releasing:
- Monitor production for any issues
- Update changelog or documentation if needed