OLD | NEW |
1 # Skolo + Raspberry Pi | 1 # Skolo + Raspberry Pi |
2 | 2 |
3 Skolo has a fleet of Raspberry Pis that are attached to one (and only one) Andro
id device. | 3 Skolo has a fleet of Raspberry Pis that are attached to one (and only one) Andro
id device. |
4 | 4 |
5 This directory contains scripts for making that all happen. | 5 This directory contains scripts for making that all happen. |
6 | 6 |
7 This is meant to be a detailed description, with [this design doc](https://docs.
google.com/document/d/1bbEfQSZvAk5yIpq4Ey1gGgGQscdO9KB0Jfe962XcowA/edit#) | 7 This is meant to be a detailed description, with [this design doc](https://docs.
google.com/document/d/1bbEfQSZvAk5yIpq4Ey1gGgGQscdO9KB0Jfe962XcowA/edit#) |
8 acting as a high level overview. If the current setup is lost in a fire and thi
s document is the | 8 acting as a high level overview. If the current setup is lost in a fire and thi
s document is the |
9 only thing remaining, it should be sufficient to fix Skolo. | 9 only thing remaining, it should be sufficient to fix Skolo. |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 passwd root | 61 passwd root |
62 | 62 |
63 # Make our user for swarming | 63 # Make our user for swarming |
64 adduser chrome-bot | 64 adduser chrome-bot |
65 # Use/Put the password in the password manager. | 65 # Use/Put the password in the password manager. |
66 | 66 |
67 # Load some android public/private keys for python-adb to use into /home/chrome-
bot/.android | 67 # Load some android public/private keys for python-adb to use into /home/chrome-
bot/.android |
68 # Download from https://pantheon.corp.google.com/storage/browser/skia-buildbots/
rpi_auth/?project=google.com:skia-buildbots | 68 # Download from https://pantheon.corp.google.com/storage/browser/skia-buildbots/
rpi_auth/?project=google.com:skia-buildbots |
69 # then use chown to make chrome-bot own them. | 69 # then use chown to make chrome-bot own them. |
70 | 70 |
| 71 # Take the rpi-master and rpi-spare ssh public keys and put them in /home/chrome
-bot/.ssh/authorized_keys |
| 72 |
| 73 # Acquire .gitconfig and .netrc for the bots. Put them in /opt/ |
| 74 # Design decision note: These configs may change; by putting them in /opt/ with |
| 75 # a script to copy them to $HOME on boot, new keys can be deployed by updating |
| 76 # them in /opt and then rebooting the rpis. If a faster deploy is required, then |
| 77 # they can be put in /opt and deployed immediately using Ansible. There is more |
| 78 # flexibility this way. (Reminder that $HOME is not NFS mounted, and so updating |
| 79 # $HOME on the master image does not autoupdate all the pis) |
| 80 |
71 # Ctrl+D to exit chroot | 81 # Ctrl+D to exit chroot |
72 ``` | 82 ``` |
73 - `./setup-swarming.sh` This will do all automatic, idempotent setup that is
possible. If Ansible can be configured to act inside a chroot, this should be p
orted to Ansible. | 83 - `./setup-swarming.sh` This will do all automatic, idempotent setup that is
possible. If Ansible can be configured to act inside a chroot, this should be p
orted to Ansible. |
74 - `ansible-playbook -i "localhost," -c local finalize_image.yml` finalize_ima
ge copies any scripts we need, changes any additional files that can be done in
an automated way. | 84 - `ansible-playbook -i "localhost," -c local finalize_image.yml` finalize_ima
ge copies any scripts we need, changes any additional files that can be done in
an automated way. |
75 - The mounted image file has been receiving the changes this entire time, no n
eed to `dd` anything to back it up. Current backups are in gs://skia-images/Swa
rming | 85 - The mounted image file has been receiving the changes this entire time, no n
eed to `dd` anything to back it up. Current backups are in gs://skia-images/Swa
rming |
76 - See "Begin serving the image" | 86 - See "Begin serving the image" |
77 | 87 |
78 ## Begin serving the image | 88 ## Begin serving the image |
79 By default, the script is looking for `/opt/rpi_img/prod.img` | 89 By default, the script is looking for `/opt/rpi_img/prod.img` |
80 | 90 |
81 ansible-playbook -i "localhost," -c local start_serving_image.yml | 91 ansible-playbook -i "localhost," -c local start_serving_image.yml |
82 | 92 |
83 To being serving staging image | 93 To being serving staging image |
84 | 94 |
85 ansible-playbook -i "localhost," -c local start_serving_image.yml --extra-va
rs "nfs_mount_point=/opt/stage image=/opt/rpi_img/stage.img" | 95 ansible-playbook -i "localhost," -c local start_serving_image.yml --extra-va
rs "nfs_mount_point=/opt/stage image=/opt/rpi_img/stage.img" |
86 | 96 |
87 | 97 |
88 ## Adding a new Raspberry PI into the swarm | 98 ## Adding a new Raspberry PI into the swarm |
89 This is also quite straight-forward. | 99 This is also quite straight-forward. |
90 1. Assemble Raspberry PI hardware. Connect Ethernet cable. | 100 1. Assemble Raspberry PI hardware. Connect Ethernet cable. |
91 2. Insert blank SD card into skia-rpi-master. | 101 2. Insert blank SD card into skia-rpi-master. |
92 3. `./format_new_card.yml` Optionally add the argument `stage` for the staging
environment. Type in static IP address and hostname suffix. | 102 3. `./format_new_card.yml` Optionally add the argument `stage` for the staging
environment. Type in static IP address and hostname suffix. |
93 4. Insert SD card into new pi. Turn on. | 103 4. Insert SD card into new pi. Turn on. |
94 | 104 |
95 The SD card is partitioned to have two primary partitions and one extended parti
tions with 3 logical partitions. | 105 The SD card is partitioned to have two primary partitions and one extended parti
tions with 3 logical partitions. |
96 - `/boot` is a small primary partition that has the boot code and a key file ca
lled `cmdline.txt`. That file is changed to mount via nfs the /root file system
and boot from it. This took a lot of tweaking to get right, and there was no a
uthoritative source on the matter. I had to use a few different sources and a b
it of dumb luck to get the configuration just right. | 106 - `/boot` is a small primary partition that has the boot code and a key file ca
lled `cmdline.txt`. That file is changed to mount via nfs the /root file system
and boot from it. This took a lot of tweaking to get right, and there was no a
uthoritative source on the matter. I had to use a few different sources and a b
it of dumb luck to get the configuration just right. |
97 - `/tmp`, `/var`, `/home` are all logical partitions on the extended partition.
These three partitions are mounted on the SD card so the RPI can function prop
erly and we have persistent access to logs. They are each 1G, but this can be ch
anged if needed. | 107 - `/tmp`, `/var`, `/home` are all logical partitions on the extended partition.
These three partitions are mounted on the SD card so the RPI can function prop
erly and we have persistent access to logs. They are each 1G, but this can be ch
anged if needed. |
98 - `/b` is a primary partition that takes up all the rest of the space. It is u
sed as the workspace for swarming. | 108 - `/b` is a primary partition that takes up all the rest of the space. It is u
sed as the workspace for swarming. |
OLD | NEW |