Skip to content

Commit 1b52e5a

Browse files
authored
DCP2.0 (#104)
* Update run.py * Delete fabfile.py * Move previous fab functions into run.py * Debugging from lambda * tabs to spaces, issues/112 * issues/105 * issues/110, fix passing USE_PLUGINS * fix tabs to spaces in run.py * tab/space error in run_batch_general * issues/107 * issues/107 * add 'cheapest' mode to monitor * get credentials working * move machine type/price/date out of fleet file * move machine type/price/date out of fleet file * support running of monitor in cheapest mode * fix indentation in CHECK_IF_DONE * move cpDone * don't move done file, you still need to check it * don't move done file, you still need to check it * fix cmdstm for batch files * fixes to make log export work * python 3 support in run.py * move Python2 files to their own folder * pin watchtower to last python2 version * support for CellProfiler 4 * fix alarm time designation * Update README.md * Update requirements.txt * Update LICENSE * Add a bit about run_batch_general
1 parent 338e7c6 commit 1b52e5a

18 files changed

+997
-671
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Distributed-CellProfiler is distributed under the following BSD-style license:
22

3-
Copyright © 2017 Broad Institute, Inc. All rights reserved.
3+
Copyright © 2020 Broad Institute, Inc. All rights reserved.
44

55
Redistribution and use in source and binary forms, with or without
66
modification, are permitted provided that the following conditions are

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,27 @@ job. When the job is completed, the code is also able to stop resources and clea
2222
Edit the config.py file with all the relevant information for your job. Then, start creating
2323
the basic AWS resources by running the following script:
2424

25-
$ fab setup
25+
$ python run.py setup
2626

2727
This script intializes the resources in AWS. Notice that the docker registry is built separately,
2828
and you can modify the worker code to build your own. Anytime you modify the worker code, you need
2929
to update the docker registry using the Makefile script inside the worker directory.
3030

3131
### Step 2
32-
After the first script runs successfully, the job can now be submitted to AWS using the
33-
following command:
32+
After the first script runs successfully, the job can now be submitted to AWS using EITHER of the
33+
following commands:
3434

3535
$ python run.py submitJob files/exampleJob.json
36+
37+
OR
38+
39+
$ python run_batch_general.py
3640

37-
This uploads the tasks that are configured in the json file. This assumes that your data is stored
38-
in S3, and the json file has the paths to find input and output directories. You have to customize
39-
the exampleJob.json file with paths that make sense for your project. Also, the tasks that compose
40-
your job are CP groups, and each one will be run in parallel. You need to define each task in this
41-
json file to guide the parallelization.
41+
Running either script uploads the tasks that are configured in the json file. This assumes that your
42+
data is stored in S3, and the json file has the paths to find input and output directories. You have to
43+
customizethe exampleJob.json file or the run_batch_general file with paths that make sense for your project.
44+
The tasks that composeyour job are CP groups, and each one will be run in parallel. You need to define each
45+
task in your input file to guide the parallelization.
4246

4347
### Step 3
4448
After submitting the job to the queue, we can add computing power to process all tasks in AWS. This
@@ -48,10 +52,8 @@ with the following command:
4852

4953
$ python run.py startCluster files/exampleFleet.json
5054

51-
The exampleFleet.json file has to be updated to determine the type of EC2 instances that you want
52-
and how much you are willing to pay for each machine-hour. Make sure to adjust the values in this
53-
json file according to your application. After the cluster is ready, the code informs you that
54-
everything is setup, and saves the spot fleet identifier in a file for further references.
55+
After the cluster is ready, the code informs you that everything is setup, and saves the spot fleet identifier
56+
in a file for further reference.
5557

5658
### Step 4
5759
When the cluster is up and running, you can monitor progress using the following command:

config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
ECS_CLUSTER = 'default'
1616
CLUSTER_MACHINES = 3
1717
TASKS_PER_MACHINE = 1
18+
MACHINE_TYPE = ['m4.xlarge']
19+
MACHINE_PRICE = 0.10
1820
EBS_VOL_SIZE = 30 # In GB. Minimum allowed is 22.
1921

2022
# DOCKER INSTANCE RUNNING ENVIRONMENT:
@@ -37,6 +39,7 @@
3739
CHECK_IF_DONE_BOOL = 'True' #True or False- should it check if there are a certain number of non-empty files and delete the job if yes?
3840
EXPECTED_NUMBER_FILES = 7 #What is the number of files that trigger skipping a job?
3941
MIN_FILE_SIZE_BYTES = 1 #What is the minimal number of bytes an object should be to "count"?
42+
NECESSARY_STRING = '' #Is there any string that should be in the file name to "count"?
4043

4144
# PLUGINS
4245
USE_PLUGINS = 'True'

fabfile.py

Lines changed: 0 additions & 269 deletions
This file was deleted.

files/exampleFleet_us-east-1.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{
22
"IamFleetRole": "arn:aws:iam::XXXXXXXXXXXXX:role/aws-ec2-spot-fleet-role",
33
"AllocationStrategy": "lowestPrice",
4-
"TargetCapacity": 3,
5-
"SpotPrice": "0.10",
6-
"ValidFrom": "2016-07-20T20:28:54Z",
7-
"ValidUntil": "2017-07-20T20:28:54Z",
84
"TerminateInstancesWithExpiration": true,
95
"LaunchSpecifications": [
106
{
117
"ImageId": "ami-fad25980",
12-
"InstanceType": "m4.xlarge",
138
"KeyName": "your_key_file_name",
149
"IamInstanceProfile": {
1510
"Arn": "arn:aws:iam::XXXXXXXXXXXX:instance-profile/ecsInstanceRole"

files/exampleFleet_us-west-2.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{
22
"IamFleetRole": "arn:aws:iam::XXXXXXXXXXXXX:role/aws-ec2-spot-fleet-role",
33
"AllocationStrategy": "lowestPrice",
4-
"TargetCapacity": 3,
5-
"SpotPrice": "0.10",
6-
"ValidFrom": "2016-07-20T20:28:54Z",
7-
"ValidUntil": "2017-07-20T20:28:54Z",
84
"TerminateInstancesWithExpiration": true,
95
"LaunchSpecifications": [
106
{
117
"ImageId": "ami-c9c87cb1",
12-
"InstanceType": "m4.xlarge",
138
"KeyName": "your_key_file_name",
149
"IamInstanceProfile": {
1510
"Arn": "arn:aws:iam::XXXXXXXXXXXX:instance-profile/ecsInstanceRole"

files/requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
fabric==1.14.0
2-
boto>=2.38.0
31
boto3>=1.0.0

0 commit comments

Comments
 (0)