Compute Resources in Code Ocean

Code Ocean leverages AWS to provide you with access to any cloud computing resource that your Capsule requires. These resources fall under two categories: flex and dedicated machines.

Flex vs. dedicated machines

Flex resources are the default option for running your Capsule. This will allocate resources to a worker machine that is part of your organization's deployment. The available flex resources in a capsule will be determined by the Starter Environment you select, for example. Python vs. Python with GPU support). Using flex resources ensures your organization gets the most value out of running machines in your deployment.

Choosing a dedicated machine will spin up a new Amazon EC2 instance exclusively for your computation. There are dedicated machines with a wide range of specifications, for example, CPUs from 0.5 GB RAM to 4000 GB RAM, to ensure that there are always resources available to match your needs. It takes approximately 2 minutes to start up a dedicated machine. The more powerful the machine you choose, the higher the hourly cost.

For more information on flex and dedicated machines, you can see our documentation.

When to use a dedicated machine

To determine if your capsule needs higher compute resources, you can monitor usage and RAM metrics in two ways:

  1. At the top of your screen when in a Cloud Workstation

2. In the capsule timeline after a Reproducible Run

If your computation exceeds the resources you’ve allocated in a Cloud Workstation, you will get an error message such as:

If your computation exceeds the resources you’ve allocated during a Reproducible Run, your run will end abruptly. If there are no flex machines with more resources, you should use a dedicated machine. Start by slowly increasing the memory and cores of your dedicated machine depending on your use case.

Spot Instances

Spot instances allow you to take up unused capacity of a currently running dedicated machine at less than one tenth of the original cost. Since you did not reserve the machine, you may be kicked off without notice.

Last updated