Files
AutoGPT/autogpt_platform/backend
dependabot[bot] 9f9097c62f chore(backend/deps): Update cryptography from 43.0.3 to 44.0.0 (#8870)
Bumps [cryptography](https://github.com/pyca/cryptography) from 43.0.3
to 44.0.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst">cryptography's
changelog</a>.</em></p>
<blockquote>
<p>44.0.0 - 2024-11-27</p>
<pre><code>
* **BACKWARDS INCOMPATIBLE:** Dropped support for LibreSSL &lt; 3.9.
* Deprecated Python 3.7 support. Python 3.7 is no longer supported by
the
  Python core team. Support for Python 3.7 will be removed in a future
  ``cryptography`` release.
* Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL
3.4.0.
* macOS wheels are now built against the macOS 10.13 SDK. Users on older
  versions of macOS should upgrade, or they will need to build
  ``cryptography`` themselves.
* Enforce the :rfc:`5280` requirement that extended key usage extensions
must
  not be empty.
* Added support for timestamp extraction to the
  :class:`~cryptography.fernet.MultiFernet` class.
* Relax the Authority Key Identifier requirements on root CA
certificates
  during X.509 verification to allow fields permitted by :rfc:`5280` but
  forbidden by the CA/Browser BRs.
* Added support for
:class:`~cryptography.hazmat.primitives.kdf.argon2.Argon2id`
  when using OpenSSL 3.2.0+.
* Added support for the :class:`~cryptography.x509.Admissions`
certificate extension.
* Added basic support for PKCS7 decryption (including S/MIME 3.2) via

:func:`~cryptography.hazmat.primitives.serialization.pkcs7.pkcs7_decrypt_der`,

:func:`~cryptography.hazmat.primitives.serialization.pkcs7.pkcs7_decrypt_pem`,
and

:func:`~cryptography.hazmat.primitives.serialization.pkcs7.pkcs7_decrypt_smime`.
<p>.. _v43-0-3:<br />
</code></pre></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f299a48153"><code>f299a48</code></a>
remove deprecated call (<a
href="https://redirect.github.com/pyca/cryptography/issues/12052">#12052</a>)</li>
<li><a
href="439eb0594a"><code>439eb05</code></a>
Bump version for 44.0.0 (<a
href="https://redirect.github.com/pyca/cryptography/issues/12051">#12051</a>)</li>
<li><a
href="2c5ad4d8dc"><code>2c5ad4d</code></a>
chore(deps): bump maturin from 1.7.4 to 1.7.5 in /.github/requirements
(<a
href="https://redirect.github.com/pyca/cryptography/issues/12050">#12050</a>)</li>
<li><a
href="d23968addd"><code>d23968a</code></a>
chore(deps): bump libc from 0.2.165 to 0.2.166 (<a
href="https://redirect.github.com/pyca/cryptography/issues/12049">#12049</a>)</li>
<li><a
href="133c0e02ed"><code>133c0e0</code></a>
Bump x509-limbo and/or wycheproof in CI (<a
href="https://redirect.github.com/pyca/cryptography/issues/12047">#12047</a>)</li>
<li><a
href="f2259d7aa0"><code>f2259d7</code></a>
Bump BoringSSL and/or OpenSSL in CI (<a
href="https://redirect.github.com/pyca/cryptography/issues/12046">#12046</a>)</li>
<li><a
href="e201c870b8"><code>e201c87</code></a>
fixed metadata in changelog (<a
href="https://redirect.github.com/pyca/cryptography/issues/12044">#12044</a>)</li>
<li><a
href="c6104cc366"><code>c6104cc</code></a>
Prohibit Python 3.9.0, 3.9.1 -- they have a bug that causes errors (<a
href="https://redirect.github.com/pyca/cryptography/issues/12045">#12045</a>)</li>
<li><a
href="d6cac753c2"><code>d6cac75</code></a>
Add support for decrypting S/MIME messages (<a
href="https://redirect.github.com/pyca/cryptography/issues/11555">#11555</a>)</li>
<li><a
href="b8e5bfd4d7"><code>b8e5bfd</code></a>
chore(deps): bump libc from 0.2.164 to 0.2.165 (<a
href="https://redirect.github.com/pyca/cryptography/issues/12042">#12042</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/pyca/cryptography/compare/43.0.3...44.0.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cryptography&package-manager=pip&previous-version=43.0.3&new-version=44.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-17 08:46:49 +00:00
..

AutoGPT Agent Server

This is an initial project for creating the next generation of agent execution, which is an AutoGPT agent server. The agent server will enable the creation of composite multi-agent systems that utilize AutoGPT agents and other non-agent components as its primitives.

Docs

You can access the docs for the AutoGPT Agent Server here.

Setup

We use the Poetry to manage the dependencies. To set up the project, follow these steps inside this directory:

  1. Install Poetry

    pip install poetry
    
  2. Configure Poetry to use .venv in your project directory

    poetry config virtualenvs.in-project true
    
  3. Enter the poetry shell

    poetry shell
    
  4. Install dependencies

    poetry install
    
  5. Copy .env.example to .env

    cp .env.example .env
    
  6. Generate the Prisma client

    poetry run prisma generate
    

    In case Prisma generates the client for the global Python installation instead of the virtual environment, the current mitigation is to just uninstall the global Prisma package:

    pip uninstall prisma
    

    Then run the generation again. The path should look something like this:
    <some path>/pypoetry/virtualenvs/backend-TQIRSwR6-py3.12/bin/prisma

  7. Migrate the database. Be careful because this deletes current data in the database.

    docker compose up db -d
    poetry run prisma migrate deploy
    

Running The Server

Starting the server without Docker

Run the following command to run database in docker but the application locally:

docker compose --profile local up deps --build --detach
poetry run app

Starting the server with Docker

Run the following command to build the dockerfiles:

docker compose build

Run the following command to run the app:

docker compose up

Run the following to automatically rebuild when code changes, in another terminal:

docker compose watch

Run the following command to shut down:

docker compose down

If you run into issues with dangling orphans, try:

docker compose down --volumes --remove-orphans && docker-compose up --force-recreate --renew-anon-volumes --remove-orphans  

Testing

To run the tests:

poetry run test

Development

Formatting & Linting

Auto formatter and linter are set up in the project. To run them:

Install:

poetry install --with dev

Format the code:

poetry run format

Lint the code:

poetry run lint

Project Outline

The current project has the following main modules:

blocks

This module stores all the Agent Blocks, which are reusable components to build a graph that represents the agent's behavior.

data

This module stores the logical model that is persisted in the database. It abstracts the database operations into functions that can be called by the service layer. Any code that interacts with Prisma objects or the database should reside in this module. The main models are:

  • block: anything related to the block used in the graph
  • execution: anything related to the execution graph execution
  • graph: anything related to the graph, node, and its relations

execution

This module stores the business logic of executing the graph. It currently has the following main modules:

  • manager: A service that consumes the queue of the graph execution and executes the graph. It contains both pieces of logic.
  • scheduler: A service that triggers scheduled graph execution based on a cron expression. It pushes an execution request to the manager.

server

This module stores the logic for the server API. It contains all the logic used for the API that allows the client to create, execute, and monitor the graph and its execution. This API service interacts with other services like those defined in manager and scheduler.

utils

This module stores utility functions that are used across the project. Currently, it has two main modules:

  • process: A module that contains the logic to spawn a new process.
  • service: A module that serves as a parent class for all the services in the project.

Service Communication

Currently, there are only 3 active services:

  • AgentServer (the API, defined in server.py)
  • ExecutionManager (the executor, defined in manager.py)
  • ExecutionScheduler (the scheduler, defined in scheduler.py)

The services run in independent Python processes and communicate through an IPC. A communication layer (service.py) is created to decouple the communication library from the implementation.

Currently, the IPC is done using Pyro5 and abstracted in a way that allows a function decorated with @expose to be called from a different process.

By default the daemons run on the following ports:

Execution Manager Daemon: 8002 Execution Scheduler Daemon: 8003 Rest Server Daemon: 8004

Adding a New Agent Block

To add a new agent block, you need to create a new class that inherits from Block and provides the following information:

  • All the block code should live in the blocks (backend.blocks) module.
  • input_schema: the schema of the input data, represented by a Pydantic object.
  • output_schema: the schema of the output data, represented by a Pydantic object.
  • run method: the main logic of the block.
  • test_input & test_output: the sample input and output data for the block, which will be used to auto-test the block.
  • You can mock the functions declared in the block using the test_mock field for your unit tests.
  • Once you finish creating the block, you can test it by running poetry run pytest -s test/block/test_block.py.