Skip to content

Commit

Permalink
Revert "Integrate scheduler with server (Issue #8009, PR #8050)"
Browse files Browse the repository at this point in the history
This reverts commit 22eab72.
  • Loading branch information
Hugo-Inmanta committed Sep 9, 2024
1 parent 1bf9cbd commit 5b465fc
Show file tree
Hide file tree
Showing 18 changed files with 92 additions and 943 deletions.
4 changes: 0 additions & 4 deletions changelogs/unreleased/8009-server-scheduler.yml

This file was deleted.

9 changes: 0 additions & 9 deletions mypy-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ src/inmanta/protocol/methods.py:0: error: Function is missing a return type anno
src/inmanta/protocol/methods.py:0: note: Use "-> None" if function does not return a value
src/inmanta/protocol/methods.py:0: error: Function is missing a return type annotation [no-untyped-def]
src/inmanta/protocol/methods.py:0: error: Function is missing a return type annotation [no-untyped-def]
src/inmanta/protocol/methods.py:0: error: Missing return statement [empty-body]
src/inmanta/protocol/methods.py:0: error: Function is missing a return type annotation [no-untyped-def]
src/inmanta/protocol/methods.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
src/inmanta/protocol/methods.py:0: error: Function is missing a return type annotation [no-untyped-def]
Expand Down Expand Up @@ -969,7 +968,6 @@ src/inmanta/app.py:0: error: Missing type parameters for generic type "Future"
src/inmanta/app.py:0: error: Argument 2 to "safe_shutdown" has incompatible type "Callable[[int | None], Coroutine[Any, Any, None]]"; expected "Callable[[], None]" [arg-type]
src/inmanta/app.py:0: error: Argument 2 to "safe_shutdown" has incompatible type "Callable[[int | None], Coroutine[Any, Any, None]]"; expected "Callable[[], None]" [arg-type]
src/inmanta/app.py:0: error: Incompatible types in assignment (expression has type "str | None", variable has type "int | None") [assignment]
src/inmanta/app.py:0: error: Incompatible types in assignment (expression has type "str | None", variable has type "int | None") [assignment]
src/inmanta/app.py:0: error: Argument 1 to "run" of "Exporter" has incompatible type "dict[str, Type]"; expected "dict[str, Entity] | None" [arg-type]
src/inmanta/app.py:0: error: No overload variant of "print" matches argument types "str", "TextIO | Any", "dict[str, object]" [call-overload]
src/inmanta/app.py:0: note: Possible overload variants:
Expand All @@ -990,16 +988,9 @@ src/inmanta/compiler/help/explainer.py:0: error: Item "None" of "RelationAttribu
src/inmanta/agent/resourcepool.py:0: error: Missing type parameters for generic type "PoolMember" [type-arg]
src/inmanta/agent/resourcepool.py:0: error: Argument 1 to "append" of "list" has incompatible type "Callable[[TPoolMember], Coroutine[Any, Any, bool]]"; expected "Callable[[PoolMember[TPoolID]], Coroutine[Any, Any, Any]]" [arg-type]
src/inmanta/agent/resourcepool.py:0: error: Missing type parameters for generic type "PoolMember" [type-arg]
src/inmanta/deploy/scheduler.py:0: error: Argument "attribute_hash" to "ResourceDetails" has incompatible type "str | None"; expected "str" [arg-type]
src/inmanta/deploy/scheduler.py:0: error: No overload variant of "list" matches argument type "object" [call-overload]
src/inmanta/deploy/scheduler.py:0: note: Possible overload variants:
src/inmanta/deploy/scheduler.py:0: note: def [_T] __init__(self) -> list[_T]
src/inmanta/deploy/scheduler.py:0: note: def [_T] __init__(self, Iterable[_T], /) -> list[_T]
src/inmanta/agent/forking_executor.py:0: error: Argument 1 of "connection_made" is incompatible with supertype "BaseProtocol"; supertype defines the argument type as "BaseTransport" [override]
src/inmanta/agent/forking_executor.py:0: note: This violates the Liskov substitution principle
src/inmanta/agent/forking_executor.py:0: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
src/inmanta/agent/agent_new.py:0: error: Argument 3 to "MPManager" has incompatible type "UUID | None"; expected "UUID" [arg-type]
src/inmanta/agent/agent_new.py:0: error: Argument 1 to "collect_report" has incompatible type "inmanta.agent.agent_new.Agent"; expected "inmanta.agent.agent.Agent" [arg-type]
src/inmanta/agent/agent.py:0: error: Cannot determine type of "ratelimiter" [has-type]
src/inmanta/validation_type.py:0: error: Incompatible types in assignment (expression has type "object", variable has type "Mapping[str, object] | None") [assignment]
src/inmanta/server/validate_filter.py:0: error: Incompatible return value type (got "Callable[[object], list[tuple[RangeOperator, int]] | None]", expected "Callable[[object, object], list[tuple[RangeOperator, int]] | None]") [return-value]
Expand Down
7 changes: 0 additions & 7 deletions src/inmanta/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,13 +1330,6 @@ async def trigger_update(self, env: uuid.UUID, agent: str, incremental_deploy: b
)
return 200

@protocol.handle(methods.trigger_read_version, env="tid")
async def read_version(self, env: uuid.UUID) -> Apireturn:
"""
Send a notification to the agent that a new version has been released
"""
pass

@protocol.handle(methods.resource_event, env="tid", agent="id")
async def resource_event(
self,
Expand Down
265 changes: 0 additions & 265 deletions src/inmanta/agent/agent_new.py

This file was deleted.

25 changes: 0 additions & 25 deletions src/inmanta/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,6 @@ def start_agent(options: argparse.Namespace) -> None:
LOGGER.info("Agent Shutdown complete")


@command("scheduler", help_msg="Start the resource scheduler")
def start_scheduler(options: argparse.Namespace) -> None:
"""
Start the new agent with the Resource Scheduler
"""
from inmanta.agent import agent_new

# The call to configure() should be done as soon as possible.
# If an AsyncHTTPClient is started before this call, the max_client
# will not be taken into account.
max_clients: Optional[int] = Config.get(section="agent_rest_transport", name="max_clients")

if max_clients:
AsyncHTTPClient.configure(None, max_clients=max_clients)

tracing.configure_logfire("agent_rs")
util.ensure_event_loop()
a = agent_new.Agent()

setup_signal_handlers(a.stop)
IOLoop.current().add_callback(a.start)
IOLoop.current().start()
LOGGER.info("Agent with Resource scheduler Shutdown complete")


class ExperimentalFeatureFlags:
"""
Class to expose feature flag configs as options in a uniform matter
Expand Down
4 changes: 0 additions & 4 deletions src/inmanta/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,3 @@ class NotificationSeverity(str, Enum):
# It's used to determine whether a venv is only partially created (due to a server crash for example) or to determine when the
# venv was last used.
INMANTA_VENV_STATUS_FILENAME = ".inmanta_venv_status"


# ID to represent the new scheduler as an agent
AGENT_SCHEDULER_ID = "$__scheduler"
Loading

0 comments on commit 5b465fc

Please sign in to comment.