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.
 
 
 
 

165 lines
7.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. ### Definitions
  13. - User - A person or entity that is able to reserve a system, and test with it.
  14. - Host system - The machine that controls and provides access to the systems.
  15. ### Features
  16. - Remote power control
  17. - serial console access
  18. - Network boot
  19. - Internet connectivity for boards w/ ethernet
  20. - Isolation between board environments
  21. Likely implemented via VLANs+jails w/ VNET to provide complete control
  22. - Long term goals:
  23. - Emulated microSD cards
  24. ### Physical Architecture
  25. The following diagrams the connections between the components. It is expected
  26. that the connections for the RockPro64 is followed similarly for other embedded
  27. devices.
  28. In the case of the Switch, the RockPro64 will be put on a VLAN which will be
  29. delivered to the Host machine tagged. This will allow a jail in the host
  30. machine to have a direct control over the broadcast domain for the device.
  31. This will allow running dhcp/bootp/tftp services for netbooting by running dnsmasq
  32. or another service. As fusefs is now jail friendly, the root FS could even be
  33. mounted via sshfs
  34. The PoE part of the switch will be used for power control. PoE splitters (~$10)
  35. are readily available and inexpensive, and the cost per port is realatively
  36. inexpensive considering that power consumption will also be provided.
  37. **************************************************************************
  38. * *
  39. * +--------------+ +-----------------+ *
  40. * | Host machine +-------------------------+ | Internet | *
  41. * +-+------------+ | +-+---------------+ *
  42. * | | | *
  43. * | | | *
  44. * | | | *
  45. * +-+------------+ +----------------+ | +-+---------------+ *
  46. * | USB Hub +-----+ Serial adapter | +---------+ PoE/VLAN Switch | *
  47. * +--------------+ +-+--------------+ +-+---------------+ *
  48. * | | *
  49. * | | *
  50. * | | *
  51. * +-+--------------+ Network +-+---------------+ *
  52. * | RockPro64 +------------+ PoE Splitter | *
  53. * +-+--------------+ +-+---------------+ *
  54. * | Power | *
  55. * +-----------------------------+ *
  56. * *
  57. **************************************************************************
  58. ### Logical Architecture
  59. No user will be able to log into the host machine directly. The only user
  60. interface exposed on the host will be via an RPC interface, e.g.
  61. `echo function xxx | ssh labhost labcli`, or via a socket from within
  62. the jail.
  63. The user will be able to log into the jail that is created during the
  64. reservation. Any modifications to the jail will be rolled back and
  65. discarded after the system has been released, or the reservation has
  66. expired.
  67. Workflow
  68. --------
  69. # Functions
  70. The functions that take a device handle can be executed from within the device jail
  71. and the device handle of that device jail will be used. An error will be raised if
  72. a device handle is provided and it does not match the current jail.
  73. These are the functions a user can execute:
  74. 1. List device classes (onlyavailable=false)
  75. List the device classes that are known about. If onlyavailable is true, than only
  76. ones that are currently available for claiming are returned.
  77. 2. Device status (claimed=false)
  78. List all the device statuses currently. This includes that status, claimed or
  79. unclaimed. If the device is claimed, it includes the user to claimed it. If claimed
  80. is true, only list devices that are currently claimed by you. The default is to list
  81. all devices.
  82. 3. Claim device (device class, power=false)
  83. A user can use this to lock a device. This will return a device handle with the
  84. device information, such as the device's jail's IP address, or an error. Once they
  85. have obtained a device, it will not be allocated to another user till they have release
  86. this device (or in the future a timeout has been hit). The user's ssh keys will be
  87. automatically populated in that jail. By default, the device will be in the power off
  88. state. When a default configuration is provided for the board, it can be automatically
  89. powered on to make it easier to integrate w/ systems like CI.
  90. 4. Reinit device (device handle)
  91. This will remove the current jail, and recreate it as if it was claimed for the first
  92. time. This can be done so you can get the jail in a clean state w/o risk losing the
  93. lock by freeing it and then reclaiming it. If you have not claimed the device, an
  94. error will be returned. If the reinit fails, an error will be returned, but the claim
  95. will be maintained.
  96. 5. Release device (device handle)
  97. Release a claim on the device handle returned by claim device. This will make it
  98. available to users again. All data in the jail will be deleted. It will return an
  99. error if you do have have a claim on the device.
  100. 6. Power off (device handle)
  101. Turn off the power to the device.
  102. 7. Power on (device handle)
  103. Turn on the power to the device.
  104. # Services provided in the device jail
  105. Once logged in, the jail will have the following services:
  106. 1. ssh
  107. Incoming ssh must be provided for the user to login.
  108. 2. One interface for internet
  109. nat setup so that all traffic appears from jail's IP.
  110. 3. One interface for device
  111. 4. Serial port for console access
  112. The configuration will identify which device to put in the jail. For
  113. USB devices, they will be able to be specified via a list of ports on
  114. the hubs so that there is no issue w/ device probe order.
  115. 5. dhcpd for device w/ tftp already configured
  116. 6. inetd w/ tftpd setup
  117. 7. nfsd setup w/ exports configured
  118. 8. power control for device
  119. As the user will have root access, all of these can be modified after.
  120. Future Work
  121. ===========
  122. There are a number of ideas to make developing boards remotely more doable.
  123. We can use devices that support OTG, to be USB devices for test boards. This
  124. means you can simulate a keyboard and or a mouse. With the combination of a
  125. HDMI to ethernet adapter (there are cheap ones for ~$40/each), a developer can
  126. work on making X or other GUI work remotely.
  127. Questions
  128. =========
  129. Should the host key for the device be kept between invocations.
  130. Pros: Users don't have to munch the known_hosts every time.
  131. Cons: Malicious user could impersonate the jail as they can copy out the key.
  132. IPv6 support?
  133. I have enough that each device can get a /64, but this remove privacy in
  134. that the network will tell which device was active at the time
  135. <!-- 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>