In the previous article we developed a stock prices WebService using docker containers. This service used the Refinitiv RTSDK and the Spring framework for actual REST heavy lifting. An reasonable next step would be to deploy this WebService on a cloud platform where it can be scaled upon demand. In this article, we explore - in pictures, how to deploy this WebService on the Amazon Elastic Container Service (ECS). AWS is only used as one of the examples here - all major cloud providers offer a similar container deployment and orchestration service.
AWS ECS offer two deployment options - EC2 and Fargate. Since we are interested in simple cloud centric solution and minimal management overhead, we can choose Fargate - where all the aspects of container life-cycle etc are managed for us. The key steps required for deployment are:
- Have access to Refinitiv market data service in cloud.
- Prepare a docker image with our Pricing Web Service. This is done in the previous article.
- Create an Elastic Container Registry (ECR) which will hold our Docker image.
- Tag our local Quotes WebService image with ECR tags.
- Push the tagged image to ECR as a private repo.
- Create an application task definition.
- Configure the service parameters like name, number of concurrent instances, security and load balancing.
- Launch the service.
Optional steps (not performed in this article)
- Integrate logs and alerts with AWS CloudWatch.
- Scale dynamically based on web service load.
Let us walk through these steps one by one.
From AWS home page, select ECR and create a registry to hold the docker image and provide a valid repo name to your repository:
Once this repo is created, it will show up in the private repositories list:
Now we can "Tag" our local Quotes-WebService docker image with this newly created ECR repo name:
docker tag md_web_service xxxxxxxxxxxx.dkr.ecr.us-east-2.amazonaws.com/refinitiv-service
The tagged image has the ECR repo name:
Use our AWS credentials from the CLI, and push the renamed local image to the remote repo:
docker login -u AWS -p $(aws ecr get-login-password --region us-east-2) xxxxxxxxxxxx.dkr.ecr.us-east-2.amazonaws.com