carousel

module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2022 License: Apache-2.0

README

the iac wrapper that will continue going in a circle to deploy servers.

Build Status codecov.io Go Report Card Apache V2 License Quality Gate Status GitHub release PkgGoDev

Summary

Carousel is the micromanager of an IaC to help manage errors even those that are not detected.

Table of Contents

Code of Conduct

This project and everyone participating in it are governed by the XMiDT Code Of Conduct. By participating, you agree to this Code.

Details

OUT OF SCOPE

carousel will NOT set up the environment required for the IaC. In other words, terraform must be able to run successfully before using carousel.

Terraform

PreReq

The .tf file MUST contain the following:

variable "versionBlueCount" {
  description = "Number of instances for version Blue"
  default     = 0
}

variable "versionBlue" {
  description = "version for the software of group Blue"
  default     = "0.0.0"
}

variable "versionGreenCount" {
  description = "Number of instances for version Green"
  default     = 0
}

variable "versionGreen" {
  description = "version for the software of group Green"
  default     = "0.0.0"
}

module "green" {
  ...
}
module "blue" {
  ...
}

output "blueHostnames" {
  value = module.blue.fqdn
}
output "greenHostnames" {
  value = module.green.fqdn
}

output "blueVersion" {
  value = var.versionBlue
}
output "greenVersion" {
  value = var.versionGreen
}
Simple Run
# For a dry run of upgrading to 0.3.1 with 4 nodes
carousel rollout -d 4 0.3.1
Host Validation

It is possible to provide a golang plugin to check a created host. Build a golang plugins with the Func func CheckHost(fqdn string) bool defined.

# For rollout 4 nodes of version 1.2.3
# the created hosts will be validated against the CheckHost(fqdn string) bool func
carousel rollout -p hostValidator.so 4 1.2.3

For more information refer to the example dir

Docker

make docker
# note plugins must be compiled on the same OS.

docker run --rm -v carousel.yaml:/carousel.yaml -v deployment:/deployment/ -e WORK_DIR=/deployment/ carousel:latest

Build

In order to build from the source, you need a working Go environment with version 1.16 or greater. Find more information on the Go website.

You can directly use go get to put the carousel binary into your GOPATH:

go get github.com/xmidt-org/carousel

You can also clone the repository yourself and build using make:

mkdir -p $GOPATH/src/github.com/xmidt-org/carousel
cd $GOPATH/src/github.com/xmidt-org/carousel
git clone git@github.com:xmidt-org/carousel.git
cd carousel
make build

Contributing

Refer to CONTRIBUTING.md.

Credits

carousel would not be possible without the help of many other pieces of open source software. Thank you open source world!

Given the Apache 2.0 license of carousel, we specifically want to call out the following libraries and their corresponding licenses shown below.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL