Skip to content

Commit e9f048d

Browse files
Merge pull request #3560 from smg247/synthetic-config
NO-JIRA: Move synthetic release flag from BigQuery to config
2 parents f190e5b + d20769e commit e9f048d

13 files changed

Lines changed: 349 additions & 512 deletions

File tree

Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,5 @@ e2e:
8787
images:
8888
$(DOCKER) build .
8989

90-
# Requires BigQuery credentials to determine which releases are synthetic (see
91-
# the Synthetic column on the Releases table). Set GOOGLE_APPLICATION_CREDENTIALS
92-
# to a service account key file, e.g.:
93-
# GOOGLE_APPLICATION_CREDENTIALS=path/to/key.json make update-variants
94-
BIGQUERY_PROJECT ?= openshift-ci-data-analysis
9590
update-variants: sippy
96-
./sippy variants snapshot --config ./config/openshift.yaml --views ./config/views.yaml --bigquery-project $(BIGQUERY_PROJECT)
91+
./sippy variants snapshot --config ./config/openshift.yaml --views ./config/views.yaml

cmd/sippy/load.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ func (f *LoadFlags) prowLoader(ctx context.Context, dbc *db.DB, sippyConfig *v1.
440440
}
441441
}
442442

443-
syntheticReleaseJobOverrides, err := variantregistry.BuildSyntheticReleaseJobOverrides(sippyConfig.Releases, releaseConfigs)
443+
syntheticReleaseJobOverrides, err := variantregistry.BuildSyntheticReleaseJobOverrides(sippyConfig.Releases)
444444
if err != nil {
445445
return nil, fmt.Errorf("error building synthetic release job overrides: %w", err)
446446
}

cmd/sippy/variants_generate.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"time"
99

1010
"cloud.google.com/go/bigquery"
11-
"github.com/openshift/sippy/pkg/api"
1211
bqcachedclient "github.com/openshift/sippy/pkg/bigquery"
1312
"github.com/pkg/errors"
1413
log "github.com/sirupsen/logrus"
@@ -101,15 +100,7 @@ func NewVariantsGenerateCommand() *cobra.Command {
101100

102101
opCtx, ctx := bqcachedclient.OpCtxForCronEnv(ctx, "variants generate")
103102

104-
bqClient, err := f.BigQueryFlags.GetBigQueryClient(ctx, opCtx, nil, f.GoogleCloudFlags.ServiceAccountCredentialFile)
105-
if err != nil {
106-
return errors.Wrap(err, "error getting BigQuery client for releases")
107-
}
108-
releaseConfigs, err := api.GetReleasesFromBigQuery(ctx, bqClient)
109-
if err != nil {
110-
return errors.Wrap(err, "error loading releases from BigQuery")
111-
}
112-
syntheticReleaseJobOverrides, err := variantregistry.BuildSyntheticReleaseJobOverrides(config.Releases, releaseConfigs)
103+
syntheticReleaseJobOverrides, err := variantregistry.BuildSyntheticReleaseJobOverrides(config.Releases)
113104
if err != nil {
114105
return errors.Wrap(err, "error building synthetic release job overrides")
115106
}

cmd/sippy/variants_snapshot.go

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
package main
22

33
import (
4-
"context"
54
"fmt"
6-
"time"
75

8-
"github.com/openshift/sippy/pkg/api"
9-
bqcachedclient "github.com/openshift/sippy/pkg/bigquery"
106
log "github.com/sirupsen/logrus"
117
"github.com/spf13/cobra"
128
"github.com/spf13/pflag"
@@ -18,25 +14,19 @@ import (
1814

1915
type VariantSnapshotFlags struct {
2016
Path string
21-
BigQueryFlags *flags.BigQueryFlags
22-
GoogleCloudFlags *flags.GoogleCloudFlags
2317
ConfigFlags *configflags.ConfigFlags
2418
ComponentReadinessFlags *flags.ComponentReadinessFlags
2519
}
2620

2721
func NewVariantSnapshotFlags() *VariantSnapshotFlags {
2822
return &VariantSnapshotFlags{
29-
BigQueryFlags: flags.NewBigQueryFlags(),
30-
GoogleCloudFlags: flags.NewGoogleCloudFlags(),
3123
ConfigFlags: configflags.NewConfigFlags(),
3224
ComponentReadinessFlags: flags.NewComponentReadinessFlags(),
3325
Path: "pkg/variantregistry/snapshot.yaml",
3426
}
3527
}
3628

3729
func (f *VariantSnapshotFlags) BindFlags(fs *pflag.FlagSet) {
38-
f.BigQueryFlags.BindFlags(fs)
39-
f.GoogleCloudFlags.BindFlags(fs)
4030
f.ConfigFlags.BindFlags(fs)
4131
f.ComponentReadinessFlags.BindFlags(fs)
4232
fs.StringVar(&f.Path, "out", f.Path, "Path to write results to")
@@ -53,24 +43,12 @@ func NewVariantSnapshotCommand() *cobra.Command {
5343
return fmt.Errorf("--config is required")
5444
}
5545

56-
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*10)
57-
defer cancel()
58-
5946
cfg, err := f.ConfigFlags.GetConfig()
6047
if err != nil {
6148
return err
6249
}
6350

64-
opCtx, ctx := bqcachedclient.OpCtxForCronEnv(ctx, "variants snapshot")
65-
bqClient, err := f.BigQueryFlags.GetBigQueryClient(ctx, opCtx, nil, f.GoogleCloudFlags.ServiceAccountCredentialFile)
66-
if err != nil {
67-
return fmt.Errorf("error getting BigQuery client: %w", err)
68-
}
69-
releaseConfigs, err := api.GetReleasesFromBigQuery(ctx, bqClient)
70-
if err != nil {
71-
return fmt.Errorf("error loading releases from BigQuery: %w", err)
72-
}
73-
syntheticReleaseJobOverrides, err := variantregistry.BuildSyntheticReleaseJobOverrides(cfg.Releases, releaseConfigs)
51+
syntheticReleaseJobOverrides, err := variantregistry.BuildSyntheticReleaseJobOverrides(cfg.Releases)
7452
if err != nil {
7553
return fmt.Errorf("error building synthetic release job overrides: %w", err)
7654
}

config/openshift-customizations.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@ releases:
1414
- "^pull-ci-openshift-online.*-(master|main).*-(verify|unit).*"
1515
- "^pull-ci-Azure-ARO-HCP-main.*"
1616
aro-integration:
17+
synthetic: true
1718
jobs:
1819
periodic-ci-Azure-ARO-HCP-main-periodic-integration-e2e-parallel: true
1920
periodic-ci-Azure-ARO-HCP-main-periodic-integration-e2e-parallel-ocp-nightly: true
2021
branch-ci-Azure-ARO-HCP-main-e2e-integration-e2e-parallel: true
2122
aro-stage:
23+
synthetic: true
2224
jobs:
2325
periodic-ci-Azure-ARO-HCP-main-periodic-stage-e2e-parallel: true
2426
periodic-ci-Azure-ARO-HCP-main-periodic-stage-e2e-parallel-ocp-nightly: true
2527
branch-ci-Azure-ARO-HCP-main-e2e-stage-e2e-parallel: true
2628
aro-production:
29+
synthetic: true
2730
jobs:
2831
periodic-ci-Azure-ARO-HCP-main-periodic-prod-e2e-parallel: true
2932
periodic-ci-Azure-ARO-HCP-main-periodic-create-aro-hcp-in-prod-uksouth: true
@@ -33,27 +36,31 @@ releases:
3336
periodic-ci-Azure-ARO-HCP-main-periodic-prod-e2e-parallel-ocp-nightly: true
3437
branch-ci-Azure-ARO-HCP-main-e2e-prod-e2e-parallel: true
3538
aro-classic-integration:
39+
synthetic: true
3640
jobs:
3741
periodic-ci-Azure-ARO-RP-master-periodic-integration-e2e-parallel-csp: true
3842
periodic-ci-Azure-ARO-RP-master-periodic-integration-e2e-parallel-miwi: true
3943
branch-ci-Azure-ARO-RP-master-e2e-integration-e2e-parallel: true
4044
branch-ci-Azure-ARO-RP-master-e2e-integration-e2e-parallel-csp: true
4145
branch-ci-Azure-ARO-RP-master-e2e-integration-e2e-parallel-miwi: true
4246
aro-classic-stage:
47+
synthetic: true
4348
jobs:
4449
periodic-ci-Azure-ARO-RP-master-periodic-stage-e2e-parallel-csp: true
4550
periodic-ci-Azure-ARO-RP-master-periodic-stage-e2e-parallel-miwi: true
4651
branch-ci-Azure-ARO-RP-master-e2e-stage-e2e-parallel: true
4752
branch-ci-Azure-ARO-RP-master-e2e-stage-e2e-parallel-csp: true
4853
branch-ci-Azure-ARO-RP-master-e2e-stage-e2e-parallel-miwi: true
4954
aro-classic-production:
55+
synthetic: true
5056
jobs:
5157
periodic-ci-Azure-ARO-RP-master-periodic-prod-e2e-parallel-csp: true
5258
periodic-ci-Azure-ARO-RP-master-periodic-prod-e2e-parallel-miwi: true
5359
branch-ci-Azure-ARO-RP-master-e2e-prod-e2e-parallel: true
5460
branch-ci-Azure-ARO-RP-master-e2e-prod-e2e-parallel-csp: true
5561
branch-ci-Azure-ARO-RP-master-e2e-prod-e2e-parallel-miwi: true
5662
rosa-stage:
63+
synthetic: true
5764
jobs:
5865
periodic-ci-openshift-release-main-osd-conformance-aws-k8s-conformance: true
5966
regexp:
@@ -66,19 +73,24 @@ releases:
6673
# ROSA Classic/STS conformance (all versions)
6774
- "^periodic-ci-openshift-release-main-nightly-.*-e2e-rosa-sts-ovn$"
6875
rosa-integration:
76+
synthetic: true
6977
jobs: {}
7078
rosa-production:
79+
synthetic: true
7180
jobs: {}
7281
rrp-integration:
82+
synthetic: true
7383
jobs:
7484
periodic-ci-openshift-online-rosa-regional-platform-main-nightly-ephemeral: true
7585
periodic-ci-openshift-online-rosa-regional-platform-main-nightly-integration: true
7686
automation:
87+
synthetic: true
7788
jobs:
7889
periodic-ci-openshift-hypershift-main-periodic-jira-agent: true
7990
periodic-ci-openshift-hypershift-main-periodic-review-agent: true
8091
periodic-ci-openshift-release-main-claude-payload-agent: true
8192
periodic-prow-auto-sippy-config-generator: true
8293
ocp-hypershift:
94+
synthetic: true
8395
regexp:
8496
- "^periodic-ci-openshift-hypershift-.*-periodics-hcm-.*"

0 commit comments

Comments
 (0)