Documentation ¶
Index ¶
- Variables
- func MakeARequestWithContext(ctx context.Context, method string, apiEndpoint string, accessToken string, ...) (*http.Response, error)
- func NewEKSClientset(ctx context.Context, userName string, payModel PayModel) (corev1.CoreV1Interface, error)
- func RegisterHatchery(mux *httptrace.ServeMux)
- func RegisterSystem(mux *httptrace.ServeMux)
- func SetupAndTeardownTest() func()
- func StrToInt(str string) (string, error)
- func TGWRoutes(userName string, tgwRoutetableId *string, tgwAttachmentId *string, ...) error
- func VPCRoutes(remote_network_info *NetworkInfo, main_network_info *NetworkInfo, ...) error
- func ValidateAuthzConfig(logger *log.Logger, authzConfig AuthzConfig) error
- type APIKeyStruct
- type AllPayModels
- type AppConfigInfo
- type AuthRequestResponse
- type AuthzConfig
- type AuthzVersion_0_1
- type CREDS
- func (creds *CREDS) CreateEcsTaskExecutionRole() (*string, error)
- func (creds *CREDS) CreateLoadBalancer(userName string) (*elbv2.CreateLoadBalancerOutput, *string, *elbv2.CreateListenerOutput, error)
- func (sess *CREDS) CreateLogGroup(LogGroupName string, creds *credentials.Credentials) (string, error)
- func (sess *CREDS) CreateTaskDefinition(input *CreateTaskDefinitionInput, userName string, hash string, ...) (string, error)
- func (creds *CREDS) EFSFileSystem(userName string) (*EFS, error)
- func (creds *CREDS) NetworkConfig(userName string) (ecs.NetworkConfiguration, error)
- type ComposeDeployDetails
- type ComposeFull
- type ComposeHealthCheck
- type ComposeResourceSpec
- type ComposeResources
- type ComposeService
- type Container
- type ContainerStates
- type CreateTaskDefinitionInput
- type DbConfig
- type EFS
- type EnvVar
- type FullHatcheryConfig
- type Gen3LicenseUserMap
- type HatcheryConfig
- type InstallBundle
- type LicenseInfo
- type NetworkInfo
- type NextflowConfig
- type NextflowGlobalConfig
- type PayModel
- type PodConditions
- type PrismaConfig
- type SidecarContainer
- type TextOutput
- type Token
- type WorkspaceKernelStatusStruct
- type WorkspaceStatus
Constants ¶
This section is empty.
Variables ¶
var ErrNopaymodels = errors.New("no paymodels found")
Functions ¶
func MakeARequestWithContext ¶
func MakeARequestWithContext(ctx context.Context, method string, apiEndpoint string, accessToken string, contentType string, headers map[string]string, body *bytes.Buffer) (*http.Response, error)
API key related helper functions Make http request with header and body
func NewEKSClientset ¶
func NewEKSClientset(ctx context.Context, userName string, payModel PayModel) (corev1.CoreV1Interface, error)
Generate EKS kubeconfig using AWS role
func RegisterHatchery ¶
RegisterHatchery setup endpoints with the http engine
func RegisterSystem ¶
func SetupAndTeardownTest ¶
func SetupAndTeardownTest() func()
func VPCRoutes ¶
func VPCRoutes(remote_network_info *NetworkInfo, main_network_info *NetworkInfo, tgwId *string, ec2_remote *ec2.EC2, ec2_local *ec2.EC2, teardown bool) error
func ValidateAuthzConfig ¶
func ValidateAuthzConfig(logger *log.Logger, authzConfig AuthzConfig) error
Types ¶
type APIKeyStruct ¶
type AllPayModels ¶
type AppConfigInfo ¶
AppConfigInfo provides the type and path of a supplementary config path
type AuthRequestResponse ¶
type AuthRequestResponse struct {
Auth bool `json:"auth"`
}
type AuthzConfig ¶
type AuthzConfig struct { Version float32 `json:"version"` AuthzVersion_0_1 AuthzVersion_0_1 }
func (*AuthzConfig) UnmarshalJSON ¶
func (authzConfig *AuthzConfig) UnmarshalJSON(data []byte) error
type AuthzVersion_0_1 ¶
type AuthzVersion_0_1 struct { And []AuthzVersion_0_1 `json:"and"` Or []AuthzVersion_0_1 `json:"or"` ResourcePaths []string `json:"resource_paths"` PayModels []string `json:"pay_models"` }
type CREDS ¶
type CREDS struct {
// contains filtered or unexported fields
}
func (*CREDS) CreateEcsTaskExecutionRole ¶
func (*CREDS) CreateLoadBalancer ¶
func (creds *CREDS) CreateLoadBalancer(userName string) (*elbv2.CreateLoadBalancerOutput, *string, *elbv2.CreateListenerOutput, error)
func (*CREDS) CreateLogGroup ¶
func (sess *CREDS) CreateLogGroup(LogGroupName string, creds *credentials.Credentials) (string, error)
Create CloudWatch LogGroup for hatchery containers
func (*CREDS) CreateTaskDefinition ¶
func (sess *CREDS) CreateTaskDefinition(input *CreateTaskDefinitionInput, userName string, hash string, awsAcctID string) (string, error)
Create/Update Task Definition in ECS
func (*CREDS) NetworkConfig ¶
func (creds *CREDS) NetworkConfig(userName string) (ecs.NetworkConfiguration, error)
type ComposeDeployDetails ¶
type ComposeDeployDetails struct {
Resources ComposeResources
}
ComposeDeployDetails holds supplemental information useful for scheduling a service
type ComposeFull ¶
type ComposeFull struct { // name of the root service mapped to the magic port RootService string `yaml:"-"` Services map[string]ComposeService }
ComposeFull holds all the data harvested from a docker-compose.yaml file
func DockstoreComposeFromBytes ¶
func DockstoreComposeFromBytes(yamlBytes []byte) (model *ComposeFull, err error)
DockstoreComposeFromBytes load and sanitize a compose app from given yaml bytes
func DockstoreComposeFromFile ¶
func DockstoreComposeFromFile(filePath string) (model *ComposeFull, err error)
DockstoreComposeFromFile loads a hatchery application (container) config from a compose.yaml file
func DockstoreComposeFromStr ¶
func DockstoreComposeFromStr(composeYaml string) (model *ComposeFull, err error)
DockstoreComposeFromStr load and sanitize a compose app from a given yaml string
func (*ComposeFull) BuildHatchApp ¶
func (model *ComposeFull) BuildHatchApp() (*Container, error)
BuildHatchApp generates a hatchery container config from a dockstore compose application config
func (*ComposeFull) Sanitize ¶
func (model *ComposeFull) Sanitize() error
Sanitize scans, validates, and decorates a given ComposeFull model
type ComposeHealthCheck ¶
ComposeHealthCheck holds the healthcheck details for a service
type ComposeResourceSpec ¶
ComposeResourceSpec holds the cpu and memory values for a resource request
func (*ComposeResourceSpec) BuildK8sResource ¶
func (rspec *ComposeResourceSpec) BuildK8sResource() map[k8sv1.ResourceName]resource.Quantity
BuildK8sResource from a compose resource spec
type ComposeResources ¶
type ComposeResources struct { Requests ComposeResourceSpec `yaml:"reservations,omitempty"` Limits ComposeResourceSpec }
ComposeResources holds the resource requests and limits for a service (contianer)
type ComposeService ¶
type ComposeService struct { Image string Name string Environment []string Entrypoint []string Command []string Volumes []string Ports []string UserUID int64 `yaml:"user_uid"` GroupUID int64 `yaml:"group_uid"` FSGID int64 `yaml:"fs_gid"` SecurityContext []string `yaml:"security_context"` Deploy ComposeDeployDetails Healthcheck ComposeHealthCheck }
ComposeService is an entry in the services block of docker-compose
func (*ComposeService) ToK8sContainer ¶
func (service *ComposeService) ToK8sContainer(friend *k8sv1.Container) (mountUserVolume bool, mountSharedMemory bool, err error)
ToK8sContainer copies data from the given service to the container friend Returns true if this container mounts the user volume. We try to avoid mounting that thing if possible while it's still EBS based.
type Container ¶
type Container struct { Name string `json:"name"` CPULimit string `json:"cpu-limit"` MemoryLimit string `json:"memory-limit"` Image string `json:"image"` PullPolicy string `json:"pull_policy"` Env map[string]string `json:"env"` TargetPort int32 `json:"target-port"` Args []string `json:"args"` Command []string `json:"command"` PathRewrite string `json:"path-rewrite"` UseTLS string `json:"use-tls"` ReadyProbe string `json:"ready-probe"` LifecyclePreStop []string `json:"lifecycle-pre-stop"` LifecyclePostStart []string `json:"lifecycle-post-start"` UserUID int64 `json:"user-uid"` GroupUID int64 `json:"group-uid"` FSGID int64 `json:"fs-gid"` UserVolumeLocation string `json:"user-volume-location"` Gen3VolumeLocation string `json:"gen3-volume-location"` Friends []k8sv1.Container `json:"friends"` NextflowConfig NextflowConfig `json:"nextflow"` License LicenseInfo `json:"license"` Authz AuthzConfig `json:"authz"` }
Container Struct to hold the configuration for Pod Container
type ContainerStates ¶
type ContainerStates struct { Name string `json:"name"` State k8sv1.ContainerState `json:"state"` Ready bool `json:"ready"` }
type CreateTaskDefinitionInput ¶
type CreateTaskDefinitionInput struct { Cpu string EnvVars []EnvVar ExecutionRoleArn string Image string Memory string Name string Port int64 LogGroupName string Volumes []*ecs.Volume MountPoints []*ecs.MountPoint LogRegion string TaskRole string Type string EntryPoint []string Args []string SidecarContainer ecs.ContainerDefinition }
func (*CreateTaskDefinitionInput) Environment ¶
func (input *CreateTaskDefinitionInput) Environment() []*ecs.KeyValuePair
type DbConfig ¶
type DbConfig struct {
DynamoDb dynamodbiface.DynamoDBAPI
}
type FullHatcheryConfig ¶
type FullHatcheryConfig struct { Config HatcheryConfig ContainersMap map[string]Container PayModelMap map[string]PayModel Logger *log.Logger }
FullHatcheryConfig bucket result from loadConfig
var Config *FullHatcheryConfig
Config package-global shared hatchery config
func LoadConfig ¶
func LoadConfig(configFilePath string, loggerIn *log.Logger) (config *FullHatcheryConfig, err error)
LoadConfig from a json file
type Gen3LicenseUserMap ¶
type Gen3LicenseUserMap struct { ItemId string `json:"itemId"` Environment string `json:"environment"` LicenseType string `json:"licenseType"` IsActive string `json:"isActive"` UserId string `json:"userId"` LicenseId int `json:"licenseId"` FirstUsedTimestamp int `json:"firstUsedTimestamp"` LastUsedTimestamp int `json:"lastUsedTimestamp"` }
type HatcheryConfig ¶
type HatcheryConfig struct { UserNamespace string `json:"user-namespace"` DefaultPayModel PayModel `json:"default-pay-model"` // DisableLocalWS bool `json:"disable-local-ws"` PayModels []PayModel `json:"pay-models"` PayModelsDynamodbTable string `json:"pay-models-dynamodb-table"` LicenseUserMapsTable string `json:"license-user-maps-dynamodb-table"` LicenseUserMapsGSI string `json:"license-user-maps-global-secondary-index"` License LicenseInfo `json:"license"` SubDir string `json:"sub-dir"` Containers []Container `json:"containers"` UserVolumeSize string `json:"user-volume-size"` Sidecar SidecarContainer `json:"sidecar"` MoreConfigs []AppConfigInfo `json:"more-configs"` PrismaConfig PrismaConfig `json:"prisma"` NextflowGlobalConfig NextflowGlobalConfig `json:"nextflow-global"` }
HatcheryConfig is the root of all the configuration
type InstallBundle ¶
type LicenseInfo ¶
type LicenseInfo struct { Enabled bool `json:"enabled"` LicenseType string `json:"license-type"` MaxLicenseIds int `json:"max-license-ids"` G3autoName string `json:"g3auto-name"` G3autoKey string `json:"g3auto-key"` FilePath string `json:"file-path"` WorkspaceFlavor string `json:"workspace-flavor"` }
LicenseInfo contains configuration for Gen3 supplied licenses.
type NetworkInfo ¶
type NetworkInfo struct {
// contains filtered or unexported fields
}
type NextflowConfig ¶
type NextflowConfig struct { Enabled bool `json:"enabled"` JobImageWhitelist []string `json:"job-image-whitelist"` S3BucketWhitelist []string `json:"s3-bucket-whitelist"` ComputeEnvironmentType string `json:"compute-environment-type"` InstanceAmi string `json:"instance-ami"` InstanceAmiBuilderArn string `json:"instance-ami-builder-arn"` InstanceType string `json:"instance-type"` InstanceMinVCpus int32 `json:"instance-min-vcpus"` InstanceMaxVCpus int32 `json:"instance-max-vcpus"` }
Configuration specific to Nextflow containers
type NextflowGlobalConfig ¶
type NextflowGlobalConfig struct { SampleConfigPublicImage string `json:"sample-config-public-image"` ImageBuilderReaderRoleArn string `json:"imagebuilder-reader-role-arn"` }
Global configuration shared by all Nextflow containers
type PayModel ¶
type PayModel struct { Id string `json:"bmh_workspace_id"` Name string `json:"workspace_type"` User string `json:"user_id"` AWSAccountId string `json:"account_id"` Status string `json:"request_status"` Local bool `json:"local"` Region string `json:"region"` Ecs bool `json:"ecs"` Subnet int `json:"subnet"` HardLimit float32 `json:"hard-limit"` SoftLimit float32 `json:"soft-limit"` TotalUsage float32 `json:"total-usage"` CurrentPayModel bool `json:"current_pay_model"` }
TODO remove PayModel from config once DynamoDB contains all necessary data
type PodConditions ¶
type PrismaConfig ¶
type PrismaConfig struct { ConsoleAddress string `json:"console-address"` ConsoleVersion string `json:"console-version"` Enable bool `json:"enable"` }
Config to allow for Prisma Agents
type SidecarContainer ¶
type SidecarContainer struct { CPULimit string `json:"cpu-limit"` MemoryLimit string `json:"memory-limit"` Image string `json:"image"` Env map[string]string `json:"env"` Args []string `json:"args"` Command []string `json:"command"` LifecyclePreStop []string `json:"lifecycle-pre-stop"` }
SidecarContainer holds fuse sidecar configuration
type TextOutput ¶
type TextOutput struct {
Text string
}
type WorkspaceKernelStatusStruct ¶
type WorkspaceKernelStatusStruct struct {
LastActivityTime string `json:"last_activity"`
}
type WorkspaceStatus ¶
type WorkspaceStatus struct { Status string `json:"status"` Conditions []PodConditions `json:"conditions"` ContainerStates []ContainerStates `json:"containerStates"` IdleTimeLimit int `json:"idleTimeLimit"` LastActivityTime int64 `json:"lastActivityTime"` WorkspaceType string `json:"workspaceType"` }