Skip to content

Commit

Permalink
Merge pull request kubernetes#16268 from borg-land/boskos-patches
Browse files Browse the repository at this point in the history
Add `boskos-resource-type` flag to use different GCE projects for scale/gpu testing
  • Loading branch information
k8s-ci-robot authored Jan 27, 2024
2 parents e5c4fe8 + 325ecd4 commit 825e9cc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
9 changes: 4 additions & 5 deletions tests/e2e/kubetest2-kops/deployer/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"os"
"path/filepath"
"strings"
"time"

"k8s.io/klog/v2"
"k8s.io/kops/tests/e2e/kubetest2-kops/gce"
Expand Down Expand Up @@ -72,17 +71,17 @@ func (d *deployer) initialize() error {
if d.GCPProject == "" {
klog.V(1).Info("No GCP project provided, acquiring from Boskos")

boskosClient, err := boskos.NewClient("http://boskos.test-pods.svc.cluster.local.")
boskosClient, err := boskos.NewClient(d.BoskosLocation)
if err != nil {
return fmt.Errorf("failed to make boskos client: %s", err)
}
d.boskos = boskosClient

resource, err := boskos.Acquire(
d.boskos,
"gce-project",
5*time.Minute,
5*time.Minute,
d.BoskosResourceType,
d.BoskosAcquireTimeout,
d.BoskosHeartbeatInterval,
d.boskosHeartbeatClose,
)
if err != nil {
Expand Down
18 changes: 12 additions & 6 deletions tests/e2e/kubetest2-kops/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ type deployer struct {

// boskos struct field will be non-nil when the deployer is
// using boskos to acquire a GCP project
boskos *client.Client

boskos *client.Client
BoskosLocation string `flag:"boskos-location" desc:"If set, manually specifies the location of the Boskos server."`
BoskosAcquireTimeout time.Duration `flag:"boskos-acquire-timeout" desc:"How long should boskos wait to acquire a resource before timing out"`
BoskosHeartbeatInterval time.Duration `flag:"boskos-heartbeat-interval" desc:"How often should boskos send a heartbeat to Boskos to hold the acquired resource. 0 means no heartbeat."`
BoskosResourceType string `flag:"boskos-resource-type" desc:"If set, manually specifies the resource type of GCP projects to acquire from Boskos."`
// this channel serves as a signal channel for the hearbeat goroutine
// so that it can be explicitly closed
boskosHeartbeatClose chan struct{}
Expand All @@ -118,11 +121,14 @@ func New(opts types.Options) (types.Deployer, *pflag.FlagSet) {
BuildOptions: &builder.BuildOptions{
BuildKubernetes: false,
},
boskosHeartbeatClose: make(chan struct{}),
ValidationCount: 10,
ValidationInterval: 10 * time.Second,
boskosHeartbeatClose: make(chan struct{}),
ValidationCount: 10,
ValidationInterval: 10 * time.Second,
BoskosLocation: "http://boskos.test-pods.svc.cluster.local.",
BoskosResourceType: "gce-project",
BoskosAcquireTimeout: 5 * time.Minute,
BoskosHeartbeatInterval: 5 * time.Minute,
}

dir, err := defaultArtifactsDir()
if err != nil {
klog.Fatalf("unable to determine artifacts directory: %v", err)
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/kubetest2-kops/deployer/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ func (d *deployer) createCluster(zones []string, adminAccess string, yes bool) e
args = appendIfUnset(args, "--project", d.GCPProject)
}
// set some sane default e2e testing behaviour on gce
args = appendIfUnset(args, "--gce-service-account", "default")
args = appendIfUnset(args, "--networking", "kubenet")
args = appendIfUnset(args, "--node-volume-size", "100")

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/scenarios/build/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ kubetest2 kops -v=6 \
--up --down --build --build-kubernetes=true --target-build-arch=linux/amd64 \
--cloud-provider=gce --admin-access=0.0.0.0/0 \
--kops-version-marker=https://storage.googleapis.com/kops-ci/bin/latest-ci.txt \
--create-args "--networking=kubenet --set=spec.nodeProblemDetector.enabled=true" \
--create-args "--gce-service-account=default --networking=kubenet --set=spec.nodeProblemDetector.enabled=true" \
--test=kops \
-- \
--ginkgo-args="--debug" \
Expand Down

0 comments on commit 825e9cc

Please sign in to comment.