Changes to folder structure to allow multigroups and changed go mod name (#2105)

* Changed folder structure to allow multi group registration

* included actions.github.com directory for resources and controllers

* updated go module to actions/actions-runner-controller

* publish arc packages under actions-runner-controller

* Update charts/actions-runner-controller/docs/UPGRADING.md

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
This commit is contained in:
Nikola Jokic
2022-12-28 01:38:34 +01:00
committed by GitHub
parent 086f9fd2d6
commit aa6dab5a9a
113 changed files with 226 additions and 226 deletions

View File

View File

@@ -8,9 +8,9 @@ import (
"strconv"
"strings"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
prometheus_metrics "github.com/actions-runner-controller/actions-runner-controller/controllers/metrics"
arcgithub "github.com/actions-runner-controller/actions-runner-controller/github"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
prometheus_metrics "github.com/actions/actions-runner-controller/controllers/actions.summerwind.net/metrics"
arcgithub "github.com/actions/actions-runner-controller/github"
"github.com/google/go-github/v47/github"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -34,7 +34,7 @@ func (r *HorizontalRunnerAutoscalerReconciler) suggestDesiredReplicas(ghc *arcgi
numMetrics := len(metrics)
if numMetrics == 0 {
// We don't default to anything since ARC 0.23.0
// See https://github.com/actions-runner-controller/actions-runner-controller/issues/728
// See https://github.com/actions/actions-runner-controller/issues/728
return nil, nil
} else if numMetrics > 2 {
return nil, fmt.Errorf("too many autoscaling metrics configured: It must be 0 to 2, but got %d", numMetrics)
@@ -99,7 +99,7 @@ func (r *HorizontalRunnerAutoscalerReconciler) suggestReplicasByQueuedAndInProgr
// In case it's an organizational runners deployment without any scaling metrics defined,
// we assume that the desired replicas should always be `minReplicas + capacityReservedThroughWebhook`.
// See https://github.com/actions-runner-controller/actions-runner-controller/issues/377#issuecomment-793372693
// See https://github.com/actions/actions-runner-controller/issues/377#issuecomment-793372693
if metrics == nil {
return nil, nil
}

View File

@@ -7,9 +7,9 @@ import (
"net/url"
"testing"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions-runner-controller/actions-runner-controller/github"
"github.com/actions-runner-controller/actions-runner-controller/github/fake"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/actions/actions-runner-controller/github"
"github.com/actions/actions-runner-controller/github/fake"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"

View File

@@ -61,7 +61,7 @@ const (
// In case it actually took more than DefaultRunnerPodRecreationDelayAfterWebhookScale for the workflow_job completion event to arrive,
// ARC will recreate the completed runner(s), assuming something went wrong in either GitHub, your K8s cluster, or ARC, so ARC needs to resync anyway.
//
// See https://github.com/actions-runner-controller/actions-runner-controller/pull/1180
// See https://github.com/actions/actions-runner-controller/pull/1180
DefaultRunnerPodRecreationDelayAfterWebhookScale = 10 * time.Minute
EnvVarRunnerName = "RUNNER_NAME"

View File

@@ -6,7 +6,7 @@ import (
"sync"
"time"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/go-logr/logr"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

View File

@@ -36,9 +36,9 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions-runner-controller/actions-runner-controller/github"
"github.com/actions-runner-controller/actions-runner-controller/simulator"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/actions/actions-runner-controller/github"
"github.com/actions/actions-runner-controller/simulator"
)
const (

View File

@@ -12,7 +12,7 @@ import (
"testing"
"time"
actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
actionsv1alpha1 "github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/go-logr/logr"
"github.com/google/go-github/v47/github"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

View File

@@ -35,9 +35,9 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions-runner-controller/actions-runner-controller/controllers/metrics"
arcgithub "github.com/actions-runner-controller/actions-runner-controller/github"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/actions/actions-runner-controller/controllers/actions.summerwind.net/metrics"
arcgithub "github.com/actions/actions-runner-controller/github"
)
const (

View File

@@ -7,10 +7,10 @@ import (
"net/http/httptest"
"time"
github2 "github.com/actions-runner-controller/actions-runner-controller/github"
github2 "github.com/actions/actions-runner-controller/github"
"github.com/google/go-github/v47/github"
"github.com/actions-runner-controller/actions-runner-controller/github/fake"
"github.com/actions/actions-runner-controller/github/fake"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
@@ -23,7 +23,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
actionsv1alpha1 "github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
)
type testEnvironment struct {

View File

@@ -1,7 +1,7 @@
package metrics
import (
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/prometheus/client_golang/prometheus"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

View File

@@ -1,7 +1,7 @@
package metrics
import (
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/prometheus/client_golang/prometheus"
)

View File

@@ -1,7 +1,7 @@
package metrics
import (
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/prometheus/client_golang/prometheus"
)

View File

@@ -9,8 +9,8 @@ import (
"strconv"
"sync"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions-runner-controller/actions-runner-controller/github"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/actions/actions-runner-controller/github"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"

View File

@@ -3,8 +3,8 @@ package controllers
import (
"testing"
arcv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions-runner-controller/actions-runner-controller/github"
arcv1alpha1 "github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/actions/actions-runner-controller/github"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"

View File

@@ -25,7 +25,7 @@ import (
"strings"
"time"
"github.com/actions-runner-controller/actions-runner-controller/hash"
"github.com/actions/actions-runner-controller/hash"
"github.com/go-logr/logr"
kerrors "k8s.io/apimachinery/pkg/api/errors"
@@ -39,7 +39,7 @@ import (
rbacv1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
)
const (
@@ -498,7 +498,7 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
// A registered runner's session and the a registration token seem to have two different and independent
// lifecycles.
//
// See https://github.com/actions-runner-controller/actions-runner-controller/issues/143 for more context.
// See https://github.com/actions/actions-runner-controller/issues/143 for more context.
labels[LabelKeyPodTemplateHash] = hash.FNVHashStringObjects(
filterLabels(runner.ObjectMeta.Labels, LabelKeyRunnerTemplateHash),
runner.ObjectMeta.Annotations,
@@ -1049,7 +1049,7 @@ func newRunnerPodWithContainerMode(containerMode string, template corev1.Pod, ru
}...)
// Determine the volume mounts assigned to the docker sidecar. In case extra mounts are included in the RunnerSpec, append them to the standard
// set of mounts. See https://github.com/actions-runner-controller/actions-runner-controller/issues/435 for context.
// set of mounts. See https://github.com/actions/actions-runner-controller/issues/435 for context.
dockerVolumeMounts := []corev1.VolumeMount{
{
Name: runnerVolumeName,
@@ -1126,7 +1126,7 @@ func newRunnerPodWithContainerMode(containerMode string, template corev1.Pod, ru
//
// br-c5bf6c172bd7 is the interface that corresponds to the docker network created with docker-create-network.
// We have another ARC feature to inherit the host's MTU to the docker networks:
// https://github.com/actions-runner-controller/actions-runner-controller/pull/1201
// https://github.com/actions/actions-runner-controller/pull/1201
//
// docker's MTU is updated to the specified MTU once any container is created.
// You can verity that by running a random container from within the runner or dockerd containers:

View File

@@ -7,7 +7,7 @@ import (
"strconv"
"time"
"github.com/actions-runner-controller/actions-runner-controller/github"
"github.com/actions/actions-runner-controller/github"
"github.com/go-logr/logr"
gogithub "github.com/google/go-github/v47/github"
corev1 "k8s.io/api/core/v1"
@@ -173,7 +173,7 @@ func ensureRunnerUnregistration(ctx context.Context, retryDelay time.Duration, l
}
// Prevent runner pod from stucking in Terminating.
// See https://github.com/actions-runner-controller/actions-runner-controller/issues/1369
// See https://github.com/actions/actions-runner-controller/issues/1369
log.Info("Deleting runner pod anyway because it has stopped prematurely. This may leave a dangling runner resource in GitHub Actions",
"lastState.exitCode", lts.ExitCode,
"lastState.message", lts.Message,
@@ -258,7 +258,7 @@ func ensureRunnerUnregistration(ctx context.Context, retryDelay time.Duration, l
log.V(2).Info("Retrying runner unregistration because the static runner is still busy")
// Otherwise we may end up spamming 422 errors,
// each call consuming GitHub API rate limit
// https://github.com/actions-runner-controller/actions-runner-controller/pull/1167#issuecomment-1064213271
// https://github.com/actions/actions-runner-controller/pull/1167#issuecomment-1064213271
return &ctrl.Result{RequeueAfter: retryDelay}, nil
}
@@ -444,7 +444,7 @@ func unregisterRunner(ctx context.Context, client *github.Client, enterprise, or
// # NOTES
//
// - It can be "status=offline" at the same time but that's another story.
// - After https://github.com/actions-runner-controller/actions-runner-controller/pull/1127, ListRunners responses that are used to
// - After https://github.com/actions/actions-runner-controller/pull/1127, ListRunners responses that are used to
// determine if the runner is busy can be more outdated than before, as those responeses are now cached for 60 seconds.
// - Note that 60 seconds is controlled by the Cache-Control response header provided by GitHub so we don't have a strict control on it but we assume it won't
// change from 60 seconds.

View File

@@ -3,7 +3,7 @@ package controllers
import corev1 "k8s.io/api/core/v1"
// Force the runner pod managed by either RunnerDeployment and RunnerSet to have restartPolicy=Never.
// See https://github.com/actions-runner-controller/actions-runner-controller/issues/1369 for more context.
// See https://github.com/actions/actions-runner-controller/issues/1369 for more context.
//
// This is to prevent runner pods from stucking in Terminating when a K8s node disappeared along with the runnr pod and the runner container within it.
//

View File

@@ -32,7 +32,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
arcv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
arcv1alpha1 "github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
corev1 "k8s.io/api/core/v1"
)

View File

@@ -6,7 +6,7 @@ import (
"sort"
"time"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/go-logr/logr"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
@@ -179,7 +179,7 @@ func getPodsForOwner(ctx context.Context, c client.Client, log logr.Logger, o cl
"Runner failed to register itself to GitHub in timely manner. "+
"Recreating the pod to see if it resolves the issue. "+
"CAUTION: If you see this a lot, you should investigate the root cause. "+
"See https://github.com/actions-runner-controller/actions-runner-controller/issues/288",
"See https://github.com/actions/actions-runner-controller/issues/288",
"creationTimestamp", pod.CreationTimestamp,
"readyTransitionTime", podConditionTransitionTime(&pod, corev1.PodReady, corev1.ConditionTrue),
"configuredRegistrationTimeout", registrationTimeout,
@@ -488,7 +488,7 @@ func collectPodsForOwners(ctx context.Context, c client.Client, log logr.Logger,
// lastSyncTime becomes non-nil only when there are one or more owner(s) hence there are same number of runner pods.
// It's used to prevent runnerset-controller from recreating "completed ephemeral runners".
// This is needed to prevent runners from being terminated prematurely.
// See https://github.com/actions-runner-controller/actions-runner-controller/issues/911 for more context.
// See https://github.com/actions/actions-runner-controller/issues/911 for more context.
//
// This becomes nil when there are zero statefulset(s). That's fine because then there should be zero stateful(s) to be recreated either hence
// we don't need to guard with lastSyncTime.

View File

@@ -37,8 +37,8 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions-runner-controller/actions-runner-controller/controllers/metrics"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/actions/actions-runner-controller/controllers/actions.summerwind.net/metrics"
)
const (
@@ -158,7 +158,7 @@ func (r *RunnerDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Req
// A selector update change doesn't trigger replicaset replacement,
// but we still need to update the existing replicaset with it.
// Otherwise selector-based runner query will never work on replicasets created before the controller v0.17.0
// See https://github.com/actions-runner-controller/actions-runner-controller/pull/355#discussion_r585379259
// See https://github.com/actions/actions-runner-controller/pull/355#discussion_r585379259
if err := r.Client.Update(ctx, updateSet); err != nil {
log.Error(err, "Failed to update runnerreplicaset resource")
@@ -183,7 +183,7 @@ func (r *RunnerDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Req
// Please add more conditions that we can in-place update the newest runnerreplicaset without disruption
//
// If we missed taking the EffectiveTime diff into account, you might end up experiencing scale-ups being delayed scale-down.
// See https://github.com/actions-runner-controller/actions-runner-controller/pull/1477#issuecomment-1164154496
// See https://github.com/actions/actions-runner-controller/pull/1477#issuecomment-1164154496
var et1, et2 time.Time
if newestSet.Spec.EffectiveTime != nil {
et1 = newestSet.Spec.EffectiveTime.Time

View File

@@ -20,7 +20,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
actionsv1alpha1 "github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
)
func TestNewRunnerReplicaSet(t *testing.T) {

View File

@@ -31,7 +31,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
)
// RunnerReplicaSetReconciler reconciles a Runner object

View File

@@ -16,8 +16,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions-runner-controller/actions-runner-controller/github/fake"
actionsv1alpha1 "github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/actions/actions-runner-controller/github/fake"
)
var (

View File

@@ -31,8 +31,8 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions-runner-controller/actions-runner-controller/controllers/metrics"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/actions/actions-runner-controller/controllers/actions.summerwind.net/metrics"
"github.com/go-logr/logr"
)

View File

@@ -26,7 +26,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
actionsv1alpha1 "github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -66,7 +66,7 @@ var _ = BeforeSuite(func(done Done) {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
CRDDirectoryPaths: []string{filepath.Join("../..", "config", "crd", "bases")},
KubeAPIServerFlags: apiServerFlags,
}

View File

@@ -5,7 +5,7 @@ import (
"fmt"
"time"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
"github.com/go-logr/logr"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"

View File

@@ -4,7 +4,7 @@ import (
"reflect"
"testing"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions/actions-runner-controller/apis/actions.summerwind.net/v1alpha1"
corev1 "k8s.io/api/core/v1"
)