Static Files¶
When steps use input files written by you, this must be explicitly stated in plan.py
by declaring the human-written files as static files.
This informs StepUp that it does not need to wait for other steps
whose outputs are the required files.
Example¶
Example source files: docs/getting_started/static_files/
Create a file limerick.txt with the following contents:
A physicist named Erwin, quite shrewd,
Put a feline in a box rather crude.
With a vial of doom,
And radioactive gloom,
The poor cat's fate, both alive and subdued!
Also create the following plan.py:
#!/usr/bin/env python3
from stepup.core.api import static, step
static("limerick.txt")
step("nl ${inp} > ${out}", inp="limerick.txt", out="numbered.txt")
The static() function declares a static file,
i.e. one that you have created.
Make the plan executable and run it with StepUp as follows:
You should get the following output:
  DIRECTOR │ Listening on /tmp/stepup-########/director (StepUp 2.0.4)
   STARTUP │ (Re)initialized boot script
  DIRECTOR │ Launched worker 0
     PHASE │ run
     START │ ./plan.py
   SUCCESS │ ./plan.py
     START │ nl limerick.txt > numbered.txt
   SUCCESS │ nl limerick.txt > numbered.txt
  DIRECTOR │ Trying to delete 0 outdated output(s).
  DIRECTOR │ Stopping workers.
  DIRECTOR │ See you!
As expected, StepUp does not wait for another step to create limerick.txt because the file is static.
The file numbered.txt will contain a copy of the limerick with line numbers.
Try the Following¶
- 
Replace
gloombyboominlimerick.txtand runstepup -n 1again. The line numbering is repeated, but the step./plan.pyis skipped as it did not change. - 
Change the order of
static()andstep()inplan.pyand runstepup -n 1again. This has no apparent effect, but the step is only sent to the worker process after the director is informed that the filelimerick.txtis static. - 
Comment out the
static()function call and runstepup -n 1again. StepUp will refuse to execute the line numbering step and will show a warning explaining why.