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

Added backup_workspace function #30

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

jonn-smith
Copy link
Collaborator

Added the backup_workspace function, which will back up the contents of a workspace to a given bucket.

@jonn-smith
Copy link
Collaborator Author

@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?

Copy link
Collaborator

@SHuang-Broad SHuang-Broad left a 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

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]:
Copy link
Collaborator

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

@jonn-smith
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants