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

feat(backend): spawn the notifications service + basic test #9464

Merged
merged 84 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
cae84e5
feat(infra): add rabbitmq to dockercompose
ntindle Feb 6, 2025
e2c9ce0
fix(infra): missed some
ntindle Feb 6, 2025
40b4d2f
feat(backend): add dependencies
ntindle Feb 6, 2025
dfe2ec2
fix(infra): missed dependencies + docs
ntindle Feb 6, 2025
d1d09df
Merge branch 'ntindle/secrt-1086-deploy-rabbitmq-as-part-of-our-docke…
ntindle Feb 6, 2025
325cd0a
feat(backend): base level attachment to rabbitmq for services
ntindle Feb 6, 2025
81bad75
fix: add healthcheck
ntindle Feb 7, 2025
c5eab7c
Merge branch 'dev' into ntindle/secrt-1086-deploy-rabbitmq-as-part-of…
ntindle Feb 7, 2025
fab0aba
Merge branch 'ntindle/secrt-1086-deploy-rabbitmq-as-part-of-our-docke…
ntindle Feb 7, 2025
d864e9c
fix(backend): rebuild rabbitmq infra
ntindle Feb 7, 2025
ee1df0f
feat(backend): add async checker + classifiy rabbitmq
ntindle Feb 7, 2025
e80d4ab
Merge branch 'dev' into ntindle/secrt-1087-attach-rabbit-mq-to-the-se…
ntindle Feb 7, 2025
66fee3a
fix(lint): fix linting and minor issues
ntindle Feb 7, 2025
2cb8157
feat(db): schema updates + migration
ntindle Feb 7, 2025
a9a268e
feat(backend): updated models for notification types + preferences
ntindle Feb 7, 2025
c23f180
feat(backend): notification queries + active user counter
ntindle Feb 7, 2025
7ff6f48
feat(backend): executions in time range query
ntindle Feb 7, 2025
815935f
feat(backend): expose added queries
ntindle Feb 7, 2025
74b1ea0
feat(backend): update models a bit more
ntindle Feb 8, 2025
ea07f03
Merge branch 'dev' into ntindle/secrt-1088-add-db-models-for-the-noti…
ntindle Feb 10, 2025
7dbb1a2
feat(backend): bring downstream changes up
ntindle Feb 10, 2025
1b28a04
feat(backend): add more migrations
ntindle Feb 10, 2025
eeec3c3
fix(backend): add the package deps
ntindle Feb 10, 2025
64e6294
fix(backend): linting
ntindle Feb 10, 2025
6ed6fa1
fix(backend): broken db query oops
ntindle Feb 10, 2025
26ce281
Merge branch 'dev' into ntindle/secrt-1088-add-db-models-for-the-noti…
ntindle Feb 10, 2025
bada17d
feat(backend): pull up changes from downstream
ntindle Feb 10, 2025
4481827
Merge branch 'dev' into ntindle/secrt-1088-add-db-models-for-the-noti…
ntindle Feb 10, 2025
c71bb17
fix(backend): relock
ntindle Feb 10, 2025
c259e5b
feat(backend): spawn the notifications service
ntindle Feb 10, 2025
cee7929
feat(backend): setup first notification service
ntindle Feb 10, 2025
91df11b
ref(backend): use lowercase types
ntindle Feb 11, 2025
0e99bdc
ref(backend): smash migrations and apply changes to api
ntindle Feb 11, 2025
63e3582
Merge branch 'ntindle/secrt-1088-add-db-models-for-the-notification-s…
ntindle Feb 11, 2025
e2441c5
Apply suggestions from code review
ntindle Feb 11, 2025
bf49a0a
Update autogpt_platform/backend/backend/data/notifications.py
ntindle Feb 11, 2025
11cda46
ref(backend): pr changes
ntindle Feb 11, 2025
82d96ee
Merge branch 'ntindle/secrt-1088-add-db-models-for-the-notification-s…
ntindle Feb 11, 2025
957ebe6
refactor(backend): raise errors from db queries
ntindle Feb 11, 2025
c69df5c
ref(backend): update from pr changes
ntindle Feb 12, 2025
3562090
Merge branch 'ntindle/secrt-1088-add-db-models-for-the-notification-s…
ntindle Feb 12, 2025
1cd90ef
Merge branch 'dev' into ntindle/secrt-1088-add-db-models-for-the-noti…
ntindle Feb 12, 2025
85f8f41
fix(backend): relock
ntindle Feb 12, 2025
ddd2b9d
fix(backend): the tests did dumb stuff like reusing ids
ntindle Feb 12, 2025
e012e3a
Merge branch 'ntindle/secrt-1088-add-db-models-for-the-notification-s…
ntindle Feb 12, 2025
aa21bf7
fix(backend): format
ntindle Feb 12, 2025
3e2f341
Merge branch 'ntindle/secrt-1088-add-db-models-for-the-notification-s…
ntindle Feb 12, 2025
21c3a6f
Merge branch 'dev' into ntindle/secrt-1088-add-db-models-for-the-noti…
ntindle Feb 12, 2025
efe6350
Merge branch 'ntindle/secrt-1088-add-db-models-for-the-notification-s…
ntindle Feb 12, 2025
47e14d5
fix(backend): move stuff to the user object and stop messing with 1-1…
ntindle Feb 12, 2025
20267d6
Discard changes to autogpt_platform/frontend/yarn.lock
ntindle Feb 12, 2025
dc55896
Merge branch 'ntindle/secrt-1088-add-db-models-for-the-notification-s…
ntindle Feb 12, 2025
7e8207e
Merge branch 'dev' into ntindle/secrt-1077-add-email-service-smaller
ntindle Feb 12, 2025
7812537
feat(backend): handle migration error
ntindle Feb 13, 2025
bfaf1e5
fix(backend): manually start the notification service in testing?
ntindle Feb 13, 2025
fb1f3d7
ci(test): add rabbitmq instance to ci
ntindle Feb 13, 2025
d776e72
ci(tests): provide ci details to the tests too
ntindle Feb 13, 2025
18923b6
Merge branch 'dev' into ntindle/secrt-1077-add-email-service-smaller
ntindle Feb 13, 2025
18ca9a5
fix(ci): undo autofix
ntindle Feb 13, 2025
fd41bcf
fix(backend): rename the service to be more reasonable
ntindle Feb 13, 2025
250316c
fix(backend): fix indentation
ntindle Feb 13, 2025
9ef3520
fix(backend): drop old param
ntindle Feb 13, 2025
9cb53c4
refactor(backend): rename use_rabbitmq to rabbitmq_config
ntindle Feb 13, 2025
b4e46c0
Discard changes to autogpt_platform/backend/backend/data/graph.py
ntindle Feb 13, 2025
04e0af8
Merge branch 'dev' into ntindle/secrt-1077-add-email-service-smaller
ntindle Feb 13, 2025
8e5cc83
fix(backend): the agent block was not attached so substitute the id d…
ntindle Feb 13, 2025
ed54af9
fix(frontend): add a timeout on waiting for complete
ntindle Feb 13, 2025
f28968c
fix: change stuff
ntindle Feb 14, 2025
f208840
Revert "fix: change stuff"
ntindle Feb 14, 2025
fcdc769
Revert "fix(frontend): add a timeout on waiting for complete"
ntindle Feb 14, 2025
dbeca6f
feat: maybe try spawning the containers?
ntindle Feb 14, 2025
8eb0cbb
use logs
ntindle Feb 14, 2025
6ddac14
Update platform-frontend-ci.yml
ntindle Feb 14, 2025
88b82c5
Update platform-frontend-ci.yml
ntindle Feb 14, 2025
c6a4809
Update platform-frontend-ci.yml
ntindle Feb 14, 2025
cd03f86
Update platform-frontend-ci.yml
ntindle Feb 14, 2025
0886ae9
expose port
ntindle Feb 14, 2025
c6173a2
Revert "Update platform-frontend-ci.yml"
ntindle Feb 14, 2025
a8f8dd3
Update docker-compose.platform.yml
ntindle Feb 14, 2025
95eb77e
fix: name
ntindle Feb 14, 2025
ef1d475
fix(infra): recompose ourselves
ntindle Feb 14, 2025
62a8b92
Update platform-frontend-ci.yml
ntindle Feb 14, 2025
67af371
Update platform-frontend-ci.yml
ntindle Feb 14, 2025
e1e5852
Update platform-frontend-ci.yml
ntindle Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions autogpt_platform/backend/backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ def main(**kwargs):
"""

from backend.executor import DatabaseManager, ExecutionManager, ExecutionScheduler
from backend.notifications import NotificationManager
from backend.server.rest_api import AgentServer
from backend.server.ws_api import WebsocketServer

run_processes(
DatabaseManager(),
ExecutionManager(),
ExecutionScheduler(),
NotificationManager(),
WebsocketServer(),
AgentServer(),
**kwargs,
Expand Down
26 changes: 26 additions & 0 deletions autogpt_platform/backend/backend/data/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from backend.data.block import BlockData, BlockInput, CompletedBlockOutput
from backend.data.includes import EXECUTION_RESULT_INCLUDE, GRAPH_EXECUTION_INCLUDE
from backend.data.queue import AsyncRedisEventBus, RedisEventBus
from backend.server.v2.store.exceptions import DatabaseError
from backend.util import json, mock
from backend.util.settings import Config

Expand Down Expand Up @@ -364,6 +365,31 @@ async def get_execution_results(graph_exec_id: str) -> list[ExecutionResult]:
return res


async def get_executions_in_timerange(
user_id: str, start_time: str, end_time: str
) -> list[ExecutionResult]:
try:
executions = await AgentGraphExecution.prisma().find_many(
where={
"AND": [
{
"startedAt": {
"gte": datetime.fromisoformat(start_time),
"lte": datetime.fromisoformat(end_time),
}
},
{"userId": user_id},
]
},
include=GRAPH_EXECUTION_INCLUDE,
)
return [ExecutionResult.from_graph(execution) for execution in executions]
except Exception as e:
raise DatabaseError(
f"Failed to get executions in timerange {start_time} to {end_time} for user {user_id}: {e}"
) from e


LIST_SPLIT = "_$_"
DICT_SPLIT = "_#_"
OBJC_SPLIT = "_@_"
Expand Down
Loading