Install Kubeflow Fairing
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 .
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.
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.
- 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:
The response should be something like this:
If you do not have Python 3.6 or later, you can 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:
The response should be something like this:
/usr/bin/virtualenv
pip3 install virtualenv
Create a new virtual environment, and activate it.
Install Kubeflow Fairing
Run the following command to install Kubeflow Fairing in your virtualenvironment.
pip install kubeflow-fairing
After the install is complete, the fairing
python package isavailable. Run the following command to verify that Kubeflow Fairingis installed:
pip show kubeflow-fairing
The response should be something like this:
Name: kubeflow-fairing
Summary: Kubeflow Fairing Python SDK.
Home-page: https://github.com/kubeflow/fairing
Author: Kubeflow Authors
Author-email: hejinchi@cn.ibm.com
License: Apache License Version 2.0
Location: <path-to-kubeflow-fairing>
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
Kubeflow Fairing uses Docker to package your code. Run the following commandto verify if Docker is installed and running:
- If you receive the
docker: command not found
message, . - If you are using Linux and you use sudo to access Docker, follow thesesteps to add your user to the docker group. Note, thedocker group grants privileges equivalent to the root user. To learn moreabout how this affects security in your system, see the guide to the.
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 .
Follow these instructions to set up Kubeflow Fairing in a hosted Jupyternotebook.
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:
The response should be something like this:
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:
docker ps
- If you receive the
docker: command not found
message, installDocker. - If you receive the
Error response from daemon: Bad response fromDocker engine
message, . - If you are using Linux and you use sudo to access Docker, follow thesesteps to add your user to the docker group. Note, thedocker group grants privileges equivalent to the root user. To learnmore about how this affects security in your system, see the guide tothe .
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.
pip3 install kubeflow-fairing
After successful installation, the python package should beavailable. Run the following command to verify that Kubeflow Fairingis installed:
pip3 show kubeflow-fairing
The response should be something like this:
To configure Kubeflow Fairing with access to the environment you would like touse for training and deployment, follow the instructions in the guide to.
- Configure your Kubeflow Fairing development environment with accessto run training jobs remotely.
- Follow the to learn more about how to runtraining jobs remotely with Kubeflow Fairing.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Last modified 17.09.2019: