Information and documentation on building an embedded board test lab.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

143 lines
6.7 KiB

  1. <meta charset="utf-8">
  2. <meta http-equiv="refresh" content="2">
  3. Embedded Board dev cluster
  4. ==========================
  5. This is the description of how the cluster is architected and setup. There
  6. are a few design decisions that are likely to be different in other
  7. environments, but this made the most sense for mine.
  8. Goal
  9. ----
  10. The goal of this setup is to allow people to be able to install and test
  11. images on various boards remotely.
  12. ### Features
  13. - Remote power control
  14. - serial console access
  15. - Network boot
  16. - Internet connectivity for boards w/ ethernet
  17. - Isolation between board environments
  18. Likely implemented via VLANs+jails w/ VNET to provide complete control
  19. - Long term goals:
  20. - Emulated microSD cards
  21. ### Physical Architecture
  22. The following diagrams the connections between the components. It is expected
  23. that the connections for the RockPro64 is followed similarly for other embedded
  24. devices.
  25. In the case of the Switch, the RockPro64 will be put on a VLAN which will be
  26. delivered to the Host machine tagged. This will allow a jail in the host
  27. machine to have a direct control over the broadcast domain for the device.
  28. This will allow running dhcp/bootp/tftp services for netbooting by running dnsmasq
  29. or another service. As fusefs is now jail friendly, the root FS could even be
  30. mounted via sshfs
  31. The PoE part of the switch will be used for power control. PoE splitters (~$10)
  32. are readily available and inexpensive, and the cost per port is realatively
  33. inexpensive considering that power consumption will also be provided.
  34. **************************************************************************
  35. * *
  36. * +--------------+ +-----------------+ *
  37. * | Host machine +-------------------------+ | Internet | *
  38. * +-+------------+ | +-+---------------+ *
  39. * | | | *
  40. * | | | *
  41. * | | | *
  42. * +-+------------+ +----------------+ | +-+---------------+ *
  43. * | USB Hub +-----+ Serial adapter | +---------+ PoE/VLAN Switch | *
  44. * +--------------+ +-+--------------+ +-+---------------+ *
  45. * | | *
  46. * | | *
  47. * | | *
  48. * +-+--------------+ Network +-+---------------+ *
  49. * | RockPro64 +------------+ PoE Splitter | *
  50. * +-+--------------+ +-+---------------+ *
  51. * | Power | *
  52. * +-----------------------------+ *
  53. * *
  54. **************************************************************************
  55. ### Logical Architecture
  56. No user will be able to log into the host machine directly. The only user
  57. interface exposed on the host will be via an RPC interface, e.g.
  58. `echo function xxx | ssh labhost labcli`, or via a socket from within
  59. the jail.
  60. Workflow
  61. --------
  62. # Functions
  63. The functions that take a device handle can be executed from within the device jail
  64. and the device handle of that device jail will be used. An error will be raised if
  65. a device handle is provided and it does not match the current jail.
  66. These are the functions a user can execute:
  67. 1. List device classes (onlyavailable=false)
  68. List the device classes that are known about. If onlyavailable is true, than only
  69. ones that are currently available for claiming are returned.
  70. 2. Device status (claimed=false)
  71. List all the device statuses currently. This includes that status, claimed or
  72. unclaimed. If the device is claimed, it includes the user to claimed it. If claimed
  73. is true, only list devices that are currently claimed by you. The default is to list
  74. all devices.
  75. 3. Claim device (device class, power=false)
  76. A user can use this to lock a device. This will return a device handle with the
  77. device information, such as the device's jail's IP address, or an error. Once they
  78. have obtained a device, it will not be allocated to another user till they have release
  79. this device (or in the future a timeout has been hit). The user's ssh keys will be
  80. automatically populated in that jail. By default, the device will be in the power off
  81. state. When a default configuration is provided for the board, it can be automatically
  82. powered on to make it easier to integrate w/ systems like CI.
  83. 4. Reinit device (device handle)
  84. This will remove the current jail, and recreate it as if it was claimed for the first
  85. time. This can be done so you can get the jail in a clean state w/o risk losing the
  86. lock by freeing it and then reclaiming it. If you have not claimed the device, an
  87. error will be returned. If the reinit fails, an error will be returned, but the claim
  88. will be maintained.
  89. 5. Release device (device handle)
  90. Release a claim on the device handle returned by claim device. This will make it
  91. available to users again. All data in the jail will be deleted. It will return an
  92. error if you do have have a claim on the device.
  93. 6. Power off (device handle)
  94. Turn off the power to the device.
  95. 7. Power on (device handle)
  96. Turn on the power to the device.
  97. # Services provided in the device jail
  98. Once logged in, the jail will have the following services:
  99. 1. ssh
  100. Incoming ssh must be provided for the user to login.
  101. 2. One interface for internet
  102. nat setup so that all traffic appears from jail's IP.
  103. 3. One interface for device
  104. 4. Serial port for console access
  105. 5. dhcpd for device w/ tftp already configured
  106. 6. inetd w/ tftpd setup
  107. 7. nfsd setup w/ exports configured
  108. 8. power control for device
  109. As the user will have root access, all of these can be modified after.
  110. Questions
  111. =========
  112. Should the host key for the device be kept between invocations.
  113. Pros: Users don't have to munch the known_hosts every time.
  114. Cons: Malicious user could impersonate the jail as they can copy out the key.
  115. IPv6 support?
  116. I have enough that each device can get a /64, but this remove privacy in
  117. that the network will tell which device was active at the time
  118. <!-- Markdeep: --><style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="markdeep.min.js" charset="utf-8"></script><script src="https://casual-effects.com/markdeep/latest/markdeep.min.js" charset="utf-8"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script>