Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --create and --tmp to run_and_cleanup #44

Merged
merged 2 commits into from Jan 13, 2020
Merged

Conversation

@bmerry
Copy link
Contributor

bmerry commented Jan 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.

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 bmerry requested a review from sratcliffe Jan 13, 2020
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.

if args.create:
try:
os.mkdir(args.path)

This comment has been minimized.

@sratcliffe

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.

@bmerry

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.

@bmerry

bmerry Jan 13, 2020

Author Contributor

Done.

@bmerry bmerry merged commit 9f95774 into master Jan 13, 2020
1 check passed
1 check passed
continuous-integration/jenkins/branch This commit looks good
Details
@bmerry bmerry deleted the run-and-cleanup-create branch Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.