Run OpenRewrite recipes across repositories at scale using the Moderne CLI.
Mass-run executes recipes against pre-built LSTs (Lossless Semantic Trees) from mass-ingest and produces:
- Data tables - Structured analysis results from the recipe
- Patches - Code changes that can be applied to repositories
- Logs - Detailed execution logs for debugging
- Pull requests - Optionally create PRs for code changes
Choose the deployment option that fits your needs:
| Option | Description | Best For |
|---|---|---|
| 1-quickstart | Single container, no monitoring | Development, testing, small deployments |
| 2-observability | Docker Compose with Grafana/Prometheus | Production single-host deployments |
# Build
docker build -t mass-run:quickstart .
# Run a search recipe
docker run --rm \
-e REPOS_CSV_LOCATION=/app/repos.csv \
-e RECIPE=org.openrewrite.java.search.FindTypes \
-e OUTPUT_LOCATION=s3://your-bucket/output \
-e MODERNE_LICENSE_KEY="your-license-key" \
-v $(pwd)/repos.csv:/app/repos.csv:ro \
-v ~/.aws:/root/.aws:ro \
mass-run:quickstartcd 2-observability
# Configure
cp .env.example .env
# Edit .env with your settings
# Copy your repos.csv
cp /path/to/repos.csv ./repos.csv
# Start
docker compose up -d
# Access dashboards at http://localhost:3000 (admin/admin)Defines the repositories to run recipes against. See the repos.csv documentation.
cloneUrl,branch,origin,path,publishUri
https://github.com/org/repo1.git,main,github.com,org/repo1,s3://lst-bucket/org/repo1
https://github.com/org/repo2.git,main,github.com,org/repo2,s3://lst-bucket/org/repo2publishUri- where the pre-built LST is stored (from mass-ingest)originandpath- required for PR creation; used to identify the project/repo on the SCM host
Required for PR creation. Maps repository hosts to their SCM types:
origin,scmType
github.com,GitHub
bitbucket.example.com,BitbucketDataCenter
github.mycompany.com,GitHubSupported SCM types:
GitHub- GitHub.com and GitHub EnterpriseBitbucketDataCenter- Bitbucket Server/Data Center
For private repositories and PR creation, mount a .git-credentials file:
https://username:token@github.com
https://username:token@bitbucket.example.com
| Variable | Description |
|---|---|
REPOS_CSV_LOCATION |
Path or S3 URL to repos.csv |
RECIPE |
Recipe ID to run |
OUTPUT_LOCATION |
S3 path for output artifacts |
| Variable | Description |
|---|---|
MODERNE_LICENSE_KEY |
License key (passed at runtime, not build time) |
| Variable | Description |
|---|---|
MODERNE_TOKEN |
Moderne API token |
MODERNE_TENANT |
Moderne tenant URL (default: https://app.moderne.io) |
| Variable | Description |
|---|---|
RECIPE_OPTIONS |
Recipe options (e.g., -Pfoo=bar -Pbaz=bop) |
RECIPE_TIMEOUT |
Timeout in seconds for recipe execution (0 = none) |
ORGANIZATION |
Organization name for syncing repos |
| Variable | Description |
|---|---|
CREATE_PRS |
Set to true to create PRs |
SCM_MAPPING_CSV |
Path to scm-mapping.csv (required for PR creation) |
PR_TITLE |
PR title |
PR_BODY |
PR description |
BRANCH_NAME |
Branch name (default: moderne/<recipe-suffix>) |
COMMIT_MESSAGE |
Commit message |
| Variable | Description |
|---|---|
LST_BUCKET |
S3 bucket for pre-built LSTs |
S3_ENDPOINT |
S3-compatible endpoint (e.g., MinIO) |
S3_REGION |
AWS region |
S3_PROFILE |
AWS profile name |
After execution, these artifacts are uploaded to OUTPUT_LOCATION/<timestamp>/:
| Artifact | Description |
|---|---|
data-tables.zip |
CSV data tables from recipe execution |
patches.zip |
Patch files for each repository with changes |
runs.zip |
Recipe execution logs |
cli-output.txt |
Full CLI command output |
pr-logs.zip |
PR creation logs (if PRs were created) |
summary.txt |
Execution summary |
| Argument | Default | Description |
|---|---|---|
MODERNE_CLI_VERSION |
(latest) | Pin to specific CLI version |
MODERNE_CLI_STAGE |
stable |
stable or staging (for pre-releases) |
Example:
# Specific version
docker build --build-arg MODERNE_CLI_VERSION=3.50.0 -t mass-run:quickstart .
# Staging builds
docker build --build-arg MODERNE_CLI_STAGE=staging -t mass-run:quickstart .- mass-ingest-example - Build LSTs at scale
- Moderne CLI - Command-line interface
- OpenRewrite - Recipe ecosystem