runner

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSupportedArch

func IsSupportedArch(arch params.OSArch) bool

func IsSupportedOSType

func IsSupportedOSType(osType params.OSType) bool

Types

type EnterprisePoolManager

type EnterprisePoolManager interface {
	CreateEnterprisePoolManager(ctx context.Context, enterprise params.Enterprise, providers map[string]common.Provider, store dbCommon.Store) (common.PoolManager, error)
	GetEnterprisePoolManager(enterprise params.Enterprise) (common.PoolManager, error)
	DeleteEnterprisePoolManager(enterprise params.Enterprise) error
	GetEnterprisePoolManagers() (map[string]common.PoolManager, error)
}

type HookTargetType

type HookTargetType string
const (
	RepoHook         HookTargetType = "repository"
	OrganizationHook HookTargetType = "organization"
	EnterpriseHook   HookTargetType = "business"
)

type OrgPoolManager

type OrgPoolManager interface {
	CreateOrgPoolManager(ctx context.Context, org params.Organization, providers map[string]common.Provider, store dbCommon.Store) (common.PoolManager, error)
	GetOrgPoolManager(org params.Organization) (common.PoolManager, error)
	DeleteOrgPoolManager(org params.Organization) error
	GetOrgPoolManagers() (map[string]common.PoolManager, error)
}

type PoolManagerController

type PoolManagerController interface {
	RepoPoolManager
	OrgPoolManager
	EnterprisePoolManager
}

type RepoPoolManager

type RepoPoolManager interface {
	CreateRepoPoolManager(ctx context.Context, repo params.Repository, providers map[string]common.Provider, store dbCommon.Store) (common.PoolManager, error)
	GetRepoPoolManager(repo params.Repository) (common.PoolManager, error)
	DeleteRepoPoolManager(repo params.Repository) error
	GetRepoPoolManagers() (map[string]common.PoolManager, error)
}

type Runner

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

func NewRunner

func NewRunner(ctx context.Context, cfg config.Config, db dbCommon.Store) (*Runner, error)

func (*Runner) AddInstanceStatusMessage

func (r *Runner) AddInstanceStatusMessage(ctx context.Context, param params.InstanceUpdateMessage) error

func (*Runner) CreateEnterprise

func (r *Runner) CreateEnterprise(ctx context.Context, param params.CreateEnterpriseParams) (enterprise params.Enterprise, err error)

func (*Runner) CreateEnterprisePool

func (r *Runner) CreateEnterprisePool(ctx context.Context, enterpriseID string, param params.CreatePoolParams) (params.Pool, error)

func (*Runner) CreateEntityScaleSet

func (r *Runner) CreateEntityScaleSet(ctx context.Context, entityType params.ForgeEntityType, entityID string, param params.CreateScaleSetParams) (scaleSetRet params.ScaleSet, err error)

func (*Runner) CreateGiteaCredentials

func (r *Runner) CreateGiteaCredentials(ctx context.Context, param params.CreateGiteaCredentialsParams) (params.ForgeCredentials, error)

func (*Runner) CreateGiteaEndpoint

func (r *Runner) CreateGiteaEndpoint(ctx context.Context, param params.CreateGiteaEndpointParams) (params.ForgeEndpoint, error)

func (*Runner) CreateGithubCredentials added in v0.1.5

func (r *Runner) CreateGithubCredentials(ctx context.Context, param params.CreateGithubCredentialsParams) (params.ForgeCredentials, error)

func (*Runner) CreateGithubEndpoint added in v0.1.5

func (r *Runner) CreateGithubEndpoint(ctx context.Context, param params.CreateGithubEndpointParams) (params.ForgeEndpoint, error)

func (*Runner) CreateOrgPool

func (r *Runner) CreateOrgPool(ctx context.Context, orgID string, param params.CreatePoolParams) (params.Pool, error)

func (*Runner) CreateOrganization

func (r *Runner) CreateOrganization(ctx context.Context, param params.CreateOrgParams) (org params.Organization, err error)

func (*Runner) CreateRepoPool

func (r *Runner) CreateRepoPool(ctx context.Context, repoID string, param params.CreatePoolParams) (params.Pool, error)

func (*Runner) CreateRepository

func (r *Runner) CreateRepository(ctx context.Context, param params.CreateRepoParams) (repo params.Repository, err error)

func (*Runner) DeleteEnterprise

func (r *Runner) DeleteEnterprise(ctx context.Context, enterpriseID string) error

func (*Runner) DeleteEnterprisePool

func (r *Runner) DeleteEnterprisePool(ctx context.Context, enterpriseID, poolID string) error

func (*Runner) DeleteGiteaCredentials

func (r *Runner) DeleteGiteaCredentials(ctx context.Context, id uint) error

func (*Runner) DeleteGiteaEndpoint

func (r *Runner) DeleteGiteaEndpoint(ctx context.Context, name string) error

func (*Runner) DeleteGithubCredentials added in v0.1.5

func (r *Runner) DeleteGithubCredentials(ctx context.Context, id uint) error

func (*Runner) DeleteGithubEndpoint added in v0.1.5

func (r *Runner) DeleteGithubEndpoint(ctx context.Context, name string) error

func (*Runner) DeleteOrgPool

func (r *Runner) DeleteOrgPool(ctx context.Context, orgID, poolID string) error

func (*Runner) DeleteOrganization

func (r *Runner) DeleteOrganization(ctx context.Context, orgID string, keepWebhook bool) error

func (*Runner) DeletePoolByID

func (r *Runner) DeletePoolByID(ctx context.Context, poolID string) error

func (*Runner) DeleteRepoPool

func (r *Runner) DeleteRepoPool(ctx context.Context, repoID, poolID string) error

func (*Runner) DeleteRepository

func (r *Runner) DeleteRepository(ctx context.Context, repoID string, keepWebhook bool) error

func (*Runner) DeleteRunner added in v0.1.4

func (r *Runner) DeleteRunner(ctx context.Context, instanceName string, forceDelete, bypassGithubUnauthorized bool) error

DeleteRunner removes a runner from a pool. If forceDelete is true, GARM will ignore any provider errors that may occur, and attempt to remove the runner from GitHub and then the database, regardless of provider errors.

func (*Runner) DeleteScaleSetByID

func (r *Runner) DeleteScaleSetByID(ctx context.Context, scaleSetID uint) error

func (*Runner) DispatchWorkflowJob

func (r *Runner) DispatchWorkflowJob(hookTargetType, signature string, forgeType params.EndpointType, jobData []byte) error

func (*Runner) GenerateSystemdUnitFile added in v0.1.4

func (r *Runner) GenerateSystemdUnitFile(ctx context.Context, runAsUser string) ([]byte, error)

func (*Runner) GetControllerInfo

func (r *Runner) GetControllerInfo(ctx context.Context) (params.ControllerInfo, error)

GetControllerInfo returns the controller id and the hostname. This data might be used in metrics and logging.

func (*Runner) GetEnterpriseByID

func (r *Runner) GetEnterpriseByID(ctx context.Context, enterpriseID string) (params.Enterprise, error)

func (*Runner) GetEnterprisePoolByID

func (r *Runner) GetEnterprisePoolByID(ctx context.Context, enterpriseID, poolID string) (params.Pool, error)

func (*Runner) GetGiteaCredentials

func (r *Runner) GetGiteaCredentials(ctx context.Context, id uint) (params.ForgeCredentials, error)

func (*Runner) GetGiteaEndpoint

func (r *Runner) GetGiteaEndpoint(ctx context.Context, name string) (params.ForgeEndpoint, error)

func (*Runner) GetGithubCredentials added in v0.1.5

func (r *Runner) GetGithubCredentials(ctx context.Context, id uint) (params.ForgeCredentials, error)

func (*Runner) GetGithubEndpoint added in v0.1.5

func (r *Runner) GetGithubEndpoint(ctx context.Context, name string) (params.ForgeEndpoint, error)

func (*Runner) GetInstance

func (r *Runner) GetInstance(ctx context.Context, instanceName string) (params.Instance, error)

func (*Runner) GetInstanceGithubRegistrationToken

func (r *Runner) GetInstanceGithubRegistrationToken(ctx context.Context) (string, error)

func (*Runner) GetJITConfigFile added in v0.1.4

func (r *Runner) GetJITConfigFile(ctx context.Context, file string) ([]byte, error)

func (*Runner) GetOrgPoolByID

func (r *Runner) GetOrgPoolByID(ctx context.Context, orgID, poolID string) (params.Pool, error)

func (*Runner) GetOrgWebhookInfo added in v0.1.4

func (r *Runner) GetOrgWebhookInfo(ctx context.Context, orgID string) (params.HookInfo, error)

func (*Runner) GetOrganizationByID

func (r *Runner) GetOrganizationByID(ctx context.Context, orgID string) (params.Organization, error)

func (*Runner) GetPoolByID

func (r *Runner) GetPoolByID(ctx context.Context, poolID string) (params.Pool, error)

func (*Runner) GetRepoPoolByID

func (r *Runner) GetRepoPoolByID(ctx context.Context, repoID, poolID string) (params.Pool, error)

func (*Runner) GetRepoWebhookInfo added in v0.1.4

func (r *Runner) GetRepoWebhookInfo(ctx context.Context, repoID string) (params.HookInfo, error)

func (*Runner) GetRepositoryByID

func (r *Runner) GetRepositoryByID(ctx context.Context, repoID string) (params.Repository, error)

func (*Runner) GetRootCertificateBundle added in v0.1.4

func (r *Runner) GetRootCertificateBundle(ctx context.Context) (params.CertificateBundle, error)

func (*Runner) GetRunnerServiceName added in v0.1.4

func (r *Runner) GetRunnerServiceName(ctx context.Context) (string, error)

func (*Runner) GetScaleSetByID

func (r *Runner) GetScaleSetByID(ctx context.Context, scaleSet uint) (params.ScaleSet, error)

func (*Runner) InstallOrgWebhook added in v0.1.4

func (r *Runner) InstallOrgWebhook(ctx context.Context, orgID string, param params.InstallWebhookParams) (params.HookInfo, error)

func (*Runner) InstallRepoWebhook added in v0.1.4

func (r *Runner) InstallRepoWebhook(ctx context.Context, repoID string, param params.InstallWebhookParams) (params.HookInfo, error)

func (*Runner) ListAllInstances

func (r *Runner) ListAllInstances(ctx context.Context) ([]params.Instance, error)

func (*Runner) ListAllJobs added in v0.1.2

func (r *Runner) ListAllJobs(ctx context.Context) ([]params.Job, error)

func (*Runner) ListAllPools

func (r *Runner) ListAllPools(ctx context.Context) ([]params.Pool, error)

func (*Runner) ListAllScaleSets

func (r *Runner) ListAllScaleSets(ctx context.Context) ([]params.ScaleSet, error)

func (*Runner) ListCredentials

func (r *Runner) ListCredentials(ctx context.Context) ([]params.ForgeCredentials, error)

func (*Runner) ListEnterpriseInstances

func (r *Runner) ListEnterpriseInstances(ctx context.Context, enterpriseID string) ([]params.Instance, error)

func (*Runner) ListEnterprisePools

func (r *Runner) ListEnterprisePools(ctx context.Context, enterpriseID string) ([]params.Pool, error)

func (*Runner) ListEnterprises

func (r *Runner) ListEnterprises(ctx context.Context, filter params.EnterpriseFilter) ([]params.Enterprise, error)

func (*Runner) ListEntityScaleSets

func (r *Runner) ListEntityScaleSets(ctx context.Context, entityType params.ForgeEntityType, entityID string) ([]params.ScaleSet, error)

func (*Runner) ListGiteaCredentials

func (r *Runner) ListGiteaCredentials(ctx context.Context) ([]params.ForgeCredentials, error)

func (*Runner) ListGiteaEndpoints

func (r *Runner) ListGiteaEndpoints(ctx context.Context) ([]params.ForgeEndpoint, error)

func (*Runner) ListGithubEndpoints added in v0.1.5

func (r *Runner) ListGithubEndpoints(ctx context.Context) ([]params.ForgeEndpoint, error)

func (*Runner) ListOrgInstances

func (r *Runner) ListOrgInstances(ctx context.Context, orgID string) ([]params.Instance, error)

func (*Runner) ListOrgPools

func (r *Runner) ListOrgPools(ctx context.Context, orgID string) ([]params.Pool, error)

func (*Runner) ListOrganizations

func (r *Runner) ListOrganizations(ctx context.Context, filter params.OrganizationFilter) ([]params.Organization, error)

func (*Runner) ListPoolInstances

func (r *Runner) ListPoolInstances(ctx context.Context, poolID string) ([]params.Instance, error)

func (*Runner) ListProviders

func (r *Runner) ListProviders(ctx context.Context) ([]params.Provider, error)

func (*Runner) ListRepoInstances

func (r *Runner) ListRepoInstances(ctx context.Context, repoID string) ([]params.Instance, error)

func (*Runner) ListRepoPools

func (r *Runner) ListRepoPools(ctx context.Context, repoID string) ([]params.Pool, error)

func (*Runner) ListRepositories

func (r *Runner) ListRepositories(ctx context.Context, filter params.RepositoryFilter) ([]params.Repository, error)

func (*Runner) ListScaleSetInstances

func (r *Runner) ListScaleSetInstances(ctx context.Context, scalesetID uint) ([]params.Instance, error)

func (*Runner) ResolveForgeCredentialByName

func (r *Runner) ResolveForgeCredentialByName(ctx context.Context, credentialsName string) (params.ForgeCredentials, error)

func (*Runner) Start

func (r *Runner) Start() error

func (*Runner) Stop

func (r *Runner) Stop() error

func (*Runner) UninstallOrgWebhook added in v0.1.4

func (r *Runner) UninstallOrgWebhook(ctx context.Context, orgID string) error

func (*Runner) UninstallRepoWebhook added in v0.1.4

func (r *Runner) UninstallRepoWebhook(ctx context.Context, repoID string) error

func (*Runner) UpdateController added in v0.1.5

func (r *Runner) UpdateController(ctx context.Context, param params.UpdateControllerParams) (params.ControllerInfo, error)

UpdateController will update the controller settings.

func (*Runner) UpdateEnterprise

func (r *Runner) UpdateEnterprise(ctx context.Context, enterpriseID string, param params.UpdateEntityParams) (params.Enterprise, error)

func (*Runner) UpdateEnterprisePool

func (r *Runner) UpdateEnterprisePool(ctx context.Context, enterpriseID, poolID string, param params.UpdatePoolParams) (params.Pool, error)

func (*Runner) UpdateGiteaCredentials

func (r *Runner) UpdateGiteaCredentials(ctx context.Context, id uint, param params.UpdateGiteaCredentialsParams) (params.ForgeCredentials, error)

func (*Runner) UpdateGiteaEndpoint

func (r *Runner) UpdateGiteaEndpoint(ctx context.Context, name string, param params.UpdateGiteaEndpointParams) (params.ForgeEndpoint, error)

func (*Runner) UpdateGithubCredentials added in v0.1.5

func (r *Runner) UpdateGithubCredentials(ctx context.Context, id uint, param params.UpdateGithubCredentialsParams) (params.ForgeCredentials, error)

func (*Runner) UpdateGithubEndpoint added in v0.1.5

func (r *Runner) UpdateGithubEndpoint(ctx context.Context, name string, param params.UpdateGithubEndpointParams) (params.ForgeEndpoint, error)

func (*Runner) UpdateOrgPool

func (r *Runner) UpdateOrgPool(ctx context.Context, orgID, poolID string, param params.UpdatePoolParams) (params.Pool, error)

func (*Runner) UpdateOrganization

func (r *Runner) UpdateOrganization(ctx context.Context, orgID string, param params.UpdateEntityParams) (params.Organization, error)

func (*Runner) UpdatePoolByID

func (r *Runner) UpdatePoolByID(ctx context.Context, poolID string, param params.UpdatePoolParams) (params.Pool, error)

func (*Runner) UpdateRepoPool

func (r *Runner) UpdateRepoPool(ctx context.Context, repoID, poolID string, param params.UpdatePoolParams) (params.Pool, error)

func (*Runner) UpdateRepository

func (r *Runner) UpdateRepository(ctx context.Context, repoID string, param params.UpdateEntityParams) (params.Repository, error)

func (*Runner) UpdateScaleSetByID

func (r *Runner) UpdateScaleSetByID(ctx context.Context, scaleSetID uint, param params.UpdateScaleSetParams) (params.ScaleSet, error)

func (*Runner) UpdateSystemInfo added in v0.1.4

func (r *Runner) UpdateSystemInfo(ctx context.Context, param params.UpdateSystemInfoParams) error

func (*Runner) Wait

func (r *Runner) Wait() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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