Build Custom AMI
Learn how to build a customized Code Ocean AMI.
Each version of Code Ocean VPC comes with a dedicated AMI that is specified in the CloudFormation template. However, in environments subject to strict AMI usage policies, you may need to build a custom AMI based on your company's preferred AMI or one that includes required additional tools and services.
The artifacts for the Code Ocean AMI are stored in the codeocean-vpc S3 bucket, bundled in a tar file. The installation process includes installing packages, drivers, and tools, deploying configuration files, and enabling the system services required for a functioning Code Ocean AMI.
The installation must be performed on a G4DN instance to allow installation of GPU drivers and packages required for GPU workers and batch machines.
Installation
Amazon Linux 2023
Launch your desired Amazon Linux 2023 base AMI using a g4dn.xlarge instance type.
Download the Code Ocean AMI installation tar file into a new directory:
mkdir -p /tmp/codeocean-ami
aws s3 cp \
s3://codeocean-vpc/templates/v4.0.0/ami/files.tar.gz \
/tmp/codeocean-amiExtract the tar file:
tar xzpf /tmp/codeocean-ami/files.tar.gz \
-C /tmp/codeocean-amiInstall the Code Ocean AMI:
chmod +x /tmp/codeocean-ami/install.sh
/tmp/codeocean-ami/install.shClean up the installation files:
Deployment
Update your Code Ocean deployment and specify the new AMI ID under the Custom AMI Configuration section of the CloudFormation template.
Last updated
Was this helpful?