Install Kubeflow Fairing

Setting up your Kubeflow Fairing development environment

You can use Kubeflow Fairing to build, train, and deploy machine learning (ML)models in a hybrid cloud environment directly from Python code or a Jupyternotebook. This guide describes how to install Kubeflow Fairing in yourdevelopment environment for local development, or development in ahosted notebook.

Using Kubeflow Fairing with Kubeflow notebooks

Kubeflow notebook servers that are built from one of the standard JupyterDocker images include Kubeflow Fairing and come preconfigured for usingKubeflow Fairing to run training jobs on your Kubeflow cluster.

If you use a Kubeflow notebook server that was built from a custom JupyterDocker image as your development environment, follow the instruction onsetting up Kubeflow Fairing in a hosted notebook environment.

Set up Kubeflow Fairing for local development

Follow these instructions to set up Kubeflow Fairing for local development.This guide has been tested on Linux and Mac OS X. Currently, this guide hasnot been tested on Windows.

Set up Python

  • You need Python 3.6 or later to use Kubeflow Fairing. To check ifyou have Python 3.6 or later installed, run the following command:
  1. python3 -V

The response should be something like this:

  1. Python 3.6.5

If you do not have Python 3.6 or later, you can downloadPython from the Python SoftwareFoundation.

  • Use virtualenv to create a virtual environment to install KubeflowFairing in. To check if you have virtualenv installed, run thefollowing command:
  1. which virtualenv

The response should be something like this:

  1. /usr/bin/virtualenv

If you do not have virtualenv, use pip3 to install virtualenv.

  1. pip3 install virtualenv

Create a new virtual environment, and activate it.

  1. virtualenv venv --python=python3
  2. source venv/bin/activate

Install Kubeflow Fairing

Run the following command to install Kubeflow Fairing in your virtualenvironment.

  1. pip install kubeflow-fairing

After the install is complete, the fairing python package isavailable. Run the following command to verify that Kubeflow Fairingis installed:

  1. pip show kubeflow-fairing

The response should be something like this:

  1. Name: kubeflow-fairing
  2. Version: 0.6.0
  3. Summary: Kubeflow Fairing Python SDK.
  4. Home-page: https://github.com/kubeflow/fairing
  5. Author: Kubeflow Authors
  6. Author-email: hejinchi@cn.ibm.com
  7. License: Apache License Version 2.0
  8. Location: <path-to-kubeflow-fairing>
  9. Requires: notebook, future, docker, tornado, cloudpickle, oauth2client, numpy, requests, setuptools, httplib2, google-auth, google-api-python-client, urllib3, boto3, azure, six, kubernetes, google-cloud-storage

Docker setup

Kubeflow Fairing uses Docker to package your code. Run the following commandto verify if Docker is installed and running:

  1. docker ps

Configure Kubeflow Fairing

To configure Kubeflow Fairing with access to an environment that you would like touse for training and deployment, follow the instructions in the guide toconfiguring Kubeflow Fairing.

Set up Kubeflow Fairing in a hosted Jupyter notebook

Follow these instructions to set up Kubeflow Fairing in a hosted Jupyternotebook.

If you are using a Kubeflow notebook server that was built from one of thestandard Jupyter Docker images, your notebooks environment has beenpreconfigured for training and deploying ML models with Kubeflow Fairing andno additional installation steps are required.

Prerequisites

Check the following prerequisites to verify that Kubeflow Fairing is compatiblewith your hosted notebook environment.

  • In the Jupyter notebooks user interface, click File > New >Terminal in the menu to start a new terminal session in your notebookenvironment.
  • You need Python 3.6 or later to use Kubeflow Fairing. To check if youhave Python 3.6 or later installed, run the following command in yourterminal session:
  1. python3 -V

The response should be something like this:

  1. Python 3.6.5
  • Kubeflow Fairing uses Docker to package your code. Run the followingcommand in your terminal session to verify if Docker is installed andrunning in your notebook environment:
  1. docker ps

Install Kubeflow Fairing

  • In the Jupyter notebooks user interface, click File > New >Terminal in the menu to start a new terminal session in your notebookenvironment.
  • Run the following command to install Kubeflow Fairing.
  1. pip3 install kubeflow-fairing

After successful installation, the fairing python package should beavailable. Run the following command to verify that Kubeflow Fairingis installed:

  1. pip3 show kubeflow-fairing

The response should be something like this:

  1. Name: kubeflow-fairing
  2. Version: 0.6.0
  3. Summary: Kubeflow Fairing Python SDK.
  4. Home-page: https://github.com/kubeflow/fairing
  5. Author: Kubeflow Authors
  6. Author-email: hejinchi@cn.ibm.com
  7. License: Apache License Version 2.0
  8. Location: <path-to-kubeflow-fairing>
  9. Requires: notebook, future, docker, tornado, cloudpickle, oauth2client, numpy, requests, setuptools, httplib2, google-auth, google-api-python-client, urllib3, boto3, azure, six, kubernetes, google-cloud-storage

Configure Kubeflow Fairing

To configure Kubeflow Fairing with access to the environment you would like touse for training and deployment, follow the instructions in the guide toconfiguring Kubeflow Fairing.

Next steps

Feedback

Was this page helpful?

Glad to hear it! Please tell us how we can improve.

Sorry to hear that. Please tell us how we can improve.

Last modified 17.09.2019: update fairing to kubeflow-fairing (#1155) (185af42e)