Skip to content

Commit

Permalink
Update runs events
Browse files Browse the repository at this point in the history
  • Loading branch information
polyaxon-ci committed Nov 6, 2023
1 parent 88ff728 commit ce910ce
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions haupt/haupt/common/events/auditor_subscriptions/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@
auditor.subscribe(run.RunSkippedActorEvent)
auditor.subscribe(run.RunStatsActorEvent)
auditor.subscribe(run.RunLineageActorEvent)
auditor.subscribe(run.RunAlertActorEvent)
1 change: 1 addition & 0 deletions haupt/haupt/common/events/event_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
NEW_STAGE = "new_stage"
NEW_ARTIFACTS = "new_artifacts"
LINEAGE = "lineage"
ALERT = "alert"
ARCHIVED = "archived"
RESTORED = "restored"
GRANTED = "granted"
Expand Down
9 changes: 9 additions & 0 deletions haupt/haupt/common/events/registry/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
RUN_LINEAGE_ACTOR = "{}.{}.{}".format(
event_subjects.RUN, event_actions.LINEAGE, event_subjects.ACTOR
)
RUN_ALERT_ACTOR = "{}.{}.{}".format(
event_subjects.RUN, event_actions.ALERT, event_subjects.ACTOR
)

EVENTS = {
RUN_CREATED,
Expand All @@ -87,6 +90,7 @@
RUN_SKIPPED_ACTOR,
RUN_STATS_ACTOR,
RUN_LINEAGE_ACTOR,
RUN_ALERT_ACTOR,
}


Expand Down Expand Up @@ -223,3 +227,8 @@ class RunStatsActorEvent(RunActorEvent):
class RunLineageActorEvent(RunActorEvent):
event_type = RUN_LINEAGE_ACTOR
attributes = PROJECT_RESOURCE_OWNER_ATTRIBUTES


class RunAlertActorEvent(RunActorEvent):
event_type = RUN_ALERT_ACTOR
attributes = PROJECT_RESOURCE_OWNER_ATTRIBUTES
12 changes: 12 additions & 0 deletions haupt/tests/tests_common/test_events/test_events_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ def test_events_subjects_runs(self):
"run",
events,
)
self._asser_event(
run.RunAlertActorEvent,
run.RunLineageActorEvent.get_event_subject(),
"run",
events,
)
assert events == run.EVENTS

def test_events_actions_runs(self):
Expand Down Expand Up @@ -266,4 +272,10 @@ def test_events_actions_runs(self):
"lineage",
events,
)
self._asser_event(
run.RunAlertActorEvent,
run.RunAlertActorEvent.get_event_action(),
"alert",
events,
)
assert events == run.EVENTS

0 comments on commit ce910ce

Please sign in to comment.