Skip to main content

The cloudFPGA Support Package

Project description

Build Status

cFSP

The cloudFPGA Support Package (cFSP) for the cloudFPGA project.

Currently, the cFSP includes a library for the control plane of cloudFPGA.

The cFSP control plane includes a Python package which is automatically generated by the Swagger Codegen project:

  • API version: 0.8
  • Package version: 1.0.0

Requirements.

Python 3.6+

Installation & Usage

Setting up python virtual environment:

git clone git@github.com:cloudFPGA/cFSP.git
cd cFSP/
which python3.8
/usr/bin/python3.8
virtualenv -p /usr/bin/python3.8 cfenv
source cfenv/bin/activate
pip install -r requirements.txt

Getting Started

Contents

Getting help

Please follow the installation procedure and then run the following:

./cfsp --help

cfsp-help

Setting up the credentials file for a user

Load the credentials for a user. If no credentials file exists, a new one be created. The default filename is user.json and it is strored in the cFSP folder. You need to provide your ZYC2 username and password, as well as a project you are member of.

./cfsp user load  --username=my_username --password=my_password --project=my_project

cfsp-user-load

The file has the following JSON format:

cfsp-user-json

NOTE: You may provide a specific configuration file instead of the default (user.json), by using the option -c my_custom_file (or --config my_custom_file), e.g.

./cfsp user load --config /home/user/user.json

Show the credentials of a user

Show the credentials of a user from a credentials file.

./cfsp user show

cfsp-user-show

Load new credentials for a user

You can easily load new credentials by:

  • either editing the configuration file (e.g. user.json),

  • or by providing any of the supported command line options (--username, --password, --project). In the latter case, the configuration file is being overwritten.

    ./cfsp user load --username=anotherUser  --password=anotherPassword  --project=anotherProject
    

    cfsp-user-load-new

Upload an image

Assuming you want to upload the FPGA image which is stored at /tmp/4_topFMKU60_impl_monolithic.bit

./cfsp image post --image_file=4_topFMKU60_impl_monolithic.bit

cfsp-image-post

Upload an image for partial reconfiguration

Assuming you want to upload the FPGA image for pr which is stored at /tmp/example_files_PR/4_topFMKU60_impl_2_pblock_ROLE_partial.bin. In that case you will also need the corresponding signature file that was produced by the build (/tmp/example_files_PR/4_topFMKU60_impl_2_pblock_ROLE_partial.bin.sig), as well as the result of the pr_verify command /tmp/example_files_PR/5_topFMKU60_impl_2_pblock_ROLE_partial.rpt. In addition, a configuration json file is selected by default in the parent folder of the provided image file. An example follows:

./cfsp image post-app-logic --image_file=/tmp/example_files_PR/4_topFMKU60_impl_2_pblock_ROLE_partial.bin --sig_file=/tmp/example_files_PR/4_topFMKU60_impl_2_pblock_ROLE_partial.bin.sig --pr_verify_rpt=/tmp/example_files_PR/5_topFMKU60_impl_2_pblock_ROLE_partial.rpt

cfsp-image-post-pr

Please note that those last two files are automatically selected by default, if only the image file is provided, like in the following example:

cfsp-image-post

Get an image

Assuming you want to get the details of the previously uloaded FPGA image with id 74462cd5-20e3-4228-a47d-258b7e5e583a

./cfsp image get 74462cd5-20e3-4228-a47d-258b7e5e583a

cfsp-image-get

Create a cluster

Assuming you want to create a cluster with

  • one CPU node from ZYC2 with ip=10.12.2.100
  • one FPGA from cloudFPGA platform with the previously uloaded FPGA image with id 74462cd5-20e3-4228-a47d-258b7e5e583a
./cfsp cluster post --image_id=74462cd5-20e3-4228-a47d-258b7e5e583a --node_ip=10.12.2.100

cfsp-cluster-post

NOTE: You may want to create many clusters of the previous type. For such cases, there is an extra option --repeat=<num>, which specifies how many times the command should be issued. Please note that this applies to all supported commands of cfsp, e.g. :

./cfsp cluster post --image_id=74462cd5-20e3-4228-a47d-258b7e5e583a --node_ip=10.12.2.100 --repeat=2

cfsp-cluster-post-repeat

Create a multi-node cluster

You can add to a cluster an arbitrary number of

  • CPU nodes from ZYC2, by using the --node_ip= identifier
  • FPGA nodes from cloudFPGA, by using the --image_id= identifier
./cfsp cluster post --image_id=74462cd5-20e3-4228-a47d-258b7e5e583a --image_id=d031b5a9-c3d8-4775-98db-e3de936a63e3  --node_ip=10.12.2.100 --node_ip=10.12.2.101 --node_ip=10.12.2.103 --node_ip=10.12.2.104 --node_ip=10.12.2.105

cfsp-cluster-post-many

Get a cluster

Assuming you want to get the details of the previously created cluster with id 259

./cfsp cluster get 259

cfsp-cluster-get

Delete a cluster

Assuming you want to delete the previously created cluster with id 259

./cfsp cluster delete 259

cfsp-cluster-delete

NOTE: You may delete all uploaded clusters of a user by not providing a specific cluster id, e.g.

./cfsp cluster delete

cfsp-cluster-delete-all

Create an instance

Assuming you want to create an instance with:

  • one FPGA from cloudFPGA platform with the previously uloaded FPGA image with id 74462cd5-20e3-4228-a47d-258b7e5e583a
./cfsp instance post --image_id=74462cd5-20e3-4228-a47d-258b7e5e583a

cfsp-instance-post

NOTE: You may want to create many instances of the previous type. For such cases, there is an extra option --repeat=<num>, which specifies how many times the command should be issued. Please note that this applies to all supported commands of cfsp, e.g. :

./cfsp instance post --image_id=74462cd5-20e3-4228-a47d-258b7e5e583a --repeat=2

cfsp-instance-post-many

Get an instance

Assuming you want to get the details of the previously created instance with id 5

./cfsp instance get 5

cfsp-instance-get

Delete an instance

Assuming you want to delete the previously created instance with id 5

./cfsp instance delete 5

cfsp-instance-delete

NOTE: You may delete all uploaded instances of a user by not providing a specific cluster id, e.g.

./cfsp instance delete

cfsp-instance-delete-all

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfsp-0.0.3.tar.gz (62.8 kB view hashes)

Uploaded Source

Built Distribution

cfsp-0.0.3-py3-none-any.whl (130.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page