Hi Andy,
At this stage the place where I'd put it would be before any code that makes the submit-job call. If you need to pass in information about the tables you setup in this call, you can then pass it in to the job data when you call submit-job.
A reasonably hacky alternative would be to make it in a before-task-start lifecycle on a task, however you must ensure that the setup will not take place more than once by checking whether setup has already taken place. Setting onyx/max-peers 1 is not sufficient as a peer my crash and a new peer may start on that task. I don't recommend this approach unless it's a last resort.
As for teardown, the best approach is to setup a future that calls await-job-completion and perform the job teardown after await-job-completion completes. An alternative here is for a process to monitor the coordination log and perform teardown tasks on seeing certain job events. Note that this approach will not work for job setup.
I have some thoughts around work we could do in this area, however it is not currently a priority. I would especially like to cover teardown on job completion, as it is harder to ensure that the process that started the job is still around on job completion.
Lucas