Code Monkey home page Code Monkey logo

cobalt's Introduction

Cobalt

Build Status Go Report Card

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 to 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 from 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 infrastructure templates are written in Terraform and can be found in the templates folder. Each subfolder represents a unique deployment schema and is packaged with a set of Terraform scripts, overview and setup instructions and automated unit & 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
    ├───az-hello-world
    │   └───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

image

This pipeline is configured to trigger new builds for each new PR.

  1. Deployment credential secrets such as service principal and terraform remote state storage accounts are sourced in azure keyvault.
  2. The pipeline downloads secrets from keyvault and used to resolve terraform template variables.
  3. The test harness image will be re-built. This includes copying any changes to Terraform scripts and the associated Terraform tests.
  4. The test harness container will be run. It will perform 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.
  5. Update the build and PR status.
  6. Begin code review once the PR status is green.

Getting Started

The easiest way to try Cobalt is to start with our hello-world template.

Setting up a cobalt deployment comprises of 5 general steps.

  1. You can follow these instructions to create an cloud-based CI pipeline definition.
  2. 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.
  3. 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.
  4. Follow these instructions to setup your local environment. Make sure that the repository lives in a directory that does not live within $GOPATH.
  5. 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 [email protected] with any additional questions or comments.

For project level questions, please contact Erik Schlegel or James Nance.

cobalt's People

Contributors

manojvazirani avatar code4clouds avatar ericpera-msft avatar erikschlegel avatar technicallywilliams avatar ianphil avatar microsoftopensource avatar hxlnt avatar aka-msft avatar charleszipp avatar james-nance avatar msftgits avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.