1. 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.
Point smartphone camera toward a fruit or vegetable
AWS enables loading of images, insights on Amazon ECS (Elastic Container Service)
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
3. IAMOPS Solution - High Level Design
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.
4. 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.
Step 3: Deploy a Task Using the SOCI Index from the ECR Repository
Install SOCI on local Machine.
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
5. ADVANTAGES OF USING SOCI:
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.
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?
Click below to explore the DevOps journey with us.
We wish you all the best!