server

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueueStateQueued      = "queued"
	QueueStateStillQueued = "still queued"
	QueueStateRunning     = "running"
)

Variables

This section is empty.

Functions

func ComputeID

func ComputeID(dir string) (string, error)

Types

type APIVersion

type APIVersion struct {
	model.Version
	Images []*model.Image `json:"images"`
}

type BuildJob

type BuildJob struct {
	// contains filtered or unexported fields
}

type BuildQueue

type BuildQueue struct {
	// contains filtered or unexported fields
}

func NewBuildQueue

func NewBuildQueue(servingPlatform serving.Platform, dockerImageBuilder docker.ImageBuilder, cpuConcurrency int, gpuConcurrency int) *BuildQueue

func (*BuildQueue) Build

func (q *BuildQueue) Build(ctx context.Context, dir string, name string, id string, arch string, config *model.Config, logWriter logger.Logger) (*BuildResult, error)

Build pushes per-arch BuildJobs onto the build queue's job channels and creates result channels for those jobs. It then waits for results on the newly created result channels.

func (*BuildQueue) Start

func (q *BuildQueue) Start(ctx context.Context)

type BuildResult

type BuildResult struct {
	// contains filtered or unexported fields
}

type JobOutput

type JobOutput struct {
	// contains filtered or unexported fields
}

type QueueLogger

type QueueLogger struct {
	// contains filtered or unexported fields
}

func NewQueueLogger

func NewQueueLogger(ch chan *JobOutput) *QueueLogger

func (*QueueLogger) Debug

func (l *QueueLogger) Debug(line string)

func (*QueueLogger) Debugf

func (l *QueueLogger) Debugf(line string, args ...interface{})

func (*QueueLogger) Info

func (l *QueueLogger) Info(line string)

func (*QueueLogger) Infof

func (l *QueueLogger) Infof(line string, args ...interface{})

func (*QueueLogger) WriteError

func (l *QueueLogger) WriteError(err error)

func (*QueueLogger) WriteStatus

func (l *QueueLogger) WriteStatus(status string, args ...interface{})

func (*QueueLogger) WriteVersion

func (l *QueueLogger) WriteVersion(version *model.Version)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cpuConcurrency int, gpuConcurrency int, rawPostUploadHooks []string, rawPostBuildHooks []string, rawPostBuildPrimaryHooks []string, authDelegate string, db database.Database, dockerImageBuilder docker.ImageBuilder, servingPlatform serving.Platform, store storage.Storage) (*Server, error)

func (*Server) DeleteVersion

func (s *Server) DeleteVersion(w http.ResponseWriter, r *http.Request)

func (*Server) DownloadFile

func (s *Server) DownloadFile(w http.ResponseWriter, r *http.Request)

func (*Server) DownloadVersion

func (s *Server) DownloadVersion(w http.ResponseWriter, r *http.Request)

func (*Server) GetCacheHashes

func (s *Server) GetCacheHashes(w http.ResponseWriter, r *http.Request)

func (*Server) GetDisplayTokenURL

func (s *Server) GetDisplayTokenURL(w http.ResponseWriter, r *http.Request)

func (*Server) GetVersion

func (s *Server) GetVersion(w http.ResponseWriter, r *http.Request)

func (*Server) ListVersions

func (s *Server) ListVersions(w http.ResponseWriter, r *http.Request)

func (*Server) ReadConfig

func (s *Server) ReadConfig(dir string) (*model.Config, error)

Load the Cog config

func (*Server) ReceiveFile

func (s *Server) ReceiveFile(w http.ResponseWriter, r *http.Request)

func (*Server) ReceiveVersion

func (s *Server) ReceiveVersion(dir string, id string, logWriter logger.Logger, user string, name string) (*model.Version, error)

func (*Server) SendBuildLogs

func (s *Server) SendBuildLogs(w http.ResponseWriter, r *http.Request)

func (*Server) Start

func (s *Server) Start(port int) error

func (*Server) UnzipInputToTempDir

func (s *Server) UnzipInputToTempDir(r *http.Request, user string, name string) (string, error)

func (*Server) VerifyToken

func (s *Server) VerifyToken(w http.ResponseWriter, r *http.Request)

func (*Server) ZipToTempPath

func (s *Server) ZipToTempPath(dir string) (string, error)

type WebHook

type WebHook struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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