Commit Graph

6423 Commits

Author SHA1 Message Date
Nicholas Tindle
3e9ca87fa7 fix(backend): upstream changes 2025-02-10 07:26:22 -06:00
Nicholas Tindle
7eea9c358e Update models.py 2025-02-10 07:26:05 -06:00
Nicholas Tindle
19e8a6cff1 feat(db): add db models for user preferences 2025-02-10 07:26:05 -06:00
Nicholas Tindle
51a9e0385b feat(backend): move to a more aligned goal of how we use rabbitmq -- not finished or proper 2025-02-10 07:26:05 -06:00
Nicholas Tindle
114c0e4e3f fix(backend): update from dev 2025-02-10 07:26:04 -06:00
Nicholas Tindle
bad8e6d152 fix: poetry 2025-02-10 07:26:04 -06:00
Nicholas Tindle
ab0ef4241c fix(backend): formatting 2025-02-10 07:26:04 -06:00
Nicholas Tindle
e262cb4c04 Revert "fix(backend): remove unused port var"
This reverts commit 1f0794a8b76d66ce8a9a7f1d711fed79679fa85e.

We actually did use that
2025-02-10 07:26:04 -06:00
Nicholas Tindle
1b0951c1da fix(backend): remove unused port var 2025-02-10 07:26:04 -06:00
Nicholas Tindle
d7251d14c1 fix(backend): remove accidental decode 2025-02-10 07:26:04 -06:00
Nicholas Tindle
a86223d3e4 feat(backend): test a notification
+ missed db registration
2025-02-10 07:26:03 -06:00
Nicholas Tindle
28370f2d2b feat(backend): email service update 2025-02-10 07:26:03 -06:00
Nicholas Tindle
384a07951a feat(backend): stub email manager 2025-02-10 07:26:03 -06:00
Nicholas Tindle
041e2810d0 feat(backend): add a thing to pass a user around 2025-02-10 07:26:03 -06:00
Nicholas Tindle
b708e91146 feat(backend): templates folder 2025-02-10 07:26:03 -06:00
Nicholas Tindle
03ebf05033 feat(backend): start the service lol 2025-02-10 07:26:03 -06:00
Nicholas Tindle
bef5a83bef feat(backend): baseline notifications service 2025-02-10 07:26:02 -06:00
Nicholas Tindle
6ed6fa1033 fix(backend): broken db query oops 2025-02-10 06:35:34 -06:00
Nicholas Tindle
64e6294abf fix(backend): linting 2025-02-10 06:21:14 -06:00
Nicholas Tindle
eeec3c3424 fix(backend): add the package deps 2025-02-10 06:13:21 -06:00
Nicholas Tindle
1b28a04072 feat(backend): add more migrations 2025-02-10 06:03:49 -06:00
Nicholas Tindle
7dbb1a2d30 feat(backend): bring downstream changes up 2025-02-10 05:59:41 -06:00
Nicholas Tindle
ea07f03638 Merge branch 'dev' into ntindle/secrt-1088-add-db-models-for-the-notification-service 2025-02-10 02:51:47 -06:00
Nicholas Tindle
610be988c4 feat(backend): attach rabbitmq to the AppService (#9438)
### Changes 🏗️
For Emailing, we need to make a new App Service (NotificationManager)
that will require us to have rabbitmq as a dependency. This is the
backing data library to make that happen + registering it with the app
service base class and connecting when we spawn up a service

<!-- Concisely describe all of the changes made in this pull request:
-->
- Adds a rabbitmq library following the existing standard for redis
- Adds rabbitmq to the service
- Adds rabbitmq mgmt library (pika) so that we can connect to rabbitmq

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  <!-- Put your test plan here: -->
- [x] I tested by adding the following to the executor `@expose
add_execution` and verifying via the UI that the messages show up in the
queue as expected + the agent executes and behaves as normal!

![image](https://github.com/user-attachments/assets/3ebfb850-d482-4b11-901c-d3bf3397a346)

```diff
      diff --git a/autogpt_platform/backend/backend/executor/manager.py b/autogpt_platform/backend/backend/executor/manager.py
index 1d965e012..4cd5b403c 100644
--- a/autogpt_platform/backend/backend/executor/manager.py
+++ b/autogpt_platform/backend/backend/executor/manager.py
@@ -18,7 +18,7 @@ if TYPE_CHECKING:
 from autogpt_libs.utils.cache import thread_cached
 
 from backend.blocks.agent import AgentExecutorBlock
-from backend.data import redis
+from backend.data import rabbitmq, redis
 from backend.data.block import (
     Block,
     BlockData,
@@ -750,6 +750,19 @@ class ExecutionManager(AppService):
     def __init__(self):
         super().__init__()
         self.use_redis = True
+        self.use_rabbitmq = rabbitmq.RabbitMQConfig(
+            exchanges=[
+                rabbitmq.Exchange(name="execution", type=rabbitmq.ExchangeType.FANOUT),
+            ],
+            queues=[
+                rabbitmq.Queue(
+                    name="execution",
+                    exchange=rabbitmq.Exchange(
+                        name="execution", type=rabbitmq.ExchangeType.FANOUT
+                    ),
+                ),
+            ],
+        )
         self.use_supabase = True
         self.pool_size = settings.config.num_graph_workers
         self.queue = ExecutionQueue[GraphExecutionEntry]()
@@ -876,6 +889,12 @@ class ExecutionManager(AppService):
         )
         self.queue.add(graph_exec)
 
+        # test rabbitmq
+        self.rabbit.publish_message(
+            exchange=self.rabbit_config.exchanges[0],
+            routing_key=self.rabbit_config.exchanges[0].name,
+            message=graph_exec_id,
+        )
         return graph_exec
 
     @expose
```
2025-02-08 21:30:30 +00:00
Nicholas Tindle
74b1ea05ec feat(backend): update models a bit more 2025-02-07 20:47:40 -06:00
Nicholas Tindle
815935f2f5 feat(backend): expose added queries 2025-02-07 16:13:22 -06:00
Nicholas Tindle
7ff6f48873 feat(backend): executions in time range query 2025-02-07 16:13:12 -06:00
Nicholas Tindle
c23f180be7 feat(backend): notification queries + active user counter 2025-02-07 16:13:00 -06:00
Nicholas Tindle
a9a268e9bc feat(backend): updated models for notification types + preferences 2025-02-07 16:12:11 -06:00
Nicholas Tindle
2cb81575b0 feat(db): schema updates + migration 2025-02-07 16:11:43 -06:00
Nicholas Tindle
66fee3a2e9 fix(lint): fix linting and minor issues 2025-02-07 14:57:47 -06:00
Nicholas Tindle
e80d4ab9b1 Merge branch 'dev' into ntindle/secrt-1087-attach-rabbit-mq-to-the-services-processes-similar-to-how 2025-02-07 11:24:55 -06:00
Nicholas Tindle
ee1df0fefc feat(backend): add async checker + classifiy rabbitmq 2025-02-07 11:19:29 -06:00
Nicholas Tindle
d864e9cbd6 fix(backend): rebuild rabbitmq infra 2025-02-07 11:19:05 -06:00
Nicholas Tindle
fab0aba21f Merge branch 'ntindle/secrt-1086-deploy-rabbitmq-as-part-of-our-docker-compose' into ntindle/secrt-1087-attach-rabbit-mq-to-the-services-processes-similar-to-how 2025-02-07 09:40:34 -06:00
Nicholas Tindle
1a4ba533ca feat(infra): add rabbitmq to docker compose (#9437)
<!-- Clearly explain the need for these changes: -->
We want to use RabbitMQ for email (and executor in the future) to ensure
message delivery -- something we currently lack with Redis. This PR is
adding RabbitMQ to the docker-compose and setup details with defaults so
that when we start bringing services up, they have the backing to do so.

### Changes 🏗️

<!-- Concisely describe all of the changes made in this pull request:
-->
- Adds rabbitmq container (with exposed API and mgmt ports)
- Adds .env.example config for the backend
- Adds dockercompose config for the backend, and passes the variables
around as needed

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  <!-- Put your test plan here: -->
  - [x] Start the container using docker compose deps subset

#### For configuration changes:
- [x] `.env.example` is updated or already compatible with my changes
- [x] `docker-compose.yml` is updated or already compatible with my
changes
- [x] I have included a list of my configuration changes in the PR
description (under **Changes**)
2025-02-07 15:40:17 +00:00
Nicholas Tindle
c5eab7c417 Merge branch 'dev' into ntindle/secrt-1086-deploy-rabbitmq-as-part-of-our-docker-compose 2025-02-07 09:34:15 -06:00
Nicholas Tindle
81bad75b2c fix: add healthcheck 2025-02-07 09:12:52 -06:00
Krzysztof Czerwinski
56a307d048 fix(frontend): Fix beads when output is array (#9439)
Array output, e.g. `Item` in Step Through Items block doesn't output
correct number of beads, this PR fixes this issue.
2025-02-07 14:42:51 +00:00
Krzysztof Czerwinski
a5ad90f09b fix(frontend): Fix issue when pasting blocks (#9443)
When block is pasted the original block's inputs behave as disconnected:
the input is shown despite there being connection. This PR fixes this
issue.
2025-02-07 14:42:08 +00:00
Krzysztof Czerwinski
a315b3fc41 fix(frontend): Prevent exception when Stripe env var is missing (#9441)
Prevent exception when `NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY` is missing
and update state management in `useCredits`.
2025-02-07 12:37:06 +00:00
Krzysztof Czerwinski
1a1fe7c0b7 feat(platform): Support opening graphs with version and execution id (#9332)
Currently it's only possible to open latest graph from monitor and see
the node execution results only when manually running. This PR adds
ability to open running and finished graphs in builder.

### Changes 🏗️

Builder now handles graph version and execution ID in addition to graph
ID when opening a graph. When an execution ID is provided, node
execution results are fetched and subscribed to in real time. This makes
it possible to open a graph that is already executing and see both
existing node execution data and real-time updates (if it's still
running).

- Use graph version and execution id on the builder page and in
`useAgentGraph`
- Use graph version on the `execute_graph` endpoint
- Use graph version on the websockets to distinguish between versions
- Move `formatEdgeID` to utils; it's used in `useAgentGraph.ts` and in
`Flow.tsx`

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  - [x] Opening finished execution restores node results
- [x] Opening running execution restores results and continues to run
properly
  - [x] Results are separate for each graph across multiple tabs

#### For configuration changes:
- [ ] `.env.example` is updated or already compatible with my changes
- [ ] `docker-compose.yml` is updated or already compatible with my
changes
- [ ] I have included a list of my configuration changes in the PR
description (under **Changes**)

<details>
  <summary>Examples of configuration changes</summary>

  - Changing ports
  - Adding new services that need to communicate with each other
  - Secrets or environment variable changes
  - New or infrastructure changes such as databases
</details>

---------

Co-authored-by: Zamil Majdy <zamil.majdy@agpt.co>
2025-02-07 10:16:30 +00:00
Swifty
c693875951 platform(fix): Improve performance of builder (#9435)
1. Remove isHovered / onMouseEnter / onMouseLeave state updates
2. Wrap Custom Node in React.memo
3. Avoid re-renders for context menus
2025-02-07 10:38:50 +01:00
Nicholas Tindle
325cd0aa46 feat(backend): base level attachment to rabbitmq for services 2025-02-06 16:13:57 -06:00
Nicholas Tindle
d1d09df24b Merge branch 'ntindle/secrt-1086-deploy-rabbitmq-as-part-of-our-docker-compose' into ntindle/secrt-1087-attach-rabbit-mq-to-the-services-processes-similar-to-how 2025-02-06 16:08:24 -06:00
Nicholas Tindle
dfe2ec25d4 fix(infra): missed dependencies + docs 2025-02-06 16:07:20 -06:00
Nicholas Tindle
40b4d2fa43 feat(backend): add dependencies 2025-02-06 13:52:19 -06:00
Nicholas Tindle
e2c9ce0beb fix(infra): missed some 2025-02-06 13:08:08 -06:00
Nicholas Tindle
cae84e5ec8 feat(infra): add rabbitmq to dockercompose 2025-02-06 13:07:36 -06:00
Krzysztof Czerwinski
797916cf14 feat(frontend): Show toast on low credit balance, rename Credits page to Billing (#9428)
<!-- Clearly explain the need for these changes: -->

### Changes 🏗️

- If a node fails to execute and error contains `Insufficient balance`
show toast with link to Billing page
- Rename `Credits` page to `Billing`
<img width="398" alt="Screenshot 2025-02-05 at 2 27 36 PM"
src="https://github.com/user-attachments/assets/6a5b4db0-a579-4607-a6bd-d5cf9229092f"
/>

### Checklist 📋

#### For code changes:
- [ ] I have clearly listed my changes in the PR description
- [ ] I have made a test plan
- [ ] I have tested my changes according to the test plan:
  <!-- Put your test plan here: -->
  - [ ] ...

<details>
  <summary>Example test plan</summary>
  
  - [ ] Create from scratch and execute an agent with at least 3 blocks
- [ ] Import an agent from file upload, and confirm it executes
correctly
  - [ ] Upload agent to marketplace
- [ ] Import an agent from marketplace and confirm it executes correctly
  - [ ] Edit an agent from monitor, and confirm it executes correctly
</details>

#### For configuration changes:
- [ ] `.env.example` is updated or already compatible with my changes
- [ ] `docker-compose.yml` is updated or already compatible with my
changes
- [ ] I have included a list of my configuration changes in the PR
description (under **Changes**)

<details>
  <summary>Examples of configuration changes</summary>

  - Changing ports
  - Adding new services that need to communicate with each other
  - Secrets or environment variable changes
  - New or infrastructure changes such as databases
</details>

---------

Co-authored-by: Aarushi <50577581+aarushik93@users.noreply.github.com>
2025-02-06 16:12:56 +00:00