Skip to content

suhlig/ruby-compile-farm

Repository files navigation

Ruby Compile Farm

Creates a Hetzner ARM VM, downloads a Ruby compiler, compiles it for arm-linux-gnueabihf (for a 32 bit Raspberry Pi, e.g. Raspberry Pi 3 or Zero 2W),zips it up and downlads it to the controlling machine.

Installation

We are using Terraform to

  1. Create a new VM, and
  2. Install Tailscale

Prerequsites

  • The environment variable HCLOUD_TOKEN must be a valid Hetzner Cloud Token.
  • The environment variable TAILSCALE_API_KEY must have a valid Tailscale API key
  • The server name is set in variables.tf, and can be overwritten on the command line as -var server_name=foobar.

Up

scripts/create

The playbook will download the compiled Ruby as ruby-4.0.1-armhf-debian13.tar.gz to the controlling machine.

When copied to a Raspberry Pi, it can be unpacked and installed and used using the following commands:

$ sudo tar -xzf ruby-4.0.1-armhf-debian13.tar.gz -C /
$ PATH=/opt/ruby-4.0.1/bin:$PATH ruby --version

Down

scripts/destroy

Troubleshooting

  1. Does the server exist in the Hetzner Cloud?

    $ hcloud server list
  2. Can you ssh into it using hcloud?

    $ hcloud server ssh ruby-compiler
  3. Did the cloud-init script succeed?

    $ less /var/log/cloud-init.log
    $ less /var/log/cloud-init-output.log
  4. Can you tailscale ssh ruby-compiler into the machine?

    Output appears in the cloud-init logfiles as mentioned above.

  5. Did the Ansible playbook succeed?

References

About

One-off Ruby compilation in an ARM Cloud VM

Topics

Resources

Stars

Watchers

Forks

Contributors