forked from kubernetes/test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure Gubernator using a static, external file
As other organizations begin to use Gubernator, the need to configure links, paths and defaults becomes greater. This patch introduces a static configuration file where this configuration can live. Mutliple mappings of organization to GCS bucket and Prow instance URL should be supported to allow for one Gubernator instance to serve valid data for multiple organizations' jobs. Signed-off-by: Steve Kuznetsov <[email protected]>
- Loading branch information
1 parent
cbf22fb
commit eb64cab
Showing
13 changed files
with
251 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
default_org: kubernetes | ||
default_repo: kubernetes | ||
external_services: | ||
istio: | ||
gcs_pull_prefix: istio-prow/pull | ||
prow_url: prow.istio.io | ||
kubernetes: | ||
gcs_pull_prefix: kubernetes-jenkins/pr-logs/pull | ||
prow_url: prow.k8s.io | ||
jobs: | ||
kubernetes-jenkins/logs/: | ||
- ci-kubernetes-e2e-gce-etcd3 | ||
- ci-kubernetes-e2e-gci-gce | ||
- ci-kubernetes-e2e-gci-gce-slow | ||
- ci-kubernetes-e2e-gci-gke | ||
- ci-kubernetes-e2e-gci-gke-slow | ||
- ci-kubernetes-kubemark-500-gce | ||
- ci-kubernetes-node-kubelet | ||
- ci-kubernetes-test-go | ||
- ci-kubernetes-verify-master | ||
- kubernetes-build | ||
- kubernetes-e2e-kops-aws | ||
kubernetes-jenkins/pr-logs/directory/: | ||
- pull-kubernetes-bazel-build | ||
- pull-kubernetes-bazel-test | ||
- pull-kubernetes-e2e-gce-bazel | ||
- pull-kubernetes-e2e-gce-etcd3 | ||
- pull-kubernetes-e2e-gce-gpu | ||
- pull-kubernetes-e2e-kops-aws | ||
- pull-kubernetes-federation-e2e-gce | ||
- pull-kubernetes-kubemark-e2e-gce | ||
- pull-kubernetes-node-e2e | ||
- pull-kubernetes-unit | ||
- pull-kubernetes-verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env python | ||
|
||
# Copyright 2017 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Updates the Gubernator configuration from the Prow configuration.""" | ||
|
||
import argparse | ||
import yaml | ||
|
||
def main(prow_config, gubernator_config): | ||
with open(prow_config) as prow_file: | ||
prow_data = yaml.load(prow_file) | ||
|
||
default_presubmits = [] | ||
for job in prow_data['presubmits']['kubernetes/kubernetes']: | ||
if job.get('always_run'): | ||
default_presubmits.append(job['name']) | ||
|
||
with open(gubernator_config) as gubernator_file: | ||
gubernator_data = yaml.load(gubernator_file) | ||
|
||
gubernator_data['jobs']['kubernetes-jenkins/pr-logs/directory/'] = default_presubmits | ||
|
||
with open(gubernator_config, 'w+') as gubernator_file: | ||
yaml.dump(gubernator_data, gubernator_file, default_flow_style=False, explicit_start=True) | ||
|
||
if __name__ == '__main__': | ||
PARSER = argparse.ArgumentParser() | ||
PARSER.add_argument('prow_config', help="Path to Prow configuration YAML.") | ||
PARSER.add_argument('gubernator_config', help="Path to Gubernator configuration YAML.") | ||
ARGS = PARSER.parse_args() | ||
main(ARGS.prow_config, ARGS.gubernator_config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# Copyright 2017 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This script updates the Gubernator configuration | ||
# file to keep it in sync with Prow. | ||
|
||
cd "$( dirname "${BASH_SOURCE[0]}" )" | ||
./update_config.py ./../prow/config.yaml ./config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
# Copyright 2017 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This script verifies the Gubernator configuration | ||
# file is in sync with Prow. | ||
|
||
cd "$( dirname "${BASH_SOURCE[0]}" )" | ||
config="$( mktemp )" | ||
trap "rm ${config}" EXIT | ||
|
||
cp ./config.yaml "${config}" | ||
./update_config.py ./../prow/config.yaml "${config}" | ||
|
||
if ! output="$( diff ./config.yaml "${config}" )"; then | ||
echo "Gubernator configuration file is out of sync!" | ||
echo "${output}" | ||
echo "Run gubernator/update-config.sh" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.