container

package
v3.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EL_CONT_DEPLOYCONF_UNSUPPORT_CAP_FOR_WL   = "Deployment config %v contains unsupported capability for a workload"
	EL_CONT_DEPLOYCONF_UNSUPPORT_CAP_FOR_CONT = "Deployment config %v contains unsupported capability for infrastructure container."
	EL_CONT_DEPLOYCONF_UNSUPPORT_BIND         = "Deployment config %v contains unsupported bind for a workload, %v"
	EL_CONT_DEPLOYCONF_UNSUPPORT_BIND_FOR     = "Deployment config %v contains unsupported bind for %v, %v"
	EL_CONT_ERROR_UNMARSHAL_DEPLOY            = "Error Unmarshalling deployment string %v, error: %v"
	EL_CONT_ERROR_UNMARSHAL_DEPLOY_OVERRIDE   = "Error Unmarshalling deployment override string %v for agreement %v, error: %v"
	EL_CONT_START_CONTAINER_ERROR             = "Error starting containers: %v"
	EL_CONT_START_CONTAINER_ERROR_FOR_AG      = "Error starting containers for agreement %v: %v"
	EL_CONT_RESTART_CONTAINER_ERROR_FOR_AG    = "Error restarting containers for agreements %v: %v"
	EL_CONT_CLEAN_OLD_CONTAINER_ERROR         = "Error cleaning up old containers before starting up new containers for %v. Error: %v"
	EL_CONT_FAIL_GET_PAENT_CONT_FOR_SVC       = "Failed to get a list of parent containers for service retry for %v. %v"
	EL_CONT_FAIL_RESTORE_NW_WITH_PARENT       = "Failed to restoring the network connection with the parents for service %v. %v"
)

messages for event logs

View Source
const IPT_COLONUS_ISOLATED_CHAIN = "OPENHORIZON-ANAX-ISOLATION"
View Source
const LABEL_PREFIX = "openhorizon.anax"
View Source
const T_CONFIGURE = "CONFIGURE"

Variables

This section is empty.

Functions

func MarkI18nMessages

func MarkI18nMessages()

This is does nothing useful at run time. This code is only used in compileing time to make the eventlog messages gets into the catalog so that they can be translated. The event log messages will be saved in English. But the CLI can request them in different languages.

func ProcessTar

func ProcessTar(file string) (string, error)

Types

type Configure

type Configure struct {
	// embedded
	WhisperProviderMsg
	ConfigureNonce      string `json:"configure_nonce"`
	Deployment          string `json:"deployment"` // JSON docker-compose like
	DeploymentSignature string `json:"deployment_signature"`
	DeploymentUserInfo  string `json:"deployment_user_info"`
}

message sent to contract owner from provider

func NewConfigure

func NewConfigure(configureNonce string, deployment string, deploymentSignature string, deploymentUserInfo string) *Configure

func (Configure) String

func (c Configure) String() string

type ContainerConfigureCommand

type ContainerConfigureCommand struct {
	DeploymentDescription  *containermessage.DeploymentDescription
	ContainerLaunchContext *events.ContainerLaunchContext
}

==============================================================================================================

func (ContainerConfigureCommand) ShortString

func (c ContainerConfigureCommand) ShortString() string

func (ContainerConfigureCommand) String

func (c ContainerConfigureCommand) String() string

type ContainerMaintenanceCommand

type ContainerMaintenanceCommand struct {
	AgreementProtocol string
	AgreementId       string
	Deployment        persistence.DeploymentConfig
}

==============================================================================================================

func (ContainerMaintenanceCommand) ShortString

func (c ContainerMaintenanceCommand) ShortString() string

func (ContainerMaintenanceCommand) String

type ContainerStopCommand

type ContainerStopCommand struct {
	Msg events.ContainerStopMessage
}

==============================================================================================================

func (ContainerStopCommand) ShortString

func (c ContainerStopCommand) ShortString() string

func (ContainerStopCommand) String

func (c ContainerStopCommand) String() string

type ContainerWorker

type ContainerWorker struct {
	worker.BaseWorker // embedded field
	// contains filtered or unexported fields
}

func CreateCLIContainerWorker

func CreateCLIContainerWorker(config *config.HorizonConfig) (*ContainerWorker, error)

func NewContainerWorker

func NewContainerWorker(name string, config *config.HorizonConfig, db *bolt.DB, am *resource.AuthenticationManager) *ContainerWorker

func (*ContainerWorker) CommandHandler

func (b *ContainerWorker) CommandHandler(command worker.Command) bool

func (*ContainerWorker) ContainersMatchingAgreement

func (b *ContainerWorker) ContainersMatchingAgreement(agreements []string, includeShared bool, fn func(*docker.APIContainers, string) error) error

func (*ContainerWorker) GetAuthenticationManager

func (cw *ContainerWorker) GetAuthenticationManager() *resource.AuthenticationManager

func (*ContainerWorker) GetClient

func (cw *ContainerWorker) GetClient() *docker.Client

func (*ContainerWorker) Initialize

func (b *ContainerWorker) Initialize() bool

func (*ContainerWorker) Messages

func (w *ContainerWorker) Messages() chan events.Message

func (*ContainerWorker) NewContainerConfigureCommand

func (b *ContainerWorker) NewContainerConfigureCommand(deploymentDescription *containermessage.DeploymentDescription, containerLaunchContext *events.ContainerLaunchContext) *ContainerConfigureCommand

func (*ContainerWorker) NewContainerMaintenanceCommand

func (b *ContainerWorker) NewContainerMaintenanceCommand(protocol string, agreementId string, deployment persistence.DeploymentConfig) *ContainerMaintenanceCommand

func (*ContainerWorker) NewContainerStopCommand

func (b *ContainerWorker) NewContainerStopCommand(msg *events.ContainerStopMessage) *ContainerStopCommand

func (*ContainerWorker) NewEvent

func (w *ContainerWorker) NewEvent(incoming events.Message)

func (*ContainerWorker) NewMaintainMicroserviceCommand

func (b *ContainerWorker) NewMaintainMicroserviceCommand(key string) *MaintainMicroserviceCommand

func (*ContainerWorker) NewShutdownMicroserviceCommand

func (b *ContainerWorker) NewShutdownMicroserviceCommand(key string) *ShutdownMicroserviceCommand

func (*ContainerWorker) NewWorkloadConfigureCommand

func (b *ContainerWorker) NewWorkloadConfigureCommand(deploymentDescription *containermessage.DeploymentDescription, agreementLaunchContext *events.AgreementLaunchContext) *WorkloadConfigureCommand

func (*ContainerWorker) NewWorkloadShutdownCommand

func (b *ContainerWorker) NewWorkloadShutdownCommand(protocol string, currentAgreementId string, deployment persistence.DeploymentConfig, agreements []string) *WorkloadShutdownCommand

func (*ContainerWorker) ResourcesCreate

func (b *ContainerWorker) ResourcesCreate(agreementId string, agreementProtocol string, configure *events.ContainerConfig, deployment *containermessage.DeploymentDescription, configureRaw []byte, environmentAdditions map[string]string, ms_networks map[string]docker.ContainerNetwork, serviceURL string, sVer string) (persistence.DeploymentConfig, error)

This function creates the containers, volumes, networks for the given agreement or service.

func (*ContainerWorker) ResourcesRemove

func (b *ContainerWorker) ResourcesRemove(agreements []string) error

type MaintainMicroserviceCommand

type MaintainMicroserviceCommand struct {
	MsInstKey string // the name that was passed into the ContainerLaunchContext, it is the key to the MicroserviceInstance table.
}

==============================================================================================================

func (MaintainMicroserviceCommand) ShortString

func (c MaintainMicroserviceCommand) ShortString() string

type NodeUnconfigCommand

type NodeUnconfigCommand struct {
	// contains filtered or unexported fields
}

============================================================================================================== This worker command is used to tell the worker than the node is done shutting down and so it can terminate itself.

func (NodeUnconfigCommand) ShortString

func (n NodeUnconfigCommand) ShortString() string

func (NodeUnconfigCommand) String

func (n NodeUnconfigCommand) String() string

type ShutdownMicroserviceCommand

type ShutdownMicroserviceCommand struct {
	MsInstKey string // key to the MicroserviceInstance table.
}

==============================================================================================================

func (ShutdownMicroserviceCommand) ShortString

func (c ShutdownMicroserviceCommand) ShortString() string

type WhisperProviderMsg

type WhisperProviderMsg struct {
	Type string `json:"type"`
}

type WorkloadConfigureCommand

type WorkloadConfigureCommand struct {
	DeploymentDescription  *containermessage.DeploymentDescription
	AgreementLaunchContext *events.AgreementLaunchContext
}

==============================================================================================================

func (WorkloadConfigureCommand) ShortString

func (c WorkloadConfigureCommand) ShortString() string

func (WorkloadConfigureCommand) String

func (c WorkloadConfigureCommand) String() string

type WorkloadShutdownCommand

type WorkloadShutdownCommand struct {
	AgreementProtocol  string
	CurrentAgreementId string
	Deployment         persistence.DeploymentConfig
	Agreements         []string
}

==============================================================================================================

func (WorkloadShutdownCommand) ShortString

func (c WorkloadShutdownCommand) ShortString() string

func (WorkloadShutdownCommand) String

func (c WorkloadShutdownCommand) String() string

Jump to

Keyboard shortcuts

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