Hash Equivalence Server
There are two hashserv instances running on on the Yocto Project autobuilder. The private read-write at hashserv.yocto.io:8686 and the read-only public copy at hashserv.yocto.io:8687.
On a VM with 7.5GB of memory and 2 vcpus we created a 150GB fast volume and mounted it at /home/hashserv. Our hashserv.db hovers at about 35GB and has gone as high as 90GB. We setup up automated snapshots for backup.
Run some commands to set up a user and grab the code:
adduser --system hashserv su - hashserv git clone https://git.openembedded.org/bitbake exit
Copy the following to /etc/systemd/system/hashserv.service
# /etc/systemd/system/hashserv.service [Unit] Description=Bitbake Hash Server After=network.target [Service] User=hashserv WorkingDirectory=/home/hashserv Type=simple ExecStart=/usr/bin/python3 /home/hashserv/bitbake/bin/bitbake-hashserv --bind :8686 [Install] WantedBy=multi-user.target
Copy the following to /etc/systemd/system/hashserv-readonly.service
# /etc/systemd/system/hashserv-readonly.service [Unit] Description=Bitbake Read-Only Hash Server After=network.target [Service] User=hashserv WorkingDirectory=/home/hashserv Type=simple ExecStart=/usr/bin/python3 /home/hashserv/bitbake/bin/bitbake-hashserv --bind :8687 --read-only [Install] WantedBy=multi-user.target
Some commands to enable and start the services:
systemctl daemon-reload systemctl enable hashserv.service hashserv-readonly.service systemctl start hashserv.service hashserv-readonly.service
Then we opened up the firewall for 8686/tcp to our autobuilder private network and opened 8687/tcp to the world. There is no authentication so it's important to use the correct firewall settings.