Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd --create and --tmp to run_and_cleanup #44
Merged
Conversation
The former allows the directory to be created if it does not already exist, and the latter sets it as TMPDIR. Together they make it easier to run a task and have it place temporary files in a specific location (e.g. on a particular mount) without modifying it.
bmerry
added a commit
to ska-sa/katsdpcontroller
that referenced
this pull request
Jan 13, 2020
This makes it about 10% slower (at the moment - may get more significant with further optimisation), but keeps memory bounded. A quick test suggests 9GB is probably enough, but allowing 15GB because we can afford it and it gives some spare room that can be used for caching. It's still more than I think ought to be getting used given the design, but that may be because many channels are being loaded and processed at once. Depends on ska-sa/katsdpdockerbase#44.
docker-base-runtime/run-and-cleanup
Outdated
|
|
||
| if args.create: | ||
| try: | ||
| os.mkdir(args.path) |
This comment has been minimized.
This comment has been minimized.
sratcliffe
Jan 13, 2020
Contributor
In the spirit of Python3, and allowing recursive dirs, how about pathlib.Path(args.path).mkdir(parents=True, exist_ok=True) ?
This comment has been minimized.
This comment has been minimized.
bmerry
Jan 13, 2020
Author
Contributor
I was undecided about creating parents. Given the use cases I would be surprised if the parent doesn't exist, and bumbling on might be hiding deeper errors. But on the other hand if it doesn't exist then it's pain to get it created, so I'll add support.
This comment has been minimized.
This comment has been minimized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
bmerry commentedJan 13, 2020
The former allows the directory to be created if it does not already
exist, and the latter sets it as TMPDIR. Together they make it easier to
run a task and have it place temporary files in a specific location
(e.g. on a particular mount) without modifying it.