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

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

Open
1 of 4 tasks
llucax opened this issue Jan 29, 2024 · 5 comments
Open
1 of 4 tasks

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

llucax opened this issue Jan 29, 2024 · 5 comments
Assignees
Labels
part:actor Affects an actor ot the actors utilities (decorator, etc.) priority:high Address this as soon as possible scope:breaking-change Breaking change, users will need to update their code type:enhancement New feature or enhancement visitble to users
Milestone

Comments

@llucax
Copy link
Contributor

llucax commented Jan 29, 2024

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:

  • 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. We can use the frequenz.actor package.
  • Create the new repository frequenz-actor-python and 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.

@llucax llucax added type:enhancement New feature or enhancement visitble to users part:actor Affects an actor ot the actors utilities (decorator, etc.) scope:breaking-change Breaking change, users will need to update their code labels Jan 29, 2024
@llucax llucax added this to the v1.0.0-rc5 milestone Jan 29, 2024
@llucax llucax added the priority:high Address this as soon as possible label Jan 29, 2024
@llucax llucax self-assigned this Jan 29, 2024
@shsms
Copy link
Contributor

shsms commented Jan 30, 2024

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?

@llucax
Copy link
Contributor Author

llucax commented Jan 30, 2024

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.

@shsms
Copy link
Contributor

shsms commented Jan 30, 2024

it would be actor inception 3 levels deep:

from frequenz.actor import actor

class A(actor.Actor):

@llucax
Copy link
Contributor Author

llucax commented Feb 1, 2024

Malkovich

@llucax
Copy link
Contributor Author

llucax commented Feb 1, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:actor Affects an actor ot the actors utilities (decorator, etc.) priority:high Address this as soon as possible scope:breaking-change Breaking change, users will need to update their code type:enhancement New feature or enhancement visitble to users
Projects
Status: To do
Development

No branches or pull requests

2 participants