schrodinger.seam.testing.stu_tests.jobfs_resume module¶
Test that jobfs files registered during a pipeline run are preserved
across a checkpoint and resume via seamcli.py resume.
A two-stage pipeline writes files to jobfs:// in stage 1, then reads them in stage 2 after a Reshuffle. The first run intentionally fails at stage 2. After resuming from the checkpoint through seamcli, stage 2 should succeed because the jobfs files were moved into the seam directory on failure and re-registered on resume.
Usage:
$SCHRODINGER/run python3 -m schrodinger.seam.testing.stu_tests.jobfs_resume
- class schrodinger.seam.testing.stu_tests.jobfs_resume.WriteToJobFS(*unused_args, **unused_kwargs)¶
Bases:
DoFnWrite each element as a file to jobfs.
- process(element)¶
Method to use for processing elements.
This is invoked by
DoFnRunnerfor each element of a inputPCollection.The following parameters can be used as default values on
processarguments to indicate that a DoFn accepts the corresponding parameters. For example, a DoFn might accept the element and its timestamp with the following signature:def process(element=DoFn.ElementParam, timestamp=DoFn.TimestampParam): ...
The full set of parameters is:
DoFn.ElementParam: element to be processed, should not be mutated.DoFn.SideInputParam: a side input that may be used when processing.DoFn.TimestampParam: timestamp of the input element.DoFn.WindowParam:Windowthe input element belongs to.DoFn.TimerParam: auserstate.RuntimeTimerobject defined by the spec of the parameter.DoFn.StateParam: auserstate.RuntimeStateobject defined by the spec of the parameter.DoFn.KeyParam: key associated with the element.DoFn.RestrictionParam: aniobase.RestrictionTrackerwill be provided here to allow treatment as a SplittableDoFn. The restriction tracker will be derived from the restriction provider in the parameter.DoFn.WatermarkEstimatorParam: a function that can be used to track output watermark of SplittableDoFnimplementations.DoFn.BundleContextParam: allows a shared context manager to be used per bundleDoFn.SetupContextParam: allows a shared context manager to be used per DoFn
- class schrodinger.seam.testing.stu_tests.jobfs_resume.MaybeFailThenRead(label: Optional[str] = None)¶
Bases:
_LocalOnlyPTransform,MaybeFailThenReadRead a jobfs file, but fail first if a sentinel file exists.
- schrodinger.seam.testing.stu_tests.jobfs_resume.main()¶