deployer

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 4 Imported by: 11

README

Arcaflow deployer interface

This library holds the deployer interface that allows for writing deployment systems for Arcaflow plugins.

New deployment systems have to implement the ConnectorFactory as a primary entry point. As a type parameter, you will have to define your configuration structure, and your factory will have to return a schema that can be used to validate configuration options.

Documentation

Overview

Package deployer provides interfaces for all deployers of plugins to follow.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyConnectorFactory

type AnyConnectorFactory interface {
	Name() string
	ConfigurationSchema() schema.Object
	Create(config any, logger log.Logger) (Connector, error)
	DeploymentType() DeploymentType
}

AnyConnectorFactory is the untyped version of ConnectorFactory.

func Any

func Any[T any](factory ConnectorFactory[T]) AnyConnectorFactory

Any wraps a factory and creates an anonymous factory from it.

type Connector

type Connector interface {
	// Deploy instructs the connector to aquire the plugin and run it,
	// resulting in the plugin starting its ATP server.
	// The ATP server will be accessible through the `Plugin` interface.
	//
	// Parameters:
	// ctx: The context that lasts the length of the deployment.
	// 	     A cancelled context means the plugin is in the process of getting shut down, or is shut down. No new
	//	     deployment should be allowed.
	// pluginSource: The source of the plugin. This can be the tag of the image to run, a Python module, or
	//		 anything else that the deployer supports.
	Deploy(ctx context.Context, pluginSource string) (Plugin, error)
}

Connector is responsible for deploying a container image on the specified target. Once deployed and ready, the connector returns an I/O to communicate with the plugin.

type ConnectorFactory

type ConnectorFactory[ConfigType any] interface {
	Name() string
	ConfigurationSchema() *schema.TypedScopeSchema[ConfigType]
	Create(config ConfigType, logger log.Logger) (Connector, error)
	DeploymentType() DeploymentType
}

ConnectorFactory is an abstraction that hides away the complexity of instantiating a Connector. Its main purpose is to provide the configuration schema for the connector and then create an instance of said connector.

type DeploymentType added in v0.4.0

type DeploymentType string

DeploymentType is the mechanism of deployment, such as image or python.

type Plugin

type Plugin interface {
	io.Reader
	io.Writer
	io.Closer
	ID() string
}

Plugin is single, possibly containerized instance of a plugin. When read from, this interface provides the stdout of the plugin, supposedly talking the Arcaflow Transport Protocol, whereas the writer will write to the standard input of the plugin. The Close() method will shut the plugin down and return when the shutdown was successful.

Directories

Path Synopsis
Package registry provides an interface to an aggregate of deployers, and a factory for that aggregate.
Package registry provides an interface to an aggregate of deployers, and a factory for that aggregate.

Jump to

Keyboard shortcuts

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