Skip to content

Commit

Permalink
Use serverless-ci cluster pool (#134)
Browse files Browse the repository at this point in the history
* Migrate off openshift-ci cluster pool

* Only jobs requesting OCP 4.15 will use the existing cluster-pool
because its version is 4.15.
* Jobs that previously used openshift cluster-pools 4.14, 4.13, 4.12,
4.11 will now start clusters from scratch as there's no available
Serverless cluster pool for those versions.

* Switch from 4.14 to 4.15

Make use of the new cluster pool for Serverless.

* Use fast channel for non-candidate releases

* Enhance unit tests

* Inline the openshift variant

* Add comments about cluster profiles and pools
  • Loading branch information
mgencur committed Mar 21, 2024
1 parent 19a4bff commit 04b1504
Show file tree
Hide file tree
Showing 11 changed files with 281 additions and 279 deletions.
2 changes: 1 addition & 1 deletion config/eventing-hyperfoil-benchmark.yaml
Expand Up @@ -2,7 +2,7 @@ config:
branches:
main:
openShiftVersions:
- version: "4.14"
- version: "4.15"
repositories:
- dockerfiles: {}
e2e:
Expand Down
10 changes: 5 additions & 5 deletions config/eventing-istio.yaml
Expand Up @@ -2,28 +2,28 @@ config:
branches:
release-next:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
release-v1.10:
openShiftVersions:
- skipCron: true
version: "4.14"
version: "4.15"
release-v1.11:
openShiftVersions:
- skipCron: true
version: "4.14"
version: "4.15"
- onDemand: true
skipCron: true
version: "4.12"
release-v1.12:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
release-v1.13:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
repositories:
Expand Down
10 changes: 5 additions & 5 deletions config/eventing-kafka-broker.yaml
Expand Up @@ -2,27 +2,27 @@ config:
branches:
release-next:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
release-v1.10:
openShiftVersions:
- skipCron: true
version: "4.14"
version: "4.15"
release-v1.11:
openShiftVersions:
- skipCron: true
version: "4.14"
version: "4.15"
- onDemand: true
version: "4.12"
release-v1.12:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
release-v1.13:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
repositories:
Expand Down
10 changes: 5 additions & 5 deletions config/eventing.yaml
Expand Up @@ -2,27 +2,27 @@ config:
branches:
release-next:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- version: "4.12"
release-v1.10:
openShiftVersions:
- skipCron: true
version: "4.14"
version: "4.15"
release-v1.11:
openShiftVersions:
- skipCron: true
version: "4.14"
version: "4.15"
- onDemand: true
skipCron: true
version: "4.12"
release-v1.12:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
release-v1.13:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
repositories:
Expand Down
12 changes: 6 additions & 6 deletions config/serverless-operator.yaml
Expand Up @@ -4,7 +4,7 @@ config:
openShiftVersions:
- cron: 0 3 * * *
generateCustomConfigs: true
version: "4.14"
version: "4.15"
- cron: 0 5 * * *
onDemand: true
version: "4.12"
Expand Down Expand Up @@ -137,18 +137,18 @@ repositories:
releaseBuildConfiguration:
base_images:
hypershift-operator:
name: "4.14"
name: "4.15"
namespace: ocp
tag: hypershift-operator
upi-installer:
name: "4.14"
name: "4.15"
namespace: ocp
tag: upi-installer
releases:
latest:
integration:
include_built_images: true
name: "4.14"
name: "4.15"
namespace: ocp
tests:
- as: e2e-hypershift-continuous
Expand Down Expand Up @@ -207,7 +207,7 @@ repositories:
cluster_profile: osd-ephemeral
env:
CLUSTER_DURATION: "10800"
CLUSTER_VERSION: "4.14"
CLUSTER_VERSION: "4.15"
COMPUTE_NODES: "4"
post:
- chain: gather
Expand Down Expand Up @@ -266,7 +266,7 @@ repositories:
releaseBuildConfiguration:
base_images:
upi-installer:
name: "4.14"
name: "4.15"
namespace: ocp
tag: upi-installer
tests:
Expand Down
8 changes: 4 additions & 4 deletions config/serving-net-istio.yaml
Expand Up @@ -2,22 +2,22 @@ config:
branches:
release-v1.10:
openShiftVersions:
- version: "4.14"
- version: "4.15"
release-v1.11:
openShiftVersions:
- skipCron: true
version: "4.14"
version: "4.15"
- onDemand: true
skipCron: true
version: "4.12"
release-v1.12:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
release-v1.13:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
repositories:
Expand Down
8 changes: 4 additions & 4 deletions config/serving-net-kourier.yaml
Expand Up @@ -3,22 +3,22 @@ config:
release-v1.10:
openShiftVersions:
- skipCron: true
version: "4.14"
version: "4.15"
release-v1.11:
openShiftVersions:
- skipCron: true
version: "4.14"
version: "4.15"
- onDemand: true
skipCron: true
version: "4.12"
release-v1.12:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
release-v1.13:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
repositories:
Expand Down
10 changes: 5 additions & 5 deletions config/serving.yaml
Expand Up @@ -2,7 +2,7 @@ config:
branches:
release-next:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
skipDockerFilesMatches:
Expand All @@ -13,22 +13,22 @@ config:
release-v1.10:
openShiftVersions:
- skipCron: true
version: "4.14"
version: "4.15"
release-v1.11:
openShiftVersions:
- skipCron: true
version: "4.14"
version: "4.15"
- onDemand: true
skipCron: true
version: "4.12"
release-v1.12:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
release-v1.13:
openShiftVersions:
- version: "4.14"
- version: "4.15"
- onDemand: true
version: "4.12"
repositories:
Expand Down
1 change: 1 addition & 0 deletions pkg/prowgen/prowgen_config.go
Expand Up @@ -189,6 +189,7 @@ func NewGenerateConfigs(ctx context.Context, r Repository, cc CommonConfig, opts
}},
}
}

cfg := cioperatorapi.ReleaseBuildConfiguration{
Metadata: metadata,
InputConfiguration: cioperatorapi.InputConfiguration{
Expand Down
69 changes: 44 additions & 25 deletions pkg/prowgen/prowgen_tests.go
Expand Up @@ -21,9 +21,21 @@ import (
)

const (
cronTemplate = "%d %d * * 2,6"
seed = 12345
cronTemplate = "%d %d * * 2,6"
seed = 12345
// Name of the cluster profile for starting new clusters from scratch.
// Introduced in https://github.com/openshift/ci-tools/pull/3978
serverlessClusterProfile = "aws-serverless"
// Name of a base domain that was created in a hosted zone with same name
// in AWS under rh-serverless account. The cluster profile defined earlier has permissions
// to create subdomains for new clusters.
devclusterBaseDomain = "serverless.devcluster.openshift.com"
// Holds version of the existing cluster pool dedicated to OpenShift Serverless in CI.
// See https://docs.ci.openshift.org/docs/how-tos/cluster-claim/#existing-cluster-pools
clusterPoolVersion = "4.15"
// Name of the owner for the existing cluster pool.
// Introduced in https://github.com/openshift/release/pull/49904
clusterPoolOwner = "serverless-ci"
)

func DiscoverTests(r Repository, openShift OpenShift, sourceImageName string, skipE2ETestMatch []string, random *rand.Rand) ReleaseBuildConfigurationOption {
Expand All @@ -48,27 +60,32 @@ func DiscoverTests(r Repository, openShift OpenShift, sourceImageName string, sk
testTimeout = &prowapi.Duration{Duration: 4 * time.Hour}
}

clusterClaim := &cioperatorapi.ClusterClaim{
Product: cioperatorapi.ReleaseProductOCP,
Version: openShift.Version,
Architecture: cioperatorapi.ReleaseArchitectureAMD64,
Cloud: cioperatorapi.CloudAWS,
Owner: "openshift-ci",
Timeout: &prowapi.Duration{Duration: time.Hour},
}
var clusterProfile cioperatorapi.ClusterProfile
workflow := pointer.String("generic-claim")
var env cioperatorapi.TestEnvironment
if openShift.CandidateRelease {
clusterClaim = nil
if strings.Contains(r.RepositoryDirectory(), "serverless-operator") {
// Use the shared profile for s-o.
clusterProfile = "aws"
} else {
clusterProfile = "aws-serverless"
env = map[string]string{
"BASE_DOMAIN": devclusterBaseDomain,
}
var (
clusterClaim *cioperatorapi.ClusterClaim
clusterProfile cioperatorapi.ClusterProfile
workflow *string
env cioperatorapi.TestEnvironment
)

useClusterPool := openShift.Version == clusterPoolVersion
// Make sure to use the existing cluster pool if available for the given OpenShift version.
if useClusterPool {
// ClusterClaim references the existing cluster pool.
// Mutually exclusive with ClusterProfile.
clusterClaim = &cioperatorapi.ClusterClaim{
Product: cioperatorapi.ReleaseProductOCP,
Version: openShift.Version,
Architecture: cioperatorapi.ReleaseArchitectureAMD64,
Cloud: cioperatorapi.CloudAWS,
Owner: clusterPoolOwner,
Timeout: &prowapi.Duration{Duration: time.Hour},
}
workflow = pointer.String("generic-claim")
} else {
// References the existing cluster profile in CI.
clusterProfile = serverlessClusterProfile
env = map[string]string{
"BASE_DOMAIN": devclusterBaseDomain,
}
workflow = pointer.String("ipi-aws")
}
Expand Down Expand Up @@ -154,7 +171,7 @@ func DiscoverTests(r Repository, openShift OpenShift, sourceImageName string, sk
},
}

if openShift.CandidateRelease {
if !useClusterPool {
testConfiguration.MultiStageTestConfiguration.Post =
append(testConfiguration.MultiStageTestConfiguration.Post,
cioperatorapi.TestStep{
Expand Down Expand Up @@ -187,7 +204,9 @@ func DiscoverTests(r Repository, openShift OpenShift, sourceImageName string, sk
}
// Periodic jobs gather artifacts on both failure/success.
for _, postStep := range cronTestConfiguration.MultiStageTestConfiguration.Post {
postStep.OptionalOnSuccess = pointer.Bool(false)
if postStep.LiteralTestStep != nil && strings.Contains(postStep.LiteralTestStep.As, "gather") {
postStep.OptionalOnSuccess = pointer.Bool(false)
}
}
cfg.Tests = append(cfg.Tests, *cronTestConfiguration)
}
Expand Down

0 comments on commit 04b1504

Please sign in to comment.