Documentation
¶
Index ¶
- Variables
- func ConcurrentAppendToArray[T any](mu *sync.Mutex, val T, arr *[]T)
- func GetProtoWorkerError(prefix string, err error, resp *pb.SyncResponse) string
- type BuildMetadata
- type BuildState
- type CheckSumError
- type MetadataEncodeError
- type RepositoryMetadata
- type StateMetadata
- type TaskExecutor
- type TaskExecutorServer
- type TaskState
- type WorkerBuilderServer
- type WorkersBuilder
Constants ¶
This section is empty.
Variables ¶
View Source
var BuildPath string = os.ExpandEnv("$HOME/conflowci/build")
Functions ¶
func ConcurrentAppendToArray ¶
func GetProtoWorkerError ¶
func GetProtoWorkerError(prefix string, err error, resp *pb.SyncResponse) string
Types ¶
type BuildMetadata ¶
type BuildMetadata struct {
Repository RepositoryMetadata `toml:"Repository"`
State StateMetadata `toml:"state"`
}
type BuildState ¶
type BuildState uint
Current state of a task.
const ( StartingBuild BuildState = iota RunningBuild CompletedBuild ErrorInBuild CompleteBuildWithErrors )
func (BuildState) String ¶
func (s BuildState) String() string
type CheckSumError ¶
type CheckSumError struct {
// contains filtered or unexported fields
}
func (CheckSumError) Error ¶
func (e CheckSumError) Error() string
type MetadataEncodeError ¶
type MetadataEncodeError struct {
// contains filtered or unexported fields
}
func (MetadataEncodeError) Error ¶
func (e MetadataEncodeError) Error() string
type RepositoryMetadata ¶
type StateMetadata ¶
type TaskExecutor ¶
type TaskExecutor struct {
TaskID uuid.UUID
State TaskState
RunsOn []config.EndpointInfo
Files []string
Cmds []string
Outputs []string
Errors []string
}
TaskExecutor represents a task syncing for remote machines it tracks each state of the task, and is responsible for dispatching tasks to remote machines. It does the dispatching after the project is already built
func NewTaskExecutor ¶
func NewTaskExecutor(cfg config.ValidatedConfig, task config.TaskConsumerJobs, wsName string) (*TaskExecutor, error)
Creates a new task executor, the task executor is responsible for executing tasks on a remote machine it dispatches each cmd with file/pattern to a remote machine in a concurrent way using the RunTaskOnAllMachines func. there is no guarantee that the commands will be executed in the order they were dispatched.
func (*TaskExecutor) RunTaskOnAllMachines ¶
func (te *TaskExecutor) RunTaskOnAllMachines() error
RunTaskOnAllMachines distributes tasks across all endpoints
type TaskExecutorServer ¶
type TaskExecutorServer struct{}
func (*TaskExecutorServer) GetFilesByRegex ¶
func (te *TaskExecutorServer) GetFilesByRegex(ctx context.Context, finder *pb.TaskFileFinder) (*pb.FileList, error)
type WorkerBuilderServer ¶
type WorkerBuilderServer struct {
// contains filtered or unexported fields
}
func NewWorkerBuilderServer ¶
func NewWorkerBuilderServer(client providerPB.RepositoryProviderClient) *WorkerBuilderServer
func (*WorkerBuilderServer) BuildRepository ¶
func (s *WorkerBuilderServer) BuildRepository(ctx context.Context, cfg *syncPB.WorkerConfig) ( *syncPB.WorkerBuildOutput, error)
func (*WorkerBuilderServer) RemoveRepositoryWorkspace ¶
func (s *WorkerBuilderServer) RemoveRepositoryWorkspace(ctx context.Context, cfg *syncPB.WorkerConfig) (*emptypb.Empty, error)
type WorkersBuilder ¶
type WorkersBuilder struct {
Name string
BuildID uuid.UUID
State BuildState
RunsOn []config.EndpointInfo
Steps []string
CloneURL string
Remote string
BranchName string
Token string
BranchRef string
}
func NewWorkerBuilder ¶
func NewWorkerBuilder(cfg config.ValidatedConfig, remote, branch, branchRef string) *WorkersBuilder
func (*WorkersBuilder) BuildAllEndpoints ¶
func (wb *WorkersBuilder) BuildAllEndpoints() []*syncPB.WorkerBuildOutput
func (*WorkersBuilder) RemoveAllRepositoryWorkspaces ¶
func (wb *WorkersBuilder) RemoveAllRepositoryWorkspaces() []error
Click to show internal directories.
Click to hide internal directories.