0de406e76c
* # This is a combination of 99 commits. # This is the 1st commit message: Adding docker test base image # This is the commit message #2: Adding test files # This is the commit message #3: testing # This is the commit message #4: Added folder # This is the commit message #5: Added folder # This is the commit message #6: Azure Devops CI Build Pipeline (#67) * Adding azure devops build pipeline * Adding README * Adding azure build badge # This is the commit message #7: saving latest tests # This is the commit message #8: Adding docker test base image (#68) # This is the commit message #9: EOD checkin # This is the commit message #10: posting latest # This is the commit message #11: eod commits # This is the commit message #12: eod commit # This is the commit message #13: refactored test directory structure # This is the commit message #14: Refactored build # This is the commit message #15: Adding hello world azure simple app # This is the commit message #16: Adding hello world azure simple app # This is the commit message #17: refactoring test harness # This is the commit message #18: refactoring test harness # This is the commit message #19: checking latest # This is the commit message #20: committing latest # This is the commit message #21: checking in latest changes # This is the commit message #22: Checking in latest progress # This is the commit message #23: applying final touches before PR submission # This is the commit message #24: updating azure keyvault secret names # This is the commit message #25: Checking in latest progress # This is the commit message #26: pushing latest pipeline definition # This is the commit message #27: updating build pipeline variable format # This is the commit message #28: updating build pipeline variable format # This is the commit message #29: cleaning up build variables # This is the commit message #30: adding minor changes to azure build pipeline # This is the commit message #31: updating azure keyvault secret names # This is the commit message #32: updating azure keyvault secret names # This is the commit message #33: fixing docker login azdo step # This is the commit message #34: fixing docker login azdo step # This is the commit message #35: fixing docker login azdo step # This is the commit message #36: fixing docker login azdo step # This is the commit message #37: updating build pipeline variables # This is the commit message #38: updating build pipeline variables # This is the commit message #39: updating build pipeline variables # This is the commit message #40: updating build pipeline variables # This is the commit message #41: updating build pipeline variables # This is the commit message #42: updating build pipeline variables # This is the commit message #43: applying fix to git diff script # This is the commit message #44: applying fix to git diff script # This is the commit message #45: applying fix to git diff script # This is the commit message #46: applying fix to git diff script # This is the commit message #47: applying fix to git diff script # This is the commit message #48: resolving pipeline bug # This is the commit message #49: fixing build error # This is the commit message #50: fixing build error # This is the commit message #51: fixing build error # This is the commit message #52: fixing build error # This is the commit message #53: fixing build error # This is the commit message #54: fixing build error # This is the commit message #55: fixing build error # This is the commit message #56: fixing build error # This is the commit message #57: fixing build error # This is the commit message #58: fixing build error # This is the commit message #59: fixing build error # This is the commit message #60: fixing build error # This is the commit message #61: fixing build error # This is the commit message #62: fixing build error # This is the commit message #63: fixing build error # This is the commit message #64: fixing build error # This is the commit message #65: fixing build error # This is the commit message #66: fixing build error # This is the commit message #67: fixing build error # This is the commit message #68: fixing build error # This is the commit message #69: fixing build error # This is the commit message #70: fixing build error # This is the commit message #71: fixing build error # This is the commit message #72: fixing build error # This is the commit message #73: trying acr fix # This is the commit message #74: latest changes # This is the commit message #75: removing docker dependency on azure devops pipeline # This is the commit message #76: removing docker dependency on azure devops pipeline # This is the commit message #77: removing docker dependency on azure devops pipeline # This is the commit message #78: removing docker dependency on azure devops pipeline # This is the commit message #79: removing docker dependency on azure devops pipeline # This is the commit message #80: removing docker dependency on azure devops pipeline # This is the commit message #81: removing docker dependency on azure devops pipeline # This is the commit message #82: removing docker dependency on azure devops pipeline # This is the commit message #83: removing docker dependency on azure devops pipeline # This is the commit message #84: removing docker dependency on azure devops pipeline # This is the commit message #85: removing docker dependency on azure devops pipeline # This is the commit message #86: removing docker dependency on azure devops pipeline # This is the commit message #87: removing docker dependency on azure devops pipeline # This is the commit message #88: removing docker dependency on azure devops pipeline # This is the commit message #89: removing docker dependency on azure devops pipeline # This is the commit message #90: removing docker dependency on azure devops pipeline # This is the commit message #91: removing docker dependency on azure devops pipeline # This is the commit message #92: removing docker dependency on azure devops pipeline # This is the commit message #93: removing docker dependency on azure devops pipeline # This is the commit message #94: removing docker dependency on azure devops pipeline # This is the commit message #95: removing docker dependency on azure devops pipeline # This is the commit message #96: removing docker dependency on azure devops pipeline # This is the commit message #97: removing docker dependency on azure devops pipeline # This is the commit message #98: final commit including resource name randomization # This is the commit message #99: Add provider to configure az infra for Terraform * resolving merge conflicts for squash Updated documentation based on review comments Integrate review comments for documentation. Add usage example for each of the providers Adding environment template descriptions removing go version var from azdo pipeline as it's unused removing unused setup folder adding more verbose logging for azure devops failure fixing pull request branch name resolution bug fixing pull request branch name resolution bug addressing nick's pr comments documenting script and docker images cleaning up required env var check fixing base branch bug Added service plan terraform templates to Azure Adding tags for resources Integrate review comments to add random id to name Add tags, capacity and reserved for service plan Minor Fixes for documentation Integrate review comments related to resource naming Remove Optional and Required in variables.tf Update variables.tf Update Service Plan Tier to Isolated squaching commits applied base image suggestions from nick * squashing commits and slimming down the build image * removing go* path from azure devops pipeline as we removed go mods * refactoring our azure devops pipeline so it's aligned with the local test runner * fixing azure devops pipeline bug * fixing base image build variable reference bug * Addressing nick's PR comments * resolving issue with failed builds after completing branches merges * addressing a bug where test harness directory changes were not getting picked up by the harness * removing local echo statement * Adding directory exists check and app service container command variable * addressing nick's PR comments * adding git diff extension whitelist filter * Overhauling main project readme * Adding james to the readme * Update README.md * Updating readme from the test-harness directory |
||
---|---|---|
.github | ||
design-reference | ||
devops/providers | ||
infra | ||
test-harness | ||
.env.template | ||
.gitignore | ||
Gopkg.lock | ||
Gopkg.toml | ||
LICENSE | ||
README.md | ||
magefile.go |
README.md
Cobalt
This project is an attempt to combine and share best practices when building production ready cloud native managed service solutions. Cobalt's infrastructure turn-key starter templates are based on real world engagements with enterprise customers.
This project puts a focus on infrastructure scalability, security, automated testing and deployment repeatability and most importantly, developer experience. Cobalt's intended audience is for developers. Feedback and suggestions are encouraged through issue requests. We welcome contributions across any one of the major cloud providers.
Cobalt is a joint collaboration with project Bedrock. One of the project goals is predictlably create, change and improve infrastructure.
This project offers a set of continuous integration pipelines responsible for testing and deploying templated environments to cloud provider(s).
How Cobalt differs to Bedrock
Cobalt hosts reusable Terraform modules to scaffold managed container services like ACI and Application Services as a couple of examples. Bedrock targets Kubernetes-based container orchestration workloads while following a GitOps devops flow. Cobalt templates reference Terraform modules like virtual networks, traffic manager, etc.
About the Repository
Infrastructure as Code
Cobalt deployment environment templates are written in Terraform and can be found in the templates folder. Each subfolder represents a unique deployment environment packaged with a set of Terraform scripts, overview and setup instructions, automated unit and integration tests.
Each template makes use of Terraform modules across both Bedrock and Cobalt. Cobalt's module registry is categorized by cloud provider then resource type. Each modules represents an absraction for the set of related cloud infrastructure objects that the module will manage.
$ tree infra
├───modules
│ └───providers
│ ├───azure
│ │ ├───api-mgmt
│ │ ├───app-gateway
│ │ ├───provider
│ │ ├───service-plan
│ │ ├───tm-endpoint-ip
│ │ ├───tm-profile
│ │ └───vnet
│ └───common
└───templates
├───azure-simple-hw
│ └───test
│ └───integration
└───backend-state-setup
Continuous Integration / Deployment + Testing
Cobalt Continuous Integration pipeline defintions are available in the ./devops/provider
folder. As of today, Cobalt provides a git devops worklfow definition for Azure DevOps. We welcome pipelines from other providers like Jenkins.
Azure DevOps CI Flow
This pipeline is configured to trigger new builds for each new branch commit.
- Deployment credential secrets such as service principal and terraform remote state storage accounts are sourced in azure keyvault.
- The pipeline downloads secrets from keyvault and used to resolve terraform template variables.
- We rebuild the test harness image so we can copy the terraform template changes from the git branch over to the docker file system.
- We then run the test harness container, which performs the following stages.
- Run a lint check on all golang test files and terraform templates.
- Executes all golang unit tests.
- Generate and validate the terraform plan.
- Apply the terraform template resource updates to the development integration deployment environment.
- Run end-to-end integration tests.
- Tear down deployed resources.
- Update the build and PR status.
- Begin code review once the PR status is green.
Getting Started
The easiest way to try Cobalt is to start with our azure-simple template.
Setting up a cobalt deployment comprises of 5 general steps.
- You can follow these instructions to create an cloud-based CI pipeline definition.
- Our cloud deployment templates provide an configurable default setup intended for a t-shirt sized environment scenario. Pick the template folder most relevant to your use-case as a starting point. Each template folder is shipped with setup instructions.
- It's important to implement quality assurance that validates E2E functional assertions against your infrastructure resources. Each template comes pre-packaged with some basic integration and unit tests. We encourage you to define integration tests in the
test/integration
folder of your template that's specific to your use-case. - Follow these instructions to setup your local environment.
- Create a new local git branch and commit your changes. Run the test harness on your localhost via
./test-harness/local-run.sh
.
Community
Please join us on Slack for discussion and/or questions.
Contributing
We do not claim to have all the answers and would greatly appreciate your ideas and pull requests.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
For project level questions, please contact Erik Schlegel or James Nance.