If not already running, start MongoDB (if your MongoDB is hosted and maintained externally, follow the note below regarding lpad init):
%% Cell type:code id:electronic-essex tags:
``` python
# !lpad init
```
%% Cell type:code id:increasing-context tags:
``` python
!catmy_launchpad.yaml
!cat~/.fireworks/my_launchpad.yaml
```
%% Cell type:markdown id:white-owner tags:
Reset/Initialize the FireWorks database (the LaunchPad):
%% Cell type:code id:entertaining-scotland tags:
``` python
!echo'y'|lpadreset
```
%% Cell type:markdown id:numerous-regard tags:
## Add a Workflow
There are many ways to add Workflows to the database, including a Python API. Let’s start with an extremely simple example that can be added via the command line:
This added a two-job linear workflow. The first jobs prints hello to the command line, and the second job prints goodbye. We gave names (optional) to each step as “hello” and “goodbye”. We named the workflow overall (optional) as “test_workflow”.
We get back basic information on our workflows. The second step “goodbye” is waiting for the first one to complete; it is not ready to run because it depends on the first job.
%% Cell type:markdown id:useful-reviewer tags:
## Run all Workflows
You can run jobs one at a time (“singleshot”) or all at once (“rapidfire”). Let’s run all jobs:
%% Cell type:code id:excess-chosen tags:
``` python
!rlaunch--silencerrapidfire
```
%% Cell type:markdown id:dedicated-commerce tags:
Clearly, both steps of our workflow ran in the correct order.
%% Cell type:markdown id:joined-antique tags:
Let’s again look at our workflows:
%% Cell type:code id:conditional-henry tags:
``` python
!lpadget_wflows-ntest_workflow-dmore
```
%% Cell type:markdown id:lucky-failing tags:
FireWorks automatically created launcher_ directories for each step in the Workflow and ran them. We see that both steps are complete. Note that there exist options to choose where to run jobs, as well as to tear down empty directories after running jobs.
%% Cell type:markdown id:forward-client tags:
## Launch the web GUI
If you have a web browser, you can launch the web GUI to see your results:
%% Cell type:code id:anticipated-patrol tags:
``` python
# !lpad webgui
```
%% Cell type:markdown id:civic-sauce tags:
Note that there are options to run the web site in a server mode, try lpad webgui -h to see all the options.
open: http://localhost:8888/proxy/5000
open: http://localhost:8888/fireworks
%% Cell type:markdown id:explicit-denial tags:
## Python code
The following Python code achieves the same behavior:
In the code above, the `{fw1:fw2}` argument to Workflow is adding a dependency of fw2 to fw1. You could instead define this dependency when defining your FireWorks: