snakemake-executor-plugin-aws-basic-batch 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. snakemake_executor_plugin_aws_basic_batch-0.1.0/.dockerignore +14 -0
  2. snakemake_executor_plugin_aws_basic_batch-0.1.0/.gitattributes +1 -0
  3. snakemake_executor_plugin_aws_basic_batch-0.1.0/.github/workflows/ci.yml +57 -0
  4. snakemake_executor_plugin_aws_basic_batch-0.1.0/.github/workflows/conventional-prs.yml +16 -0
  5. snakemake_executor_plugin_aws_basic_batch-0.1.0/.github/workflows/publish.yml +23 -0
  6. snakemake_executor_plugin_aws_basic_batch-0.1.0/.gitignore +215 -0
  7. snakemake_executor_plugin_aws_basic_batch-0.1.0/Dockerfile +62 -0
  8. snakemake_executor_plugin_aws_basic_batch-0.1.0/LICENSE +21 -0
  9. snakemake_executor_plugin_aws_basic_batch-0.1.0/PKG-INFO +12 -0
  10. snakemake_executor_plugin_aws_basic_batch-0.1.0/README.md +37 -0
  11. snakemake_executor_plugin_aws_basic_batch-0.1.0/examples/simple-workflow/.dockerignore +2 -0
  12. snakemake_executor_plugin_aws_basic_batch-0.1.0/examples/simple-workflow/Dockerfile +7 -0
  13. snakemake_executor_plugin_aws_basic_batch-0.1.0/examples/simple-workflow/README.md +125 -0
  14. snakemake_executor_plugin_aws_basic_batch-0.1.0/examples/simple-workflow/Snakefile +75 -0
  15. snakemake_executor_plugin_aws_basic_batch-0.1.0/examples/simple-workflow/justfile +174 -0
  16. snakemake_executor_plugin_aws_basic_batch-0.1.0/examples/simple-workflow/pyproject.toml +25 -0
  17. snakemake_executor_plugin_aws_basic_batch-0.1.0/examples/terraform/README.md +144 -0
  18. snakemake_executor_plugin_aws_basic_batch-0.1.0/examples/terraform/coordinator/.terraform.lock.hcl +45 -0
  19. snakemake_executor_plugin_aws_basic_batch-0.1.0/examples/terraform/coordinator/main.tf +767 -0
  20. snakemake_executor_plugin_aws_basic_batch-0.1.0/examples/terraform/coordinator/terraform.tfvars.example +40 -0
  21. snakemake_executor_plugin_aws_basic_batch-0.1.0/examples/terraform/simple-workflow/main.tf +287 -0
  22. snakemake_executor_plugin_aws_basic_batch-0.1.0/examples/terraform/simple-workflow/terraform.tfvars.example +24 -0
  23. snakemake_executor_plugin_aws_basic_batch-0.1.0/justfile +47 -0
  24. snakemake_executor_plugin_aws_basic_batch-0.1.0/pyproject.toml +32 -0
  25. snakemake_executor_plugin_aws_basic_batch-0.1.0/src/snakemake_executor_plugin_aws_basic_batch/__init__.py +322 -0
  26. snakemake_executor_plugin_aws_basic_batch-0.1.0/src/snakemake_executor_plugin_aws_basic_batch/batch_client.py +20 -0
  27. snakemake_executor_plugin_aws_basic_batch-0.1.0/tests/test_plugin.py +17 -0
  28. snakemake_executor_plugin_aws_basic_batch-0.1.0/uv.lock +1624 -0
@@ -0,0 +1,14 @@
1
+ .venv/
2
+ .git/
3
+ .github/
4
+ .claude/
5
+ *.pyc
6
+ __pycache__/
7
+ *.egg-info/
8
+ dist/
9
+ build/
10
+ .pytest_cache/
11
+ .coverage
12
+ examples/
13
+ tests/
14
+ docs/
@@ -0,0 +1 @@
1
+ uv.lock merge=binary linguist-generated=true
@@ -0,0 +1,57 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+
9
+ env:
10
+ PYTHON_VERSION: "3.11"
11
+
12
+ jobs:
13
+ linting:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Check out the code
17
+ uses: actions/checkout@v4
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v4
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ env.PYTHON_VERSION }}
26
+
27
+ - name: Install dependencies
28
+ run: uv sync --dev
29
+
30
+ - name: Check formatting
31
+ run: uv run ruff format --check .
32
+
33
+ - name: Lint
34
+ run: uv run ruff check .
35
+
36
+ testing:
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - name: Check out the code
40
+ uses: actions/checkout@v4
41
+
42
+ - name: Install uv
43
+ uses: astral-sh/setup-uv@v4
44
+
45
+ - name: Set up Python
46
+ uses: actions/setup-python@v5
47
+ with:
48
+ python-version: ${{ env.PYTHON_VERSION }}
49
+
50
+ - name: Install dependencies
51
+ run: uv sync --dev
52
+
53
+ - name: Run pytest
54
+ run: uv run coverage run -m pytest
55
+
56
+ - name: Run Coverage
57
+ run: uv run coverage report -m
@@ -0,0 +1,16 @@
1
+ name: PR
2
+ on:
3
+ pull_request_target:
4
+ types:
5
+ - opened
6
+ - reopened
7
+ - edited
8
+ - synchronize
9
+
10
+ jobs:
11
+ title-format:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: amannn/action-semantic-pull-request@v6
15
+ env:
16
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,23 @@
1
+ name: Publish to PyPI
2
+ on:
3
+ push:
4
+ tags:
5
+ - 'v*'
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ environment: pypi
11
+ permissions:
12
+ id-token: write
13
+ steps:
14
+ - uses: actions/checkout@v5
15
+
16
+ - name: Install uv
17
+ uses: astral-sh/setup-uv@v7
18
+
19
+ - name: Build package
20
+ run: uv build
21
+
22
+ - name: Publish to PyPI
23
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,215 @@
1
+ # Just workflow tracking
2
+ .last-job-id
3
+
4
+ # workflow example files
5
+ examples/simple-workflow/.snakemake/
6
+ examples/terraform/**/.terraform/
7
+ examples/terraform/*/terraform.tfvars
8
+
9
+ # Byte-compiled / optimized / DLL files
10
+ __pycache__/
11
+ *.py[codz]
12
+ *$py.class
13
+
14
+ # C extensions
15
+ *.so
16
+
17
+ # Distribution / packaging
18
+ .Python
19
+ build/
20
+ develop-eggs/
21
+ dist/
22
+ downloads/
23
+ eggs/
24
+ .eggs/
25
+ lib/
26
+ lib64/
27
+ parts/
28
+ sdist/
29
+ var/
30
+ wheels/
31
+ share/python-wheels/
32
+ *.egg-info/
33
+ .installed.cfg
34
+ *.egg
35
+ MANIFEST
36
+
37
+ # PyInstaller
38
+ # Usually these files are written by a python script from a template
39
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
40
+ *.manifest
41
+ *.spec
42
+
43
+ # Installer logs
44
+ pip-log.txt
45
+ pip-delete-this-directory.txt
46
+
47
+ # Unit test / coverage reports
48
+ htmlcov/
49
+ .tox/
50
+ .nox/
51
+ .coverage
52
+ .coverage.*
53
+ .cache
54
+ nosetests.xml
55
+ coverage.xml
56
+ *.cover
57
+ *.py.cover
58
+ .hypothesis/
59
+ .pytest_cache/
60
+ cover/
61
+
62
+ # Translations
63
+ *.mo
64
+ *.pot
65
+
66
+ # Django stuff:
67
+ *.log
68
+ local_settings.py
69
+ db.sqlite3
70
+ db.sqlite3-journal
71
+
72
+ # Flask stuff:
73
+ instance/
74
+ .webassets-cache
75
+
76
+ # Scrapy stuff:
77
+ .scrapy
78
+
79
+ # Sphinx documentation
80
+ docs/_build/
81
+
82
+ # PyBuilder
83
+ .pybuilder/
84
+ target/
85
+
86
+ # Jupyter Notebook
87
+ .ipynb_checkpoints
88
+
89
+ # IPython
90
+ profile_default/
91
+ ipython_config.py
92
+
93
+ # pyenv
94
+ # For a library or package, you might want to ignore these files since the code is
95
+ # intended to run in multiple environments; otherwise, check them in:
96
+ # .python-version
97
+
98
+ # pipenv
99
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
100
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
101
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
102
+ # install all needed dependencies.
103
+ #Pipfile.lock
104
+
105
+ # UV
106
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
107
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
108
+ # commonly ignored for libraries.
109
+ #uv.lock
110
+
111
+ # poetry
112
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
113
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
114
+ # commonly ignored for libraries.
115
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
116
+ #poetry.lock
117
+ #poetry.toml
118
+
119
+ # pdm
120
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
121
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
122
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
123
+ #pdm.lock
124
+ #pdm.toml
125
+ .pdm-python
126
+ .pdm-build/
127
+
128
+ # pixi
129
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
130
+ #pixi.lock
131
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
132
+ # in the .venv directory. It is recommended not to include this directory in version control.
133
+ .pixi
134
+
135
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
136
+ __pypackages__/
137
+
138
+ # Celery stuff
139
+ celerybeat-schedule
140
+ celerybeat.pid
141
+
142
+ # SageMath parsed files
143
+ *.sage.py
144
+
145
+ # Environments
146
+ .env
147
+ .envrc
148
+ .venv
149
+ env/
150
+ venv/
151
+ ENV/
152
+ env.bak/
153
+ venv.bak/
154
+
155
+ # Spyder project settings
156
+ .spyderproject
157
+ .spyproject
158
+
159
+ # Rope project settings
160
+ .ropeproject
161
+
162
+ # mkdocs documentation
163
+ /site
164
+
165
+ # mypy
166
+ .mypy_cache/
167
+ .dmypy.json
168
+ dmypy.json
169
+
170
+ # Pyre type checker
171
+ .pyre/
172
+
173
+ # pytype static type analyzer
174
+ .pytype/
175
+
176
+ # Cython debug symbols
177
+ cython_debug/
178
+
179
+ # PyCharm
180
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
181
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
182
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
183
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
184
+ #.idea/
185
+
186
+ # Abstra
187
+ # Abstra is an AI-powered process automation framework.
188
+ # Ignore directories containing user credentials, local state, and settings.
189
+ # Learn more at https://abstra.io/docs
190
+ .abstra/
191
+
192
+ # Visual Studio Code
193
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
194
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
195
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
196
+ # you could uncomment the following to ignore the entire vscode folder
197
+ # .vscode/
198
+
199
+ # Ruff stuff:
200
+ .ruff_cache/
201
+
202
+ # PyPI configuration file
203
+ .pypirc
204
+
205
+ # Cursor
206
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
207
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
208
+ # refer to https://docs.cursor.com/context/ignore-files
209
+ .cursorignore
210
+ .cursorindexingignore
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
@@ -0,0 +1,62 @@
1
+ # syntax=docker/dockerfile:1
2
+
3
+ # Minimal Snakemake executor image for AWS Batch
4
+ # Uses uv for fast, reproducible dependency installation
5
+
6
+ ARG PYTHON_VERSION=3.13
7
+
8
+ # =============================================================================
9
+ # Builder stage: install dependencies with uv
10
+ # =============================================================================
11
+ FROM python:${PYTHON_VERSION}-slim-bookworm AS builder
12
+
13
+ # Copy uv from the official image
14
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
15
+
16
+ # Set uv environment variables for reproducible builds
17
+ ENV UV_COMPILE_BYTECODE=1 \
18
+ UV_LINK_MODE=copy
19
+
20
+ WORKDIR /app
21
+
22
+ # Install dependencies first (better layer caching)
23
+ # Only copy files needed for dependency resolution
24
+ COPY pyproject.toml uv.lock* ./
25
+
26
+ # Sync dependencies without installing the project itself
27
+ # This layer is cached unless pyproject.toml or uv.lock changes
28
+ RUN --mount=type=cache,target=/root/.cache/uv \
29
+ uv sync --frozen --no-install-project --no-dev
30
+
31
+ # Copy source code and install the project in non-editable mode
32
+ COPY src/ ./src/
33
+ RUN --mount=type=cache,target=/root/.cache/uv \
34
+ uv sync --frozen --no-editable --no-dev
35
+
36
+ # =============================================================================
37
+ # Runtime stage: minimal image with just the virtual environment
38
+ # =============================================================================
39
+ FROM python:${PYTHON_VERSION}-slim-bookworm AS runtime
40
+
41
+ LABEL org.opencontainers.image.title="snakemake-executor-plugin-aws-basic-batch" \
42
+ org.opencontainers.image.description="Minimal Snakemake image with AWS Batch executor plugin" \
43
+ org.opencontainers.image.source="https://github.com/radusuciu/snakemake-executor-plugin-aws-basic-batch" \
44
+ org.opencontainers.image.authors="Radu Suciu <radusuciu@gmail.com>"
45
+
46
+ # Create non-root user for security
47
+ RUN groupadd --gid 1000 snakemake && \
48
+ useradd --uid 1000 --gid 1000 --create-home snakemake
49
+
50
+ # Copy the prepared virtual environment from builder
51
+ COPY --from=builder --chown=snakemake:snakemake /app/.venv /app/.venv
52
+
53
+ # Add virtual environment to PATH
54
+ ENV PATH="/app/.venv/bin:$PATH"
55
+
56
+ # Switch to non-root user
57
+ USER snakemake
58
+
59
+ WORKDIR /workflow
60
+
61
+ # Default command shows help
62
+ CMD ["snakemake", "--help"]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Radu Suciu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.4
2
+ Name: snakemake-executor-plugin-aws-basic-batch
3
+ Version: 0.1.0
4
+ Project-URL: Repository, https://github.com/radusuciu/snakemake-executor-plugin-aws-basic-batch
5
+ Author-email: Radu Suciu <radusuciu@gmail.com>
6
+ License-File: LICENSE
7
+ Requires-Python: <4.0,>=3.11
8
+ Requires-Dist: boto3>=1.26.0
9
+ Requires-Dist: snakemake-interface-common<2,>=1.22.0
10
+ Requires-Dist: snakemake-interface-executor-plugins<10,>=9.3.9
11
+ Requires-Dist: snakemake-storage-plugin-s3>=0.3.6
12
+ Requires-Dist: snakemake>=9.14.0
@@ -0,0 +1,37 @@
1
+ # snakemake-executor-plugin-aws-basic-batch
2
+
3
+ A Snakemake executor plugin for AWS Batch that uses pre-configured job definitions.
4
+
5
+ Unlike the [standard AWS Batch plugin](https://github.com/snakemake/snakemake-executor-plugin-aws-batch) which dynamically creates job definitions, this "basic" plugin relies on existing job definitions. This allows all resource configuration to be managed externally (e.g., via Terraform/CloudFormation). Additionally, workflow files and dependencies must bundled in the container image.
6
+
7
+ ## Usage
8
+
9
+ ```bash
10
+ snakemake --executor aws-basic-batch \
11
+ --aws-basic-batch-region us-east-1 \
12
+ --aws-basic-batch-job-queue my-queue \
13
+ --aws-basic-batch-job-definition my-job-def \
14
+ --default-storage-provider s3 \
15
+ --default-storage-prefix s3://my-bucket/workdir
16
+ ```
17
+
18
+ ## Coordinator Mode
19
+
20
+ Run the entire workflow as a fire-and-forget AWS Batch job:
21
+
22
+ ```bash
23
+ snakemake --executor aws-basic-batch \
24
+ --aws-basic-batch-coordinator true \
25
+ ...
26
+ ```
27
+
28
+ The coordinator job runs Snakemake itself on AWS Batch, submitting and monitoring rule jobs. Your terminal can disconnect after submission.
29
+
30
+ Optional coordinator-specific settings:
31
+ - `--aws-basic-batch-coordinator-queue` - Job queue for the coordinator (defaults to main queue)
32
+ - `--aws-basic-batch-coordinator-job-definition` - Job definition for the coordinator (defaults to main job definition)
33
+
34
+ ## Requirements
35
+
36
+ - Workflow and dependencies must be included in the container image
37
+ - Job definitions should have appropriate IAM roles for S3 access and Batch job submission (for coordinator mode)
@@ -0,0 +1,7 @@
1
+ # Example workflow image based on the snakemake-executor-plugin-aws-basic-batch base
2
+ FROM radusuciu/snakemake-executor-plugin-aws-basic-batch:latest
3
+
4
+ # Copy the example workflow
5
+ COPY --chown=snakemake:snakemake Snakefile /workflow/Snakefile
6
+
7
+ WORKDIR /workflow
@@ -0,0 +1,125 @@
1
+ # Simple Workflow Example
2
+
3
+ A minimal Snakemake workflow to test the AWS Batch executor plugin.
4
+
5
+ ## What It Does
6
+
7
+ 1. **create_input**: Generates sample text files
8
+ 2. **process**: Processes each sample in parallel (one Batch job per sample)
9
+ 3. **aggregate**: Combines all processed results into a summary
10
+
11
+ ## Prerequisites
12
+
13
+ Deploy the terraform infrastructure in two steps:
14
+
15
+ ### 1. Deploy Coordinator Infrastructure
16
+
17
+ The coordinator module creates shared resources (VPC, job queue, IAM roles, S3 bucket, coordinator job definition):
18
+
19
+ ```bash
20
+ cd examples/terraform/coordinator
21
+ terraform init
22
+ terraform apply
23
+ ```
24
+
25
+ ### 2. Deploy Workflow Infrastructure
26
+
27
+ The workflow module creates workflow-specific resources (job definition, ECR repository). It requires outputs from the coordinator:
28
+
29
+ ```bash
30
+ # From the simple-workflow example directory:
31
+ just tf-init
32
+ just tf-apply-new
33
+
34
+ # Or manually:
35
+ cd examples/terraform/simple-workflow
36
+ terraform init
37
+ terraform apply \
38
+ -var="job_queue_arn=$(terraform -chdir=../coordinator output -raw job_queue_arn)" \
39
+ -var="job_role_arn=$(terraform -chdir=../coordinator output -raw job_role_arn)" \
40
+ -var="execution_role_arn=$(terraform -chdir=../coordinator output -raw execution_role_arn)" \
41
+ -var="log_group_name=$(terraform -chdir=../coordinator output -raw log_group_name)" \
42
+ -var="log_group_arn=$(terraform -chdir=../coordinator output -raw log_group_arn)" \
43
+ -var="bucket_arn=$(terraform -chdir=../coordinator output -raw bucket_arn)"
44
+ ```
45
+
46
+ ### 3. Note the Outputs
47
+
48
+ After deployment, get the values needed for snakemake:
49
+
50
+ ```bash
51
+ # From examples/terraform/coordinator:
52
+ terraform output # region, job_queue_name, coordinator_job_definition_name, bucket_name
53
+
54
+ # From examples/terraform/simple-workflow:
55
+ terraform output # job_definition_name
56
+ ```
57
+
58
+ ## Running the Workflow
59
+
60
+ ### Using Justfile (Recommended)
61
+
62
+ The justfile provides shortcuts for common operations:
63
+
64
+ ```bash
65
+ cd examples/simple-workflow
66
+
67
+ # Submit coordinator job
68
+ just run
69
+
70
+ # Monitor job status
71
+ just watch
72
+
73
+ # View logs
74
+ just logs
75
+
76
+ # Check status
77
+ just status
78
+ ```
79
+
80
+ Generate a snakemake command with your deployed infrastructure values:
81
+
82
+ ```bash
83
+ just tf-snakemake-cmd
84
+ ```
85
+
86
+ ### Option 1: Standard Mode (local orchestration)
87
+
88
+ Your machine runs Snakemake and submits jobs to AWS Batch:
89
+
90
+ ```bash
91
+ snakemake --executor aws-basic-batch \
92
+ --aws-basic-batch-region <region> \
93
+ --aws-basic-batch-job-queue <queue-name> \
94
+ --aws-basic-batch-job-definition <job-def-name> \
95
+ --default-storage-provider s3 \
96
+ --default-storage-prefix s3://<bucket-name>
97
+ ```
98
+
99
+ ### Option 2: Coordinator Mode (fire-and-forget)
100
+
101
+ Submit a coordinator job that runs the entire workflow on Batch:
102
+
103
+ ```bash
104
+ snakemake --executor aws-basic-batch \
105
+ --aws-basic-batch-region <region> \
106
+ --aws-basic-batch-job-queue <queue-name> \
107
+ --aws-basic-batch-job-definition <job-def-name> \
108
+ --aws-basic-batch-coordinator \
109
+ --aws-basic-batch-coordinator-job-definition <coordinator-job-def-name> \
110
+ --default-storage-provider s3 \
111
+ --default-storage-prefix s3://<bucket-name>
112
+ ```
113
+
114
+ ### Local Test (no AWS)
115
+
116
+ ```bash
117
+ snakemake --cores 1
118
+ ```
119
+
120
+ ## Expected Output
121
+
122
+ After completion, you'll have:
123
+ - `data/sample_A.txt`, `data/sample_B.txt`, `data/sample_C.txt`
124
+ - `results/sample_A.processed.txt`, etc.
125
+ - `results/summary.txt` - aggregated output showing all processed samples
@@ -0,0 +1,75 @@
1
+ # Simple example workflow for testing snakemake-executor-plugin-aws-basic-batch
2
+ #
3
+ # This workflow:
4
+ # 1. Creates sample input files
5
+ # 2. Processes them in parallel on AWS Batch
6
+ # 3. Aggregates results
7
+ #
8
+ # Run locally (for testing):
9
+ # snakemake --cores 1
10
+ #
11
+ # Run on AWS Batch:
12
+ # snakemake --executor aws-basic-batch \
13
+ # --aws-basic-batch-region <region> \
14
+ # --aws-basic-batch-job-queue <queue-name> \
15
+ # --aws-basic-batch-job-definition <job-def-name> \
16
+ # --default-storage-provider s3 \
17
+ # --default-storage-prefix s3://<your-bucket>/workflow
18
+
19
+ SAMPLES = ["sample_A", "sample_B", "sample_C"]
20
+
21
+
22
+ rule all:
23
+ input:
24
+ "results/summary.txt",
25
+
26
+
27
+ rule create_input:
28
+ """Generate sample input data."""
29
+ output:
30
+ "data/{sample}.txt",
31
+ shell:
32
+ """
33
+ echo "Input data for {wildcards.sample}" > {output}
34
+ echo "Generated at: $(date)" >> {output}
35
+ echo "Hostname: $(hostname)" >> {output}
36
+ """
37
+
38
+
39
+ rule process:
40
+ """Process each sample (runs on AWS Batch in parallel)."""
41
+ input:
42
+ "data/{sample}.txt",
43
+ output:
44
+ "results/{sample}.processed.txt",
45
+ shell:
46
+ """
47
+ echo "=== Processing {wildcards.sample} ===" > {output}
48
+ echo "Started at: $(date)" >> {output}
49
+ echo "Running on: $(hostname)" >> {output}
50
+ echo "" >> {output}
51
+ echo "Input contents:" >> {output}
52
+ cat {input} >> {output}
53
+ echo "" >> {output}
54
+ echo "Processing complete at: $(date)" >> {output}
55
+ """
56
+
57
+
58
+ rule aggregate:
59
+ """Combine all processed results."""
60
+ input:
61
+ expand("results/{sample}.processed.txt", sample=SAMPLES),
62
+ output:
63
+ "results/summary.txt",
64
+ shell:
65
+ """
66
+ echo "=== Workflow Summary ===" > {output}
67
+ echo "Generated at: $(date)" >> {output}
68
+ echo "Total samples processed: {params}" >> {output}
69
+ echo "" >> {output}
70
+ for f in {input}; do
71
+ echo "--- $f ---" >> {output}
72
+ cat "$f" >> {output}
73
+ echo "" >> {output}
74
+ done
75
+ """