-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added backup_workspace
function
#30
base: main
Are you sure you want to change the base?
Conversation
@SHuang-Broad I didn't test this yet - but I wanted to get your feedback on it. What's the best way to do testing? |
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.
Hey Jonn, I don't think I can review this throughly before my vacation.
A high-level comment is I see you have bare calls to FISS APIs.
I try to wrap all calls to FISS via this
lrma-cloud-utils/src/lrmaCU/utils.py
Line 52 in f97c09a
def retry_fiss_api_call(func_name: str, max_attempts: int, *args, **kwargs) -> requests.Response: |
This makes calls more resilient.
Regarding how to test this, I admit I test things with real workspaces (hence #1 ).
So if you have battle-tested this, that's good. Otherwise I'd prefer this new function to be tested in some workspaces.
@@ -22,6 +22,18 @@ def get_workspace_bucket(ns: str, ws: str, max_attempts: int = 2) -> str: | |||
return _query_workspace(ns, ws, max_attempts)['bucketName'] | |||
|
|||
|
|||
def get_workspace_attributes(ns: str, ws: str, max_attempts: int = 2) -> dict[str, str]: |
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.
I'd suggest rename this function a bit (sorry for naming the existing one sub-optimally).
get_workspace_all_attributes
to avoid (easy to make) typos
No worries. This isn't critical to get it, but it would be nice. I'll add some tests in a workspace and we can go over it again when you get back. |
Added the
backup_workspace
function, which will back up the contents of a workspace to a given bucket.