conf

package
v0.9.68 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2018 License: BSD-2-Clause Imports: 10 Imported by: 28

Documentation

Index

Constants

View Source
const ALL_APP string = "*"
View Source
const BasePriority int = 1
View Source
const CLIEN_DIR_DELAY_DONE time.Duration = 1 * time.Minute // clean done workunit dir after 1 minute
View Source
const CLIEN_DIR_DELAY_FAIL time.Duration = 30 * time.Minute //clean failed workunit dir after 30 minutes
View Source
const DB_COLL_CGS string = "ClientGroups"
View Source
const DB_COLL_JOBS string = "Jobs"
View Source
const DB_COLL_PERF string = "Perf"
View Source
const DB_COLL_USERS string = "Users"
View Source
const DEFAULT_CHUNK_SIZE int64 = 1048576 * 1

default chunk size, consistent with shock

View Source
const DEFAULT_INDEX string = "chunkrecord"

default index type used for intermediate data

View Source
const DEFAULT_PAGE_SIZE int = 25

Default page size

View Source
const INSTANCE_METADATA_TIMEOUT time.Duration = 5 * time.Second
View Source
const LOGIN_PREFIX string = "go4711"

prefix for site login

View Source
const SHOCK_TIMEOUT time.Duration = 30 * time.Second

Shock_TimeOut

View Source
const STDERR_FILENAME string = "awe_stderr.txt"
View Source
const STDOUT_FILENAME string = "awe_stdout.txt"
View Source
const VERSION string = "0.9.68"
View Source
const WORKNOTES_FILENAME string = "awe_worknotes.txt"

Variables

View Source
var (
	SHOW_VERSION bool
	TITLE        string

	// Reload
	RELOAD      string
	RECOVER     bool
	RECOVER_MAX int

	// AWE server port
	SITE_PORT int
	API_PORT  int
	// AWE server external address
	SITE_URL string
	API_URL  string

	// AWE proxy port
	P_SITE_PORT int
	P_API_PORT  int

	// SSL
	SSL_ENABLED   bool
	SSL_KEY_FILE  string
	SSL_CERT_FILE string

	// Anonymous-Access-Control
	ANON_WRITE     bool
	ANON_READ      bool
	ANON_DELETE    bool
	ANON_CG_WRITE  bool
	ANON_CG_READ   bool
	ANON_CG_DELETE bool

	// Auth
	BASIC_AUTH         bool
	GLOBUS_TOKEN_URL   string
	GLOBUS_PROFILE_URL string
	OAUTH_URL_STR      string
	OAUTH_BEARER_STR   string
	SITE_LOGIN_URL     string
	CLIENT_AUTH_REQ    bool
	CLIENT_GROUP_TOKEN string

	// Admin
	ADMIN_EMAIL     string
	ADMIN_USERS_VAR string

	// Directories
	DATA_PATH     string
	SITE_PATH     string
	LOGS_PATH     string
	AWF_PATH      string
	PID_FILE_PATH string

	// Mongodb
	MONGODB_HOST     string
	MONGODB_DATABASE string
	MONGODB_USER     string
	MONGODB_PASSWD   string
	MONGODB_TIMEOUT  int

	// Server
	COREQ_LENGTH       int
	EXPIRE_WAIT        int
	GLOBAL_EXPIRE      string
	PIPELINE_EXPIRE    string
	PERF_LOG_WORKUNIT  bool
	MAX_WORK_FAILURE   int
	MAX_CLIENT_FAILURE int
	GOMAXPROCS         int

	// Client
	WORK_PATH                   string
	APP_PATH                    string
	SUPPORTED_APPS              string
	PRE_WORK_SCRIPT             string
	PRE_WORK_SCRIPT_ARGS_STRING string
	PRE_WORK_SCRIPT_ARGS        = []string{}
	METADATA                    string

	SERVER_URL             string
	CLIENT_NAME            string
	CLIENT_HOSTNAME        string
	CLIENT_HOST_IP         string
	CLIENT_HOST_deprecated string

	CLIENT_GROUP   string
	CLIENT_DOMAIN  string
	WORKER_OVERLAP bool
	PRINT_APP_MSG  bool
	AUTO_CLEAN_DIR bool
	NO_SYMLINK     bool
	CACHE_ENABLED  bool

	CWL_TOOL  string
	CWL_JOB   string
	SHOCK_URL string

	// Docker
	USE_DOCKER                    string
	DOCKER_BINARY                 string
	USE_APP_DEFS                  string
	CGROUP_MEMORY_DOCKER_DIR      string
	MEM_CHECK_INTERVAL            = 0 * time.Second //in milliseconds e.g. use 10 * time.Second
	MEM_CHECK_INTERVAL_SECONDS    int
	APP_REGISTRY_URL              string
	DOCKER_SOCKET                 string
	DOCKER_WORK_DIR               string
	DOCKER_WORKUNIT_PREDATA_DIR   string
	SHOCK_DOCKER_IMAGE_REPOSITORY string

	// Other
	ERROR_LENGTH         int
	DEV_MODE             bool
	DEBUG_LEVEL          int
	CONFIG_FILE          string
	LOG_OUTPUT           string
	PRINT_HELP           bool // full usage
	SHOW_HELP            bool // simple usage
	SHOW_GIT_COMMIT_HASH bool
	CPUPROFILE           string
	MEMPROFILE           string

	// submitter (CWL)
	SUBMITTER_OUTDIR         string
	SUBMITTER_QUIET          bool
	SUBMITTER_PACK           bool
	SUBMITTER_OUTPUT         string
	SUBMITTER_WAIT           bool
	SUBMITTER_DOWNLOAD_FILES bool

	// WORKER (CWL)
	CWL_RUNNER_ARGS string

	// used to track changes in data structures
	VERSIONS = make(map[string]int)

	// used to track expiration for different pipelines
	PIPELINE_EXPIRE_MAP = make(map[string]string)

	// used to track admin users
	AdminUsers = []string{}

	// used for login
	LOGIN_RESOURCES = make(map[string]LoginResource)
	LOGIN_DEFAULT   string

	// used to map bearer token to oauth url
	AUTH_OAUTH    = make(map[string]string)
	HAS_OAUTH     bool
	OAUTH_DEFAULT string // first value in OAUTH_URL_STR

	// authServer variables
	AUTH_URL         string
	USE_OAUTH_SERVER bool

	// internal config control
	FAKE_VAR = false

	//
	ARGS []string
)

set defaults in function "getConfiguration" below !!!!!

View Source
var GIT_COMMIT_HASH string // use -ldflags "-X github.com/MG-RAST/AWE/lib/conf.GIT_COMMIT_HASH <value>"
View Source
var LOG_OUTPUTS = [3]string{"file", "console", "both"}
View Source
var WORKUNIT_LOGS = [3]string{"stdout", "stderr", "worknotes"}

Functions

func Init_conf added in v0.9.13

func Init_conf(mode string) (err error)

func Print

func Print(service string)

func PrintClientCfg

func PrintClientCfg()

func PrintClientUsage

func PrintClientUsage()

func PrintProxyUsage

func PrintProxyUsage()

func PrintServerUsage

func PrintServerUsage()

func PrintVersionMsg

func PrintVersionMsg()

Types

type Config_store added in v0.9.13

type Config_store struct {
	Store []*Config_value
	Fs    *flag.FlagSet
	Con   *config.Config
}

func NewCS added in v0.9.13

func NewCS(c *config.Config) *Config_store

func (*Config_store) AddBool added in v0.9.13

func (this *Config_store) AddBool(target *bool,
	default_value bool,
	section string,
	key string,
	descr_short string,
	descr_long string)

func (*Config_store) AddInt added in v0.9.13

func (this *Config_store) AddInt(target *int,
	default_value int,
	section string,
	key string,
	descr_short string,
	descr_long string)

func (*Config_store) AddString added in v0.9.13

func (this *Config_store) AddString(target *string,
	default_value string,
	section string,
	key string,
	descr_short string,
	descr_long string)

func (Config_store) Parse added in v0.9.13

func (this Config_store) Parse()

func (Config_store) PrintHelp added in v0.9.13

func (this Config_store) PrintHelp()

type Config_value added in v0.9.13

type Config_value struct {
	Conf_type string
	Conf_str  *Config_value_string
	Conf_int  *Config_value_int
	Conf_bool *Config_value_bool
}

type Config_value_bool added in v0.9.13

type Config_value_bool struct {
	Target        *bool
	Default_value bool
	Section       string
	Key           string
	Descr_short   string
	Descr_long    string
}

type Config_value_int added in v0.9.13

type Config_value_int struct {
	Target        *int
	Default_value int
	Section       string
	Key           string
	Descr_short   string
	Descr_long    string
}

type Config_value_string added in v0.9.13

type Config_value_string struct {
	Target        *string
	Default_value string
	Section       string
	Key           string
	Descr_short   string
	Descr_long    string
}

type LoginResource added in v0.9.49

type LoginResource struct {
	Icon      string `json:"icon"`
	Prefix    string `json:"prefix"`
	Keyword   string `json:"keyword"`
	Url       string `json:"url"`
	UseHeader bool   `json:"useHeader"`
	Bearer    string `json:"bearer"`
}

Jump to

Keyboard shortcuts

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