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

Succesfully 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. Schedule a simulation to run using the hello-world workflow template
> queenbee pollination simulations schedule -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 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

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.2.1.tar.gz (10.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.2.1-py2.py3-none-any.whl (8.6 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: queenbee_pollination-0.2.1.tar.gz
  • Upload date:
  • Size: 10.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.2.1.tar.gz
Algorithm Hash digest
SHA256 97210106fe916facd0cbd96b0103a00da1a8f491af78990cef22e540e4860ab8
MD5 374e5f8b325c1283fb2ea518fd925bc3
BLAKE2b-256 d4d9d112c0cc63b5c8ee49afd0949a189a27bc652de730f7c5b84e77d2682a54

See more details on using hashes here.

File details

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

File metadata

  • Download URL: queenbee_pollination-0.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.6 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.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3058e08d5aa7fd15065ac8a88ac59c83e20d5a2a80ce774f815f5f5cf6ed775c
MD5 8fe84858816539caf6496c40b3704e20
BLAKE2b-256 2897dbec5d8f99ad7491c25cc4f9be352799c4713d3d8f92611e2f4f7842334c

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