config

package
v4.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

API configuration as read from strings/JSON and some constants defined here also

Index

Constants

View Source
const KubernetesMaxTimeoutSec = 2 * 60 * 60
View Source
const PiquantDownloadSignedURLExpirySec = 60 * 60

PiquantDownloadSignedURLExpirySec Expiry time in seconds of piquant executable signed S3 links

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	AdminEmails []string

	Auth0Domain             string
	Auth0ManagementClientID string
	Auth0ManagementSecret   string
	Auth0NewUserRoleID      string

	ConfigBucket string

	CoresPerNode int32

	DataSourceSNSTopic string
	CoregSqsQueueUrl   string

	DatasetsBucket string

	EnvironmentName string

	HotQuantNamespace string // Used for faster PIQUANT runs, eg executing a spectral fit

	KubernetesLocation string // "internal" vs "external"

	LogLevel           logger.LogLevel // Can be changed at runtime, but if API restarts, it goes back to configured value
	ManualUploadBucket string

	// Mongo Connection
	MongoSecret string

	PiquantDockerImage string // PIQUANT docker image to use to run a job
	PiquantJobsBucket  string // PIQUANT job scratch drive

	PosterImage             string
	QuantDestinationPackage string

	QuantExecutor  string
	QuantNamespace string // Used for running large multi-node quants

	QuantObjectType string

	SentryEndpoint string

	UsersBucket string

	ZenodoURI         string
	ZenodoAccessToken string

	// Vars not set by environment
	NodeCountOverride int32
	MaxQuantNodes     int32
	KubeConfig        string // Env sets this via command line parameter

	// Web Socket config
	WSWriteWaitMs       uint
	WSPongWaitMs        uint
	WSPingPeriodMs      uint
	WSMaxMessageSize    uint
	WSMessageBufferSize uint

	// Local file caching (from S3 to where API is running)
	MaxFileCacheAgeSec    uint
	MaxFileCacheSizeBytes uint

	ImportJobMaxTimeSec  uint32
	PIQUANTJobMaxTimeSec uint32

	// The GroupId of the group a new user is added to by default as a member
	DefaultUserGroupId string
}

APIConfig combines env vars and config JSON values

func Init

func Init() (APIConfig, error)

Init config, loads config params

func NewConfigFromFile

func NewConfigFromFile(configFilePath string) (APIConfig, error)

Jump to

Keyboard shortcuts

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