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

Andy/multiple bundle location #3899

Merged
merged 18 commits into from
Dec 6, 2021
Merged

Conversation

andyjin2000
Copy link
Contributor

@andyjin2000 andyjin2000 commented Dec 2, 2021

Reasons for making this change

Adding REST API endpoints to help support multiple bundle locations. Added 2 GET endpoints (one to fetch all BundleLocations associated with a given bundle, and another to fetch a specific BundleLocation), as well as 1 POST endpoint to add a new BundleLocation to a bundle

Design doc: https://docs.google.com/document/d/1TOsO4gnxUm1XMmlGUb7BJ4Z6y_olFbv9APbx0-IEy6M/edit#

Related issues

Fixes #3801, which is part of multi-bundle store megaissue #3799

Screenshots

Checklist

  • I've added a screenshot of the changes, if this is a frontend change
  • I've added and/or updated tests, if this is a backend change
  • I've run the pre-commit.sh script
  • I've updated docs, if needed

codalab/model/bundle_model.py Show resolved Hide resolved
codalab/model/bundle_model.py Outdated Show resolved Hide resolved
codalab/rest/bundles.py Outdated Show resolved Hide resolved
codalab/rest/bundles.py Outdated Show resolved Hide resolved
codalab/rest/bundles.py Outdated Show resolved Hide resolved
codalab/rest/schemas.py Outdated Show resolved Hide resolved
tests/unit/server/bundle_store_test.py Outdated Show resolved Hide resolved


@post('/bundles/<bundle_uuid:re:%s>/locations/', apply=AuthenticatedProtectedPlugin())
def _add_bundle_location(bundle_uuid: str):
Copy link
Member

Choose a reason for hiding this comment

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

the final thing you should do is actually test these REST endpoints to make sure they work. You can run python codalab_service.py start -bd and then manually call the endpoints using postman -- see https://www.postman.com/ and https://buttercms.com/blog/postman-testing-the-api-development-environment

Copy link
Member

@epicfaace epicfaace Dec 4, 2021

Choose a reason for hiding this comment

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

Or if you don't want to use postman, you could instead create an automated test under rest1 in test_cli.py: https://github.com/codalab/codalab-worksheets/blob/master/tests/cli/test_cli.py#L2394. postman might be easier / quicker to do though

Copy link
Member

@epicfaace epicfaace left a comment

Choose a reason for hiding this comment

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

@andyjin2000 how about let's just fix the documentation issues and then merge this PR for now? @jzwang43 can then test out the REST endpoints as he's using the CLI and then we can fix issues as needed.

@andyjin2000
Copy link
Contributor Author

Sounds good, I will update documentation as soon as I get a chance

@andyjin2000 andyjin2000 merged commit 39db846 into master Dec 6, 2021
@andyjin2000 andyjin2000 deleted the andy/multiple-bundle-location branch December 6, 2021 04:58
@epicfaace
Copy link
Member

@jzwang43 now that these endpoints have been merged, you should be able to start working on the CLI now

@jzwang43 jzwang43 mentioned this pull request Dec 9, 2021
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.

Create new bundle location REST endpoints
2 participants