Skip to content

cmd: gather the logs from bootstrap instead of printing commands #1822

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 4 commits into from
Jun 10, 2019

Conversation

abhinavdahiya
Copy link
Contributor

@abhinavdahiya abhinavdahiya commented Jun 5, 2019

xref: https://jira.coreos.com/browse/CORS-1071

This changes the gather bootstrap to establish an SSH connection to bootstrap host to gather the logs, rather than printing the commands for
the user to execute.

$ ./openshift-install --dir dev gather bootstrap --log-level debug --bootstrap 192.168.126.10 --master 192.168.126.11
DEBUG OpenShift Installer unreleased-master-1100-gc3be773d1eedc9356c5f9af955bcb8db25729e0b
DEBUG Built from commit c3be773d1eedc9356c5f9af955bcb8db25729e0b
INFO Pulling logs from bootstrap for debugging
DEBUG Gathering bootstrap journals ...
DEBUG Gathering bootstrap containers ...
DEBUG Gathering rendered assets...
DEBUG Gathering cluster resources ...
DEBUG Waiting for logs ...
DEBUG error: the server doesn't have a resource type "nodes"
DEBUG error: the server doesn't have a resource type "pods"
DEBUG error: the server doesn't have a resource type "nodes"
DEBUG error: the server doesn't have a resource type "configmaps"
DEBUG error: the server doesn't have a resource type "clusterversion"
DEBUG error: the server doesn't have a resource type "pods"
DEBUG error: the server doesn't have a resource type "clusteroperators"
DEBUG error: the server doesn't have a resource type "csr"
DEBUG error: the server doesn't have a resource type "apiservices"
DEBUG error: the server doesn't have a resource type "endpoints"
DEBUG error: the server doesn't have a resource type "namespaces"
DEBUG error: the server doesn't have a resource type "roles"
DEBUG error: the server doesn't have a resource type "kubecontrollermanager"
DEBUG error: the server doesn't have a resource type "machineconfigpools"
DEBUG error: the server doesn't have a resource type "kubeapiserver"
DEBUG error: the server doesn't have a resource type "nodes"
DEBUG error: the server doesn't have a resource type "secrets"
DEBUG error: the server doesn't have a resource type "pods"
DEBUG error: the server doesn't have a resource type "events"
DEBUG error: the server doesn't have a resource type "services"
DEBUG error: the server doesn't have a resource type "openshiftapiserver"
DEBUG error: the server doesn't have a resource type "rolebindings"
DEBUG Error from server (NotFound): the server could not find the requested resource
DEBUG error: the server doesn't have a resource type "secrets"
DEBUG error: the server doesn't have a resource type "machineconfigs"
DEBUG Gather remote logs
DEBUG Collecting info from 192.168.126.11
DEBUG scp: ./installer-masters-gather.sh: Permission denied
 EBUG Warning: Permanently added '192.168.126.11' (ECDSA) to the list of known hosts.
DEBUG Gathering master journals ...
DEBUG Gathering master containers ...
DEBUG Waiting for logs ...
DEBUG Log bundle written to ~/log-bundle.tar.gz
INFO Bootstrap gather logs captured here "dev/log-bundle.tar.gz"

/cc @jhixson74 @patrickdillon @wking

@openshift-ci-robot
Copy link
Contributor

@abhinavdahiya: GitHub didn't allow me to request PR reviews from the following users: jhixson74.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

xref: https://jira.coreos.com/browse/CORS-1071

/cc @jhixson74 @patrickdillon @wking

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.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2019
@openshift-ci-robot openshift-ci-robot requested a review from wking June 5, 2019 22:10
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 5, 2019
@abhinavdahiya
Copy link
Contributor Author

/cc @jhixson74

@openshift-ci-robot
Copy link
Contributor

@abhinavdahiya: GitHub didn't allow me to request PR reviews from the following users: jhixson74.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @jhixson74

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.

@abhinavdahiya
Copy link
Contributor Author

/retest

@abhinavdahiya abhinavdahiya changed the title WIP: cmd: gather the logs from bootstrap instead of printing commands cmd: gather the logs from bootstrap instead of printing commands Jun 6, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 6, 2019
@abhinavdahiya
Copy link
Contributor Author

/cc @openshift/openshift-team-installer

@openshift-ci-robot openshift-ci-robot requested a review from a team June 6, 2019 19:13
@smarterclayton
Copy link
Contributor

Awesome. Can we invoke gather in the e2e tear down trap?

@wking
Copy link
Member

wking commented Jun 6, 2019

Can we invoke gather in the e2e tear down trap?

We already gather in CI's teardown container. I don't see a need to teardown in the trap.

The package allows users to create a new SSH client that
- Uses an SSH agent to provide authentication
- Either uses the keys from paths explicity provided, or loads all the keys from `~/.ssh` to use for authentication

The package also provides a way to Run a command using an SSH client. The client must be configured to allow SSH agent forwarding.

The package also provides a way to pull a file from remote server to a file on the local host using a SSH client.
abhinavdahiya added a commit to abhinavdahiya/release that referenced this pull request Jun 7, 2019
…ogs on bootstrap failure

With installer PR [1], the installer will automatically gather the logs from bootstrap in case of bootstrap failure.
It uses the `~/.ssh` directlory to load the private SSH keys for authentication, when not specifically invoked using `gather bootstrap --key <>`

[1]: openshift/installer#1822
@wking
Copy link
Member

wking commented Jun 9, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 9, 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:
  • OWNERS [abhinavdahiya,wking]

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

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 7cc42fa into openshift:master Jun 10, 2019
@openshift-ci-robot
Copy link
Contributor

@abhinavdahiya: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws-scaleup-rhel7 4326be6 link /test e2e-aws-scaleup-rhel7

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

wking added a commit to wking/openshift-docs that referenced this pull request Oct 27, 2019
Since openshift/installer@cad7f02a8b (cmd: gather the logs from
bootstrap instead of printing commands, 2019-06-05,
openshift/installer#1822).  This functionality is new in 4.2.z; you
still need to SSH in 4.1.z.
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/openshift-docs that referenced this pull request Nov 7, 2019
Since openshift/installer@cad7f02a8b (cmd: gather the logs from
bootstrap instead of printing commands, 2019-06-05,
openshift/installer#1822).  This functionality is new in 4.2.z; you
still need to SSH in 4.1.z.
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/openshift-docs that referenced this pull request Nov 7, 2019
Since openshift/installer@cad7f02a8b (cmd: gather the logs from
bootstrap instead of printing commands, 2019-06-05,
openshift/installer#1822).  This functionality is new in 4.2.z; you
still need to SSH in 4.1.z.
@wking
Copy link
Member

wking commented Dec 18, 2019

/cherrypick release-4.1

@openshift-cherrypick-robot

@wking: #1822 failed to apply on top of branch "release-4.1":

Using index info to reconstruct a base tree...
M	Gopkg.lock
M	Gopkg.toml
Falling back to patching base and 3-way merge...
Auto-merging Gopkg.toml
Auto-merging Gopkg.lock
Applying: pkg: add gather/ssh package for utilities for gathering using ssh
Applying: cmd: gather the logs from bootstrap instead of printing commands
error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	cmd/openshift-install/gather.go
Falling back to patching base and 3-way merge...
Auto-merging cmd/openshift-install/gather.go
CONFLICT (content): Merge conflict in cmd/openshift-install/gather.go
Patch failed at 0003 cmd: gather the logs from bootstrap instead of printing commands

In response to this:

/cherrypick release-4.1

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.

wking added a commit to wking/openshift-release that referenced this pull request Dec 18, 2019
…ather

The installer does this automatically since
openshift/installer@cad7f02a8b (cmd: gather the logs from bootstrap
instead of printing commands, 2019-06-05, openshift/installer#1822).
You'd still need to SSH in to gather manually in 4.1.z, but if we
think that's important we should backport the gather logic to the
installer's 4.1 branch [1].

[1]: openshift/installer#2840
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants