Skip to content

ci-operator/templates/e2e-metal: fix csr approval and bootstrap log gathering #3587

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

Merged

Conversation

abhinavdahiya
Copy link
Contributor

Carries changes from 1 and 2

/cc @wking @staebler

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 24, 2019
@abhinavdahiya
Copy link
Contributor Author

/test pj-rehearse

while true; do
if [[ ! -f /tmp/install-complete ]]; then
oc get csr -ojson | jq -r '.items[] | select(.status == {} ) | .metadata.name' | xargs --no-run-if-empty oc adm certificate approve
sleep 15 & wait
Copy link
Member

@wking wking Apr 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backgrounding slow processes gets them into the jobs output so we can TERM them for graceful shutdown. I don't think we care about gracefully stopping sleep, it won't cause any problems getting hard-killed by container removal. Can we just make this line sleep 15, or am I missing something?

oc get csr -ojson | jq -r '.items[] | select(.status == {} ) | .metadata.name' | xargs oc adm certificate approve
function approve_csrs() {
while true; do
if [[ ! -f /tmp/install-complete ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can drop the break and rephrase this loop to:

while [[ ! -f /tmp/install-complete ]]; do
  oc get csr -ojson | jq -r '.items[] | select(.status == {} ) | .metadata.name' | xargs --no-run-if-empty oc adm certificate approve
  sleep 15
fi


oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"emptyDir":{}}}}'
update_image_registry &
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the pattern is to echo some progress message before taking action, should we have echo 'Updating image registry storage...' or something similar before this line? I'm also fine just having the script silently do its job, but it feels odd to have this update_image_registry appear to happen under an Approving pending CSRs header.


echo "Completing UPI setup"
openshift-install --dir=/tmp/artifacts/installer wait-for install-complete &
wait "$!"
touch /tmp/install-complete
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this? We already have this trap to set either /tmp/setup-success or /tmp/exit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its from #3573 .
need the approve_csr to keep looping until install-complete. Any other suggestions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need the approve_csr to keep looping until install-complete.

Guard for both (like this)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this script is set -e, so touch /tmp/install-complete ends up with the same semantics as the existing /tmp/setup-success, not the success-agnostic completion marker that #3473 seems to have expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -366,14 +374,9 @@ objects:
mkdir -p /tmp/artifacts/pods /tmp/artifacts/nodes /tmp/artifacts/metrics /tmp/artifacts/bootstrap /tmp/artifacts/network


if [ -f /tmp/artifacts/installer/terraform.tfstate ]
if [ -f /tmp/artifacts/terraform/terraform.tfstate ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everyone else puts this under the installer directory:

$ git grep -h terraform.tfstate origin/master -- ci-operator/templates/openshift/installer | grep -o '/tmp.*tfstate' | sort | uniq -c
     12 /tmp/artifacts/installer/terraform.tfstate

but I guess that's because they're running Terraform via the installer. So +1 to this, although I was initially confused ;).

echo "Approving any pending CSR requests"
oc get csr -ojson | jq -r '.items[] | select(.status == {} ) | .metadata.name' | xargs oc adm certificate approve
function approve_csrs() {
while [[ ! -f /tmp/exit ]] || [[ ! -f /tmp/setup-success ]]; do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want && to bail out if either exists.

@wking
Copy link
Member

wking commented Apr 25, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 25, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, wking

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

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 5a6afa4 into openshift:master Apr 25, 2019
@openshift-ci-robot
Copy link
Contributor

@abhinavdahiya: Updated the following 2 configmaps:

  • prow-job-cluster-launch-installer-metal-e2e configmap in namespace ci using the following files:
    • key cluster-launch-installer-metal-e2e.yaml using file ci-operator/templates/openshift/installer/cluster-launch-installer-metal-e2e.yaml
  • prow-job-cluster-launch-installer-metal-e2e configmap in namespace ci-stg using the following files:
    • key cluster-launch-installer-metal-e2e.yaml using file ci-operator/templates/openshift/installer/cluster-launch-installer-metal-e2e.yaml

In response to this:

Carries changes from 1 and 2

/cc @wking @staebler

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.

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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants