SleepImage Gains Automated CI/CD Pipeline and Serverless Database for its Fast-growing Sleep Testing System


SleepImage wanted to automate its CI/CD pipeline, leverage serverless database technology, and perform a security assessment across its AWS cloud infrastructure.


ClearScale implemented solutions on each of these fronts using the latest AWS technologies and best practices.


SleepImage is now able to deploy new features faster to users, as well as scale with its rapidly growing demand, as necessary.

AWS Services

Amazon ECR, Amazon ECR, Amazon Aurora, Amazon S3

Executive Summary

SleepImage is a Denver-based company that offers an FDA-cleared Software-as-a-Medical-Device (SaMD) to measure sleep quality, evaluate sleep disorders and diagnose and manage sleep disordered breathing. The SleepImage System SaMD receives data from a SleepImage mobile app that is connected with approved recording devices to allows patients to sleep in the comforts of their own beds while collecting and sending accurate sleep data to healthcare providers.

After containerizing its core application, SleepImage decided to bring in third-party support to create an automated container deployment pipeline. The company also wanted to migrate to a serverless database and re-evaluate its data storage architecture. As an AWS Premier Tier Services Partner with both the DevOps and Migration competencies, ClearScale brought the expertise and experience that SleepImage needed to realize its vision.

"We had several reasons to engage a cloud partner. ClearScale took the time to understand our goals, explain different options, and then execute everything on time and budget. We trusted the team to implement the right AWS solutions for our business that have set us up for future growth. ClearScale did not disappoint."
Hugi Hilmisson
Chief Technology Officer, SleepImage

The Challenge

SleepImage wanted to upgrade its IT infrastructure by:

1) Building an automated container deployment pipeline using Amazon Elastic Kubernetes Service (EKS) clusters

2) Creating Terraform templates to automate infrastructure provisioning for the containerization process

3) Migrating from Amazon RDS to Amazon Aurora; and

4) Leveraging Amazon S3 instead of Amazon EBS or EFS for storing sleep study data

Each of these initiatives required input and execution help from an AWS expert. Successful implementation would allow SleepImage to deploy future updates more rapidly, maximize cost-effectiveness, and enable a higher number of concurrent connections to the database.

The ClearScale Solution

The SleepImage project involved four stages:

  • CI/CD automation
  • Infrastructure-as-Code (IaC)
  • Database migration
  • Security assessment

CI/CD Automation

To achieve CI/CD automation, ClearScale added three services to the SleepImage architecture:

Amazon ECR is AWS’ fully managed container registry that simplifies the process of sharing, storing, and using container images. ClearScale configured GitHub Workflows to establish a continuous integration process and store created Docker images in ECR.

For continuous deployment, ClearScale used Argo CD, a continuous delivery tool designed specifically for Kubernetes. Argo CD can track changes in *.yaml configuration files, compare and comply with existing state in Amazon EKS, handle deployments, and initiate rollbacks.

With ECR and Argo CD, ClearScale achieved the container automation SleepImage needed to increase deployment efficiency.

Infrastructure-as-Code (IaC)

ClearScale implemented Infrastructure-as-Code (IaC) for both the infrastructure and application layers of the SleepImage cloud architecture. The team used Terraform to write the IaC scripts and a series of GitHub Workflows with the following inputs:

  • Environment: where to apply/plan/destroy the infrastructure for a single Terraform stack
  • Stack: list of AWS services used on the infrastructure and application fronts
  • Mode: apply, plan, and destroy actions for a single Terraform stack

In this hierarchy, resources at lower levels depend on resources at higher levels:

SleepImage Diagram

Database Migration

On the database migration side, ClearScale moved the SleepImage RDS MySQL database to Amazon Aurora, a fully managed relational database engine that's compatible with MySQL and PostgreSQL. ClearScale also upgraded a version of the SleepImage MySQL engine from 5.7 to 8.0 following the migration plan below:

SleepImage Diagram

Security Assessment

After completing the implementation phase of the project, ClearScale performed security audits for the SleepImage production and non-production environments. Assessing both was critical for ensuring the client’s cloud infrastructure would always keep sensitive patient data safe.

Architecture Diagrams

SleepImage Diagram Control Tower initial setup

SleepImage Diagram AWS Accounts hierarchy

The Benefits

With ClearScale’s help, SleepImage updated its cloud architecture in valuable ways. The client now has a clear and efficient workflow for creating infrastructure and application-related resources in AWS. The company is also now leveraging Aurora, which can scale seamlessly with user demand.

Additionally, ClearScale identified opportunities for security upgrades and implemented those within the SleepImage cloud environments. The SleepImage internal IT team can now address vulnerabilities and bolster the security of its cloud resources and data. Overall, these updates put SleepImage in a position to innovate faster and more efficiently in today’s ever-evolving healthcare landscape.