Skip to content

Commit a5158ae

Browse files
committed
deploy: f2d5c77
1 parent c9889aa commit a5158ae

8 files changed

Lines changed: 89 additions & 39 deletions

File tree

_images/sample_DCP_config_2.png

25 KB
Loading

_sources/config_examples.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Our internal configurations for each pipeline are as follows:
4646
| EBS_VOL_SIZE (if using S3 mounted as a file system) | 22 | 22 | 22 | 22 | 22 | Files are read directly off of S3, mounted as a file system when `DOWNLOAD_FILES = False`. |
4747
| EBS_VOL_SIZE (if downloading files) | 22 | 200 | 22 | 22 | 40 | Files are downloaded to the EBS volume when `DOWNLOAD_FILES = True`. |
4848
| DOWNLOAD_FILES | 'False' | 'False' | 'False' | 'False' | 'False' | |
49+
| ASSIGN_IP | 'False' | 'False' | 'False' | 'False' | 'False' | |
4950
| DOCKER_CORES | 4 | 4 | 4 | 4 | 3 | If using c class machines and large images (2k + pixels) then you might need to reduce this number. |
5051
| CPU_SHARES | DOCKER_CORES * 1024 | DOCKER_CORES * 1024 | DOCKER_CORES * 1024 | DOCKER_CORES * 1024 | DOCKER_CORES * 1024 | We never change this. |
5152
| MEMORY | 7500 | 7500 | 7500 | 7500 | 7500 | This must match your machine type. m class use 15000, c class use 7500. |

_sources/costs.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,28 @@
22

33
Distributed-CellProfiler is run by a series of three commands, only one of which incurs costs at typical scale of usage:
44

5-
[`setup`](step_1_configuration.md) creates a queue in SQS and a cluster, service, and task definition in ECS.
6-
ECS is entirely free.
5+
[`setup`](step_1_configuration.md) creates a queue in SQS and a cluster, service, and task definition in ECS.
6+
ECS is entirely free.
77
SQS queues are free to create and use up to 1 million requests/month.
88

99
[`submitJobs`](step_2_submit_jobs.md) places messages in the SQS queue which is free (under 1 million requests/month).
1010

11-
[`startCluster`](step_3_start_cluster.md) is the only command that incurs costs with initiation of your spot fleet request, creating machine alarms, and optionally creating a run dashboard.
11+
[`startCluster`](step_3_start_cluster.md) is the only command that incurs costs with initiation of your spot fleet request, creating machine alarms, and optionally creating a run dashboard.
1212

13-
The spot fleet is the major cost of running Distributed-CellProfiler, exact pricing of which depends on the number of machines, type of machines, and duration of use.
13+
The spot fleet is the major cost of running Distributed-CellProfiler, exact pricing of which depends on the number of machines, type of machines, and duration of use.
1414
Your bid is configured in the [config file](step_1_configuration.md).
15+
Simple spot fleet configurations can be minimized by:
16+
17+
1) Optimize `MACHINE_TYPE` and `EBS_VOL_SIZE` based on the actual memory and harddrive needs of your run.
18+
2) When possible, mount your S3 bucket using S3FS so that you can set `DOWNLOAD_FILES = 'False'` to not incur file egress costs.
19+
See [Step 1 Configuration](step_1_configuration.md) for more information.
20+
Data egress charges range for various reasons including traversing AWS regions and/or AWS availability zones but are [often $0.08–$0.12 per GB](https://aws.amazon.com/blogs/apn/aws-data-transfer-charges-for-server-and-serverless-architectures/).
21+
3) Set `ASSIGN_IP = 'False'` so that you don't pay for IPv4 addresses per EC2 instance in your spot fleet.
22+
Public IPv4 costs are minimal ([$0.005/IP/hour as of February 1, 2024](https://aws.amazon.com/blogs/aws/new-aws-public-ipv4-address-charge-public-ip-insights/)) but there is no need to incur even this minimal cost unless you have a specific need for it.
23+
See [Step 1 Configuration](step_1_configuration.md) for more information.
1524

1625
Spot fleet costs can be minimized/stopped in multiple ways:
26+
1727
1) We encourage the use of [`monitor`](step_4_monitor.md) during your job to help minimize the spot fleet cost as it automatically scales down your spot fleet request as your job queue empties and cancels your spot fleet request when you have no more jobs in the queue.
1828
Note that you can also perform a more aggressive downscaling of your fleet by monitor by engaging Cheapest mode (see [`more information here`](step_4_monitor.md)).
1929
2) If your job is finished, you can still initiate [`monitor`](step_4_monitor.md) to perform the same cleanup (without the automatic scaling).
@@ -23,14 +33,16 @@ Note that you can also perform a more aggressive downscaling of your fleet by mo
2333
After the spot fleet has started, a Cloudwatch instance alarm is automatically placed on each instance in the fleet.
2434
Cloudwatch instance alarms [are currently $0.10/alarm/month](https://aws.amazon.com/cloudwatch/pricing/).
2535
Cloudwatch instance alarm costs can be minimized/stopped in multiple ways:
36+
2637
1) If you run monitor during your job, it will automatically delete Cloudwatch alarms for any instance that is no longer in use once an hour while running and at the end of a run.
2738
2) If your job is finished, you can still initiate [`monitor`](step_4_monitor.md) to delete Cloudwatch alarms for any instance that is no longer in use.
2839
3) In [AWS Cloudwatch console](https://console.aws.amazon.com/cloudwatch/) you can select unused alarms by going to Alarms => All alarms. Change Any State to Insufficient Data, select all alarms, and then Actions => Delete.
2940
4) We provide a [hygiene script](hygiene.md) that will clean up old alarms for you.
3041

31-
Cloudwatch Dashboards [are currently free](https://aws.amazon.com/cloudwatch/pricing/) for 3 Dashboards with up to 50 metrics per month and are $3 per dashboard per month after that.
42+
Cloudwatch Dashboards [are currently free](https://aws.amazon.com/cloudwatch/pricing/) for 3 Dashboards with up to 50 metrics per month and are $3 per dashboard per month after that.
3243
Cloudwatch Dashboard costs can be minimized/prevented in multiple ways:
44+
3345
1) You can choose not to have Distributed-CellProfiler create a Dashboard by setting `CREATE_DASHBOARD = 'False'` in your [config file](step_1_configuration.md).
3446
2) We encourage the use of [`monitor`](step_4_monitor.md) during your job as if you have set `CLEAN_DASHBOARD = 'True'` in your [config file](step_1_configuration.md) it will automatically delete your Dashboard when your job is done.
3547
3) If your job is finished, you can still initiate [`monitor`](step_4_monitor.md) to perform the same cleanup (without the automatic scaling).
36-
4) You can manually delete Dashboards in the [Cloudwatch Console]((https://console.aws.amazon.com/cloudwatch/)) by going to Dashboards, selecting your Dashboard, and selecting Delete.
48+
4) You can manually delete Dashboards in the [Cloudwatch Console]((https://console.aws.amazon.com/cloudwatch/)) by going to Dashboards, selecting your Dashboard, and selecting Delete.

_sources/step_1_configuration.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ It need not be unique, but it should be descriptive enough that you can tell job
1717
***
1818

1919
### AWS GENERAL SETTINGS
20+
2021
These are settings that will allow your instances to be configured correctly and access the resources they need- see [Step 0: Prep](step_0_prep.md) for more information.
2122

2223
Bucket configurations allow you to read/write from/to different bucket in different accounts from where you are running DCP.
@@ -48,15 +49,23 @@ Distinct clusters for each job are not necessary, but if you're running multiple
4849
* **MACHINE_PRICE:** How much you're willing to pay per hour for each machine launched.
4950
AWS has a handy [price history tracker](https://console.aws.amazon.com/ec2sp/v1/spot/home) you can use to make a reasonable estimate of how much to bid.
5051
If your jobs complete quickly and/or you don't need the data immediately you can reduce your bid accordingly; jobs that may take many hours to finish or that you need results from immediately may justify a higher bid.
52+
See also [AWS on-demand pricing](https://aws.amazon.com/ec2/pricing/on-demand/) to compare the cost savings of using spot fleets.
5153
* **EBS_VOL_SIZE:** The size of the temporary hard drive associated with each EC2 instance in GB.
5254
The minimum allowed is 22.
5355
If you have multiple Dockers running per machine, each Docker will have access to (EBS_VOL_SIZE/TASKS_PER_MACHINE)- 2 GB of space.
5456
* **DOWNLOAD_FILES:** Whether or not to download the image files to the EBS volume before processing, as opposed to accessing them all from S3FS.
5557
This typically requires a larger EBS volume (depending on the size of your image sets, and how many sets are processed per group), but avoids occasional issues with S3FS that can crop up on longer runs.
58+
By default, DCP uses S3FS to mount the S3 `SOURCE_BUCKET` as a pseudo-file system on each EC2 instance in your spot fleet to avoid file download.
59+
If you are unable to mount the `SOURCE_BUCKET` (perhaps because of a permissions issue) you should proceed with `DOWNLOAD_FILES = 'True'`.
60+
* **ASSIGN_IP:** Whether or not to assign an a public IPv4 address to each instance in the spot fleet.
61+
If set to 'False' will overwrite whatever is in the Fleet file.
62+
If set to 'True' will respect whatever is in the Fleet file.
63+
Distributed-CellProfiler originally defaulted to assign an IP address to each instance so that one could connect to the instance for troubleshooting but that need has been mostly obviated by the level of logging currently in DCP.
5664

5765
***
5866

5967
### DOCKER INSTANCE RUNNING ENVIRONMENT
68+
6069
* **DOCKER_CORES:** How many copies of your script to run in each Docker container.
6170
* **CPU_SHARES:** How many CPUs each Docker container may have.
6271
* **MEMORY:** How much memory each Docker container may have.
@@ -83,8 +92,9 @@ See [Step 0: Prep](step_0_prep.med) for more information.
8392

8493
***
8594

86-
### MONITORING
87-
* **AUTO_MONITOR:** Whether or not to have Auto-Monitor automatically monitor your jobs.
95+
### MONITORING
96+
97+
* **AUTO_MONITOR:** Whether or not to have Auto-Monitor automatically monitor your jobs.
8898

8999
***
90100

@@ -111,6 +121,7 @@ Useful when trying to detect jobs that may have exported smaller corrupted files
111121
***
112122

113123
### CELLPROFILER SETTINGS
124+
114125
* **ALWAYS CONTINUE:** Whether or not to run CellProfiler with the --always-continue flag, which will keep CellProfiler from crashing if it errors.
115126
Use with caution.
116127
This can be particularly helpful in jobs where a large number of files are loaded in a single run (such as during illumination correction) so that a corrupted or missing file doesn't prevent the whole job completing.
@@ -120,6 +131,7 @@ We suggest using this setting in conjunction with a small number of JOB_RETRIES.
120131
***
121132

122133
### PLUGINS
134+
123135
* **USE_PLUGINS:** Whether or not you will be using external plugins from the CellProfiler-plugins repository.
124136
When True, passes the `--plugins-directory` flag to CellProfiler.
125137
Defaults to the current v1.0 `CellProfiler-plugins/active_plugins` location for plugins but will revert to the historical location of plugins in the `CellProfiler-plugins` root directory if the `active_plugins` folder is not present.
@@ -147,7 +159,7 @@ If you need to use deprecated plugin organization you can access previous commit
147159

148160
### EXAMPLE CONFIGURATIONS
149161

150-
!(Sample_Distributed-CellProfiler_Configuration_1)[images/sample_DCP_config_1.png]
162+
![Sample_Distributed-CellProfiler_Configuration_1](images/sample_DCP_config_1.png)
151163

152164
This is an example of one possible configuration.
153165
It's a fairly large machine that is able to process 64 jobs at the same time.
@@ -159,9 +171,9 @@ The Config settings for this example are:
159171

160172
**DOCKER_CORES** = 4 (copies of CellProfiler to run inside a docker)
161173
**CPU_SHARES** = 4096 (number of cores for each Docker * 1024)
162-
**MEMORY** = 15000 (MB for each Docker)
174+
**MEMORY** = 15000 (MB for each Docker)
163175

164-
!(Sample_Distributed-CellProfiler_Configuration_2)[images/sample_DCP_config_2.png]
176+
![Sample_Distributed-CellProfiler_Configuration_2](images/sample_DCP_config_2.png)
165177

166178
This is an example of another possible configuration.
167179
When we run Distributed CellProfiler we tend to prefer running a larger number of smaller machine.
@@ -175,4 +187,4 @@ The Config settings for this example are:
175187

176188
**DOCKER_CORES** = 4 (copies of CellProfiler to run inside a docker)
177189
**CPU_SHARES** = 4096 (number of cores for each Docker * 1024)
178-
**MEMORY** = 15000 (MB for each Docker)
190+
**MEMORY** = 15000 (MB for each Docker)

config_examples.html

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -594,167 +594,175 @@ <h1>config.py configuration examples<a class="headerlink" href="#config-py-confi
594594
<td><p>‘False’</p></td>
595595
<td><p></p></td>
596596
</tr>
597-
<tr class="row-even"><td><p>DOCKER_CORES</p></td>
597+
<tr class="row-even"><td><p>ASSIGN_IP</p></td>
598+
<td><p>‘False’</p></td>
599+
<td><p>‘False’</p></td>
600+
<td><p>‘False’</p></td>
601+
<td><p>‘False’</p></td>
602+
<td><p>‘False’</p></td>
603+
<td><p></p></td>
604+
</tr>
605+
<tr class="row-odd"><td><p>DOCKER_CORES</p></td>
598606
<td><p>4</p></td>
599607
<td><p>4</p></td>
600608
<td><p>4</p></td>
601609
<td><p>4</p></td>
602610
<td><p>3</p></td>
603611
<td><p>If using c class machines and large images (2k + pixels) then you might need to reduce this number.</p></td>
604612
</tr>
605-
<tr class="row-odd"><td><p>CPU_SHARES</p></td>
613+
<tr class="row-even"><td><p>CPU_SHARES</p></td>
606614
<td><p>DOCKER_CORES * 1024</p></td>
607615
<td><p>DOCKER_CORES * 1024</p></td>
608616
<td><p>DOCKER_CORES * 1024</p></td>
609617
<td><p>DOCKER_CORES * 1024</p></td>
610618
<td><p>DOCKER_CORES * 1024</p></td>
611619
<td><p>We never change this.</p></td>
612620
</tr>
613-
<tr class="row-even"><td><p>MEMORY</p></td>
621+
<tr class="row-odd"><td><p>MEMORY</p></td>
614622
<td><p>7500</p></td>
615623
<td><p>7500</p></td>
616624
<td><p>7500</p></td>
617625
<td><p>7500</p></td>
618626
<td><p>7500</p></td>
619627
<td><p>This must match your machine type. m class use 15000, c class use 7500.</p></td>
620628
</tr>
621-
<tr class="row-odd"><td><p>SECONDS_TO_START</p></td>
629+
<tr class="row-even"><td><p>SECONDS_TO_START</p></td>
622630
<td><p>60</p></td>
623631
<td><p>3*60</p></td>
624632
<td><p>60</p></td>
625633
<td><p>3*60</p></td>
626634
<td><p>3*60</p></td>
627635
<td><p></p></td>
628636
</tr>
629-
<tr class="row-even"><td><p>SQS_QUEUE_NAME</p></td>
637+
<tr class="row-odd"><td><p>SQS_QUEUE_NAME</p></td>
630638
<td><p>APP_NAME + ‘Queue’</p></td>
631639
<td><p>APP_NAME + ‘Queue’</p></td>
632640
<td><p>APP_NAME + ‘Queue’</p></td>
633641
<td><p>APP_NAME + ‘Queue’</p></td>
634642
<td><p>APP_NAME + ‘Queue’</p></td>
635643
<td><p>We never change this.</p></td>
636644
</tr>
637-
<tr class="row-odd"><td><p>SQS_MESSAGE_VISIBILITY</p></td>
645+
<tr class="row-even"><td><p>SQS_MESSAGE_VISIBILITY</p></td>
638646
<td><p>3*60</p></td>
639647
<td><p>240*60</p></td>
640648
<td><p>15*60</p></td>
641649
<td><p>10*60</p></td>
642650
<td><p>120*60</p></td>
643651
<td><p>About how long you expect a job to take * 1.5 in seconds</p></td>
644652
</tr>
645-
<tr class="row-even"><td><p>SQS_DEAD_LETTER_QUEUE</p></td>
653+
<tr class="row-odd"><td><p>SQS_DEAD_LETTER_QUEUE</p></td>
646654
<td><p>‘YOURNAME_DEADMESSAGES’</p></td>
647655
<td><p>‘YOURNAME_DEADMESSAGES’</p></td>
648656
<td><p>‘YOURNAME_DEADMESSAGES’</p></td>
649657
<td><p>‘YOURNAME_DEADMESSAGES’</p></td>
650658
<td><p>‘YOURNAME_DEADMESSAGES’</p></td>
651659
<td><p></p></td>
652660
</tr>
653-
<tr class="row-odd"><td><p>JOB_RETRIES</p></td>
661+
<tr class="row-even"><td><p>JOB_RETRIES</p></td>
654662
<td><p>3</p></td>
655663
<td><p>3</p></td>
656664
<td><p>3</p></td>
657665
<td><p>3</p></td>
658666
<td><p>3</p></td>
659667
<td><p></p></td>
660668
</tr>
661-
<tr class="row-even"><td><p>AUTO_MONITOR</p></td>
669+
<tr class="row-odd"><td><p>AUTO_MONITOR</p></td>
662670
<td><p>‘True’</p></td>
663671
<td><p>‘True’</p></td>
664672
<td><p>‘True’</p></td>
665673
<td><p>‘True’</p></td>
666674
<td><p>‘True’</p></td>
667675
<td><p>Can be turned off if manually running Monitor.</p></td>
668676
</tr>
669-
<tr class="row-odd"><td><p>CREATE_DASHBOARD</p></td>
677+
<tr class="row-even"><td><p>CREATE_DASHBOARD</p></td>
670678
<td><p>‘True’</p></td>
671679
<td><p>‘True’</p></td>
672680
<td><p>‘True’</p></td>
673681
<td><p>‘True’</p></td>
674682
<td><p>‘True’</p></td>
675683
<td><p></p></td>
676684
</tr>
677-
<tr class="row-even"><td><p>CLEAN_DASHBOARD</p></td>
685+
<tr class="row-odd"><td><p>CLEAN_DASHBOARD</p></td>
678686
<td><p>‘True’</p></td>
679687
<td><p>‘True’</p></td>
680688
<td><p>‘True’</p></td>
681689
<td><p>‘True’</p></td>
682690
<td><p>‘True’</p></td>
683691
<td><p></p></td>
684692
</tr>
685-
<tr class="row-odd"><td><p>CHECK_IF_DONE_BOOL</p></td>
693+
<tr class="row-even"><td><p>CHECK_IF_DONE_BOOL</p></td>
686694
<td><p>‘True’</p></td>
687695
<td><p>‘True’</p></td>
688696
<td><p>‘True’</p></td>
689697
<td><p>‘True’</p></td>
690698
<td><p>‘True’</p></td>
691699
<td><p>Can be turned off if wanting to overwrite old data.</p></td>
692700
</tr>
693-
<tr class="row-even"><td><p>EXPECTED_NUMBER_FILES</p></td>
701+
<tr class="row-odd"><td><p>EXPECTED_NUMBER_FILES</p></td>
694702
<td><p>1 (an image)</p></td>
695703
<td><p>number channels + 1 (an .npy for each channel and isdone)</p></td>
696704
<td><p>3 (Experiment.csv, Image.csv, and isdone)</p></td>
697705
<td><p>1 (an image)</p></td>
698706
<td><p>5 (Experiment, Image, Cells, Nuclei, and Cytoplasm .csvs)</p></td>
699707
<td><p>Better to underestimate than overestimate.</p></td>
700708
</tr>
701-
<tr class="row-odd"><td><p>MIN_FILE_SIZE_BYTES</p></td>
709+
<tr class="row-even"><td><p>MIN_FILE_SIZE_BYTES</p></td>
702710
<td><p>1</p></td>
703711
<td><p>1</p></td>
704712
<td><p>1</p></td>
705713
<td><p>1</p></td>
706714
<td><p>1</p></td>
707715
<td><p>Count files of any size.</p></td>
708716
</tr>
709-
<tr class="row-even"><td><p>NECESSARY_STRING</p></td>
717+
<tr class="row-odd"><td><p>NECESSARY_STRING</p></td>
710718
<td><p>‘’</p></td>
711719
<td><p>‘’</p></td>
712720
<td><p>‘’</p></td>
713721
<td><p>‘’</p></td>
714722
<td><p>‘’</p></td>
715723
<td><p>Not necessary for standard workflows.</p></td>
716724
</tr>
717-
<tr class="row-odd"><td><p>ALWAYS_CONTINUE</p></td>
725+
<tr class="row-even"><td><p>ALWAYS_CONTINUE</p></td>
718726
<td><p>‘False’</p></td>
719727
<td><p>‘False’</p></td>
720728
<td><p>‘False’</p></td>
721729
<td><p>‘False’</p></td>
722730
<td><p>‘False’</p></td>
723731
<td><p>Use with caution.</p></td>
724732
</tr>
725-
<tr class="row-even"><td><p>USE_PLUGINS</p></td>
733+
<tr class="row-odd"><td><p>USE_PLUGINS</p></td>
726734
<td><p>‘False’</p></td>
727735
<td><p>‘False’</p></td>
728736
<td><p>‘False’</p></td>
729737
<td><p>‘False’</p></td>
730738
<td><p>‘False’</p></td>
731739
<td><p>Not necessary for standard workflows.</p></td>
732740
</tr>
733-
<tr class="row-odd"><td><p>UPDATE_PLUGINS</p></td>
741+
<tr class="row-even"><td><p>UPDATE_PLUGINS</p></td>
734742
<td><p>‘False’</p></td>
735743
<td><p>‘False’</p></td>
736744
<td><p>‘False’</p></td>
737745
<td><p>‘False’</p></td>
738746
<td><p>‘False’</p></td>
739747
<td><p>Not necessary for standard workflows.</p></td>
740748
</tr>
741-
<tr class="row-even"><td><p>PLUGINS_COMMIT</p></td>
749+
<tr class="row-odd"><td><p>PLUGINS_COMMIT</p></td>
742750
<td><p>‘’</p></td>
743751
<td><p>‘’</p></td>
744752
<td><p>‘’</p></td>
745753
<td><p>‘’</p></td>
746754
<td><p>‘’</p></td>
747755
<td><p>Not necessary for standard workflows.</p></td>
748756
</tr>
749-
<tr class="row-odd"><td><p>INSTALL_REQUIREMENTS</p></td>
757+
<tr class="row-even"><td><p>INSTALL_REQUIREMENTS</p></td>
750758
<td><p>‘False’</p></td>
751759
<td><p>‘False’</p></td>
752760
<td><p>‘False’</p></td>
753761
<td><p>‘False’</p></td>
754762
<td><p>‘False’</p></td>
755763
<td><p>Not necessary for standard workflows.</p></td>
756764
</tr>
757-
<tr class="row-even"><td><p>REQUIREMENTS_FILE</p></td>
765+
<tr class="row-odd"><td><p>REQUIREMENTS_FILE</p></td>
758766
<td><p>‘’</p></td>
759767
<td><p>‘’</p></td>
760768
<td><p>‘’</p></td>

0 commit comments

Comments
 (0)