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

[CLI] Move storage from app prefix to project/app prefix #14583

Merged
merged 16 commits into from
Sep 13, 2022

Conversation

dmitsf
Copy link
Member

@dmitsf dmitsf commented Sep 7, 2022

What does this PR do?

We decided to move app storage prefix from app_id to project_id/app_id.
This PR makes the change. The environment variable LIGHTNING_STORAGE_PATH will be set inside the workflow container, and we will take the storage path from this environment variable.
If it's not specified, it will use the previous logic for defining app storage prefix.

Does your PR introduce any breaking changes? If yes, please list them.

Yes! App storage prefix will be different for new apps.
@rlizzo @panos-is @rusenask please take a look should we check do we have something from previously created app storages in the new logic, e.g. here: https://github.com/Lightning-AI/lightning/blob/master/src/lightning_app/storage/orchestrator.py#L90:L92 ?

We will deprecate old-way created storages in ~1 month.

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

@github-actions github-actions bot added the app (removed) Generic label for Lightning App package label Sep 7, 2022
@dmitsf dmitsf self-assigned this Sep 9, 2022
@dmitsf dmitsf requested a review from rlizzo September 9, 2022 05:11
@dmitsf dmitsf marked this pull request as ready for review September 9, 2022 05:14
@dmitsf dmitsf requested review from panos-is and rusenask September 9, 2022 17:24
@rlizzo
Copy link
Contributor

rlizzo commented Sep 9, 2022

should we check do we have something from previously created app storages in the new logic, e.g. here: https://github.com/Lightning-AI/lightning/blob/master/src/lightning_app/storage/orchestrator.py#L90:L92 ?

I think for this we can actually get rid of that conditional and the old way of doing things entirely. This code would only ever run on newly created apps, not currently running apps that don't know the about the environment variable.

We just need to start injecting the env var on the cloud (before this is merged so that e2e tests can pass) and call it a day :)

@dmitsf dmitsf added this to the app:0.6.x milestone Sep 9, 2022
Copy link
Contributor

@awaelchli awaelchli left a comment

Choose a reason for hiding this comment

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

Could we add a tiny test case (or modify existing one) just to make sure we understand what the exact value of LIGHTNING_STORAGE_PATH would look like and how it's returned from this function.

src/lightning_app/storage/path.py Show resolved Hide resolved
@mergify mergify bot added the ready PRs ready to be merged label Sep 10, 2022
@awaelchli
Copy link
Contributor

@dmitsf Just double checking, is the milestone correct, as this is a new addition/breaking change rather than a bugfix?

@dmitsf dmitsf modified the milestones: app:0.6.x, app:0.7 Sep 12, 2022
…om:Lightning-AI/lightning into grid-10433-move-storage-from-app-prefix-to
@dmitsf dmitsf requested a review from hhsecond as a code owner September 12, 2022 14:44
@mergify mergify bot added has conflicts and removed ready PRs ready to be merged labels Sep 12, 2022
…om:Lightning-AI/lightning into grid-10433-move-storage-from-app-prefix-to
@mergify mergify bot added ready PRs ready to be merged and removed has conflicts ready PRs ready to be merged labels Sep 12, 2022
@dmitsf
Copy link
Member Author

dmitsf commented Sep 12, 2022

@dmitsf Just double checking, is the milestone correct, as this is a new addition/breaking change rather than a bugfix?

Thanks! Changed to 0.7.

@mergify mergify bot added has conflicts and removed ready PRs ready to be merged labels Sep 12, 2022
Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

LGTM !

src/lightning_app/storage/path.py Show resolved Hide resolved
@mergify mergify bot added ready PRs ready to be merged and removed has conflicts ready PRs ready to be merged labels Sep 12, 2022
@codecov
Copy link

codecov bot commented Sep 12, 2022

Codecov Report

Merging #14583 (66bfaee) into master (9769f57) will increase coverage by 24%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master   #14583     +/-   ##
=========================================
+ Coverage      61%      85%    +24%     
=========================================
  Files         381      327     -54     
  Lines       27588    25791   -1797     
=========================================
+ Hits        16899    21925   +5026     
+ Misses      10689     3866   -6823     

@dmitsf dmitsf merged commit 6e21f46 into master Sep 13, 2022
@dmitsf dmitsf deleted the grid-10433-move-storage-from-app-prefix-to branch September 13, 2022 00:11
@Borda Borda modified the milestones: app:0.7, app:0.6.x Sep 15, 2022
@krshrimali krshrimali mentioned this pull request Sep 16, 2022
12 tasks
krshrimali pushed a commit that referenced this pull request Sep 16, 2022
* Move storage from app prefix to project/app prefix: checking and legacy support

* Changelog message

Co-authored-by: Jirka Borovec <[email protected]>
lexierule pushed a commit that referenced this pull request Sep 19, 2022
* Move storage from app prefix to project/app prefix: checking and legacy support

* Changelog message

Co-authored-by: Jirka Borovec <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app (removed) Generic label for Lightning App package ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants