All Projects → compozed → deployadactyl

compozed / deployadactyl

Licence: other
Make deployment downtime extinct

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to deployadactyl

swift-buildpack
IBM Cloud buildpack for Swift
Stars: ✭ 33 (-59.26%)
Mutual labels:  deployment, cloud-foundry
batou
batou is a universal, fractal deployment utility using Python.
Stars: ✭ 37 (-54.32%)
Mutual labels:  deployment
WOA-Deployer
WOA Deployer
Stars: ✭ 77 (-4.94%)
Mutual labels:  deployment
gcloud-deploy-tutorial
How to continuously deploy a Full Stack React +Node.js +MySql App to Google Cloud Compute Engine
Stars: ✭ 19 (-76.54%)
Mutual labels:  deployment
wimpy.deploy
Ansible role to automate immutable infrastructure scheduling one docker container on one EC2 instance
Stars: ✭ 21 (-74.07%)
Mutual labels:  deployment
evolution
Evolution process of The Falco Project
Stars: ✭ 37 (-54.32%)
Mutual labels:  deployment
ci-docker-image
A Docker Image meant for use with CI/CD pipelines
Stars: ✭ 23 (-71.6%)
Mutual labels:  deployment
antifreeze
Cloud Foundry CLI plugin to detect if an app doesn't match the manifest
Stars: ✭ 21 (-74.07%)
Mutual labels:  cloud-foundry
cloud-cap-risk-management
The SAP Risk Management example applications show how to deploy a CAP (SAP Cloud Application Programming model) application to Cloud Foundry and Kyma.
Stars: ✭ 36 (-55.56%)
Mutual labels:  cloud-foundry
deployer-php-action
Deploy PHP projects using Deployer from Github Actions
Stars: ✭ 57 (-29.63%)
Mutual labels:  deployment
terraform-module-icp-deploy
This Terraform module can be used to deploy IBM Cloud Private on any supported infrastructure vendor. Tested on Ubuntu 16.04 and RHEL 7 on SoftLayer, VMware, AWS and Azure.
Stars: ✭ 13 (-83.95%)
Mutual labels:  deployment
build-plugin-template
Template repository to create new Netlify Build plugins.
Stars: ✭ 26 (-67.9%)
Mutual labels:  deployment
Cloud-PAW-Management
Simplify PAW and SPA for the masses, unify the MS Internal, and public PAW specs, and expedite deployment to ~5min or less.
Stars: ✭ 45 (-44.44%)
Mutual labels:  deployment
Deploy-machine-learning-model
Dockerize and deploy machine learning model as REST API using Flask
Stars: ✭ 61 (-24.69%)
Mutual labels:  deployment
kuberay
A toolkit to run Ray applications on Kubernetes
Stars: ✭ 146 (+80.25%)
Mutual labels:  deployment
mini-qml
Minimal Qt deployment for Linux, Windows, macOS and WebAssembly.
Stars: ✭ 44 (-45.68%)
Mutual labels:  deployment
Docker-Templates
Docker configurations for TheHive, Cortex and 3rd party tools
Stars: ✭ 71 (-12.35%)
Mutual labels:  deployment
starter-kit
Starter kit for full-stack JavaScript projects
Stars: ✭ 21 (-74.07%)
Mutual labels:  cloud-foundry
random-dose-of-knowledge
Using the latest Software Engineering practices to create a modern and simple app.
Stars: ✭ 26 (-67.9%)
Mutual labels:  deployment
configurator
Synchronize and Version Control ConfigMaps & Secrets across Deployment Rollouts.
Stars: ✭ 68 (-16.05%)
Mutual labels:  deployment

Release CircleCI Go Report Card codecov Stories in Ready Gitter GoDoc

Deployadactyl is a Go library for managing applications across multiple Cloud Foundry instances. Deployadactyl utilizes blue green deployments and if it's unable to execute the requested operation it will rollback to the previous state. It also utilizes Go channels for concurrent deployments across the multiple Cloud Foundry instances.

Check out our stories on Pivotal Tracker!

How It Works

Deployadactyl works by utilizing the Cloud Foundry CLI to manage applications. The general flow is to get a list of Cloud Foundry instances, check that the instances are available, log into each instance, and concurrently execute the requested operation on each instance. If the requested operation fails, Deployadactyl will automatically revert the application back to the previous state. For example, in the case of deploying an application, the specified artifact will be downloaded and cf push will be called concurrently in the deploying applications directory on each CF instance. If the push fails on any instance, the application will be reverted to the version that was previously deployed on all instances.

Why Use Deployadactyl?

As an application grows, it will have multiple foundations for each environment. These scaling foundations make managing an application time consuming and difficult to manage. Deployment errors can greatly increase downtime and result in inconsistent state of the application across all foundations..

Deployadactyl makes the process easy and efficient with:

  • Management of multiple environment configurations
  • Concurrent deployments and running state management across environment foundations
  • Automatic rollbacks for failures or errors
  • Prechecking foundation availablity before managing applicaiton state
  • Event handlers for third-party services

Installation Requirements

Dependencies

Deployadactyl has the following dependencies within the environment:

We use Godeps to vendor our GO dependencies. To grab the dependencies and save them to the vendor folder, run the following commands:

$ go get -u github.com/tools/godep
$ godep restore                       // updates local packages to required versions
$ rm -rf Godeps
$ godep save ./...                    // creates ./vendor folder with dependencies

or

$ make dependencies

Configuration File

Deployadactyl needs a yml configuration file to specify available environments for managing applications. At a minimum, each environment has a name and a list of foundations.

The configuration file can be placed anywhere within the Deployadactyl directory, or outside, as long as the location is specified when running the server.

Param Necessity Type Description
name Required string Used in the deploy when the users are sending a request to Deployadactyl to specify which environment from the config they want to use.
foundations Required []string A list of Cloud Foundry Cloud Controller URLs.
domain Optional string Used to specify a load balanced URL that has previously been created on the Cloud Foundry instances.
authenticate Optional bool Used to specify if basic authentication is required for users. See the authentication section for more details
skip_ssl Optional bool Used to skip SSL verification when Deployadactyl logs into Cloud Foundry.
instances Optional int Used to set the number of instances an application is deployed with. If the number of instances is specified in a Cloud Foundry manifest, that will be used instead.

Example Configuration yml

---
environments:
  - name: preproduction
    domain: preproduction.example.com
    foundations:
    - https://api.foundation-1.example.com
    - https://api.foundation-2.example.com
    authenticate: false
    skip_ssl: true
    instances: 2

  - name: production
    domain: production.example.com
    foundations:
    - https://production.foundation-1.example.com
    - https://production.foundation-2.example.com
    - https://production.foundation-3.example.com
    - https://production.foundation-4.example.com
    authenticate: true
    skip_ssl: false
    instances: 4

Environment Variables

Authentication is optional as long as CF_USERNAME and CF_PASSWORD environment variables are exported. We recommend making a generic user account that is able to push to each Cloud Foundry instance.

$ export CF_USERNAME=some-username
$ export CF_PASSWORD=some-password

Optional: The log level can be changed by defining DEPLOYADACTYL_LOGLEVEL. DEBUG is the default log level.

Installing Deployadactyl

Local Installation

After a configuration file has been created and environment variables have been set, the server can be run using the following commands:

$ cd ~/go/src/github.com/compozed/deployadactyl && go run server.go

or

$ cd ~/go/src/github.com/compozed/deployadactyl && go build && ./deployadactyl

Cloud Foundry Installation

To push Deployadactyl to Cloud Foundry, edit the manifest.yml to include the CF_USERNAME and CF_PASSWORD environment variables. In addition, be sure to create a config.yml. Then you can push to Cloud Foundry like normal:

$ cf login
$ cf push

or

$ make push

Available Installation Flags

Flag Usage
-config location of the config file (default "./config.yml")
-envvar turns on the environment variable handler that will bind environment variables to your application at deploy time
-health-check turns on the health check handler that confirms an application is up and running before finishing a push
-route-mapper turns on the route mapper handler that will map additional routes to an application during a deployment. see the Cloud Foundry manifest documentation here for more information

API

A deployment can be executed or modified by hitting the API using curl or other means. For more information on using the Deployadactyl API visit the API documentation in the wiki.

Example Push Curl

curl -X POST \
     -u your_username:your_password \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d '{ "artifact_url": "https://example.com/lib/release/my_artifact.jar", "health_check_endpoint": "/health" }' \
     https://preproduction.example.com/v3/deploy/environment/org/space/t-rex

Example Stop Curl

curl -X PUT \
     -u your_username:your_password \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d '{ "state": "stopped" }' \
     https://preproduction.example.com/v3/deploy/environment/org/space/t-rex

Event Handling

With Deployadactyl you can optionally register event handlers to perform any additional actions your deployment flow may require. For example, you may want to do an additional health check before the new application overwrites the old application.

NOTE The event handling framework for Deployadactyl has been reworked in version 3 to allow for strongly typed binding between event handler functions and the events on which those functions operate. See more info below and in the wiki

Event Handler Example

Attach an event handler to a specific event by creating a binding between the desired event and your handler function and add it to the EventManager:

myHandler := func(event PushStartedEvent) error {
   mylog.Debug("A push has started with manifest: " + event.Manifest)
   ...
   return nil
}

eventManager.AddBinding(NewPushStartedEventBinding(myHandler))

Custom events can be created by implementing the Binding and IEvent interfaces.

Deprecated Event Handling

Prior to version 3, events were registered the following way:

type Handler struct {...}

func (h Handler) OnEvent(event interfaces.Event) error {
   if event.Type == "push.started" {
      deploymentInfo := event.Data.(*DS.DeployEventData).DeploymentInfo
      mylog.Debug("A push has started with manifest: " + deploymentInfo.Manifest
      ...
      return nil
   } else ...
}

eventManager.AddHandler(Handler{...}, "push.started")

This method of event handling is still supported for push related events and creating custom events, but is deprecated and can be expected to be removed in the future.

Contributing

See our CONTRIBUTING section for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].