test.py - Python examples for firework launches; using lpad

Hello,

I’m curious as to how the webgui syncs with the launches using the python method to submit tasks. It would seem that if you want to use the webgui you are forced to submit jobs via commandline / terminal. Maybe I’ve missed something in the tutorial, but an explanation would be appreciated.

Hi

The webgui can currently only be used to monitor the progress of workflow and jobs. It cannot be used to compose or submit workflows as we have not built a UI to do so. To submit a workflow, you’d either need to use the command line or Python interface.

···

Best,
Anubhav

Perhaps I wasn’t clear enough…

If you python test.py with test.py containing the following:

Enter code here…from fireworks.core.firework import Firework, Workflow

``
from fireworks.core.fworker import FWorker

from fireworks.core.launchpad import LaunchPad

from fireworks.core.rocket_launcher import launch_rocket, rapidfire

from fireworks.user_objects.firetasks.script_task import ScriptTask

def setup():

launchpad = LaunchPad(name='fireworks_test')

#launchpad.reset()

return launchpad

def basic_wf_ex():

print('--- BASIC WORKFLOW EXAMPLE ---')

# setup

launchpad = setup()

# add FireWorks

task1 = ScriptTask.from_str('echo "Ingrid is the CEO."')

task2 = ScriptTask.from_str('echo "Jill is a manager."')

task3 = ScriptTask.from_str('echo "Jack is a manager."')

task4 = ScriptTask.from_str('echo "Kip is an intern."')

fw1 = Firework(task1, fw_id=1)

fw2 = Firework(task2, fw_id=2)

fw3 = Firework(task3, fw_id=3)

fw4 = Firework(task4, fw_id=4)

# make workflow

workflow = Workflow([fw1, fw2, fw3, fw4], {1: [2, 3], 2: [4], 3: [4]})

launchpad.add_wf(workflow)

# launch Rocket

rapidfire(launchpad, FWorker())

if ‘main’== name:

basic_wf_ex()

Which is a small subset of the example in test.py, you may then not be able to see any fireworks if you try the lpad in the commandline / terminal. This also translate to not seeing any completed jobs in the webgui. Is there something I am missing here?

···

On Monday, November 26, 2018 at 4:36:12 PM UTC+1, ajain wrote:

Hi

The webgui can currently only be used to monitor the progress of workflow and jobs. It cannot be used to compose or submit workflows as we have not built a UI to do so. To submit a workflow, you’d either need to use the command line or Python interface.

On Mon, Nov 26, 2018 at 4:04 AM Christopher Pashartis [email protected] wrote:

Hello,

I’m curious as to how the webgui syncs with the launches using the python method to submit tasks. It would seem that if you want to use the webgui you are forced to submit jobs via commandline / terminal. Maybe I’ve missed something in the tutorial, but an explanation would be appreciated.

You received this message because you are subscribed to the Google Groups “fireworkflows” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

Visit this group at https://groups.google.com/group/fireworkflows.

For more options, visit https://groups.google.com/d/optout.


Best,
Anubhav

Hi Christopher

Your initial code changes the default LaunchPad database to “fireworks_test”. By default, the “lpad” command assumes the default database (“fireworks”) unless you specify otherwise.

To get the “lpad” command to use this custom database, create a “my_launchpad.yaml” file and use:

lpad -l <path/to/my_launchpad.yaml> [[rest of lpad command]]

e.g. lpad -l /Users/creds/my_launchpad.yaml webgui

You can also set the FW config to set default locations for things like my_launchpad.yaml

https://materialsproject.github.io/fireworks/config_tutorial.html

You can use “lpad init” to help you create a my_launchpad.yaml file

https://materialsproject.github.io/fireworks/quickstart.html

···

On Monday, November 26, 2018 at 4:57:55 PM UTC-5, Christopher Pashartis wrote:

Perhaps I wasn’t clear enough…

If you python test.py with test.py containing the following:

Enter code here…from fireworks.core.firework import Firework, Workflow

``
from fireworks.core.fworker import FWorker

from fireworks.core.launchpad import LaunchPad

from fireworks.core.rocket_launcher import launch_rocket, rapidfire

from fireworks.user_objects.firetasks.script_task import ScriptTask

def setup():

launchpad = LaunchPad(name='fireworks_test')
#launchpad.reset()
return launchpad

def basic_wf_ex():

print('--- BASIC WORKFLOW EXAMPLE ---')
# setup
launchpad = setup()
# add FireWorks
task1 = ScriptTask.from_str('echo "Ingrid is the CEO."')
task2 = ScriptTask.from_str('echo "Jill is a manager."')
task3 = ScriptTask.from_str('echo "Jack is a manager."')
task4 = ScriptTask.from_str('echo "Kip is an intern."')
fw1 = Firework(task1, fw_id=1)
fw2 = Firework(task2, fw_id=2)
fw3 = Firework(task3, fw_id=3)
fw4 = Firework(task4, fw_id=4)
# make workflow
workflow = Workflow([fw1, fw2, fw3, fw4], {1: [2, 3], 2: [4], 3: [4]})
launchpad.add_wf(workflow)
# launch Rocket
rapidfire(launchpad, FWorker())

if ‘main’== name:

basic_wf_ex()

Which is a small subset of the example in test.py, you may then not be able to see any fireworks if you try the lpad in the commandline / terminal. This also translate to not seeing any completed jobs in the webgui. Is there something I am missing here?

On Monday, November 26, 2018 at 4:36:12 PM UTC+1, ajain wrote:

Hi

The webgui can currently only be used to monitor the progress of workflow and jobs. It cannot be used to compose or submit workflows as we have not built a UI to do so. To submit a workflow, you’d either need to use the command line or Python interface.

On Mon, Nov 26, 2018 at 4:04 AM Christopher Pashartis [email protected] wrote:

Hello,

I’m curious as to how the webgui syncs with the launches using the python method to submit tasks. It would seem that if you want to use the webgui you are forced to submit jobs via commandline / terminal. Maybe I’ve missed something in the tutorial, but an explanation would be appreciated.

You received this message because you are subscribed to the Google Groups “fireworkflows” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

Visit this group at https://groups.google.com/group/fireworkflows.

For more options, visit https://groups.google.com/d/optout.


Best,
Anubhav

Hi,

I just wanted to let you know that FWS v1.8.4 tries to clean up some of the code to no longer use environment variables for connecting to the database. It’s possible that this might help in some of your issues. See the example at the bottom here:

https://materialsproject.github.io/fireworks/basesite_tutorial.html

Best,

Anubhav

···

On Wednesday, November 28, 2018 at 7:43:49 AM UTC-8, Anubhav Jain wrote:

Hi Christopher

Your initial code changes the default LaunchPad database to “fireworks_test”. By default, the “lpad” command assumes the default database (“fireworks”) unless you specify otherwise.

To get the “lpad” command to use this custom database, create a “my_launchpad.yaml” file and use:

lpad -l <path/to/my_launchpad.yaml> [[rest of lpad command]]

e.g. lpad -l /Users/creds/my_launchpad.yaml webgui

You can also set the FW config to set default locations for things like my_launchpad.yaml

https://materialsproject.github.io/fireworks/config_tutorial.html

You can use “lpad init” to help you create a my_launchpad.yaml file

https://materialsproject.github.io/fireworks/quickstart.html

On Monday, November 26, 2018 at 4:57:55 PM UTC-5, Christopher Pashartis wrote:

Perhaps I wasn’t clear enough…

If you python test.py with test.py containing the following:

Enter code here…from fireworks.core.firework import Firework, Workflow

``
from fireworks.core.fworker import FWorker

from fireworks.core.launchpad import LaunchPad

from fireworks.core.rocket_launcher import launch_rocket, rapidfire

from fireworks.user_objects.firetasks.script_task import ScriptTask

def setup():

launchpad = LaunchPad(name='fireworks_test')
#launchpad.reset()
return launchpad

def basic_wf_ex():

print('--- BASIC WORKFLOW EXAMPLE ---')
# setup
launchpad = setup()
# add FireWorks
task1 = ScriptTask.from_str('echo "Ingrid is the CEO."')
task2 = ScriptTask.from_str('echo "Jill is a manager."')
task3 = ScriptTask.from_str('echo "Jack is a manager."')
task4 = ScriptTask.from_str('echo "Kip is an intern."')
fw1 = Firework(task1, fw_id=1)
fw2 = Firework(task2, fw_id=2)
fw3 = Firework(task3, fw_id=3)
fw4 = Firework(task4, fw_id=4)
# make workflow
workflow = Workflow([fw1, fw2, fw3, fw4], {1: [2, 3], 2: [4], 3: [4]})
launchpad.add_wf(workflow)
# launch Rocket
rapidfire(launchpad, FWorker())

if ‘main’== name:

basic_wf_ex()

Which is a small subset of the example in test.py, you may then not be able to see any fireworks if you try the lpad in the commandline / terminal. This also translate to not seeing any completed jobs in the webgui. Is there something I am missing here?

On Monday, November 26, 2018 at 4:36:12 PM UTC+1, ajain wrote:

Hi

The webgui can currently only be used to monitor the progress of workflow and jobs. It cannot be used to compose or submit workflows as we have not built a UI to do so. To submit a workflow, you’d either need to use the command line or Python interface.

On Mon, Nov 26, 2018 at 4:04 AM Christopher Pashartis [email protected] wrote:

Hello,

I’m curious as to how the webgui syncs with the launches using the python method to submit tasks. It would seem that if you want to use the webgui you are forced to submit jobs via commandline / terminal. Maybe I’ve missed something in the tutorial, but an explanation would be appreciated.

You received this message because you are subscribed to the Google Groups “fireworkflows” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

Visit this group at https://groups.google.com/group/fireworkflows.

For more options, visit https://groups.google.com/d/optout.


Best,
Anubhav