-
Notifications
You must be signed in to change notification settings - Fork 2k
templates/openshift: grab bootstrap log on failure #2633
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
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -338,8 +338,7 @@ objects: | |
| exit 1 | ||
| fi | ||
|
|
||
| /bin/openshift-install --dir=/tmp/artifacts/installer create cluster & | ||
| wait "$!" | ||
| /bin/openshift-install --dir=/tmp/artifacts/installer create cluster | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, previous discussion here. I still think this change breaks the |
||
|
|
||
| # Performs cleanup of all created resources | ||
| - name: teardown | ||
|
|
@@ -386,7 +385,34 @@ objects: | |
| export PATH=$PATH:/tmp/shared | ||
|
|
||
| echo "Gathering artifacts ..." | ||
| mkdir -p /tmp/artifacts/pods /tmp/artifacts/nodes /tmp/artifacts/metrics | ||
| mkdir -p /tmp/artifacts/pods /tmp/artifacts/nodes /tmp/artifacts/metrics /tmp/artifacts/bootstrap | ||
|
|
||
| if [ -f /tmp/artifacts/installer/terraform.tfstate ] | ||
| then | ||
| # we don't have jq, so the python equivalent of | ||
| # jq '.modules[].resources."aws_instance.bootstrap".primary.attributes."public_ip" | select(.)' | ||
| bootstrap_ip=$(python -c \ | ||
| 'import sys, json; d=reduce(lambda x,y: dict(x.items() + y.items()), map(lambda x: x["resources"], json.load(sys.stdin)["modules"])); k="aws_instance.bootstrap"; print d[k]["primary"]["attributes"]["public_ip"] if k in d else ""' \ | ||
| < /tmp/artifacts/installer/terraform.tfstate | ||
| ) | ||
|
|
||
| if [ -n "${bootstrap_ip}" ] | ||
| then | ||
| for service in bootkube openshift kubelet crio | ||
| do | ||
| queue "/tmp/artifacts/bootstrap/${service}.service" curl \ | ||
| --insecure \ | ||
| --silent \ | ||
| --connect-timeout 5 \ | ||
| --retry 3 \ | ||
| --cert /tmp/artifacts/installer/tls/journal-gatewayd.crt \ | ||
| --key /tmp/artifacts/installer/tls/journal-gatewayd.key \ | ||
| --url "https://${bootstrap_ip}:19531/entries?_SYSTEMD_UNIT=${service}.service" | ||
| done | ||
| fi | ||
| else | ||
| echo "No terraform statefile found. Skipping collection of bootstrap logs." | ||
| fi | ||
|
|
||
| oc --request-timeout=5s get nodes -o jsonpath --template '{range .items[*]}{.metadata.name}{"\n"}{end}' > /tmp/nodes | ||
| oc --request-timeout=5s get pods --all-namespaces --template '{{ range .items }}{{ $name := .metadata.name }}{{ $ns := .metadata.namespace }}{{ range .spec.containers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ range .spec.initContainers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ end }}' > /tmp/containers | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why this change?
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.
That was an artifact of some previous refactoring. Backgrounding the process and then immediately waiting on it should be equivalent to just running it in the foreground.
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.
I've filed #2680, rolling this back and adding an additional
waitto ourTERMhandlers. As discussed in that PR, we need the backgroundedcreate clusterso the shell will fire theTERMhandler whichTERMs the child processes. As master stands (with this PR but without #2680), aborting an e2e job willTERMthe setup container's shell process, but that process will not forward theTERMtoopenshift-installand will wait until it exits normally. I haven't actually tested with a wrapping container, but my guess is that this means that jobs being aborted duringopenshift-installare mostly hitting their gentle-shutdown timeout and gettingKILLed. With #2680, the forwardedTERMgives the installer a chance at a gentle shutdown (although at the moment, I don't think the installer takes advantage of that opportunity).