jobflow.settings

Settings for jobflow.

pydantic settings jobflow.settings.JobflowSettings[source]

Bases: BaseSettings

Settings for jobflow.

The default way to modify these is to modify ~/.jobflow.yaml. Alternatively, the environment variable JOBFLOW_CONFIG_FILE can be set to point to a yaml file with jobflow settings.

Lastly, the variables can be modified directly though environment variables by using the “JOBFLOW” prefix. E..g., JOBFLOW_JOB_STORE=path/to/jobstore.file.

Allowed JOB_STORE formats

If the store is not supplied, a MemoryStore will be used. Can be specified in multiple formats.

The simplest format is the yaml dumped version of the store, generated using:

>>> import yaml
>>> yaml.dump(store.as_dict())

Alternatively, the store can be specified as the keys docs_store, additional_stores and any other keyword arguments supported by the JobStore constructor. The docs_store and additional stores are specified by the type key which must match a Maggma Store subclass, and the remaining keys are passed to the store constructor. For example, the following file would create a JobStore with a MongoStore for docs and a GridFSStore or S3Store as an additional store for data.

GridFSStore example:

docs_store:
  type: MongoStore
  database: jobflow_unittest
  collection_name: outputs
  host: localhost
  port: 27017
additional_stores:
  data:
    type: GridFSStore
    database: jobflow_unittest
    collection_name: outputs_blobs
    host: localhost
    port: 27017

S3Store example (Note: the key field must be set to blob_uuid):

docs_store:
  type: MongoStore
  database: jobflow_unittest
  collection_name: outputs
  host: localhost
  port: 27017
additional_stores:
  data:
    type: S3Store
    bucket: output_blobs
    key: blob_uuid
    index:
      type: MongoStore
      database: jobflow_unittest
      collection_name: output_blobs_index
      host: localhost
      port: 27017
      key: blob_uuid

Lastly, the store can be specified as a file name that points to a file containing the credentials in any format supported by JobStore.from_file.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Validators:
  • load_default_settings » all fields

field CONFIG_FILE: str = '/home/runner/.jobflow.yaml'

File to load alternative defaults from.

field JOB_STORE: JobStore [Optional]

Default JobStore to use when running locally or using FireWorks. See the JobflowSettings docstring for more details on the accepted formats.

field DIRECTORY_FORMAT: str = '%Y-%m-%d-%H-%M-%S-%f'

Date stamp format used to create directories

field UID_TYPE: str = 'uuid4'

Type of unique identifier to use to track jobs.