opensafely-core / opensafely-core/stata-docker
Ensure Stata's default log output gets written to the container's stdout
Nobody has claimed this yet.
- Dominant language
- Stata
- Stars
- 2
- Forks
- 0
- Avg merge
- 18h 29m
- Merged PRs (30d)
- 1
Description
Currently we run Stata in batch mode (with the -b flag). This causes it to write it's output to a log file named <script-name>.log and means that Stata jobs have effectively zero useful information in the default logs.
We should make sure that these logs get written to stdout somehow (in a streaming fashion, not as a batch at the end, so we can see what long running jobs are up to).
It's possible that we don't actually need the -b flag but we'll have to experiment to see what the behaviour is.
Whatever happens we'll still need our wrapper script to parse the log output to try to guess whether the job has errored as Stata helpfully exits with status zero in all cases.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the current Stata batch-mode invocation and inspect the wrapper script that parses log output. Experiment with the -b flag and log handling to determine how output can stream to stdout while preserving error detection. Done means long-running job output is visible in container stdout and the wrapper still parses the log output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100