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

refactor(BA-627): Extract list_volumes and get_volume into pool.py (#3564) #3569

Open
wants to merge 2 commits into
base: refactor/move-abc-py
Choose a base branch
from

Conversation

MintCat98
Copy link

@MintCat98 MintCat98 commented Feb 3, 2025

resolves #3564 (BA-627)

Extracted list_volumes and get_volume into storage/volumes/pool.py.

Checklist: (if applicable)

  • Milestone metadata specifying the target backport version
  • Mention to the original issue
  • Installer updates including:
    • Fixtures for db schema changes
    • New mandatory config options
  • Update of end-to-end CLI integration tests in ai.backend.test
  • API server-client counterparts (e.g., manager API -> client SDK)
  • Test case(s) to:
    • Demonstrate the difference of before/after
    • Demonstrate the flow of abstract/conceptual models with a concrete implementation
  • Documentation
    • Contents in the docs directory
    • docstrings in public interfaces and type annotations

📚 Documentation preview 📚: https://sorna--3569.org.readthedocs.build/en/3569/


📚 Documentation preview 📚: https://sorna-ko--3569.org.readthedocs.build/ko/3569/

@github-actions github-actions bot added area:docs Documentations comp:common Related to Common component comp:storage-proxy Related to Storage proxy component size:XL 500~ LoC labels Feb 3, 2025
@MintCat98 MintCat98 marked this pull request as ready for review February 4, 2025 01:33
@MintCat98 MintCat98 changed the base branch from main to refactor/move-abc-py February 4, 2025 01:43
Comment on lines +15 to +29
class VolumePool:
def __init__(
self,
local_config: Mapping[str, Any],
etcd: AsyncEtcd,
event_dispatcher: EventDispatcher,
event_producer: EventProducer,
backends: Mapping[str, Type[AbstractVolume]],
):
self.local_config = local_config
self.etcd = etcd
self.event_dispatcher = event_dispatcher
self.event_producer = event_producer
self.backends = backends
self.volumes: dict[str, AbstractVolume] = {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a type hint for instance variables to the class declaration?
And, set instance variable to private.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:docs Documentations comp:common Related to Common component comp:storage-proxy Related to Storage proxy component size:XL 500~ LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extract list_volumes and get_volume into pool.py
2 participants