GoogleCloudPlatform / reliable-app-platforms

A MVP of a platform for delivering reliable applications on Google Cloud
Apache License 2.0
19 stars 6 forks source link

Add CI for applications #33

Open MKand opened 10 months ago

MKand commented 10 months ago

Now we use ./deploy.sh to trigger applications' CI pipelines. We need to create a new repo for each application, (service preferably) that triggers the CI pipeline when a new push is made

MKand commented 9 months ago

Shobit's proposal: Current state:

To onboard a new application in the reliable-apps-platform, we run deploy.sh script. This script kicks-off CloudBuild pipelines to : a) build application's infrastructure i.e AR repo, CD pipelines and endpoint. b) deploy application. c) create SLO for the application.

The application's IaC and source code are in the same repo under a subdirectory.

Requirement:

Onboarding process for an application should be able to create separate repos and pipelines for the application and facilitate progressive release mechanism and day2 operations.

Proposal:

Create generic app and infra templates from app-repo and infra-repo folders respectively . These templates will be used to create an application's infra and app repositories. Point deploy.sh script to a generic yaml file that is run via cloud build and gives us : a new github repo for the application's infrastructure(named APP_NAME-infra) created from the infra template. This repo will contain a cloudbuild.yaml file that will point to the TF code in the same repo which will build the application infra by referring to the modules under https://github.com/GoogleCloudPlatform/reliable-app-platforms.git//modules a cloudbuild trigger(aka infra pipeline) that connects to the cloudbuild.yaml in the application's infra repo. This trigger gets invoked on every commit in the repo and automatically sync the TF changes. a new github repo for the application's source code(named APP_NAME). This repo will contain k8 manifests copied from the app template with a cloudbuild.yaml file that lays the instructions to build the code , store in AR and deploy on GKE. a cloudbuild trigger(app pipeline) that connects to the cloudbuild.yaml in app repo. This trigger gets invoked on every commit and builds the application code docker image, store in AR and performs the deployment. This will enable developers to quickly iterate on their app with CI/CD and complete the outer loop story. Having separate pipelines for infra and application deployment will allow customizations as needed.