Bases: fireworks.utilities.fw_serializers.FWSerializable
A FWAction encapsulates the output of a FireTask (it is returned by a FireTask after the FireTask completes). The FWAction allows a user to store rudimentary output data as well as return commands that alter the workflow.
stored_data (dict): data to store from the run. Does not affect the operation of FireWorks. exit (bool): if set to True, any remaining FireTasks within the same Firework are skipped. update_spec (dict): specifies how to update the child FW’s spec mod_spec ([dict]): update the child FW’s spec using the DictMod language (more flexible
than update_spec)
additions ([Workflow]): a list of WFs/FWs to add as children detours ([Workflow]): a list of WFs/FWs to add as children (they will inherit the
current FW’s children)
defuse_children (bool): defuse all the original children of this Firework defuse_workflow (bool): defuse all incomplete steps of this workflow
If the FWAction gives any dynamic action, we skip the subsequent FireTasks
Bases: collections.defaultdict, fireworks.utilities.fw_serializers.FWSerializable
FireTaskBase is used like an abstract class that defines a computing task (FireTask). All FireTasks should inherit from FireTaskBase.
You can set parameters of a FireTask like you’d use a dict.
This method gets called when the FireTask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.
Bases: abc.ABCMeta
Bases: fireworks.utilities.fw_serializers.FWSerializable
A Firework is a workflow step and might be contain several FireTasks.
Return firework dict with updated launches and state.
Bases: fireworks.utilities.fw_serializers.FWSerializable, object
A Launch encapsulates data about a specific run of a Firework on a computing resource.
Adds the job_id to the reservation.
Updates the update_on field of the state history of a Launch. Used to ping that a Launch is still alive.
Bases: fireworks.utilities.fw_serializers.FWSerializable, object
A Tracker monitors a file and returns the last N lines for updating the Launch object.
Reads the monitored file and returns back the last N lines
Bases: fireworks.utilities.fw_serializers.FWSerializable
A Workflow connects a group of FireWorks in an execution order.
Bases: dict, fireworks.utilities.fw_serializers.FWSerializable
An inner class for storing the DAG links between FireWorks
Return list of all nodes
Return a dict of child and its parents.
Note: if performance of parent_links becomes an issue, override delitem/setitem to update parent_links
Convert to str form for Mongo, which cannot have int keys .
Convert to str form for Mongo, which cannot have int keys.
Method to add a workflow as a child to a Firework Note: detours must have children that have STATE_RANK that is WAITING or below
Apply a FWAction on a Firework in the Workflow.
Return Workflow from the given Firework.
Return Workflow from its dict representation.
Create a fresh Workflow from an existing one.
Return list of all fireworks
Gets leaf FireWorks of this workflow (those with no children).
Refreshes the state of a Firework and any affected children.
Archives the launches of a Firework so that it can be re-run.
Reset the states of all Fireworks in this workflow to ‘WAITING’.
Gets root FireWorks of this workflow (those with no parents).
Bases: fireworks.utilities.fw_serializers.FWSerializable
name (str): the name of the resource, should be unique category (str): a String describing the computing resource, does not need to be unique query (dict): a dict query that restricts the type of Firework this resource will run env (dict): a dict of special environment variables for the resource.
This env is passed to running FireTasks as a _fw_env in the fw_spec, which provides for abstraction of resource-specific commands or settings. See fireworks.core.firework.FireTaskBase for information on how to use this env variable in FireTasks.
Returns FWorker object from settings file(my_fworker.yaml).
Returns updated query dict.
Bases: fireworks.utilities.fw_serializers.FWSerializable
The LaunchPad manages the FireWorks database.
Add the launch and firework to the offline_run collection.
Add workflow(or firework) to the launchpad. The firework ids will be reassigned.
Append a new workflow on top of an existing workflow.
new_wf (Workflow): The new workflow to append fw_ids ([int]): The parent fw_ids at which to append the workflow detour (bool): Whether to connect the new Workflow in a “detour” style, i.e., move original children of the parent fw_ids to the new_wf pull_spec_mods (bool): Whether the new Workflow should pull the FWActions of the parent
fw_ids
Archive the workflow containing the given firework id.
given the launch id, cancel the reservation and rerun the fireworks
Given the reservation id, cancel the reservation and rerun the corresponding fireworks.
Change the launch directory corresponding to the given launch id.
Checkout the next ready firework, mark it with the given state(RESERVED or RUNNING) and return it to the caller. The caller is responsible for running the Firework.
Internal method used to mark a Firework’s Launch as completed.
Given the firework id, defuse the firework and refresh the workflow.
fw_id (int): firework id rerun_duplicates (bool): if True, duplicate fireworks(ones with the same launch) are
marked for rerun and then defused.
Defuse the workflow containing the given firework id.
Delete the workflow containing firework with the given id.
Detect lost runs i.e running fireworks that haven’t been updated within the specified time limit or running firework whose launch has been marked fizzed or completed.
Return the reserved launch ids that have not been updated for a while.
Unmark the offline run for the given launch or firework id.
Given a Firework id, give back a Firework object.
Given firework id, return firework dict.
Return all the fw ids that match a query.
Given the reservation id, return the list of firework ids.
Given a Launch id, return details of the Launch.
Return the log directory.
AJ: This is needed for job packing due to Proxy objects not being fully featured...
Checkout the next Firework id
Checkout the next Launch id
Given the firework id, return the reservation id
Given a Firework id, give back the Workflow containing that Firework.
Given a FireWork id, give back the Workflow containing that FireWork.
Return one fw id for all workflows that match a query.
A much faster way to get summary information about a Workflow by querying only for needed information.
Support for job packing
Perform launchpad maintenance: detect lost runs and unreserved RESERVE launches.
Mark the launch corresponding to the given id as FIZZLED.
Ping that a Launch is still alive: updates the ‘update_on ‘field of the state history of a Launch.
Update the launch state using the offline data in FW_offline.json file.
Given the firework id, re-ignite(set state=WAITING) the defused firework.
Reignite the workflow containing the given firework id.
Rerun the firework corresponding to the given id.
Rerun a fw at the task level.
fw_id (int): fw_id to rerun rerun_duplicates (bool): also rerun duplicate FWs launch_id (int): launch id to rerun, if known. otherwise the last launch_id will be used recover_mode (str): use “prev_dir” to run again in previous dir, “cp” to try to copy
data to new dir, or None to start from scratch
Checkout the next ready firework and mark the launch reserved.
Create a new FireWorks database. This will overwrite the existing FireWorks database! To safeguard against accidentally erasing an existing database, a password must be entered.
password (str): A String representing today’s date, e.g. ‘2012-12-31’ require_password (bool): Whether a password is required to reset the DB. Setting to
false is dangerous because running code unintentionally could clear your DB - use max_reset_wo_password to minimize risk.
For the given launch id and firework id, restore the back up data.
Checks to see if the database contains any FireWorks that are ready to run.
Set priority to the firework with the given id.
Set reservation id to the launch corresponding to the given launch id.
Note: usernames/passwords are exported as unencrypted Strings!
Database tuneup: build indexes
Update fireworks with a spec. Sometimes you need to modify a firework in progress.
fw_ids [int]: All fw_ids to modify. spec_document (dict): The spec document. Note that only modifications to
the spec key are allowed. So if you supply {“_tasks.1.parameter”: “hello”}, you are effectively modifying spec._tasks.1.parameter in the actual fireworks collection.
Bases: object
A LazyFirework only has the fw_id, and grabs other data just-in-time. This representation can speed up Workflow loading as only “important” FWs need to be fully loaded.
Bases: exceptions.ValueError
Error raised if the context manager WFLock can’t acquire the lock on the WF within the selected time interval (WFLOCK_EXPIRATION_SECS), if the killing of the lock is disabled (WFLOCK_EXPIRATION_KILL)
Bases: object
Lock a Workflow, i.e. for performing update operations Raises a LockedWorkflowError if the lock couldn’t be acquired withing expire_secs and kill==False. Calling functions are responsible for handling the error in order to avoid database inconsistencies.
The Rocket fetches a workflow step from the FireWorks database and executes it.
Args: launchpad (LaunchPad): A LaunchPad object for interacting with the FW database.
If none, reads FireWorks from FW.json and writes to FWAction.json
fworker (FWorker): A FWorker object describing the computing resource fw_id (int): id of a specific Firework to run (quit if it cannot be found)
Run the rocket (check out a job from the database and execute it)
Run a single rocket in the current directory.
Keeps running Rockets in m_dir until we reach an error. Automatically creates subdirectories for each Rocket. Usually stops when we run out of FireWorks from the LaunchPad.