All Projects → spinnaker → Orca

spinnaker / Orca

Licence: apache-2.0
Orchestration engine

Programming Languages

groovy
2714 projects

Projects that are alternatives of or similar to Orca

Json Avro Converter
JSON to Avro conversion tool designed to make migration to Avro easier.
Stars: ✭ 186 (-0.53%)
Mutual labels:  hacktoberfest
Plotly.js
Open-source JavaScript charting library behind Plotly and Dash
Stars: ✭ 14,268 (+7529.95%)
Mutual labels:  hacktoberfest
Home Panel
A web frontend for controlling the home.
Stars: ✭ 185 (-1.07%)
Mutual labels:  hacktoberfest
Coremltools
Core ML tools contain supporting tools for Core ML model conversion, editing, and validation.
Stars: ✭ 2,483 (+1227.81%)
Mutual labels:  hacktoberfest
Supertinyicons
Under 1KB each! Super Tiny Icons are miniscule SVG versions of your favourite website and app logos
Stars: ✭ 13,177 (+6946.52%)
Mutual labels:  hacktoberfest
Jaeger
CNCF Jaeger, a Distributed Tracing Platform
Stars: ✭ 14,813 (+7821.39%)
Mutual labels:  hacktoberfest
Amazingavatar
An android amazing avatar anim in CollapsingToolbarLayout.
Stars: ✭ 186 (-0.53%)
Mutual labels:  hacktoberfest
Macos Egpu Cuda Guide
Set up CUDA for machine learning (and gaming) on macOS using a NVIDIA eGPU
Stars: ✭ 187 (+0%)
Mutual labels:  hacktoberfest
Moya
Network abstraction layer written in Swift.
Stars: ✭ 13,607 (+7176.47%)
Mutual labels:  hacktoberfest
Data Structures And Algorithms Hacktoberfest18
List of data structures and algorithms. Feel free to contribute under Hacktoberfest '18!
Stars: ✭ 187 (+0%)
Mutual labels:  hacktoberfest
Cosmos
Hacktoberfest 2021 | World's largest Contributor driven code dataset | Algorithms that run our universe | Your personal library of every algorithm and data structure code that you will ever encounter |
Stars: ✭ 12,936 (+6817.65%)
Mutual labels:  hacktoberfest
Fyne
Cross platform GUI in Go inspired by Material Design
Stars: ✭ 15,142 (+7997.33%)
Mutual labels:  hacktoberfest
Diagrams
🎨 Diagram as Code for prototyping cloud system architectures
Stars: ✭ 15,756 (+8325.67%)
Mutual labels:  hacktoberfest
Google Signin
Google Sign-in for your React Native applications
Stars: ✭ 2,391 (+1178.61%)
Mutual labels:  hacktoberfest
Js fun practice
A list of small & fun functional programming exercises in JavaScript
Stars: ✭ 186 (-0.53%)
Mutual labels:  hacktoberfest
Elasticpypi
Serverless pypi
Stars: ✭ 186 (-0.53%)
Mutual labels:  hacktoberfest
Virgilio
Virgilio is developed and maintained by these awesome people. You can email us virgilio.datascience (at) gmail.com or join the Discord chat.
Stars: ✭ 13,200 (+6958.82%)
Mutual labels:  hacktoberfest
Formatter Maven Plugin
Formatter Maven Plugin
Stars: ✭ 187 (+0%)
Mutual labels:  hacktoberfest
Sicp
Web, PDF and e-book editions of SICP JS (XML, LaTeX, Node.js)
Stars: ✭ 185 (-1.07%)
Mutual labels:  hacktoberfest
Emuflight
EmuFlight is flight controller software (firmware) used to fly multi-rotor craft.
Stars: ✭ 184 (-1.6%)
Mutual labels:  hacktoberfest

Orca

Build Status

Orca Logo

Orca is the orchestration engine for Spinnaker. It is responsible for taking an execution definition and managing the stages and tasks, coordinating the other Spinnaker services.

Orca Executions (either Pipelines or Orchestrations) are composed of Stages which in turn are composed of Tasks. The tasks of a stage share a common context which can be queried across the entire execution allowing multiple stages to coordinate. For example a bake stage publishes details of the image it creates which is then used by a deploy stage.

Orca is a stateless, horizontally scalable service. Spinnaker's execution state is persisted to a backend store and work is distributed evenly through a work queue. So long as your backend persistence layer has capacity, you can freely add or remove Orca servers to match workload demands.

Internals Overview

Domain

The primary domain model is an Execution, of which there are two types: PIPELINE and ORCHESTRATION. The PIPELINE type is for pipelines while ORCHESTRATIONs is unscheduled, ad-hoc API-submitted actions and what you see in the UI under the "Tasks" tab in an Application.

At this point in Spinnaker’s life, these two types are nearly programmatically identical, the key difference being that a Pipeline has a predefined persistent configuration, whereas an Orchestration is arbitarily configured at request-time and serial in execution.

For one Execution, there are one or many Stages organized as a DAG (Directed Acyclic Graph). An Execution supports concurrent branching logic of Stages. These Stages define higher-order, user-friendly actions and concepts, such as "Resize Server Group" or "Deploy" and can be chained together to form complex delivery workflows. Within a Stage, there are one or more Tasks (not to be confused with the Tasks tab in the UI: Internally these are Orchestrations). A Task can be considered an atomic unit of work, focused on a single action. If you are familiar with the Spinnaker UI, you'll note that for every Stage, there are multiple line items that correlate to a Stage's runtime: These are often Tasks. Tasks are always executed sequentially and serially.

It's important to note that a Stage is recursively composable. One stage can have zero to many Synthetic Stages, that is, stages that can occur either BEFORE or AFTER its parent stage. This is most easily illustrated in a Canary stage, which deploys multiple Server Groups (a baseline and canary). While to the end-user this appears to be a single stage, it's actually a composition of multiple Deploy stages with some extra logic on top. Lastly, an Execution's stage graph does not need to be known ahead of time. An Execution can lay its tracks down ahead of itself as it is running, which is how some of the more advanced functionality is implemented, like automatic rollbacks or canary behaviors.

Runtime

Orca uses a distributed queue library, Keiko, to manage its work. Keiko uses atomic messages to progress work through its lifecycle and allows Orca to first be resilient to node failure, as well as spread load evenly across the deployment making Orca easier to scale and operate.

Keiko itself is an abstraction around a delay queue, meaning it can deliver Messages immediately or at specific times in the future, as well as reschedule messages that have already been added to the queue for a new delivery time. This delay queue functionality is pivotal to Orca's performance and operational characteristics when dealing with long running operations.

A Message is a fine-grained unit of work. As an example, a StartStage message will verify that all upstream branches are complete and then perform any logic associated with preparing for the stage's execution. It won't actually perform the stage's core actions. A RunTask is really the only message that actually performs stage work that a user would be familiar with.

Some message types are re-deliverable and can be duplicated, whereas others are not. For example, in a pipeline that has two concurrent stage branches that do not join at the end, there will be two CompleteExecution messages sent. This is fine, because the CompleteExecutionHandler has logic to verify that indeed all stages are in a completed state before marking the entire execution as complete, whether it ultimately be a failure or success.

For every message type, there is a single correlated Handler that contains all of the logic for processing this Message type. A Message's contents are small and the bare minimum of information to process the request: For instance, an Execution is referenced by ID rather than containing its entire state. Orca builds atop these foundational Handlers in the form of StageDefinitionBuilder and other classes to build the DAG and implement actual Spinnaker orchestration logic.

The queue can be categorized into two parts: The QueueProcessor, and its Handlers. Orca uses a single thread to run QueueProcessor, which polls the oldest messages "ready" off the queue. A ready message is one whose delivery time is now or in the past: It is normal to have many more messages in the queue than those that are actually ready.

A separate worker thread pool is used for Handlers. Orca depends on threads in that pool in order to scale sufficiently. You can tune threads either by adjusting the pool size or by increasing the number of Orca instances. By ignoring downstream bottlenecks Orca can scale horizontally to meet Spinnaker work demand.

If the queue starts to back up, Executions and their Tasks will begin to take longer to start or complete. Sometimes the queue will back up because of downstream service pressure (for example, Clouddriver), but may also be due to Orca not having enough threads or persistence capacity.

One further note about the QueueProcessor and its thread pool. The QueueProcessor polls the queue on a regular interval (default 10ms) and tries to fill its thread pool if there's work ready to process. If the thread pool has a core size of 20, and 5 are already busy, it will attempt to take 15 messages off the queue immediately rather than one. This is because in most cases a message takes less than 1ms to complete and we don't want Orca to idle unnecessarily.

Storage & Work Queue

The following storage backends are supported for storing Execution state:

  • Redis (default)
  • MySQL (recommended)

The following backends are supported for the work queue:

  • Redis

Running Orca

Orca requires Redis (and optionally MySQL) to be up and running.

Start Orca via ./gradlew bootRun, or by following the instructions using the Spinnaker installation scripts.

Debugging

To start the JVM in debug mode, set the Java system property DEBUG=true:

./gradlew -DDEBUG=true

The JVM will then listen for a debugger to be attached on port 8183. The JVM will not wait for the debugger to be attached before starting Orca; the relevant JVM arguments can be seen and modified as needed in build.gradle.

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].