sealights

package module
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 16 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"                  // allow to specify command for the agent. default value: 'startBackgroundTestListener'
        "customAgentUrl"        // sealights agent will be downloaded from this url if provided
        "customCommand"         // allow to replace application start command
        "proxy"                 // proxy for the agent download client
        "proxyUsername"         // proxy user
        "proxyPassword"         // proxy password
    
        + rest of the parameters will be passed directly to the Sealights agent
    }
    
  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]

Logs

You can enable Debug logs level by setting BP_DEBUG env variable:

cf set-env <your-app> BP_DEBUG True

Documentation

Index

Constants

View Source
const AgentDir = "sealights"
View Source
const AgentDownloadUrlFormat = "https://agents.sealights.co/dotnetcore/%s/%s"
View Source
const DefaultPort = "31031"
View Source
const DefaultVersion = "latest"
View Source
const DotnetDir = "dotnet-sdk"
View Source
const LinuxAgentName = "SL.DotNet"
View Source
const LinuxPackageDir = "sealights-dotnet-agent-linux-self-contained"
View Source
const LinuxPackageName = "sealights-dotnet-agent-linux-self-contained.tar.gz"
View Source
const LinuxProfilerId = "3B1DAA64-89D4-4999-ABF4-6A979B650B7D"
View Source
const ReleaseFileName = "dotnet-core-buildpack-release-step.yml"
View Source
const StartCommandType = "web"
View Source
const VersionFileName = "version.txt"
View Source
const WindowsAgentName = "SL.DotNet.exe"
View Source
const WindowsPackageDir = "sealights-dotnet-agent-windows-self-contained"
View Source
const WindowsPackageName = "sealights-dotnet-agent-windows-self-contained.zip"
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, string, error)

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
	Stager *libbuildpack.Stager
}

func NewConfiguration

func NewConfiguration(log *libbuildpack.Logger, stager *libbuildpack.Stager) *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
}

func NewLauncher added in v0.0.4

func NewLauncher(log *libbuildpack.Logger, options *SealightsOptions, agentInstallationDir 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
	Proxy          string
	ProxyUsername  string
	ProxyPassword  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