Skip to content
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

feat(discovery-client): Add CLI commands to find and SSH into a robot #2072

Merged
merged 5 commits into from
Aug 20, 2018

Conversation

mcous
Copy link
Contributor

@mcous mcous commented Aug 16, 2018

overview

In support of the switch to IPv4, this PR adds a couple commands to the discovery-client CLI:

  • discovery find [name] [options] - Find the IP address of a single robot, optionally by name
  • discovery-ssh [name] [options] - Bash script to call discovery find and then SSH into the found robot

changelog

  • feat(discovery-client): Add CLI commands to find and SSH into a robot
    • discovery find [name] [options]
    • discovery-ssh [name] [options]

review requests

questions

  • How should we deploy this? I'm thinking npm might actually be a good idea
    • Tool is necessary for factory
    • Could be very useful for support + customers
  • Should we also update the Makefiles?
    • If so, what do we want the task + args to look like
    • Also, which Makefile would it live in? I'm thinking top-level

testing

This must be run in an environment with bash and ssh available/

Run make install after checkout to get new yarn dependencies and rebuild discovery-client.

  • SSH into IPv4 USB
    • npx discovery-ssh --ipFilter=169.254
  • SSH into IPv6 USB
    • npx discovery-ssh --candidates="[fd00:0:cafe:fefe::1]" --ipFilter="[fd00"
  • Read through the examples in discovery-client/README.md and make sure they work, too
  • SSH into named robot
    • npx discovery-ssh opentrons-moon-moon

@mcous mcous added feature Ticket is a feature request / PR introduces a feature ready for review labels Aug 16, 2018
@@ -24,7 +24,7 @@ const options = {
nameFilter: /^opentrons/i,
allowedPorts: [31950],
pollInterval: 5000,
candidates: [{ip: '[fd00:0:cafe:fefe::1]', port: 31950}, 'localhost']
candidates: [{ ip: '[fd00:0:cafe:fefe::1]', port: 31950 }, 'localhost']
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for all these whitespace changes; I enabled prettier in my editor and this is the prettier default. Let me know if this bothers you and I can revert

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't mind it, its more readable

@codecov
Copy link

codecov bot commented Aug 16, 2018

Codecov Report

Merging #2072 into edge will decrease coverage by 0.03%.
The diff coverage is 53.44%.

Impacted file tree graph

@@            Coverage Diff            @@
##             edge   #2072      +/-   ##
=========================================
- Coverage   33.03%     33%   -0.04%     
=========================================
  Files         452     452              
  Lines        7195    7236      +41     
=========================================
+ Hits         2377    2388      +11     
- Misses       4818    4848      +30
Impacted Files Coverage Δ
app-shell/src/discovery.js 90% <ø> (ø) ⬆️
discovery-client/src/cli.js 0% <0%> (ø) ⬆️
discovery-client/src/index.js 98.91% <100%> (+0.11%) ⬆️
discovery-client/src/poller.js 88.46% <100%> (ø) ⬆️
discovery-client/src/service.js 100% <100%> (ø) ⬆️
app/src/components/TempDeckStatusCard/index.js 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd85213...590963b. Read the comment docs.

Copy link
Contributor

@Kadee80 Kadee80 left a comment

Choose a reason for hiding this comment

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

tested on wandering-👩 and VS. discussed logging in person.

@mcous
Copy link
Contributor Author

mcous commented Aug 20, 2018

Got verbal 👍 from Andy

@mcous mcous merged commit 5ae3ef1 into edge Aug 20, 2018
@mcous mcous deleted the dc_extend-cli-for-factory branch August 20, 2018 19:45

# example: find the IP address of a wired robot that may be IPv4 or IPv6
# (IPv6 means legacy non-mDNS wired configuration)
discovery find -i "169.254" "fd00" -c "[fd00:0:cafe:fefe::1]"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Universal SSH into wired bot command 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Ticket is a feature request / PR introduces a feature medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants