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: '!'
- 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
- List your existing workflows
> queenbee pollination workflows list
ID Name
------------------------------------ ------------------------------
2444c12f-06f3-47c9-9566-e71860017961 hello-world
- 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
- 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
- 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
- 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
- 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
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for queenbee_pollination-0.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f34bfb78b048f0ea43db23a580801915e59e87bb4f731308046d4bef6ea4d157 |
|
MD5 | 5bf30a1a5adc1e3067740b47ab136aa9 |
|
BLAKE2b-256 | b0c7c1bfde93ffb6aa2d15586d62f9a0aa1be723b842910444f76778515c1b82 |
Hashes for queenbee_pollination-0.2.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14af002677ee183593f313f3f10e960f2d3a960d67b3723d316c15a44ac0b163 |
|
MD5 | 20179fc044b05e14b609ddde230304ca |
|
BLAKE2b-256 | ce3bc79f70fadf7633175b3b3b4408edbd724cdcdc1bccc245657e40f1037529 |