sealights

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

README

libbuildpack-sealights

Cloud Foundry Buildpack integrations with Sealights

Bind your application to your Sealights service

  1. First step is to create and configure user provided service

    For Linux: cf cups sealights -p '{"token":"ey…"}' For Windows: cf cups sealights -p "{\"token\":\"ey…\"}"

    Note: you can change prameters later with command cf uups sealights -p ...

    Complete list of the prameters currently supported by the buildpack service is:

    {
        "version"               // sealights version. default value - latest
        "verb"                  // execution stage. values: [config, scan, startExecution, testListener, endExecution]
                                // in case if stage is not provided sealights service will not be called on container start
        "customAgentUrl"        // sealights agent will be downloaded from this url if provided
        "customCommand"         // allow to replace application start command
        "labId"                 // will be downloaded agent version of the specified lab
        "proxy"                 // proxy for the agent download client
        "proxyUsername"         // proxy user
        "proxyPassword"         // proxy password
        "enableProfilerLogs"    // allow to enable logs in the profiler when listener is started in the background mode
    
        + rest of the arguments that required for sealights service
    }
    
  2. Bind your application to your Sealights service

    cf bind-service [app name] sealights

  3. Restage an application to apply the changes

    cf restage [app name]

Documentation

Index

Constants

View Source
const AgentDir = "sealights"
View Source
const AgentName = "SL.DotNet.dll"
View Source
const DefaultLabId = "agents"
View Source
const DefaultVersion = "latest"
View Source
const DotnetDir = "dotnet-sdk"
View Source
const LinuxProfilerId = "3B1DAA64-89D4-4999-ABF4-6A979B650B7D"
View Source
const PackageArchiveName = "sealights-agent.tar.gz"
View Source
const ReleaseFileName = "dotnet-core-buildpack-release-step.yml"
View Source
const SealightsCli = "sealights"
View Source
const StartCommandType = "web"
View Source
const WindowsProfilerId = "01CA2C22-DC03-4FF5-8350-59E32A3536BA"

Variables

This section is empty.

Functions

func NewHook

func NewHook() libbuildpack.Hook

NewHook returns a libbuildpack.Hook instance for integrating with Sealights

Types

type AgentInstaller added in v0.0.6

type AgentInstaller struct {
	Log                *libbuildpack.Logger
	Options            *SealightsOptions
	MaxDownloadRetries int
}

func NewAgentInstaller added in v0.0.6

func NewAgentInstaller(log *libbuildpack.Logger, options *SealightsOptions) *AgentInstaller

func (*AgentInstaller) InstallAgent added in v0.0.6

func (agi *AgentInstaller) InstallAgent(stager *libbuildpack.Stager) (string, error)

func (*AgentInstaller) InstallDependency added in v0.0.6

func (agi *AgentInstaller) InstallDependency(stager *libbuildpack.Stager) (string, error)

Install dotnet sdk and runtime required for the agent

type Command

type Command interface {
	Execute(string, io.Writer, io.Writer, string, ...string) error
}

Command is an interface around libbuildpack.Command. Represents an executor for external command calls. We have it as an interface so that we can mock it and use in the unit tests.

type Configuration

type Configuration struct {
	Value *SealightsOptions
	Log   *libbuildpack.Logger
}

func NewConfiguration

func NewConfiguration(log *libbuildpack.Logger) *Configuration

func (Configuration) UseSealights

func (conf Configuration) UseSealights() bool

type Launcher added in v0.0.4

type Launcher struct {
	Log                *libbuildpack.Logger
	Options            *SealightsOptions
	AgentDirAbsolute   string
	AgentDirForRuntime string
	DotNetDir          string
}

func NewLauncher added in v0.0.4

func NewLauncher(log *libbuildpack.Logger, options *SealightsOptions, agentInstallationDir string, dotnetInstallationDir string, buildDir string) *Launcher

func (*Launcher) ModifyStartParameters added in v0.0.4

func (la *Launcher) ModifyStartParameters(stager *libbuildpack.Stager) error

type ReleaseData added in v0.0.5

type ReleaseData struct {
	DefaultProcessTypes map[string]string `yaml:"default_process_types"`
}

file format: default_process_types:

web: cd ${DEPS_DIR}/0/dotnet_publish && exec ./app --server.urls http://0.0.0.0:${PORT}

type ReleaseInfo added in v0.0.5

type ReleaseInfo struct {
	Data     ReleaseData
	FilePath string
}

func NewReleaseInfo added in v0.0.5

func NewReleaseInfo(buildDirectory string) *ReleaseInfo

func (*ReleaseInfo) GetStartCommand added in v0.0.5

func (rel *ReleaseInfo) GetStartCommand() string

func (*ReleaseInfo) SetStartCommand added in v0.0.5

func (rel *ReleaseInfo) SetStartCommand(newCommand string) error

type SealightsHook

type SealightsHook struct {
	libbuildpack.DefaultHook
	Log     *libbuildpack.Logger
	Command Command
}

SealightsHook implements libbuildpack.Hook. It downloads and install the Sealights OneAgent.

func (*SealightsHook) AfterCompile

func (h *SealightsHook) AfterCompile(stager *libbuildpack.Stager) error

AfterCompile downloads and installs the Sealights agent, and modify application start command

type SealightsOptions

type SealightsOptions struct {
	Version            string
	Verb               string
	CustomAgentUrl     string
	CustomCommand      string
	LabId              string
	Proxy              string
	ProxyUsername      string
	ProxyPassword      string
	EnableProfilerLogs string
	SlArguments        map[string]string
}

type VcapServicesModel

type VcapServicesModel struct {
	Sealights SealightsOptions
}

Jump to

Keyboard shortcuts

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