Skip to content

Conversation

@wking
Copy link
Member

@wking wking commented Sep 10, 2020

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-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.

@wking wking force-pushed the per-region-leases branch 3 times, most recently from cc5e7eb to 8ab9d41 Compare September 15, 2020 22:21
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 15, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 15, 2020
@wking
Copy link
Member Author

wking commented Sep 15, 2020

I've pushed cc5e7eb -> e303bcd070, rebasing around #11772 and adding make check-boskos, make boskos-config, and a boskos-config presubmit. Which seems to be failing...

@wking
Copy link
Member Author

wking commented Sep 15, 2020

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 make, or whether we want to skip make and just inline the command it wraps.

@wking
Copy link
Member Author

wking commented Sep 15, 2020

I've pushed 0cf4ca96f8 -> 2dd18757cf, dropping make and using the registry.svc.ci.openshift.org/ci/python-validation image, at @stevekuznetsov 's suggestion.

wking added a commit to wking/openshift-release that referenced this pull request Sep 16, 2020
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
Copy link
Member

@petr-muller petr-muller left a 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

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 16, 2020
@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 16, 2020
@wking wking force-pushed the per-region-leases branch from 2dd1875 to 032371d Compare October 8, 2020 20:59
@openshift-ci-robot openshift-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed lgtm Indicates that a PR is ready to be merged. labels Oct 8, 2020
…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
@wking wking force-pushed the per-region-leases branch from 032371d to 5cf5ba3 Compare October 8, 2020 21:02
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 8, 2020
@wking
Copy link
Member Author

wking commented Oct 8, 2020

With 2dd18757cf -> 5cf5ba3, I've rebased onto master, claimed python3 because #11869 is still unsettled, and limited this change to a no-op reshuffling. I'll come back with follow-up work after this PR lands to actually move AWS/GCP/Azure to per-region leases.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Oct 8, 2020

@wking: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/ci-testgrid-allow-list 2dd18757cf29a64a766870e36aa4927deed6c20a link /test ci-testgrid-allow-list

Full PR test history. Your PR dashboard.

Details

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. 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
@wking
Copy link
Member Author

wking commented Oct 8, 2020

Me giving up on getting python to point to a Python with PyYAML means we can drop the hold.

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 8, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 8, 2020
@openshift-ci-robot
Copy link
Contributor

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [petr-muller,stevekuznetsov]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit d0cc94d into openshift:master Oct 8, 2020
@openshift-ci-robot
Copy link
Contributor

@wking: Updated the following 4 configmaps:

  • job-config-master configmap in namespace ci at cluster app.ci using the following files:
    • key openshift-release-master-presubmits.yaml using file ci-operator/jobs/openshift/release/openshift-release-master-presubmits.yaml
  • resources configmap in namespace ci at cluster api.ci using the following files:
    • key boskos.yaml using file core-services/prow/02_config/_boskos.yaml
  • resources configmap in namespace ci at cluster app.ci using the following files:
    • key boskos.yaml using file core-services/prow/02_config/_boskos.yaml
  • job-config-master configmap in namespace ci at cluster api.ci using the following files:
    • key openshift-release-master-presubmits.yaml using file ci-operator/jobs/openshift/release/openshift-release-master-presubmits.yaml
Details

In response to this:

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-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.

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': {},
Copy link
Contributor

@coverprice coverprice Oct 8, 2020

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)
},

Copy link
Member Author

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?

@wking
Copy link
Member Author

wking commented Oct 8, 2020

Followed up for per-region Azure leases in #12584.

@wking wking deleted the per-region-leases branch October 8, 2020 23:54
wking added a commit to wking/ci-docs that referenced this pull request Oct 15, 2020
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).
wking added a commit to wking/ci-docs that referenced this pull request Oct 15, 2020
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).
wking added a commit to wking/ci-docs that referenced this pull request Oct 15, 2020
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).
wking added a commit to wking/openshift-release that referenced this pull request Feb 23, 2022
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".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants