Skip to main content

queenbee-pollination extends queenbee to interact with the Pollination API

Project description

queenbee-pollination

queenbee-pollination extends queenbee in order to interact with the Pollination API.

Installation

You can install this as a cli tool using the following command:

pip install queenbee-pollination[cli]

CLI QuickStart

Authentication

When you first run any queenbee-pollination command through the CLI you will be required to enter some authentication details so that the tool can interact with the Pollination API using your account.

You will need your Pollination API token Key and ID which can be found on your account page.

You will be prompted to do so by the CLI as demonstrated below:

> queenbee pollination workflows

Looks like this is your first time logging in.

To interract with Pollination you need to save authentication credentials in C:\Users\me\.queenbee

This tool will walk you through this process:

Enter your API Token ID: f15be412fe6f41dc01440f2363a13fed
Enter your API Token Secret: 
Logging in using api tokens...
Success!

You can now run queenbee pollination commands as an authenticated user!
Check the and modify the config file at your own risk: C:\Users\me\.queenbee

You can now check the configuration file saved at the path indicated in you command line. in the case of the example above the path to the config file is: C:\Users\me\.queenbee.

Hello World!

We have compiled a quick demo workflow for you to test out the queenbee-pollination plugin.

Copy and save the text below into a file called hello.yaml.

type: workflow
name: hello-world

operators:
- name: whalesay
  image: docker/whalesay

templates:
- type: function
  name: cowsay
  operator: whalesay
  inputs:
    parameters:
    - name: word
  command: cowsay {{inputs.parameters.word}}

flow:
  name: say-hello-world
  tasks:
  - name: say-hello
    template: cowsay
    arguments:
      parameters:
      - name: word
        value: hello
  - name: say-world
    template: cowsay
    dependencies: ['say-hello']
    arguments:
      parameters:
      - name: word
        value: world
  - name: exclamate
    template: cowsay
    dependencies: ['say-world']
    arguments:
      parameters:
      - name: word
        value: '!'
  1. Save the workflow to the Pollination platform
> queenbee pollination workflows create -f hello.yaml

Successfully updated workflow hello-world
ID: 7ceff0de-2ed9-4e89-b943-9d3f2754ad0f
  1. List your existing workflows
> queenbee pollination workflows list

  ID                                    Name
------------------------------------  ------------------------------
2444c12f-06f3-47c9-9566-e71860017961  hello-world
  1. Submit a simulation to run using the hello-world workflow template
> queenbee pollination simulations submit -w 2444c12f-06f3-47c9-9566-e71860017961

Succesfully created simulation: f01b6926-c953-4b4d-be7f-945aafa1ec5c
  1. Resubmit the simulation a couple of times to create multiple simulations.
> queenbee pollination simulations resubmit -i f01b6926-c953-4b4d-be7f-945aafa1ec5c

Succesfully created simulation: 7b78543f-e929-4876-bb23-88775f69ffc9
  1. List all running simulations
> queenbee pollination simulations list

ID                                    Workflow                        Phase      Completed    Stated At                  Finished At
------------------------------------  ------------------------------  ---------  -----------  -------------------------  -------------------------
f01b6926-c953-4b4d-be7f-945aafa1ec5c  hello-world                     Succeeded  True         2019-12-11 07:59:05+00:00  2019-12-11 07:59:23+00:00
c7a681d2-2b1c-414e-bc9e-88cf0bfcaf84  hello-world                     Succeeded  True         2019-12-11 07:57:50+00:00  2019-12-11 07:57:50+00:00
e5fa5b0b-7253-47cd-a6a0-63b2f5249cf4  hello-world                     Succeeded  True         2019-12-11 07:54:46+00:00  2019-12-11 07:54:46+00:00
e556c46e-f71e-4bd5-927b-f4ce6a1d1e73  hello-world                     Succeeded  True         2019-12-11 07:49:39+00:00  2019-12-11 07:49:39+00:00
  1. Retrieve the logs from the latest ran workflow. The command below will download all logs into the dump/logs/ folder.
> queenbee pollination simulations download -i f01b6926-c953-4b4d-be7f-945aafa1ec5c -f dump -a logs
  1. Retrieve all persisted simulation data to a local folder called sim-data.
> queenbee pollination simulations download -i f01b6926-c953-4b4d-be7f-945aafa1ec5c -f sim-data
  1. Inpect simulation metadata in detail. Get and save the simulation object into a file called dump.json
> queenbee pollination simulations get -i f01b6926-c953-4b4d-be7f-945aafa1ec5c -f dump.json

Artifacts

You can also upload raw files to the Pollination storage bucket. These files will then be accessible to any simulation you run thereafter.

Create

Create a folder called test and place some files in it. You can then upload these files using the following command:

> queenbee pollination artifacts upload -f test

Uploaded test/file1.txt
Uploaded test/file2.txt
Uploaded test/file3.txt

List

You can list all files within your pollination folder by running the following command:

> queenbee pollination artifacts list

Name                            Path                                                                             Size (Mb)  Last Modified
------------------------------  -----------------------------------------------------------------------------  -----------  --------------------------------
room.pts                        daylight/project_folder/asset/grid/room.pts                                       0.10778   2019-12-13 03:35:02.526000+00:00
room.pts.bkup                   daylight/project_folder/asset/grid/room.pts.bkup                                  0.004248  2019-12-13 03:34:58.764000+00:00
rflux_sky.rad                   daylight/project_folder/asset/sky/rflux_sky.rad                                   0.000196  2019-12-13 03:34:56.755000+00:00
sky.rad                         daylight/project_folder/asset/sky/sky.rad                                         0.00018   2019-12-13 03:34:57.345000+00:00

Delete

Artifacts can be deleted by using a prefix of exact file key. Here is an exampled to delete all files within a folder called daylight/project_folder/:

> queenbee pollination artifacts delete -p daylight/project_folder

Poof... All gone!

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

queenbee_pollination-0.3.1.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

queenbee_pollination-0.3.1-py2.py3-none-any.whl (9.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file queenbee_pollination-0.3.1.tar.gz.

File metadata

  • Download URL: queenbee_pollination-0.3.1.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.9

File hashes

Hashes for queenbee_pollination-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b18e67e498185e4d7eb225ca5f8bb4c8f35f71d7cc2afacc5738268c19fb639d
MD5 6d27fc2f4f24b9370fce16a8dd61b230
BLAKE2b-256 aa3c0c162bf7db3b487cf5f5d5ab0fca987d15a90543efef834ff8a0de68fd80

See more details on using hashes here.

File details

Details for the file queenbee_pollination-0.3.1-py2.py3-none-any.whl.

File metadata

  • Download URL: queenbee_pollination-0.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.9

File hashes

Hashes for queenbee_pollination-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0f8a936492495382b872d43c6a33f1fc52257b5d073b9fbf8b489873ed667df0
MD5 9cc98c2a37e089563e2692d0bc5467d7
BLAKE2b-256 7545880e3149d9fd86e68af66bd004f36e649aa32836dd18ea66ae4396542a16

See more details on using hashes here.

Supported by

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