Skip to content

Split the frequenz.sdk.actor package to its own repository #851

Open

Description

@llucax

What's needed?

We need to allow cloud applications to be able to write actors without depending on the microgrid.

Proposed solution

Split the frequenz.sdk.actor package to its own repository:

  • We can use the frequenz.actor package. See which namespace would be possible to use for the new python package: frequenz.actor would be the natural choice, but it is still a namespace for the many actor packages. frequenz.actor.core or frequenz.actor.base might be some options, although not that clear. Keeping frequenz.sdk.actor could be another option, but we need to see if it doesn't conflict with frequenz.sdk living in another package too. Another alternative could be frequenz.actors (in plural, as we already have with channels), but that might be a bit confusing that we have both frequenz.actor and frequenz.actors packages.
  • Create the new repository frequenz-actor-python
  • Move the code there
  • Release a v1.0.0 version (we want to ensure stability from day one, as we are stabilizing all the base repos).
  • Remove the code from the SDK and depend on the new repo

Use cases

All the cloud apps.

Alternatives and workarounds

For now we've been copying protobuf files from the common API repo to the API repos that should depend on common to break the dependency, but this is clearly not sustainable.

Additional context

This is a very complicated, multi-dimensional, problem, involving many parts. Is part (and one way) to solve the dependency conflict of the SDK depending on the microgrid API v0.15 (and common v0.4) and the new API clients depending on common v0.5.

Activity

  1. added
    type:enhancementNew feature or enhancement visitble to users
    part:actorAffects an actor ot the actors utilities (decorator, etc.)
    scope:breaking-changeBreaking change, users will need to update their code
    on Jan 29, 2024
  2. added this to the v1.0.0-rc5 milestone on Jan 29, 2024
  3. self-assigned this
    on Jan 29, 2024
  4. shsms commented on Jan 30, 2024

    @shsms
    Contributor

    I like frequenz.actor.base, because it is the base class for all actors. but works badly for namespaced imports from frequenz.actor import base.

    Maybe frequenz.actor.actor_base?

  5. llucax commented on Jan 30, 2024

    @llucax
    ContributorAuthor

    Maybe, what about frequenz.actor.actor? It is a bit redundant but it should work more naturally with the imports.

    I will try if there is any way to still use the frequenz.actor module, that is definitely the ideal, but I don´t have very high expectations to succeed.

  6. shsms commented on Jan 30, 2024

    @shsms
    Contributor

    it would be actor inception 3 levels deep:

    from frequenz.actor import actor
    
    class A(actor.Actor):
  7. llucax commented on Feb 1, 2024

    @llucax
    ContributorAuthor

    Malkovich

  8. llucax commented on Feb 1, 2024

    @llucax
    ContributorAuthor

    image

    I just did a test and we can use frequenz.actor 🎉

    As long as only one wheel is defining frequenz/actor/__init__.py it seems to be fine.

  9. modified the milestones: v1.0.0-rc5, v1.0.0-rc6 on Feb 5, 2024
  10. 18 remaining items

  11. llucax commented on Feb 13, 2025

    @llucax
    ContributorAuthor

    This will actually be moved to the new core repository, as having a repo just for one class doesn't seem to have a lot of sense... Updating the issue title and description.

    This will probably not be possible, as actor = task + channels (even when the base class doesn't use channels, I guess eventually we'll want to tie them more explicitly), and we want to use core in channels, it will introduce a circular dependency. So I see 2 solutions:

    1. Separate actor repository as it was the original plan
    2. Not provide an Actor class and just use Service instead until we really need to make an Actor anything else than a background task, and only create a new repo (and class) after that happens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

part:actorAffects an actor ot the actors utilities (decorator, etc.)priority:highAddress this as soon as possiblescope:breaking-changeBreaking change, users will need to update their codetype:enhancementNew feature or enhancement visitble to users

Type

No type

Fields

Priority

None yet

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions