Skip to main content

Getting Started

Fair Compute platform is a web service and a collection of tools that allows you to turn your computers into a cluster that you can use for sharing with other developers or for deployment.

If you're already using the cloud, you can leverage Fair to add some extra compute to your backend during crunch times and save money since desktop hardware is considerably cheaper than its cloud counterpart, and you likely have some idle machines sitting in your office or at home.

In this tutorial, we will install Fair and launch our first job.

Installation

1. Sign Up & Activate the Account

To start using Fair please sign up at faircompute.com. It is free. You can find invitation codes in our Discord.

2. Install Fair Desktop App

Install Fair Desktop application onto the machine you want to use to run jobs. Use fair CLI to schedule jobs.


Access Control

By default, nobody has access to your machines, except for you. To allow others to run jobs on your machines, you will need to create a cluster and give access to other users. You can find more information about this in Managing Clusters section.

For extra piece of mind, you can shutdown the fair-desktop application. This will prevent any jobs from running on your machine. Even if fair-desktop app is not running - you can still use CLI to schedule jobs and manage other machines that you have access to.

3. Configure Credentials

Configure credentials using Fair command line tool by running

fair configure

You can also configure credentials using Fair desktop app. To configure credentials, launch the app, right-click on the tray icon and click change credentials.

Lastly, you can edit the config manually. Location depends on your operating system.

%APPDATA%\Fair Compute\config\credentials.yml
To open the file, press Win + R and paste the path or type it in the file explorer address bar.

4. Install Docker

Install Docker if you're planning to use containers. Note that only Docker engine is required, desktop app is optional.

Using Fair

1. Inspect the Cluster

Once you've authenticated and launched the client it is time to inspect the cluster. Use fair cluster info command for this purpose. Ensure that you see details of all the machines that you have launched Fair desktop application on.

fair cluster info

If cluster is empty, it means that no providers are running. You can start a provider on a machine using fair-desktop command:

fair-desktop

Afterward fair cluster info command should show that you have at least one node in the cluster.

2. Run your First Task

To run the task on the cluster you can leverage fair task command:

fair docker run alpine echo "Hello Fair Compute"

If you need to see more details about program execution, pass -vv flag.