Use case

Increase container startup speed by 50% with Seekable OCI

About the Company

Clarifruit is an automated, end-to-end quality control as a service (QCaaS) platform that facilitates fast, objective, and consistent fresh fruit and vegetable quality control. By providing high-quality control data, it empowers growers, marketing companies, wholesalers, and retailers to make informed business decisions, reduce waste, and maximize profitability across the fresh produce supply chain.

fruit

Point smartphone camera toward a fruit or vegetable

amazon ecs

AWS enables loading of images, insights on Amazon ECS (Elastic Container Service)

qc report

Get insights on size, color, stem color, defects, firmness, etc. Automatically generates a full QC report, real time wherever you are in the world

Figure 1: How Clarifruit solution works

Goal​

Accelerate the container startup time so their users can process and access real-time insights faster

Solution:

Implement SOCI (Seekable OCI), a technology open-sourced by AWS that enables container runtimes to implement lazy loading to start applications faster without modifying the container images.

What is lazy loading?

Lazy loading is an approach where data is downloaded from the registry in parallel with the application startup. Container images are stored as an ordered list of layers, and layers are most often stored as gzipped tar files.

IAMOPS Solution - High level Design

SOCI

Figure 2: Solution Architecture for SOCI Index Builder on AWS

The process of starting and scaling out containerized applications from a remote registry may lead to significant latency, as the image must be fully downloaded and unpacked before the application can be started.

An analysis showed that 76% of container startup time is due to downloading container images, yet the container only needs an average of 6.4% of the data to perform useful work.

One solution to this problem is lazy loading (also known as asynchronous loading) of container images.

Seekable OCI works by creating an index (SOCI index) of the files within an existing container image. This index is a key enabler to launching containers faster, providing the capability to extract an individual file from a container image without having to download the entire image.

Applications no longer need to wait to complete pulling and unpacking a container image before applications start running.

When utilizing Amazon ECS with AWS Fargate to run SOCI-indexed containerized images, AWS Fargate automatically detects if a SOCI index for the image exists and enables containers to start immediately after getting the data it needs to function effectively.

SOCI has enabled Clarifruit 50% improvement in startup performance allowing them to deploy and scale out faster, quickly serve increased user demand and save on costs by reducing idle compute capacity.

How to Use Soci Indexed ECR Docker Image For ECS Fargate Task

Step 1: Install SOCI CLI using following command:

wget https://github.com/awslabs/soci snapshotter/releases/download/v0.3.0/soci-snapshotter-0.3.0-linux-amd64.tar.gz && tar -xvf soci-snapshotter-0.3.0-linux-amd64.tar.gz && cp ./soci /usr/local/bin && cp ./soci-snapshotter-grpc /usr/local/bin

Step 2: Pull the image from ECR Repo and create SOCI index and push image to ECR Repo.

Note: Here you need to provide the registry password and image tag for which we need to create an image.

  • export REGISTRY_PASSWORD=$(aws ecr get-login-password –region eu-west-1)
  • sudo ctr i pull –user AWS:$REGISTRY_PASSWORD $REPOSITORY_TAG
  • sudo soci create $REPOSITORY_TAG
  • sudo soci push –user AWS:$REGISTRY_PASSWORD –platform linux/amd64 $REPOSITORY_TAG

Step 3: Deploy a Task Using the SOCI Index from the ECR Repository

Install SOCI on local Machine.
Pre-requisites
containerd >= 1.4 – required to run soci-snapshotter
fuse used for mounting filesystem without root access
sudo apt-get install fuse

Execute following commands for installation of SOCI on Linux machine.
sudo wget https://github.com/awslabs/soci-snapshotter/releases/download/v0.3.0/soci-snapshotter-0.3.0-linux-amd64.tar.gz
sudo tar -xvf soci-snapshotter-0.3.0-linux-amd64.tar.gz
sudo cp ./soci /usr/local/bin
sudo cp ./soci-snapshotter-grpc /usr/local/bin
sudo soci –help
sudo soci-snapshotter-grpc –version

Advantages of Using SOCI:

Speedy Image Sharing:

As they deal with large images, the need to process data as fast as possible. Generating accurate insights is crucial so clients can access critical information more promptly, improving their overall satisfaction with their platform.

Enhanced Performance:

ClariFruit needs a solution that supercharges ECR image operations so it can process data and generate quality control insights real-time, enabling clients to make timely decisions regarding their fresh produce inventory. It means faster deployments, rapid application scaling, and optimized resource utilization.

Compatibility & Flexibility:

They want to ensure that they can plug and play the solution with other container runtimes and registries. This way they can tap into a thriving containerization ecosystem. Developers and ops teams can extract specific parts, inspect, debug, and update without pulling the entire image. It's all about faster development and streamlined image management.

Summary

By implementing Seekable OCI in ECR, Clarifruit was able to rev up the time to start containerized applications.

SOCI indexes on AWS Fargate is approximately 50% faster compared to running without SOCI indexes.

Clarifruit was able to unlock the full potential of their containerization workflows, enabling faster deployments, cost savings, data integrity and greater flexibility in managing container images.

Highlight

Accelerate container startup times by 50% using Seekable OCI.

We checked the task launch time with multiple task and the results:

Without SOCI, it took 35 secs and using SOCI, it took only 15 secs.

Want to optimize your application deployment and say goodbye to delays and inefficiencies?

Book a Free Call