nelson
package nelson
- Source
- package.scala
- Alphabetic
- By Inheritance
- nelson
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- type @@[T, Tag] = AnyRef { ... /* 2 definitions in type refinement */ }
-
abstract
class
Accepts extends AnyRef
This should be added to http4s
- final case class AccessToken(value: String) extends Product with Serializable
-
trait
Actionable[A] extends AnyRef
An Actionable is something that can be "acted" upon in the context of a datacenter and namespace.
An Actionable is something that can be "acted" upon in the context of a datacenter and namespace. In Nelson this typically means deploying into a datacenter using a scheduler such as Nomad, or interacting with Aws to launch some infrastructure.
- final case class AuditConfig(concurrencyLimit: Int, bufferLimit: Int) extends Product with Serializable
-
final
case class
BannedClientsConfig(httpUserAgents: List[HttpUserAgent]) extends Product with Serializable
Configuration for banning/allowing various clients.
- final case class Base64(decoded: String) extends AnyVal with Product with Serializable
- implicit class BedazzledIO[A] extends AnyRef
- implicit class BedazzledOpt[A] extends AnyRef
- implicit class BedazzledString extends AnyRef
- type BlueprintRef = (String, Revision)
-
trait
Cache[K, V] extends AnyRef
Basic cache API providing get/put operations
-
trait
CacheBuilder[K, V] extends AnyRef
Basic CacheBuilder API for constructing cache instances.
Basic CacheBuilder API for constructing cache instances. API is subset of what Google's Guava libraries is providing
- final case class CacheConfig(stackStatusCache: Cache[(String, String, String), DeploymentStatus]) extends Product with Serializable
- final case class CleanupConfig(initialTTL: Duration, extendTTL: Duration, cleanupDelay: FiniteDuration, sweeperDelay: FiniteDuration) extends Product with Serializable
- final case class CyclicDependency(message: String) extends NelsonError with Product with Serializable
- type DNSName = String
- final case class DatabaseConfig(driver: String, connection: String, username: Option[String], password: Option[String], maxConnections: Option[Int]) extends Product with Serializable
- final case class Datacenter(name: String, docker: Docker, domain: Domain, defaultTrafficShift: TrafficShift, proxyCredentials: Option[ProxyCredentials], interpreters: Infrastructure.Interpreters, loadbalancer: Option[~>[LoadbalancerOp, IO]], policy: PolicyConfig) extends Product with Serializable
- type DatacenterRef = String
- type DependencyEdge = (RoutingNode, RoutingNode)
- final case class DependencyGraph(gr: RoutingGraph) extends Product with Serializable
- final case class DeploymentCommitFailed(reason: String) extends NelsonError with Product with Serializable
- type DeploymentHash = String
- final case class DeploymentMonitorConfig(delay: FiniteDuration) extends Product with Serializable
- sealed abstract class DeploymentStatus extends Product with Serializable
- type DeploymentStatusString = String
- final case class DeprecatedDependency(unit: String, dc: String, ns: String, dependency: ServiceName) extends NelsonError with Product with Serializable
-
final
case class
DockerConfig(connection: String, verifyTLS: Boolean) extends Product with Serializable
configuration options for the docker cli controller.
- type EmailAddress = String
- final case class EmailConfig(host: String, port: Int, auth: Authenticator, from: EmailAddress, useSSL: Boolean = true) extends Product with Serializable
- final case class ExceededLimitRange(value: Int) extends NelsonError with Product with Serializable
- final case class ExpirationPolicyConfig(defaultPeriodic: ExpirationPolicy, defaultNonPeriodic: ExpirationPolicy) extends Product with Serializable
- type ExpirationPolicyRef = String
- final case class FailedDockerExtraction(err: String) extends NelsonError with Product with Serializable
- final case class FailedDockerOperation(err: String) extends NelsonError with Product with Serializable
- final case class FailedLoadbalancerDeploy(name: String, reason: String) extends NelsonError with Product with Serializable
- final case class FailedWorkflow(name: String, reason: String = "") extends NelsonError with Product with Serializable
- final case class FeatureVersion(major: Int, minor: Int) extends Product with Serializable
- type GUID = String
- final case class GithubConfig(domain: Option[Uri], clientId: String, clientSecret: String, redirectUri: String, scope: String, systemAccessToken: AccessToken, systemUsername: String, organizationBlacklist: List[String], organizationAdminList: List[String]) extends Product with Serializable
-
class
GuavaCache[K, V] extends Cache[K, V]
************** Specific Guava based cache implementation *****************
- class GuavaCacheBuilder[K, V] extends CacheBuilder[K, V]
-
final
case class
Hook(id: Long, isActive: Boolean) extends Product with Serializable
Represents the webhook added to the Github repository.
- type ID = Long
- class InstrumentedDockerClient extends ~>[DockerOp, IO]
- class InstrumentedNomadClient extends ~>[SchedulerOp, IO]
- class InstrumentedVaultClient extends ~>[Vault, IO]
- final case class Interpreters(git: ~>[GithubOp, IO], storage: ~>[StoreOp, IO], slack: Option[~>[SlackOp, IO]], email: Option[~>[EmailOp, IO]]) extends Product with Serializable
- final case class InvalidDockerImage(name: String) extends NelsonError with Product with Serializable
- final case class InvalidGrant(unitName: UnitName, grant: String) extends NelsonError with Product with Serializable
- final case class InvalidLoadbalancer(rs: Vector[Route]) extends NelsonError with Product with Serializable
- final case class InvalidLoadbalancerNameLength(name: String, max: Int) extends NelsonError with Product with Serializable
- final case class InvalidLoadbalancerPort(port: Int, allowed: List[Int]) extends NelsonError with Product with Serializable
- final case class InvalidNamespaceName(name: String) extends NelsonError with Product with Serializable
- final case class InvalidPrometheusRules(msg: String) extends NelsonError with Product with Serializable
- final case class InvalidRepoAccess(s: String) extends NelsonError with Product with Serializable
- final case class InvalidRouteDefinition(name: String) extends NelsonError with Product with Serializable
- final case class InvalidSlug(s: String) extends NelsonError with Product with Serializable
- final case class InvalidTrafficShiftReverse(reason: String) extends NelsonError with Product with Serializable
- final case class InvalidUnitNameChars(name: String) extends NelsonError with Product with Serializable
- final case class InvalidUnitNameLength(name: String) extends NelsonError with Product with Serializable
- final class Kubectl extends AnyRef
- final case class LoadbalancerNotFound(guid: GUID) extends NelsonError with Product with Serializable
- type LoadbalancerRef = String
- final case class MajorVersion(major: Int) extends Product with Serializable
- final case class Manifest(units: List[UnitDef], plans: List[Plan], loadbalancers: List[Loadbalancer], namespaces: List[Namespace], targets: DeploymentTarget, notifications: NotificationSubscriptions) extends Product with Serializable
- final case class ManifestConfig(filename: String) extends Product with Serializable
- final case class ManifestUnitKindMismatch(unitKind: String, unitNames: List[String]) extends NelsonError with Product with Serializable
- final case class ManualDeployFailed(reason: String) extends NelsonError with Product with Serializable
- class Metrics extends AnyRef
- final case class MisconfiguredDatacenter(name: String, problem: String) extends NelsonError with Product with Serializable
- final case class MissingDefaultNamespaceReference(ns: NamespaceName) extends NelsonError with Product with Serializable
- final case class MissingDependency(unit: String, dc: String, ns: String, dependency: ServiceName) extends NelsonError with Product with Serializable
- final case class MissingDeployment(guid: String) extends NelsonError with Product with Serializable
- final case class MissingDeploymentReference(id: Long, slug: Slug) extends NelsonError with Product with Serializable
- final case class MissingHealthCheckPath(protocol: String) extends NelsonError with Product with Serializable
- final case class MissingIndividualDefaultNamespaceReference(ns: NamespaceName) extends NelsonError with Product with Serializable
- final case class MissingReleaseForDeployment(guid: String) extends NelsonError with Product with Serializable
- final case class MissingResourceReference(ref: String, p: Plan) extends NelsonError with Product with Serializable
- final case class MultipleErrors(errors: NonEmptyList[NelsonError]) extends NelsonError with Product with Serializable
- final case class MultipleValidationErrors(errors: NonEmptyList[NelsonError]) extends NelsonError with Product with Serializable
- final case class NamespaceCreateFailed(reason: String) extends NelsonError with Product with Serializable
- final case class NamespaceName(nel: NonEmptyList[String]) extends Product with Serializable
-
final
case class
NelsonConfig(git: GithubConfig, network: NetworkConfig, security: SecurityConfig, database: DatabaseConfig, dockercfg: DockerConfig, nomadcfg: NomadConfig, manifest: ManifestConfig, timeout: Duration, cleanup: CleanupConfig, deploymentMonitor: DeploymentMonitorConfig, datacenters: List[Datacenter], pipeline: PipelineConfig, audit: AuditConfig, template: TemplateConfig, http: Client[IO], pools: Pools, interpreters: Interpreters, workflowLogger: WorkflowLogger, bannedClients: Option[BannedClientsConfig], ui: UIConfig, proxyPortWhitelist: Option[ProxyPortWhitelist], defaultNamespace: NamespaceName, expirationPolicy: ExpirationPolicyConfig, discoveryDelay: FiniteDuration, queue: Queue[IO, Action], auditQueue: Queue[IO, AuditEvent[_]]) extends Product with Serializable
Global configuration for all the various external inputs that Nelson actually cares about.
- abstract class NelsonError extends RuntimeException
-
final
case class
NetworkConfig(bindHost: String, bindPort: Int, externalHost: String, externalPort: Int, tls: Boolean, monitoringPort: Int, idleTimeout: Duration) extends Product with Serializable
specify the settings for the network configuration of nelson: what ports and addresses are bound, versus which are used for remote callers.
- final case class NomadConfig(applicationPrefix: Option[String], requiredServiceTags: Option[List[String]]) extends Product with Serializable
- final case class Organization(id: Long, _name: Option[String], slug: String, avatar: URI) extends Product with Serializable
- final case class PeriodicUnitWithTrafficShift(name: String) extends NelsonError with Product with Serializable
-
final
case class
PipelineConfig(concurrencyLimit: Int, bufferLimit: Int) extends Product with Serializable
controls how the workflow pipeline executes, and what concurrency limits are in place.
- type PlanRef = String
-
final
case class
PolicyConfig(resourceCredsPath: String, pkiPath: Option[String]) extends Product with Serializable
Configuration for auto-generated Vault policies
- final case class Pools(defaultPool: ExecutorService, serverPool: ExecutorService, schedulingPool: ScheduledExecutorService) extends Product with Serializable
- final case class ProblematicDeployable(str: String, url: String) extends NelsonError with Product with Serializable
- final case class ProblematicRepoManifest(slug: Slug) extends NelsonError with Product with Serializable
- class PrometheusConsul extends ~>[ConsulOp, IO]
- final case class ProxyPortWhitelist(ports: List[Int]) extends Product with Serializable
-
final
case class
Released(slug: Slug, version: Version, timestamp: Instant, referenceId: Long, releaseHtmlUrl: URI) extends Product with Serializable
Meant to represent a released version of a unit.
Meant to represent a released version of a unit. These are fixed in time, and immutable after creation.
- final case class ReleasedDeployment(id: Long, unit: DCUnit, namespace: String, hash: String, timestamp: Instant, state: DeploymentStatus, guid: GUID) extends Product with Serializable
- type RenderedBlueprint = String
- final case class Repo(id: Long, slug: Slug, access: RepoAccess, hook: Option[Hook] = None) extends Product with Serializable
-
sealed
trait
RepoAccess extends AnyRef
Denotes the access aforded to this repository for nelson.
Denotes the access aforded to this repository for nelson. Avalible options are (in order of access level, descending): - admin - push - pull
- final case class RepoNotFound(slug: Slug) extends NelsonError with Product with Serializable
- final case class Schedule(interval: Interval) extends Product with Serializable
- final case class SecurityConfig(encryptionKeyBase64: String, signingKeyBase64: String, expireLoginAfter: Duration, useEnvironmentSession: Boolean) extends Product with Serializable
-
final
case class
Session(expiry: Instant, github: AccessToken, user: User) extends Product with Serializable
this is the data that we store (encrypted) into the cookie stored on users browsers.
- type Sha256 = String
- final case class SlackConfig(webhook: Uri, username: String) extends Product with Serializable
-
final
case class
Slug(owner: String, repository: String) extends Product with Serializable
Typed representation of the owner / repo string that is used to canonically reference a repo within nelson.
- type StatusMessage = String
- type TagName = String
- final case class TaskEvent(message: String, driverMessage: String) extends Product with Serializable
- final case class TemplateConfig(tempDir: Path, memoryMegabytes: Int, cpuPeriod: Int, cpuQuota: Int, timeout: FiniteDuration, templateEngineImage: String, vaultAddress: Option[String]) extends Product with Serializable
- type TempoaryAccessCode = String
- sealed trait TrafficShiftPolicy extends AnyRef
-
final
case class
UIConfig(enabled: Boolean, filePath: Option[String]) extends Product with Serializable
Configuration for servicing the user interface
Configuration for servicing the user interface
- filePath
Location of the UI static files on the filesystem.
- final case class UnexpectedConsulResponse(resp: String) extends NelsonError with Product with Serializable
- final case class UnexpectedMissingHook(slug: Slug) extends NelsonError with Product with Serializable
- type UnitName = String
- type UnitRef = String
- final case class UnknownBackendDestination(r: Route, unames: List[String]) extends NelsonError with Product with Serializable
- final case class UnknownBlueprintReference(ref: String, revision: Revision) extends NelsonError with Product with Serializable
- final case class UnknownDatacenter(name: String) extends NelsonError with Product with Serializable
- final case class UnknownNamespace(dcName: String, nsName: String) extends NelsonError with Product with Serializable
- final case class UnknownPortRef(ref: String, unit: UnitName) extends NelsonError with Product with Serializable
- final case class UnsatisfiedDeploymentRequirements(u: UnitDef) extends NelsonError with Product with Serializable
-
final
case class
User(login: String, avatar: URI, name: Option[String], email: Option[String], orgs: List[Organization]) extends Product with Serializable
represents the current user who's logged into the system.
- final case class Version(major: Int, minor: Int, patch: Int) extends Product with Serializable
- trait Versionable[A] extends Serializable
- final case class VersionedGitTagRequired(ref: Reference) extends NelsonError with Product with Serializable
-
trait
Workflow[O] extends AnyRef
Workflows must be defined in terms of a particular type of UnitDef they target, and an output of the workflow.
Workflows must be defined in terms of a particular type of UnitDef they target, and an output of the workflow. By having a workflow specilized to a particular type of unit, we avoid having to have 'uber workflows' that need to handle every possible type of unit, which reduces the implementation complexity of a given workflow quite considerably. In addition, the output type
O
is intended to provide an opertunity for the workflow to output something more than just effects. For example, a workflow could accumulate a set of logs, or some reporting state - whatever - it doesnt matter.Workflows define both setup (deploy) and teardown (detroy) workflow
- sealed abstract class WorkflowControlOp[+A] extends AnyRef
- final case class WorkflowLoggerConfig(bufferLimit: Int, filePath: Path) extends Product with Serializable
- type WorkflowRef = String
- abstract class YamlError extends NelsonError
- abstract class YamlParser[A] extends AnyRef
Value Members
- def featureVersionFrom1or2DotString(versionString: String): Option[FeatureVersion]
-
def
fromJson[A](in: String)(implicit arg0: DecodeJson[A]): IO[A]
Given we're mostly parsing string results to task, make a simple decoder utility function for it.
-
def
linkTo(resource: String)(network: NetworkConfig): URI
Whenever one needs to refernce another location on the Nelson service, and we expect it to be referenced by an external caller (e.g.
Whenever one needs to refernce another location on the Nelson service, and we expect it to be referenced by an external caller (e.g. Github or browser) then we need to use the
linkTo
function which will generate a valid URL with all the external configuration settings needed for the link to work properly (i.e. accounting for HTTP(S) and such) - def randomAlphaNumeric(desiredLength: Int): String
- implicit val versionableLoadbalancer: Versionable[@@[Loadbalancer, Versioned]]
- implicit def versionableOps[A](a: A)(implicit arg0: Versionable[A]): AllOps[A]
- implicit val versionableUnit: Versionable[@@[UnitDef, Versioned]]
- def withTempFile[A](s: String, prefix: String = "nelson-", suffix: String = ".tmp", dir: Path = DefaultTempDir)(f: (File) ⇒ Stream[IO, A]): Stream[IO, A]
-
object
&
We used to get this from Unfiltered.
We used to get this from Unfiltered. Put it here until we can get it into http4s.
-
object
AcceptsSvg extends Accepts
True if a request accepts svg+xml
- object Actionable
- object AtomicShiftPolicy extends TrafficShiftPolicy
- object BannedClientsConfig extends Serializable
- object Banner
- object Base64 extends Serializable
-
object
BuildInfo extends Product with Serializable
This object was generated by sbt-buildinfo.
-
object
Cache
Main public entry point for creating in-memory cache.
Main public entry point for creating in-memory cache.
Default cache has no means to remove anything. It keeps entries forever (but they can be overriden)
Behavior can be customized with following options:
- limit maximum number of elements to cache once limit is reached older elements will be removed, typically using "last recently used" strategy
- "ttl since update" for object in cache Prevents from keeping stale objects in the cache
- "ttl since last use" Prevents from wasting memory on unused objects
ConcurrencyLevel hint is Guava-specific hint to guide the allowed concurrency among update operations. Default value is 4 (for guava 13.0)
From Guava docs: Used as a hint for internal sizing. The table is internally partitioned to try to permit the indicated number of concurrent updates without contention. Because assignment of entries to these partitions is not necessarily uniform, the actual concurrency observed may vary. Ideally, you should choose a value to accommodate as many threads as will ever concurrently modify the table. Using a significantly higher value than you need can waste space and time, and a significantly lower value can lead to thread contention. But overestimates and underestimates within an order of magnitude do not usually have much noticeable impact. A value of one permits only one thread to modify the cache at a time, but since read operations and cache loading computations can proceed concurrently, this still yields higher concurrency than full synchronization.
-
object
Canopus extends Workflow[Unit]
Kubernetes deployment workflow that just deploys and deletes units.
Kubernetes deployment workflow that just deploys and deletes units. No Vault policy or traffic shifting (yet!).
This workflow is named after the Canopus star which represents King Menelaus's helmsman in Greek mythology. Canopus is a star in the Carina constellation, which in turn was once part of the Argo constellation, named after the ship used by Jason and the Argonauts.
The name here is inspired by the existing use of astronomical names (see the Magnetar workflow), "kubernetes" which is Greek for helmsman, and Nelson's usage of the Argonaut library for J(a)SON parsing.
- object CatsHelpers
- object Config
- object CycleDetection
- object Datacenter extends Serializable
- object DeploymentStatus extends Serializable
- object FeatureVersion extends Serializable
- object Github
- object Http4sConsul
- object Infrastructure
- object InstrumentedDockerClient extends Serializable
- object InstrumentedNomadClient extends Serializable
- object InstrumentedVaultClient extends Serializable
- object Json
- object Kubectl
- object LinearShiftPolicy extends TrafficShiftPolicy
- object Magnetar extends Workflow[Unit]
- object Main
- object Manifest extends Serializable
- object ManifestValidator
- object Metrics
- object NamespaceName extends Serializable
- object Nelson
- object NoTargetDatacenters extends NelsonError with Product with Serializable
- object NomadNotImplemented extends NelsonError
- object Pipeline
- object Pools extends Serializable
- object PrometheusConsul extends Serializable
-
object
Pulsar extends Workflow[Unit]
Kubernetes deployment workflow that deploys and deletes units, whilst provisioning authentication roles in Vault so that Kubernetes pods can talk to Vault at runtime.
- object Released extends Serializable
- object Repo extends Serializable
- object RepoAccess
- object Schedule extends Serializable
- object Server
- object Session extends Serializable
- object Slug extends Serializable
- object StubbedConsulClient extends ~>[ConsulOp, IO]
-
object
Tag
Copied, adapted, and minimized from Scalaz's Tag implementation.
Copied, adapted, and minimized from Scalaz's Tag implementation. https://github.com/scalaz/scalaz/blob/v7.1.17/core/src/main/scala/scalaz/Tag.scala
- object Templates
- object TrafficShiftPolicy
- object UnsatisfiedDeploymentRequirements extends Serializable
- object Version extends Serializable
- object Versionable extends Serializable
- object Workflow
- object WorkflowControlOp
- object YamlError extends Serializable
- object YamlParser
- object process