Overview

What Is FaaSpot?

FaaSpot is a SaaS service that enables you to run Functions as a Service (FaaS), and reduce your monthly Cloud expenses. The concept provides the ability for you to run your functions on a FaaSpot spot. A FaaSpot spot is a VM that can run your functions. You can run multiple concurrent functions on one spot. Nevertheless, the more spots that you have, the more concurrent functions you'll be able to run. The cool thing about FaaSpot, is that you pay for each spot that you have, regardless of the number of functions that you run on it, and it actually uses AWS spots to reduce costs.

Requirements

  1. You need a FaaSpot token. If you haven’t already obtained a FaaSpot API key, send us a request at info@faaspot.com.
  2. If you're using the python-client, python-client version compatibility is: Python 2.7, 3.3-3.5.

Note

Communication with the FaaSpot webserver is encrypted and secured.

You can access FaaSpot using the FaaSpot client from the VM, directly from the Python script (as a library), or by using the proprietary REST API. The FaaSpot’s command-line interface is the default method for interacting with FaaSpot and managing your functions.

Limitations

  1. FaaSpot currently supports only python scripts.
  2. The python script needs a main function with a specific format.
  3. The function run time must be less than a minute.

Installation

You can install the FaaSpot Client via pip:

$ pip install faaspot

Note

After installing the FaaSpot client you'll have both the command-line interface (CLI) and a python-client library. The CLI client name is fas and the python-client library name is faaspot.

To upgrade the FaaSpot client version, run: pip install faaspot --upgrade.

For info about the CLI, go to the CLI page. For info about the python library, go to the functions page.

Setting Up The Environment

To use the FaaSpot client, you need to configure your profile. This configuration will apply to both the CLI and the python-client library. Create a FaaSpot profile that contains your FaaSpot token credentials.

$ fas profiles create --token MY_API_TOKEN

Note

The fas profiles create command will create a global configuration file located at ~/.faaspot folder, which contain the connection configuration to FaaSpot.

You can also manually edit the ~/.faaspot/conf.yaml file.

Note

fas supports tab completion in bash shells via the argcomplete package.

To enable it, add

eval "$(register-python-argcomplete fas)"

to the ~/.basrc file. You can add it manually or by running

$ echo -e '\neval "$(register-python-argcomplete fas)"\n' >> ~/.bashrc

and then run source ~/.bashrc. You can test that it works by running

$ fas sp<TAB>

It should complete to

$ fas spots