Skip to content

Latest commit

 

History

History
88 lines (55 loc) · 2.14 KB

PATCHES.md

File metadata and controls

88 lines (55 loc) · 2.14 KB

Instructions for testing a patch for faasd

Launch a virtual machine

You can use any kind of Linux virtual machine, Ubuntu 20.04 is recommended.

Launch a cloud VM or use Multipass, which is free to use an can be run locally. A Raspberry Pi 3 or 4 could also be used, but will need you to run make dist to cross compile a valid binary.

Copy over your SSH key

Your SSH key will be used, so that you can copy a new faasd binary over to the host.

multipass launch \
  --memory 4G \
  -c 2 \
  -n faasd

# Then access its shell
multipass shell faasd

# Edit .ssh/authorized_keys

# Add .ssh/id_rsa.pub from your host and save the file

Install faasd on the VM

You start off with the upstream version of faasd on the host, then add the new version over the top later on.

cd /tmp/
git clone https://github.com/openfaas/faasd --depth=1
cd faasd/hack
./install.sh

# Run the login command given to you at the end of the script

Get the multipass IP address:

export IP=$(multipass info faasd --format json| jq -r '.info.faasd.ipv4[0]')

Build a new faasd binary with the patch

Check out faasd on your local computer

git clone https://github.com/openfaas/faasd
cd faasd

gh pr checkout #PR_NUMBER_HERE

GOOS=linux go build

# You can also run "make dist" which is slower, but includes
# a version and binaries for other platforms such as the Raspberry Pi

Copy it over to the VM

Now build a new faasd binary and copy it to the VM:

scp faasd ubuntu@$IP:~/

Now deploy the new version on the VM:

killall -9 faasd-linux; killall -9 faasd-linux ; mv ./faasd-linux /usr/local/bin/faasd

Check it worked and test that patch

Now run a command with faas-cli such as:

  • faas-cli list
  • faas-cli version

See the testing instructions on the PR and run through those steps.

Post your results on GitHub to assist the creator of the pull request.

You can see how to get the logs for various components using the eBook Serverless For Everyone Else, or by consulting the DEV.md guide.