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 script to validate remote object store paths #2667

Merged
merged 4 commits into from
Oct 25, 2023

Conversation

irenedea
Copy link
Contributor

@irenedea irenedea commented Oct 24, 2023

What does this PR do?

Adds a script that validates remote object store paths using composer utility functions.

This is helpful for debugging especially on remote runs.

What issue(s) does this change relate to?

Before submitting

  • Have you read the contributor guidelines?
  • Is this change a documentation change or typo fix? If so, skip the rest of this checklist.
  • Was this change discussed/approved in a GitHub issue first? It is much more likely to be merged if so.
  • Did you update any related docs and document your change?
  • Did you update any related tests and add any new tests related to your change? (see testing)
  • Did you run the tests locally to make sure they pass?
  • Did you run pre-commit on your change? (see the pre-commit section of prerequisites)

@j316chuck
Copy link
Contributor

j316chuck commented Oct 24, 2023

qq: Is this script supposed to be used locally in interactive session since there already exists an mcli yaml?

@irenedea
Copy link
Contributor Author

@j316chuck the mcli yaml that i was using only supports s3, so i figured this would be an easy way to check all backends easily and through composer as well. Though, if this script fails, it doesn't necessarily rule out composer issues. I'll write an mcli yaml for this as well.

@irenedea irenedea enabled auto-merge (squash) October 24, 2023 18:13
Copy link
Contributor

@dakinggg dakinggg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this part of the library instead of a script? similar to composer_collect_env

@irenedea
Copy link
Contributor Author

@dakinggg good suggestion! so it would both in the library as well as a script, yeah?

@dakinggg
Copy link
Contributor

Yeah, exact same as composer_collect_env setup

@irenedea
Copy link
Contributor Author

@dakinggg I think the best move would be to create a list_remote_objects (that does exactly what the script does now, but returns a list of objects if objects are found). This would probably belong in file_helpers.py. If we add this function to file_helpers.py, do you have any thoughts on where to put the script?

@dakinggg
Copy link
Contributor

Can you define console_scripts that don't use main? It kinda looks like you can, but I've never tried it. If so, can just define a function in file_helpers.py that prints out what you want, and define the console_scripts command to point to that function

@irenedea
Copy link
Contributor Author

irenedea commented Oct 24, 2023

@dakinggg Tried it, but it won't work--it needs to a be a function that takes no arguments. So we could (1) keep a tiny script in scripts/validate_remote_path.py and have it call the list_remote_objects function in file_helpers.py (2) create a small function that takes no args in file_helpers.py that calls list_remote_objects and use that for the console script. wdyt?

@dakinggg
Copy link
Contributor

I think Its possible to set it up with args parsed by argparse. because the composer launcher is set up the same way. See the main function in there that parses args

@irenedea irenedea requested a review from a team as a code owner October 25, 2023 01:32
@irenedea irenedea requested a review from dakinggg October 25, 2023 01:32
setup.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
composer/utils/file_helpers.py Outdated Show resolved Hide resolved
@irenedea irenedea merged commit 151fb45 into mosaicml:dev Oct 25, 2023
15 checks passed
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.

3 participants