Upgrade Code Ocean
Learn how to upgrade your Code Ocean Version
Last updated
Learn how to upgrade your Code Ocean Version
Last updated
If you have a backup stack configured, you must follow the upgrade procedure for the backup stack using the latest CloudFormation backup stack template version prior to upgrading the linked primary deployment.
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 and system jobs:
Wait until all computations complete by waiting until the following CloudWatch metric reaches 0: CloudWatch > Metrics > CodeOcean > AutoScalingGroupName > SlotsUtilization
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.
There are five AWS Batch Compute Environments in Code Ocean VPC deployment, each with a corresponding job queue. Before starting the CFN update, you should verify that there are no jobs in Runnable
or Running
status in any of those queues:
BatchOnDemandJobQueue
BatchGpuOnDemandJobQueue
BatchSpotJobQueue
BatchGpuSpotJobQueue
BatchJobsJobQueue
AWS Batch > Dashboard > Job queue overview
, then for each of the 5 Code Ocean deployment's queues mentioned above, press on the number of jobs under Running
or Runnable
, then cancel any job in Runnable
or Running
status:
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.
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.
You can specify tags (key-value pairs) for resources in your stack and set advanced options.
Click Next when you are done.
Review and assure that all the details are correct.
Check the box to acknowledge that CloudFormation might create IAM resources.
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.
When the stack update is finished, the state of the CloudFormation stack will turn into UPDATE_COMPLETE
.