Skip to main content

A package for running neurosynth-compose analyses

Project description

compose-runner

Python package to execute meta-analyses created using neurosynth compose and NiMARE as the meta-analysis execution engine.

AWS Deployment

This repository includes an AWS CDK application that turns compose-runner into a serverless batch pipeline using Step Functions, AWS Lambda, and ECS Fargate. The deployed architecture works like this:

  • ComposeRunnerSubmit (Lambda Function URL) accepts HTTP requests, validates the meta-analysis payload, and starts a Step Functions execution. The response is immediate and returns both a durable job_id (the execution ARN) and the artifact_prefix used for S3 and log correlation.
  • A Standard state machine runs a single Fargate task (compose_runner.ecs_task) and waits for completion. The container downloads inputs, executes the meta-analysis on up to 4 vCPU / 30 GiB of memory, uploads artifacts to S3, and writes metadata.json into the same prefix.
  • ComposeRunnerStatus (Lambda Function URL) wraps DescribeExecution, merges metadata from S3, and exposes a simple status endpoint suitable for polling.
  • ComposeRunnerLogPoller streams the ECS CloudWatch Logs for a given artifact_prefix, while ComposeRunnerResultsFetcher returns presigned URLs for stored artifacts.
  1. Create a virtual environment and install the CDK dependencies:
    cd infra/cdk
    python -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
    
  2. (One-time per account/region) bootstrap the CDK environment:
    cdk bootstrap
    
  3. Deploy the stack (supplying the compose-runner version you want baked into the images):
    cdk deploy \
      -c composeRunnerVersion=$(hatch version) \
      -c resultsPrefix=compose-runner/results \
      -c taskCpu=4096 \
      -c taskMemoryMiB=30720
    
    Pass -c resultsBucketName=<bucket> to use an existing S3 bucket, or omit it to let the stack create and retain a dedicated bucket. Additional knobs:
  • -c stateMachineTimeoutSeconds=32400 to control the max wall clock per run
  • -c submitTimeoutSeconds / -c statusTimeoutSeconds / -c pollTimeoutSeconds to tune Lambda timeouts
  • -c taskEphemeralStorageGiB if the default 21 GiB scratch volume is insufficient

The deployment builds both the Lambda image (aws_lambda/Dockerfile) and the Fargate task image (Dockerfile), provisions the Step Functions state machine, and configures a public VPC so each task has outbound internet access. The CloudFormation outputs list the HTTPS endpoints for submission, status, logs, and artifact retrieval, alongside the Step Functions ARN.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

compose_runner-0.7.4.tar.gz (13.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

compose_runner-0.7.4-py2.py3-none-any.whl (13.4 MB view details)

Uploaded Python 2Python 3

File details

Details for the file compose_runner-0.7.4.tar.gz.

File metadata

  • Download URL: compose_runner-0.7.4.tar.gz
  • Upload date:
  • Size: 13.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for compose_runner-0.7.4.tar.gz
Algorithm Hash digest
SHA256 f1127952f066c91797f62e6e1c14957272f5332be34c7faf1f7aaa2f3117d449
MD5 f7b3e9c2d6d73d88cf9647676802dd31
BLAKE2b-256 85be4533f6e4c61a25da5cfc788f299810881b2c4c24569fff0924157ce7b5c2

See more details on using hashes here.

File details

Details for the file compose_runner-0.7.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for compose_runner-0.7.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d02d031fa8a8ca41fb82aa521e9b60b2b1e818976114f0422d31a85ef37d1ebd
MD5 5f1e1f5d1d00b70872cc67f81f67acc9
BLAKE2b-256 8deec2d39947ee1fb075cb3c68c5551835798ee2c04a89ba9b2d9b36cf3b8374

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page