Upgrade Code Ocean

Learn how to upgrade your Code Ocean Version

Prerequisites

To upgrade to a newer version of Code Ocean, please contact support at support@codeocean.com and request to have the Code Ocean’s AMIs shared with your AWS account.

Stop Running Computations

Before you start to update your Code Ocean application stack, you need to make sure there are no computations running, to ensure a smooth upgrade.

Using AWS Session Manager, connect to Code Ocean services instance :

Run the following command to stop computations :

curl -v -X POST localhost:8300/cancel_computations

Wait until all computations complete by waiting until the following CloudWatch metric reaches 0: CloudWatch > Metrics > CodeOcean > AutoScalingGroupName > SlotsUtilization

Remove scale-in Protection from Code Ocean Worker EC2 Instances

The upgrade waits for existing running workers to terminate before continuing. If you verified that there are no running computations in the previous step, you can safely remove the scale in protection from the workers in the auto scaling group to complete the upgrade quicker.

In the AWS EC2 console go to EC2 > Auto Scaling Groups > workers-[id]-asg > Instance Management, then select all instances and click Actions > Remove scale-in protection

Then in EC2 > Auto Scaling Groups > workers-[id]-asg > Details reduce the Desired capacity to 0.

Update the CloudFormation Stack

Note : If you are using a least privileged IAM role to update your CloudFormation stack, make sure to first update your least privileged IAM role from here

Upgrading Code Ocean is done by updating the CloudFormation stack you've created upon deployment :

On the next screen, select Replace current template, then Amazon S3 URL, and specify the CloudFormation template URL. You can find the URL in Step 1 - Specify the template section, or use a URL you've received from our support team:

Click Next when you are done.

Specify Stack Details

Stack's Parameters will be set to the values that have been set upon the latest upgrade/deployment, or to their recommended defaults. Please visit the Deployment Parameters page for the full list of parameters and their purpose. Please contact our support or email support@codeocean.com if you have any questions or you need help regarding parameters values.

Click Next.

Configure Stack Options (Optional)

You can specify tags (key-value pairs) for resources in your stack and set advanced options.

Click Next when you are done.

Review

  1. Review and assure that all the details are correct.

  2. Check the box to acknowledge that CloudFormation might create IAM resources.

  3. Click Update stack to start the deployment.

After you click on Update stack, you will be redirected to the stack screen where you can follow the progress of your stack update under the Events tab.

Upgrade Completion

When the stack update is finished, the state of the CloudFormation stack will turn into UPDATE_COMPLETE .

Last updated