Documentation ¶
Overview ¶
Copyright 2022 Evan Hazlett
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Evan Hazlett ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( // ServerQueueGroupName is the name for the server queue group ServerQueueGroupName = "fynca-servers" // WorkerQueueGroupName is the name for the worker queue group WorkerQueueGroupName = "fynca-workers" QueueSubjectJobPriorityNormal = "normal" QueueSubjectJobPriorityUrgent = "urgent" QueueSubjectJobPriorityAnimation = "animation" QueueSubjectJobPriorityLow = "low" // S3ProjectPath is the project for project files S3ProjectPath = "projects" // S3RenderPath is the s3 bucket for final renders S3RenderPath = "render" // S3JobPath is the path to the render job config S3JobPath = "job.json" // S3JobLogPath is the path to the job log S3JobLogPath = "job.log" // S3JobStatusContentType is the content type for job status objects S3JobContentType = "application/json" // WorkerTTL is the TTL for the worker heartbeat WorkerTTL = time.Second * 10 // CtxTokenKey is the key stored in the context for the token CtxTokenKey = "token" // CtxTokenKey is the key stored in the context for the username CtxUsernameKey = "username" // CtxTokenKey is the key stored in the context if the user is an admin CtxAdminKey = "isAdmin" // CtxNamespaceKey is the key stored in the context for the namespace CtxNamespaceKey = "namespace" // CtxDefaultNamespace is the default key used when unauthenticated and no auth CtxDefaultNamespace = "default" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticatorConfig ¶
type Config ¶
type Config struct { // GRPCAddress is the address for the grpc server GRPCAddress string // TLSCertificate is the certificate used for grpc communication TLSServerCertificate string // TLSKey is the key used for grpc communication TLSServerKey string // TLSClientCertificate is the client certificate used for communication TLSClientCertificate string // TLSClientKey is the client key used for communication TLSClientKey string // TLSInsecureSkipVerify disables certificate verification TLSInsecureSkipVerify bool // S3Endpoint is the endpoint for the S3 compatible service S3Endpoint string // S3AccessID is the S3 access id S3AccessID string // S3AccessKey is the S3 key S3AccessKey string // S3Bucket is the S3 bucket S3Bucket string // S3UseSSL enables SSL for the S3 service S3UseSSL bool // NATSUrl is the URL for the NATS server NATSURL string // NATSJobStreamName is the queue subject for the workers NATSJobStreamName string // NATSJobStatusStreamName is the queue subject for the servers NATSJobStatusStreamName string // NATSKVBucketWorkerControl is the name of the kv store in the for worker control NATSKVBucketWorkerControl string // DatabaseAddress is the address of the database DatabaseAddress string // JobTimeout is the maximum amount of time a job can take JobTimeout duration // Workers are worker specific configuration Workers []*Worker // ProfilerAddress enables the performance profiler on the specified address ProfilerAddress string // TraceEndpoint is the endpoint of the telemetry tracer TraceEndpoint string // Environment is the environment the app is running in Environment string // InitialAdminPassword is the password used when creating the initial admin account. If empty, a random one is generated. InitialAdminPassword string // Authenticator is the auth configuration Authenticator *AuthenticatorConfig // TODO: cleanup // JobPrefix is the prefix for all queued jobs JobPrefix string // JobPriority is the priority for queued jobs JobPriority int // JobCPU is the amount of CPU (in Mhz) that will be configured for each job JobCPU int // JobMemory is the amount of memory (in MB) that will be configured for each job JobMemory int }
Config is the configuration used for the server
func DefaultConfig ¶
func DefaultConfig() *Config
func LoadConfig ¶
LoadConfig returns a Fynca config from the specified file path
func (*Config) GetJobTimeout ¶
func (*Config) GetWorkerConfig ¶
GetWorkerConfig returns the node specific configuration or default if not found
type RenderEngine ¶
type Worker ¶
type Worker struct { // Name is the name of the worker to apply the configuration // leave blank for all Name string // MaxJobs is the maximum number of jobs this worker will perform and then exit MaxJobs int // RenderEngines is a list of enabled render engines for the worker RenderEngines []*RenderEngine }