-
Notifications
You must be signed in to change notification settings - Fork 2.1k
core-services/prow/02_config/generate-boskos: For spitting out lots of names #11752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core-services/prow/02_config/generate-boskos: For spitting out lots of names #11752
Conversation
cc5e7eb to
8ab9d41
Compare
8ab9d41 to
e303bcd
Compare
e303bcd to
0cf4ca9
Compare
|
Fixed the position of the new presubmit job in the YAML file with e303bcd070 -> 0cf4ca96f8. Just have to figure out which image to use for the presubmit so we get |
0cf4ca9 to
2dd1875
Compare
|
I've pushed 0cf4ca96f8 -> 2dd18757cf, dropping |
I want this so '#!/usr/bin/env python' gets a version of Python that
has PyYAML installed. We currently only install it for Python 3, but
as long as the default Python is Python 2, it will not be available to
Python-agnostic scripts [1]. Auditing the existing users:
$ git --no-pager grep -l python-validation ci-operator
ci-operator/jobs/openshift/release/openshift-release-master-presubmits.yaml
So all the consumers are jobs in that one file. Getting the commands they run:
$ yaml2json <ci-operator/jobs/openshift/release/openshift-release-master-presubmits.yaml | jq -r '.presubmits["openshift/release"][].spec.containers[] | select(.image | endswith("python-validation")) | (.command | join(" ")) + " " + (.args | join(" "))'
hack/validate-ci-operator-config-filename.py --config-dir ./ci-operator/config
hack/validate-prow-job-semantics.py ./
hack/validate-release-controller-config.sh ./
pylint --rcfile=hack/.pylintrc --ignore=lib --persistent=n hack
Don't have to worry about pylint, because we install that in the
Dockerfile. Looking for how the shell script is associated with
Python:
$ grep 'python\|\.py' hack/validate-release-controller-config.sh
${base_dir}/hack/generators/release-controllers/generate-release-controllers.py "${base_dir}"
And checking all three Python scripts:
$ head -n1 hack/validate-ci-operator-config-filename.py hack/validate-prow-job-semantics.py hack/generators/release-controllers/generate-release-controllers.py
==> hack/validate-ci-operator-config-filename.py <==
#!/usr/bin/env python3
==> hack/validate-prow-job-semantics.py <==
#!/usr/bin/env python3
==> hack/generators/release-controllers/generate-release-controllers.py <==
#!/usr/bin/env python3
So we are uniformly python3 today, and changing the default to Python
3 should not cause problems.
Confirming the default in the current image:
$ podman run --rm registry.svc.ci.openshift.org/ci/python-validation /usr/bin/env python --version
Python 2.7.5
$ podman run --rm registry.svc.ci.openshift.org/ci/python-validation rpm -q --whatprovides /usr/bin/python2
python-2.7.5-69.el7_5.x86_64
Apparently the preferred way to change the default is via
'alternatives' [2], but that fails for me with no useful error
message:
$ podman run --rm registry.svc.ci.openshift.org/ci/python-validation sh -c 'env python --version && command -v python3 && alternatives --set python $(command -v python3) || echo "$?"'Python 2.7.5
/usr/local/bin/python3
2
So instead I've installed a new virtual environment [3] and set the
PATH and VIRTUAL_ENV variables to produce the core environment you'd
get from sourcing ~/.venv/bin/activate:
$ podman run --rm registry.svc.ci.openshift.org/ci/python-validation sh -c 'python3 -m venv ~/.venv && grep "^export\|^PATH=\|^VIRTUAL_ENV=\|^# unset PYTHONHOME" ~/.venv/bin/activate'
VIRTUAL_ENV="/root/.venv"
export VIRTUAL_ENV
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
[1]: openshift#11752
[2]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/using-python3_configuring-basic-system-settings#configuring-the-unversioned-python_installing-and-using-python
[3]: https://docs.python.org/3/library/venv.html
petr-muller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but this needs the other PR to make the underlying image have yaml so holding
/hold
2dd1875 to
032371d
Compare
…f names Quotas for some providers depend on both account-scoped resources (e.g. AWS elastic IPs default to five per account [1]), region-scoped resources (e.g. AWS VPCs default to five per region [1]), potentialy other scoping (e.g. AWS NAT gateways default to five per availability zone [1]). This commit moves us away from account-scoped leases and towards region-scoped leases in account-scoped buckets. That allows us to say things like "on Azure, we have more capacity in centralus than we do in our other regions". The generating script is because typing out "us-east-1" 50 times is tedious and hard to review, and today there is apparently no support in the Boskos config directly to ask for $N copies of a given name. I'm also adding myself as an owner, so DPTP doesn't have to bother with lease adjustment. Other CI-platform maintainers should feel free to add themselves as well, if they want to approve lease adjustments to their platforms. Currently a mostly-no-op reshuffling of the exisiting Boskos config. The python-validation image follows the pattern set by the existing prow-config-semantics job. This script works with both Python 2 and Python 3, but I'm using python3 in the shebang because the verification image currently has 'python' pointed at Python 2 but only installs PyYAML for Python 3, and I've been unable to land a pivot to point it at Python 3 [2]. [1]: https://docs.openshift.com/container-platform/4.5/installing/installing_aws/installing-aws-account.html#installation-aws-limits_installing-aws-account [2]: openshift#11869
032371d to
5cf5ba3
Compare
|
@wking: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Seems like our python-validation image does not include it [1]: hack/validate-boskos.sh: line 14: git: command not found 'diff -u A B' is in POSIX [2]. The '|| true' catches the exit status, which is when differences were found [2]. The chance of a >1 exit status for other errors seems small enough that I haven't bothered to handle it, although ideally we'd exit out in that situation. [1]: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_release/11752/rehearse-11752-pull-ci-openshift-release-master-boskos-config/1314310508639162368 [2]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: petr-muller, stevekuznetsov, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@wking: Updated the following 4 configmaps:
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
| 'default': 120, | ||
| }, | ||
| 'libvirt-s390x-quota-slice': {}, | ||
| 'libvirt-ppc64le-quota-slice': {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code golf:
'libvirt-ppc64le-quota-slice': {
f'libvirt-ppc64le-{i}-{j}': 1
for j in range(4)
for i in range(2)
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me. File a PR?
|
Followed up for per-region Azure leases in #12584. |
Catching up with openshift/release#5cf5ba3f87 (core-services/prow/02_config/generate-boskos: For spitting out lots of names, 2020-09-10, openshift/release#11752).
Catching up with openshift/release@5cf5ba3f87 (core-services/prow/02_config/generate-boskos: For spitting out lots of names, 2020-09-10, openshift/release#11752).
Catching up with openshift/release@5cf5ba3f87 (core-services/prow/02_config/generate-boskos: For spitting out lots of names, 2020-09-10, openshift/release#11752).
I'd added myself as an approver here in 5cf5ba3 (core-services/prow/02_config/generate-boskos: For spitting out lots of names, 2020-10-08, openshift#11752). This comment isn't structured metadata, but it makes it slightly less likely that folks ask me to review things like "I'm adding a new repository".
Quotas for some providers depend on both account-scoped resources (e.g. AWS elastic IPs default to five per account), region-scoped resources (e.g. AWS VPCs default to five per region), potentialy other scoping (e.g. AWS NAT gateways default to five per availability zone). This commit moves us away from account-scoped leases and towards region-scoped leases in account-scoped buckets. That allows us to say things like "on Azure, we have more capacity in centralus than we do in our other regions".
The generating script is because typing out
us-east-150 times is tedious and hard to review, and today there is apparently no support in the Boskos config directly to ask for $N copies of a given name.I'm also adding myself as an owner, so DPTP doesn't have to bother with lease adjustment. Other CI-platform maintainers should feel free to add themselves as well, if they want to approve lease adjustments to their platforms.