constants

package module
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

README

GitHub release CI PkgGoDev Go Report Card

meows

meows is a Kubernetes controller for GitHub Actions self-hosted runners. You can run jobs in your GitHub Actions workflows on your Kubernetes cluster with meows.

Project Status: Initial development

Supported software

  • Kubernetes: 1.24, 1.25, 1.26

Features

  • Run a self-hosted runner on a pod
    • meows runs the GitHub Actions Runner on a pod. It allows you to use a pod as a self-hosted runner.
    • The pod spec is customizable. E.g., labels, annotations, environment variables, volumes, and other specs are customizable. So you can prepare any environment you want.
    • We call the pod runner pod :)
  • Pool and maintain some runners and runner pods
    • meows prepares multiple runner pods as you specified. It allows you to pool various runners and reduce Actions job clagging.
  • Run GitHub Actions jobs in the clean environment
    • meows only runs one job on a single runner pod. When a job in a runner pod gets finished, meows will delete the pod and create a new one. So you can always run a job on a clean runner pod.
  • Extend the lifetimes of runner pods
    • When a job has finished, meows will delete the assigned runner pod after a while. But if necessary, you can extend the lifetime of the runner pod. For example, it enables you to investigate a failed job.
    • Currently, you can only extend it if a job has failed.

Documentation

docs directory contains documents about designs and specifications.

Docker images

Docker images are available on Quay.io

Documentation

Index

Constants

View Source
const (
	RunnerSecretExpiresAtAnnotationKey = "meows.cybozu.com/expires-at"

	// RunnerPoolFinalizer is a finalizer for runnerpool resource.
	RunnerPoolFinalizer = "meows.cybozu.com/runnerpool"

	// AppNameLabelKey is a label key for application name.
	AppNameLabelKey = "app.kubernetes.io/name"

	// AppComponentLabelKey is a label key for the component.
	AppComponentLabelKey = "app.kubernetes.io/component"

	// AppInstanceLabelKey is a label key for the instance name.
	AppInstanceLabelKey = "app.kubernetes.io/instance"

	// RunnerPodName is the label key to select individual pod.
	RunnerPodName = "meows.cybozu.com/runner-pod-name"
)

Metadata keys

View Source
const (
	// AppName is the application name.
	AppName = "meows"

	// AppComponentRunner is the component name for runner.
	AppComponentRunner = "runner"
)
View Source
const (
	// RunnerListenPort is the port number for runner container.
	RunnerListenPort = 8080

	// RunnerMetricsPortName is the port name for runner container.
	RunnerMetricsPortName = "metrics"
)

Container ports

View Source
const (
	// DeletionTimeEndpoint is the endpoint to get deletion time for runner container.
	DeletionTimeEndpoint = "deletion_time"

	// StatusEndPoint is the endpoint to get status of a runner pod.
	StatusEndPoint = "status"
)

Container endpoints

View Source
const (
	RunnerPodStateInitializing = "initializing"
	RunnerPodStateRunning      = "running"
	RunnerPodStateDebugging    = "debugging"
	RunnerPodStateStale        = "stale"
)

Runner pods state.

View Source
const (
	ListenerExitStateRetryableError = "retryable_error"
	ListenerExitStateUpdating       = "updating"
	ListenerExitStateUndefined      = "undefined"
)

Exit state of Actions Listener.

View Source
const (
	// OptionConfigMapName is a configmap name for the controller option.
	OptionConfigMapName = "meows-cm"

	// Data keys for controller option.
	OptionConfigMapDataOrganizationRule = "organization-rule"
	OptionConfigMapDataRepositoryRule   = "repository-rule"
)

Constants for controller option configmap.

View Source
const (
	// DefaultCredentialSecretName is the default secret name for GitHub credential secret.
	DefaultCredentialSecretName = "meows-github-cred"

	// Data keys for GitHub App's credential.
	CredentialSecretDataAppID             = "app-id"
	CredentialSecretDataAppInstallationID = "app-installation-id"
	CredentialSecretDataAppPrivateKey     = "app-private-key"

	// Data keys for GitHub personal access token (PAT).
	CredentialSecretDataPATToken = "token"
)

Constants for GitHub credential secret.

View Source
const (
	// RunnerRootDirPath is a directory path where GitHub Actions Runner will be installed.
	RunnerRootDirPath = "/runner"

	// RunnerWorkDirPath is a working directory path for job execution.
	RunnerWorkDirPath = "/runner/_work"

	// RunnerVarDirPath is a directory path for storing variable files.
	RunnerVarDirPath = "/var/meows"

	// SlackChannelFilePath is a file path for the Slack channel to be notified.
	SlackChannelFilePath = RunnerVarDirPath + "/slack_channel"

	// SecretsDirName is a directory name for storing secret files.
	SecretsDirName = "secrets"

	// RunnerTokenFileName is a file name for GitHub registration token.
	RunnerTokenFileName = "runnertoken"
)

Directory path for runner pods.

View Source
const (
	// PodNameEnvName is a env field key for POD_NAME.
	PodNameEnvName = "POD_NAME"

	// PodNamespaceEnvName is a env field key for POD_NAMESPACE.
	PodNamespaceEnvName = "POD_NAMESPACE"

	// RunnerOrgEnvName is a env field key for RUNNER_ORG.
	RunnerOrgEnvName = "RUNNER_ORG"

	// RunnerRepoEnvName is a env field key for RUNNER_REPO.
	RunnerRepoEnvName = "RUNNER_REPO"

	// RunnerPoolNameEnvName is a env field key for RUNNER_POOL_NAME.
	RunnerPoolNameEnvName = "RUNNER_POOL_NAME"

	// RunnerOptionEnvName is a env field key for RUNNER_OPTION
	RunnerOptionEnvName = "RUNNER_OPTION"

	// SlackChannelEnvName is a env field key for MEOWS_SLACK_CHANNEL
	SlackChannelEnvName = "MEOWS_SLACK_CHANNEL"
)

Environment variables

View Source
const (
	DefaultSlackAgentServiceName = "slack-agent.meows.svc"
)
View Source
const (
	// RunnerContainerName is a container name which runs GitHub Actions runner.
	RunnerContainerName = "runner"
)

Container names

View Source
const (
	// Version is the meows version.
	Version = "0.11.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the meows v1alpha1 API group +kubebuilder:object:generate=true +groupName=meows.cybozu.com
Package v1alpha1 contains API Schema definitions for the meows v1alpha1 API group +kubebuilder:object:generate=true +groupName=meows.cybozu.com
cmd

Jump to

Keyboard shortcuts

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