This blog post will walk you through how we’ve automated our Micro-services deployment using photon.
If working on such problems excite you, our SRE team is hiring. If you care about developer productivity and tooling—check out the job description and apply here.
At slice, our team is growing at a 3X scale, and the number of engineers and micro-services have started increasing. So automatically we were looking for a way to automate our CI/CD pipelines. We had already done POCs with Packer and Jenkins-based scripts. But we found that they were not universal; we couldn’t use the same learnings from one pipeline for all services and in all environments. Also, every time the service had different deployment requirements, we had to customise the pipeline again.
We went to the whiteboard. We already had experience with hercules, and we loved the idea of using Docker as immutable carriers of an application. As a result, we designed photon.
The idea was simple; We wanted to build a tool that captures a developer’s wishes, deploys, updates, and deletes the application. We gave it over to the devs to decide how they’d want to consume the photon CRUD interface.
Developers package their code in the form of docker images to private registries. Provide a configuration file. Photon reads the configuration and immediately deploys the application over AWS Fargate. Photon takes care of logging, distributed tracing, and the deployment pattern itself.
To use photon, a developer-only needs to run the following commands.
We then used photon for one of our use cases.
- A developer commits in his specific branch, a photon pipeline runs and gets an endpoint for his application server over slack.
- The developer then merges his branch to the staging environment. photon terminates all his feature branch-related infra, and the photon pipeline updates staging deployment.
- We use a similar flow for staging, beta and production environments.
photon now supports a lot of features by itself. Here are a few:
- Logging – using fluent bit (which can be directed to any standard logging mechanism) and cloud watch.
- Distributed tracing.
- Different Deployment Patterns – B/G, Canary and Linear Deployment.
- Secrets and Configuration Management.
The developer can again disable/enable and customise these features from the same configuration file.
The interface remains the same.
photon is currently used to deploy over 50+ micro-services, different consumers across different environments at slice. It creates, updates, and cleans up the infra at the developer’s will. We currently benchmark the ease for deploying services using photon for developers to be less than an hour, for all environments.
photon has made service deployment a declarative and productive process — enjoyable and hassle-free and we will open-source it in the coming quarter.