ds-reify

Run encapsulated docker containers that do... something in the Amazon Web Services infrastructure.

https://github.com/distributedscience/distributed-something

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.3%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

Run encapsulated docker containers that do... something in the Amazon Web Services infrastructure.

Basic Info
Statistics
  • Stars: 7
  • Watchers: 4
  • Forks: 4
  • Open Issues: 8
  • Releases: 2
Created about 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

Distributed-Something

Run encapsulated docker containers that do... something in the Amazon Web Services (AWS) infrastructure. We are interested in scientific image analysis so we have used it for CellProfiler, Fiji, BioFormats2Raw, and certain functionalities from pycytominer. You can use it for whatever you want!

Documentation

Full documentation is available on our Documentation Website. We have a fully-functional minimal example of a Distributed-Something application available at Distributed-HelloWorld.

Overview

This code is an example of how to use AWS distributed infrastructure for running anything Dockerized. The configuration of the AWS resources is done using boto3 and the AWS CLI. The worker is written in Python and is encapsulated in a Docker container. There are four AWS components that are minimally needed to run distributed jobs:

  1. An SQS queue
  2. An ECS cluster
  3. An S3 bucket
  4. A spot fleet of EC2 instances

All of them can be managed individually through the AWS Management Console. However, this code helps to get started quickly and run a job autonomously if all the configuration is correct. The code runs a script that links all these components and prepares the infrastructure to run a distributed job. When the job is completed, the code is also able to stop resources and clean up components. It also adds logging and alarms via CloudWatch, helping the user troubleshoot runs and destroy stuck machines.

Running the code

Step 1

Edit the config.py file with all the relevant information for your job. Then, start creating the basic AWS resources by running the following script:

python3 run.py setup

This script initializes the resources in AWS. Notice that the docker registry is built separately and you can modify the worker code to build your own. Any time you modify the worker code, you need to update the docker registry using the Makefile script inside the worker directory.

Step 2

After the first script runs successfully, the job can now be submitted to with the following command:

python3 run.py submitJob files/exampleJob.json

Running the script uploads the tasks that are configured in the json file.
You have to customize the exampleJob.json file with information that make sense for your project. You'll want to figure out which information is generic and which is the information that makes each job unique.

Step 3

After submitting the job to the queue, we can add computing power to process all tasks in AWS. This code starts a fleet of spot EC2 instances which will run the worker code. The worker code is encapsulated in Docker containers, and the code uses ECS services to inject them in EC2. All this is automated with the following command:

python3 run.py startCluster files/exampleFleet.json

After the cluster is ready, the code informs you that everything is setup, and saves the spot fleet identifier in a file for further reference.

Step 4

When the cluster is up and running, you can monitor progress using the following command:

python3 run.py monitor files/APP_NAMESpotFleetRequestId.json

The file APP_NAMESpotFleetRequestId.json is created after the cluster is setup in step 3. It is important to keep this monitor running if you want to automatically shutdown computing resources when there are no more tasks in the queue (recommended).

See our full documentation for more information about each step of the process.

Distributed-Something

Owner

  • Name: DistributedScience
  • Login: DistributedScience
  • Kind: organization

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Cimini"
  given-names: "Beth A."
  orcid: "https://orcid.org/0000-0001-9640-9318"
- family-names: "Weisbart"
  given-names: "Erin"
  orcid: "https://orcid.org/0000-0002-6437-2458"
title: "Distributed-Something"
version: 0.1.0
doi: 10.1038/s41592-023-01918-8
date-released: 2023-06-05
url: "https://github.com/DistributedScience/Distributed-Something"
preferred-citation:
  type: article
  authors:
  - family-names: "Cimini"
    given-names: "Beth A."
    orcid: "https://orcid.org/0000-0001-9640-9318"
  - family-names: "Weisbart"
    given-names: "Erin"
    orcid: "https://orcid.org/0000-0002-6437-2458"
  doi: "10.1038/s41592-023-01918-8"
  journal: "Nature Methods"
  month: 6
  start: 0 # First page number
  end: 0 # Last page number
  title: "Distributed-Something: scripts to leverage AWS storage and computing for distributed workflows at scale"
  issue: 0
  volume: 0
  year: 2023

GitHub Events

Total
  • Issues event: 2
  • Watch event: 1
  • Issue comment event: 5
  • Push event: 3
  • Fork event: 1
Last Year
  • Issues event: 2
  • Watch event: 1
  • Issue comment event: 5
  • Push event: 3
  • Fork event: 1

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 12 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
pypi.org: ds-reify

A CLI helper for [Distributed-Something](https://github.com/DistributedScience/Distributed-Something)

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 12 Last month
Rankings
Dependent packages count: 6.6%
Average: 18.6%
Dependent repos count: 30.6%
Maintainers (1)
Last synced: 7 months ago

Dependencies

files/requirements.txt pypi
  • boto3 >=1.0.0
.github/workflows/deploy.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • peaceiris/actions-gh-pages v3.6.1 composite
worker/Dockerfile docker
  • someuser/somedocker sometag build