Add user tag to AWS and GCP volumes#1948
Merged
r4victor merged 17 commits intodstackai:masterfrom Nov 5, 2024
james-boydell:1943_add_user_tag_to_aws_volumes
Merged
Add user tag to AWS and GCP volumes#1948r4victor merged 17 commits intodstackai:masterfrom james-boydell:1943_add_user_tag_to_aws_volumes
r4victor merged 17 commits intodstackai:masterfrom
james-boydell:1943_add_user_tag_to_aws_volumes
Conversation
- create volume now requires a user of type UserModel to be passed in - db for volumes should have column for user_id -only passing back the user name when creating the volume
r4victor
reviewed
Nov 4, 2024
r4victor
reviewed
Nov 4, 2024
..._internal/server/migrations/versions/9be642a33d08_added_user_id_and_user_to_volumes_table.py
Outdated
Show resolved
Hide resolved
Collaborator
|
@james-boydell, I also recommend running Python tests locally for a faster feedback loop. It should be fairly simple to set up: install deps from requirements_dev.txt and run |
r4victor
approved these changes
Nov 5, 2024
Collaborator
|
@james-boydell, thanks for the PR, nice work! I added a commit to handle backward compatibility. Merging it. |
The loading is required everywhere VolumeModel is converted to Volume. If not loaded, the server errors when processing/returning other users' volumes. E.g. when global admins lists all volumes.
Collaborator
|
Found missing VolumeModel.user loading in few places. Fixed it. |
superprat
pushed a commit
to bahaal-tech/dstack
that referenced
this pull request
Dec 20, 2024
* update volumes model * generate db migration * add user field to Volume class * update volume service - create volume now requires a user of type UserModel to be passed in - db for volumes should have column for user_id -only passing back the user name when creating the volume * update router * tag aws volume with dstack user that created it * add datack user to gcp volume label * updating tests * updating on how user is fetched * updating tests * update data migration to update volume user_id based on project.owner_id * update volume model to remove lazy join * regenerate migration * join in users * Set default Volume.user for client backward compatibility * Load VolumeModel.user The loading is required everywhere VolumeModel is converted to Volume. If not loaded, the server errors when processing/returning other users' volumes. E.g. when global admins lists all volumes. * Fix VolumeModel.user loading on postgres --------- Co-authored-by: Victor Skvortsov <vds003@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes: #1943
-extended to gcp as well