-
Notifications
You must be signed in to change notification settings - Fork 10
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
Change logging level on PandASubdirectoryProvider #516
Conversation
@@ -20,7 +24,13 @@ def __init__(self, directory: Path | None = None): | |||
else None | |||
) | |||
|
|||
def update(self, directory: Path): | |||
def update(self, directory: Path, create_directory=False): | |||
if create_directory: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As is, you're allowed to (but always not) pass in a Path on construction, but the path is only created on update. If passing a Path into the initialiser isn't desired, remove it, if it is desired sometimes, make sure that the directory may be created during the init
if create_directory: | ||
panda_directory = f"{directory}/{self.resource_dir}" | ||
# At some point in the future, ophyd_async will have the feature to create the requested directory | ||
if not os.path.isdir(panda_directory): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in the Hyperion/blueapi container: which user does Hyperion run as? blueapi runs as a kubernetes user without file system permissions as far as possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I hadn't considered that, Hyperion is running on a control machine so should have permissions. it might be better to just stick this part within a Hyperion plan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running as gda2?
Either way, if it's in the plan or the DirProvider it'll need to be running as a user that can write to the visit directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, as gda2. We can either check, in dodal, if the user has permission to create a directory if create_directory=True
before trying to create it, or have the logic in Hyperion where the user will always be able to. I think Hyperion is better for now, can always change later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the logic to Hyperion so this PR is pretty tiny now!
c508ee5
to
ce03053
Compare
29c076b
to
4974999
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you.
In a previous PR I suggested adding this logging message, but later realised it would appear every time Hyperion started, so debug is better
Instructions to reviewer on how to test:
Checks for reviewer