Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Use a DataServer and MultiStore to pool connections #321

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/jobflow/managers/fireworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
import typing

from fireworks import FiretaskBase, Firework, FWAction, Workflow, explicit_serialize
from fireworks.utilities.fw_utilities import DataServer
from fireworks.fw_config import DS_PASSWORD
from maggma.stores.shared_stores import MultiStoreFacade
import os

if typing.TYPE_CHECKING:
from typing import Sequence
Expand Down Expand Up @@ -151,7 +155,14 @@ def run_task(self, fw_spec):

if store is None:
store = SETTINGS.JOB_STORE
store.connect()
if os.environ["FW_DATASERVER_PORT"]:
sivonxay marked this conversation as resolved.
Show resolved Hide resolved
ds = DataServer(address=("127.0.0.1", int(os.environ["FW_DATASERVER_PORT"])),
authkey=DS_PASSWORD)
ds.connect()
multistore = ds.MultiStore()
store = MultiStoreFacade(store, multistore)
else:
store.connect()

if hasattr(self, "fw_id"):
job.metadata.update({"fw_id": self.fw_id})
Expand Down