Commit Graph

210 Commits (master)

Author SHA1 Message Date
Aarushi e3f35d79c7
tweak(.github): Update pr template wording (#8103)
* update pr template wording

* add what and how

* Update .github/PULL_REQUEST_TEMPLATE.md

---------

Co-authored-by: Toran Bruce Richards <toran.richards@gmail.com>
2024-09-19 12:44:50 +00:00
Aarushi 0040495143
tweak(.github): Update PR template (#8100)
* update PR template

* Update .github/PULL_REQUEST_TEMPLATE.md

Co-authored-by: Krzysztof Czerwinski <34861343+kcze@users.noreply.github.com>

* add note

* typo

---------

Co-authored-by: Krzysztof Czerwinski <34861343+kcze@users.noreply.github.com>
2024-09-19 13:00:16 +01:00
Reinier van der Leer 8fd22bcfd7
feat(server, builder): Implement "STOP" button for graph runs (#7892)
- feat(builder): Add "Stop Run" buttons to monitor and builder
  - Implement additional state management in `useAgentGraph` hook
    - Add "stop" request mechanism
    - Implement execution status tracking using WebSockets
    - Add `isSaving`, `isRunning`, `isStopping` outputs
    - Add `requestStopRun` method
      - Rename `requestSaveRun` to `requestSaveAndRun` for clarity
  - Add needed functionality for the above to `AutoGPTServerAPI` client
    - Add `stopGraphExecution` method
    - Add support for multiple handlers per WebSocket method
    - Fix parsing of timestamps in `execution_event` WebSocket messages
  - Add `IconSquare` from Lucide to `@/components/ui/icons`

- feat(server): Add `POST /graphs/{graph_id}/executions/{graph_exec_id}/stop` route
  - Add `stop_graph_run` method to `AgentServer`

- feat(server): Add `cancel_execution` method to `ExecutionManager`
  - Replace node executor `ProcessPoolExecutor` by `multiprocessing.Pool` (which has a `terminate()` method)
    - Remove now unnecessary `Executor.wait_future(..)` method
  - Add `get_graph_execution(..)` in `.data.execution`

- fix(server): Reduce number of node executors to 5 per graph executor
  This is necessary because `multiprocessing.Pool` spawns its workers on init, instead of based on demand like `ProcessPoolExecutor` does

- dx(server): Improve debug logging in `ExecutionManager`
- ci(server): Add debug logging mode to CI Pytest step

### Other improvements
Server:
- Improve output type of `ExecutionManager.add_execution(..)`
- Renamed a few things in `.server.rest_api` for consistency

Front end:
- Improved typing in `AutoGPTServerAPI` client
2024-09-05 14:42:28 +02:00
Aarushi 5000aa7ee0
tweak(rnd,docker) Remove SQLite (#7966)
* move migrations, update networking and dockignore

* update docs

* remove sqlite from ci

* remove schema linting checks

* fix formatting

* remove schema linting

* add test script

* formatting and linting

* stop pg not down

* seperate test db

* diff port

* remove duplicate
2024-09-04 10:18:57 +01:00
Reinier van der Leer 96ef35536c
ci(server): Run tests even if linting fails 2024-08-29 15:42:49 +02:00
Nicholas Tindle 1df7d527dd
Remove debug (#7890) 2024-08-25 17:59:41 +00:00
Nicholas Tindle efcd0f93ed
ci(all): take two on the global status checker (#7849)
* ci(all): fundamentally change how we do this

* Update workflow-checker.yml

* ci: dupe and move file in attempt to figure out why its not accessible

* Update workflow-checker.yml

* fix: sleep before checking, move files, improve code

* Update workflow-checker.yml

* Update check_actions_status.py

* Update check_actions_status.py

* Update workflow-checker.yml

* Update workflow-checker.yml

* ci: remove debug, add more

* Update check_actions_status.py

* Update check_actions_status.py

* Update check_actions_status.py

* Revert "Update check_actions_status.py"

This reverts commit 36134527af.

* Revert "Update check_actions_status.py"

This reverts commit 828aabf532.

* Update check_actions_status.py

* Update check_actions_status.py

* Update check_actions_status.py

* Update check_actions_status.py
2024-08-22 07:06:15 -05:00
lelcruz 60d25135e6
fix(github): Added in fallback variables for postgres testing (#7715)
Co-authored-by: Leslie Cruz <lelcruz@users.noreply.github.com>
Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
2024-08-06 15:09:02 -05:00
Andy Hooker 6fa7d22c91
feat(builder): Addition of prettier for aligned of development styles (#7629)
* fix(builder): Adding prettier configuration files and to package.

* fix(builder): Running script "format" added to the package.json

* feat(builder): Adding a job to the yaml file. This job will run "format" which leverages prettier.

* feat(builder): Running script "format" and merging master

* feat(builder): Setting configuration to prettier defaults in .prettierrc.json, and adding a requested newline in the .prettierignore

* feat(builder): Updating the CI to not add a job for prettier but instead add a check to verify prettier was run before commiting.

* feat(builder): Confirming CI update fails when user does not run prettier first. Updating with file changes after prettier

* feat(builder): Running prettier write to fix warnings

* fix(builder): Removing .prett
per PR change request

* fix(builder): Running prettier formatter

* fix(builder): Running prettier formatter check found additional files

* fix(builder): Running prettier format

* fix(builder): Removing running "format" command from PR due to a change request.

* fix(builder): Removing running "format" command from PR due to a change request.

---------

Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
2024-08-05 09:14:02 +02:00
Andy Hooker a21fd30fce
fix(github): Update CODEOWNERS for rnd directories (#7684)
Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
2024-08-02 17:23:28 -05:00
Aarushi ac45b7cae9
feat(rnd,infra): Add Helm linting in CI (#7633)
* Set up helm and tf for backend

* update helm charts and settings

* remove example files

* use latest tag

* delay and timeouts for probes

* env based pyro host

* default backend

* linting

* add helm linting in CI

* read from settings

* fix formatting

* update to use config
2024-08-01 09:22:04 +01:00
Aarushi 22b6dbbf6a
feat(rnd,infra) Set up terraform (#7565)
* add terraform

* gitignore update

* linting

* formatting and linting in ci

* store state in backend bucket
2024-07-25 09:45:36 +01:00
Nicholas Tindle 3e384c9771
ci(server): add sqlite processing (#7586)
* ci(server): add sqlite processing

* ci(server): try setting DATABASE_URL based on db platform

* fix(server): swap default back to sqlite

* ci(server): go back to database url

---------

Co-authored-by: Aarushi <50577581+aarushik93@users.noreply.github.com>
2024-07-24 14:46:39 +01:00
Aarushi 39afba6da8
feat(ci) Fix migrations in CI (#7563)
* update CI

* add poetry run

* schema prisma
2024-07-23 14:01:45 +01:00
Aarushi a911f9a5eb
feat(rnd) Add Postgres support (#7513)
* replace SQLite with Postgres

* make sqlite default

* add migrations for sqlite and postgres

* update readme

* fix formatting
2024-07-22 23:43:49 +01:00
Nicholas Tindle 7de49dfbe5
Update workflow-checker.yml (#7553) 2024-07-22 13:49:27 -05:00
Nicholas Tindle 56b82369b6
ci(all): verify the workflows as part of each run (#7500) 2024-07-22 07:23:48 -05:00
Nicholas Tindle 6ffa644fb6
fix(ops/issues): update template for bugs (#7211) 2024-07-22 07:16:51 -05:00
Reinier van der Leer 354e626965
feat(dx): Add `Builder` and `Server` to auto-labeler 2024-07-18 00:19:38 +02:00
Zamil Majdy 78b84289cb
feat(rnd): Add code-formatter & linting on AutoGPT server (#7458)
### Background

Add formatter & linter command.
Tools: ruff --> isort --> black --> pyright.

### Changes 🏗️

Introduced:
* `poetry run format`
* `poetry run lint`

`poetry run lint` will be executed on CI.
2024-07-17 11:54:29 +01:00
Krzysztof Czerwinski 6550bdc10c
feat(rnd): AutoGPT Agent wrapper for Agent Server (#7365)
- Add `autogpt` and `forge` dependency to the `autogpt_server`
- Add `AutoGPTAgentBlock` that initializes and runs a single agent loop on execution
- Add `BlockAgent` that inherits from `autogpt` `Agent` and is a thin extension on the agent that allows to disable components
- Add `OutputComponent` that adds `output` command for the agent
2024-07-13 19:47:29 +01:00
Krzysztof Czerwinski 08612cc3bf
refactor(agent, forge): Move tests from `autogpt` to `forge` (#7247)
- Move `autogpt/tests/vcr_cassettes` submodule to `forge/tests/vcr_cassettes`
- Remove not needed markers from `pyproject.toml`: `"requires_openai_api_key", "requires_huggingface_api_key"`
- Update relevant GitHub workflows

Moved relevant tests from `autogpt/tests` to appropiate directories:
- Component tests to their respective component dirs
- `autogpt/tests/unit/test_web_search.py` → `forge/components/web/test_search.py`
- `autogpt/tests/unit/test_git_commands.py` → `forge/components/git_operations/test_git_operations.py`
- `autogpt/tests/unit/test_file_operations.py` → `forge/components/file_manager/test_file_manager.py`
- `autogpt/tests/integration/test_image_gen.py` → `forge/components/image_gen/test_image_gen.py`
- `autogpt/tests/integration/test_web_selenium.py` → `forge/components/web/test_selenium.py`
- `autogpt/tests/integration/test_execute_code.py` → `forge/components/code_executor/test_code_executor.py`
- `autogpt/tests/unit/test_s3_file_storage.py` → `forge/file_storage/test_s3_file_storage.py`
- `autogpt/tests/unit/test_gcs_file_storage.py` → `forge/file_storage/test_gcs_file_storage.py`
- `autogpt/tests/unit/test_local_file_storage.py` → `forge/file_storage/test_local_file_storage.py`
- `autogpt/tests/unit/test_json.py` → `forge/json/test_parsing.py`
- `autogpt/tests/unit/test_logs.py` → `forge/logging/test_utils.py`
- `autogpt/tests/unit/test_url_validation.py` → `forge/utils/test_url_validator.py`
- `autogpt/tests/unit/test_text_file_parsers.py` → `forge/utils/test_file_operations.py`

- (Re)moved dependencies from `autogpt/pyproject.toml` that were only used in these test files.

Also:
- Added `load_env_vars` fixture to `forge/conftest.py`
- Fixed a type error in `forge/components/web/test_search.py`
- Merged `autogpt/.gitattributes` into root `.gitattributes`

---------

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2024-07-04 02:09:01 +02:00
Aarushi 854080f7af
ci(builder): Add CI for AutoGPT Builder (#7267)
Add a simple Node/NPM linting workflow for `rnd/autogpt_builder/`

---------

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2024-06-28 01:30:34 +02:00
Nicholas Tindle 785a40ff9d
feat(server, autogpt): Add Example files and update build option (#7271) 2024-06-27 09:56:21 -05:00
Nicholas Tindle 6ec708c771
ci(server): Agent Server CI (#7193) 2024-06-12 00:29:23 +07:00
Reinier van der Leer 8f18aebf90 Update wiki links to new location (Nexus/wiki -> AutoGPT/wiki) 2024-06-09 23:13:25 +02:00
Reinier van der Leer 319232568a
fix+docs(agent): Update LLM access instructions & remove GPT-specific flags (#7183)
* Update instructions to set up OpenAI / GPT-4 access
* Add instructions to set up Anthropic access
* Add instructions to set up Groq access
* Remove GPT-specific `--gpt3only`, `--gpt4only` CLI flags and related logic
* Remove duplicate config instructions from docker setup page, replace it by a link to the standard setup instructions
2024-06-03 08:51:46 -05:00
Reinier van der Leer f107ff8cf0
Set up unified pre-commit + CI w/ linting + type checking & FIX EVERYTHING (#7171)
- **FIX ALL LINT/TYPE ERRORS IN AUTOGPT, FORGE, AND BENCHMARK**

### Linting
- Clean up linter configs for `autogpt`, `forge`, and `benchmark`
- Add type checking with Pyright
- Create unified pre-commit config
- Create unified linting and type checking CI workflow

### Testing
- Synchronize CI test setups for `autogpt`, `forge`, and `benchmark`
   - Add missing pytest-cov to benchmark dependencies
- Mark GCS tests as slow to speed up pre-commit test runs
- Repair `forge` test suite
  - Add `AgentDB.close()` method for test DB teardown in db_test.py
  - Use actual temporary dir instead of forge/test_workspace/
- Move left-behind dependencies for moved `forge`-code to from autogpt to forge

### Notable type changes
- Replace uses of `ChatModelProvider` by `MultiProvider`
- Removed unnecessary exports from various __init__.py
- Simplify `FileStorage.open_file` signature by removing `IOBase` from return type union
  - Implement `S3BinaryIOWrapper(BinaryIO)` type interposer for `S3FileStorage`

- Expand overloads of `GCSFileStorage.open_file` for improved typing of read and write modes

  Had to silence type checking for the extra overloads, because (I think) Pyright is reporting a false-positive:
  https://github.com/microsoft/pyright/issues/8007

- Change `count_tokens`, `get_tokenizer`, `count_message_tokens` methods on `ModelProvider`s from class methods to instance methods

- Move `CompletionModelFunction.schema` method -> helper function `format_function_def_for_openai` in `forge.llm.providers.openai`

- Rename `ModelProvider` -> `BaseModelProvider`
- Rename `ChatModelProvider` -> `BaseChatModelProvider`
- Add type `ChatModelProvider` which is a union of all subclasses of `BaseChatModelProvider`

### Removed rather than fixed
- Remove deprecated and broken autogpt/agbenchmark_config/benchmarks.py
- Various base classes and properties on base classes in `forge.llm.providers.schema` and `forge.models.providers`

### Fixes for other issues that came to light
- Clean up `forge.agent_protocol.api_router`, `forge.agent_protocol.database`, and `forge.agent.agent`

- Add fallback behavior to `ImageGeneratorComponent`
   - Remove test for deprecated failure behavior

- Fix `agbenchmark.challenges.builtin` challenge exclusion mechanism on Windows

- Fix `_tool_calls_compat_extract_calls` in `forge.llm.providers.openai`

- Add support for `any` (= no type specified) in `JSONSchema.typescript_type`
2024-05-28 05:04:21 +02:00
Krzysztof Czerwinski cdae98d36b
fix(ci): Fix cli and CI (#7166)
- Add a special case for cli to handle autogpt and forge agent
- Remove forge agent from smoke test ci
2024-05-22 17:18:00 +01:00
Reinier van der Leer 5292736779
fix(agent): Unbreak docker builds after repo restructure (#7164)
- Move `autogpt/Dockerfile` to `Dockerfile.autogpt`
  - Write new selective `.dockerignore` (in repo root) to keep build context clean
  - Amend `autogpt/docker-compose.yml` and all `autogpt-docker-*.yml` workflows accordingly

- Include `forge/` in docker build context so it can be used as a path dependency

- Include `frontend/` in docker builds
2024-05-22 18:11:16 +02:00
Krzysztof Czerwinski 4c325724ec
refactor(autogpt, forge): Remove `autogpts` directory (#7163)
- Moved `autogpt` and `forge` to project root
- Removed `autogpts` directory
- Moved and renamed submodule `autogpts/autogpt/tests/vcr_cassettes` to `autogpt/tests/vcr_cassettes`
- When using CLI agents will be created in `agents` directory (instead of `autogpts`)
- Renamed relevant docs, code and config references from `autogpts/[forge|autogpt]` to `[forge|autogpt]` and from `*../../*` to `*../*`
- Updated `CODEOWNERS`, GitHub Actions and Docker `*.yml` configs
- Updated symbolic links in `docs`
2024-05-22 13:08:54 +01:00
Swifty 34fdbaa26b
Remove arena (#7134)
* remove arena

* refactor: Remove Arena intake workflow

* Remove all mention of the arena

* remove evo.ninja
2024-05-09 11:36:40 +02:00
Reinier van der Leer 90f3c5e2d9
fix(ci): Disable annoying "PR too big" auto-message 2024-04-10 17:49:31 +02:00
Reinier van der Leer 30bc761391
ci(agent): Add macOS on M1 to AutoGPT CI matrix (#7041)
Use a `macos-14` runner to cover macOS on M1/arm64

- Add `macos-arm64` to `platform-os` matrix, and map it to `macos-14` runner
2024-03-22 14:26:16 +01:00
Reinier van der Leer 2a0e087461
ci(agent): Disable Python dependency caching on Windows
On Windows, unpacking cached dependencies takes longer than just installing them with `poetry install`. :')
2024-03-22 14:15:43 +01:00
Reinier van der Leer 828b81e5ef
ci(agent): Fix Python dependency caching on macOS 2024-03-22 14:13:22 +01:00
Reinier van der Leer 20041d65bf
ci(agent): Fix Docker CI for PR runs from forks (vol. 2)
- Fix docker image tag format error when `secrets.DOCKER_USER` is not set
2024-03-22 12:57:29 +01:00
Reinier van der Leer 9e39937072
ci(agent): Fix Docker CI for PR runs from forks
- Disable 'Log in to Docker hub' step for `pull_request` runs
2024-03-22 12:50:58 +01:00
Reinier van der Leer dde0c70a81
ci(agent): Matrix CI tests across Linux, macOS and Windows (#7029)
* Matrix the AutoGPT Python CI's `test` job across Ubuntu, macOS and Windows

   - Set up MinIO in a step rather than specifying it under `jobs[test].services`, because services are only supported on Linux runners

   - Add Windows version of step to install Poetry

   - Add macOS compatibility patches to 'Install Poetry (Unix)' and `setup_git_auth` steps
  
   **Caveats:**
   - **No Docker on macOS or Windows**
      * Windows comes with Docker but only supports running Windows containers, while we're mainly interested in using Linux containers for code execution and/or running auxiliary services.
      * [The macOS runner doesn't come with Docker](https://github.com/actions/runner-images/issues/17). Setting it up is possible but takes ~3-4 minutes, and the performance of the Colima engine is poor: a `docker pull` that takes 2 seconds on Linux takes 45 seconds on macOS.

   - **No S3 service available on Windows**
   It seems that running a background process [isn't possible on Windows](https://github.com/actions/runner/issues/598#issuecomment-2011890429), and neither is running Linux-based Docker containers.

* Add `autogpt-agent` and OS-specific flags to Codecov upload step

* Improve caching of Python dependencies in CI by changing the cache key
   - Include hash of `poetry.lock` instead of `pyproject.toml` in key
   - Remove date component from key; it was included to avoid getting stuck to old cached versions of packages when we were still using `requirements.txt`. With `poetry.lock` that is no longer a concern.

* Fix skip check in test_s3_file_storage.py
2024-03-21 21:15:46 +01:00
Reinier van der Leer 29d390d54d
ci: Disable annoying auto-message discouraging big PRs 2024-03-01 12:28:00 +01:00
Reinier van der Leer b69f0b2cd0
fix(ci/arena): Fix requesting manual review
Three times the charm, right?
2024-03-01 12:22:05 +01:00
Reinier van der Leer 0308fb45be
fix(ci/arena): Fix requesting manual review 2024-03-01 11:44:27 +01:00
Reinier van der Leer 0325370fed
fix(ci/arena): Fix requesting manual review 2024-03-01 11:41:49 +01:00
Reinier van der Leer 1e4bd0388f
fix(ci/arena): Skip checking file against itself for duplicates 2024-03-01 11:34:47 +01:00
Reinier van der Leer d1b06f0be3
fix(ci/arena): Improve output format 2024-03-01 11:27:26 +01:00
Reinier van der Leer 3e40b35ef1
fix(ci/arena): Reverse check for `pr.mergeable` 2024-03-01 11:23:14 +01:00
Reinier van der Leer 70873906b7
fix(ci/arena): Make check for `pr.mergeable` more specific 2024-03-01 11:20:54 +01:00
Reinier van der Leer f93a8a93b4
fix(ci/arena): Fix error accessing `context` & improve log output readability 2024-03-01 11:19:31 +01:00
Reinier van der Leer 4121d3712d
fix(ci/arena): Fix syntax & formatting errors 2024-03-01 11:07:54 +01:00
Reinier van der Leer 4546dfdf17
feat(ci/arena): Add logging and debug output to workflow script 2024-03-01 11:02:41 +01:00
Reinier van der Leer 4011294da0
ci(arena): Fix `arena-intake` workflow
Sorry folks, it's been a while since I wrote javascript :')
2024-03-01 10:41:34 +01:00
Reinier van der Leer 48f6f83f05
ci(arena): Fix `arena-intake` workflow 2024-03-01 10:35:28 +01:00
Reinier van der Leer 51f5808430
ci: Add 'Arena intake' workflow to automatically check 'entering the arena' PRs 2024-03-01 00:27:10 +01:00
Reinier van der Leer 695049bfa3
ci: Auto-label PRs based on the scope of their diff 2024-02-29 19:38:04 +01:00
Reinier van der Leer 1f1e8c9f7d
Update CODEOWNERS 2024-02-22 17:26:46 +01:00
Reinier van der Leer 8fd2e48c1b
fix(ci/frontend): Add trigger on `push` including workflow file 2024-02-21 02:04:13 +01:00
Reinier van der Leer 69ccb185e8
fix(ci/frontend): Add and fix trigger on workflow file 2024-02-21 02:02:41 +01:00
Reinier van der Leer a88e833831
ci: Revise Frontend CI
- Rename build-frontend.yml to frontend-ci.yml
- Add a `pull_request` trigger
- Disable committing and pushing to a `frontend_build_{hash}` branch
- (Re)enable auto-creating a pull request for the new frontend build
2024-02-21 02:00:33 +01:00
Reinier van der Leer 0f5490075b
fix(ci/benchmark): Install benchmark dependencies
Otherwise `poetry -C benchmark run benchmark/reports/format.py` fails.
2024-02-20 16:56:47 +01:00
Reinier van der Leer c8a40727d1
fix(ci/benchmark): Specify poetry env path for report conversion step 2024-02-20 12:10:49 +01:00
Reinier van der Leer 1079d71699
fix(ci/benchmark): Unbreak "Push reports to data branch" step
The `report_subfolder` variable was being populated with two identical lines, because there will be two untracked files in the folder, resulting in the same dirname.
This caused later commands using that variable to fail. Fix is to `sort -u` before storing the value to `report_subfolder`.
2024-02-20 10:35:14 +01:00
Reinier van der Leer e104427767
feat(ci/benchmark): Generate step summary from benchmark report 2024-02-19 17:13:41 +01:00
Reinier van der Leer 784e2bbb1c
fix(ci/benchmark): Mitigate VCS conflicts with files in data branch
`agbenchmark` currently creates files like success_rate.json in the base REPORTS_FOLDER, which causes conflicts in the last step of the benchmark workflow.
To prevent issues, these files must be removed prior to switching to the data branch.
2024-02-17 18:09:44 +01:00
Reinier van der Leer 959377f54c
fix(ci/benchmark): Add `set +e` because we expect (some) challenges to fail 2024-02-17 15:56:55 +01:00
Reinier van der Leer d5ad719757
ci: Allow telemetry for non-push events, as long as it's on `master`
Also disable telemetry for AutoGPT's unit/integration tests.
2024-02-17 15:12:43 +01:00
Reinier van der Leer 1ca9b9fa93
ci: Fix setting/passing `TELEMETRY_*` environment variables 2024-02-17 14:26:03 +01:00
Reinier van der Leer fa4bdef17c
ci: Update actions to newest versions
- `actions/stale` -> `v9`
- `actions/cache` -> `v4`
- `actions/checkout` -> `v4`
- `actions/setup-node` -> `v4`
- `docker/login-action` -> `v3`
- `actions/setup-python` -> `v5`
- `codecov/codecov-action` -> `v4`
- `actions/upload-artifact` -> `v4`
- `subosito/flutter-action` -> `v2`
- `docker/build-push-action` -> `v5`
- `docker/setup-buildx-action` -> `v3`
2024-02-17 13:59:13 +01:00
Reinier van der Leer 880c8e804c
fix(ci/benchmark): Allow workflow to continue regardless of challenge outcomes 2024-02-17 11:52:26 +01:00
Reinier van der Leer d6ab470c58
Rename autogpts-benchmark-nightly.yml to autogpts-benchmark.yml 2024-02-16 18:32:50 +01:00
Reinier van der Leer a5de79beb6
ci(benchmark): Add nightly benchmark workflow
Added autogpts-benchmark-nightly.yml, which will run every night at 02:00 UTC with a selection of challenges.
2024-02-16 17:41:58 +01:00
Reinier van der Leer 679339d00c
feat(benchmark): Make report output folder configurable
- Make `AgentBenchmarkConfig.reports_folder` directly configurable (through `REPORTS_FOLDER` env variable). The default is still `./agbenchmark_config/reports`.
- Change all mentions of `REPORT_LOCATION` (which fulfilled the same function at some point in the past) to `REPORTS_FOLDER`.
2024-02-15 18:07:45 +01:00
Reinier van der Leer 6017eefb32
ci: Enable telemetry in CI runs on `master` 2024-02-14 12:03:54 +01:00
Reinier van der Leer 88bbdfc7fc
ci: Pick 3 challenges to run with `--mock` in smoke test CI 2024-02-14 02:30:03 +01:00
Reinier van der Leer 14c9773890
ci(agent): Add `GIT_REVISION` label to Docker builds 2024-02-12 12:31:04 +01:00
Reinier van der Leer 25cc6ad6ae
AGBenchmark codebase clean-up (#6650)
* refactor(benchmark): Deduplicate configuration loading logic

   - Move the configuration loading logic to a separate `load_agbenchmark_config` function in `agbenchmark/config.py` module.
   - Replace the duplicate loading logic in `conftest.py`, `generate_test.py`, `ReportManager.py`, `reports.py`, and `__main__.py` with calls to `load_agbenchmark_config` function.

* fix(benchmark): Fix type errors, linting errors, and clean up CLI validation in __main__.py

   - Fixed type errors and linting errors in `__main__.py`
   - Improved the readability of CLI argument validation by introducing a separate function for it

* refactor(benchmark): Lint and typefix app.py

   - Rearranged and cleaned up import statements
   - Fixed type errors caused by improper use of `psutil` objects
   - Simplified a number of `os.path` usages by converting to `pathlib`
   - Use `Task` and `TaskRequestBody` classes from `agent_protocol_client` instead of `.schema`

* refactor(benchmark): Replace `.agent_protocol_client` by `agent-protcol-client`, clean up schema.py

   - Remove `agbenchmark.agent_protocol_client` (an offline copy of `agent-protocol-client`).
      - Add `agent-protocol-client` as a dependency and change imports to `agent_protocol_client`.
   - Fix type annotation on `agent_api_interface.py::upload_artifacts` (`ApiClient` -> `AgentApi`).
   - Remove all unused types from schema.py (= most of them).

* refactor(benchmark): Use pathlib in agent_interface.py and agent_api_interface.py

* refactor(benchmark): Improve typing, response validation, and readability in app.py

   - Simplified response generation by leveraging type checking and conversion by FastAPI.
   - Introduced use of `HTTPException` for error responses.
   - Improved naming, formatting, and typing in `app.py::create_evaluation`.
   - Updated the docstring on `app.py::create_agent_task`.
   - Fixed return type annotations of `create_single_test` and `create_challenge` in generate_test.py.
   - Added default values to optional attributes on models in report_types_v2.py.
   - Removed unused imports in `generate_test.py`

* refactor(benchmark): Clean up logging and print statements

   - Introduced use of the `logging` library for unified logging and better readability.
   - Converted most print statements to use `logger.debug`, `logger.warning`, and `logger.error`.
   - Improved descriptiveness of log statements.
   - Removed unnecessary print statements.
   - Added log statements to unspecific and non-verbose `except` blocks.
   - Added `--debug` flag, which sets the log level to `DEBUG` and enables a more comprehensive log format.
   - Added `.utils.logging` module with `configure_logging` function to easily configure the logging library.
   - Converted raw escape sequences in `.utils.challenge` to use `colorama`.
   - Renamed `generate_test.py::generate_tests` to `load_challenges`.

* refactor(benchmark): Remove unused server.py and agent_interface.py::run_agent

   - Remove unused server.py file
   - Remove unused run_agent function from agent_interface.py

* refactor(benchmark): Clean up conftest.py

   - Fix and add type annotations
   - Rewrite docstrings
   - Disable or remove unused code
   - Fix definition of arguments and their types in `pytest_addoption`

* refactor(benchmark): Clean up generate_test.py file

   - Refactored the `create_single_test` function for clarity and readability
      - Removed unused variables
      - Made creation of `Challenge` subclasses more straightforward
      - Made bare `except` more specific
   - Renamed `Challenge.setup_challenge` method to `run_challenge`
   - Updated type hints and annotations
   - Made minor code/readability improvements in `load_challenges`
   - Added a helper function `_add_challenge_to_module` for attaching a Challenge class to the current module

* fix(benchmark): Fix and add type annotations in execute_sub_process.py

* refactor(benchmark): Simplify const determination in agent_interface.py

   - Simplify the logic that determines the value of `HELICONE_GRAPHQL_LOGS`

* fix(benchmark): Register category markers to prevent warnings

   - Use the `pytest_configure` hook to register the known challenge categories as markers. Otherwise, Pytest will raise "unknown marker" warnings at runtime.

* refactor(benchmark/challenges): Fix indentation in 4_revenue_retrieval_2/data.json

* refactor(benchmark): Update agent_api_interface.py

   - Add type annotations to `copy_agent_artifacts_into_temp_folder` function
   - Add note about broken endpoint in the `agent_protocol_client` library
   - Remove unused variable in `run_api_agent` function
   - Improve readability and resolve linting error

* feat(benchmark): Improve and centralize pathfinding

   - Search path hierarchy for applicable `agbenchmark_config`, rather than assuming it's in the current folder.
   - Create `agbenchmark.utils.path_manager` with `AGBenchmarkPathManager` and exporting a `PATH_MANAGER` const.
   - Replace path constants defined in __main__.py with usages of `PATH_MANAGER`.

* feat(benchmark/cli): Clean up and improve CLI

   - Updated commands, options, and their descriptions to be more intuitive and consistent
   - Moved slow imports into the entrypoints that use them to speed up application startup
   - Fixed type hints to match output types of Click options
   - Hid deprecated `agbenchmark start` command
   - Refactored code to improve readability and maintainability
   - Moved main entrypoint into `run` subcommand
   - Fixed `version` and `serve` subcommands
   - Added `click-default-group` package to allow using `run` implicitly (for backwards compatibility)
   - Renamed `--no_dep` to `--no-dep` for consistency
   - Fixed string formatting issues in log statements

* refactor(benchmark/config): Move AgentBenchmarkConfig and related functions to config.py

   - Move the `AgentBenchmarkConfig` class from `utils/data_types.py` to `config.py`.
   - Extract the `calculate_info_test_path` function from `utils/data_types.py` and move it to `config.py` as a private helper function `_calculate_info_test_path`.
   - Move `load_agent_benchmark_config()` to `AgentBenchmarkConfig.load()`.
   - Changed simple getter methods on `AgentBenchmarkConfig` to calculated properties.
   - Update all code references according to the changes mentioned above.

* refactor(benchmark): Fix ReportManager init parameter types and use pathlib

   - Fix the type annotation of the `benchmark_start_time` parameter in `ReportManager.__init__`, was mistyped as `str` instead of `datetime`.
   - Change the type of the `filename` parameter in the `ReportManager.__init__` method from `str` to `Path`.
   - Rename `self.filename` with `self.report_file` in `ReportManager`.
   - Change the way the report file is created, opened and saved to use the `Path` object.

* refactor(benchmark): Improve typing surrounding ChallengeData and clean up its implementation

   - Use `ChallengeData` objects instead of untyped `dict` in  app.py, generate_test.py, reports.py.
   - Remove unnecessary methods `serialize`, `get_data`, `get_json_from_path`, `deserialize` from `ChallengeData` class.
   - Remove unused methods `challenge_from_datum` and `challenge_from_test_data` from `ChallengeData class.
   - Update function signatures and annotations of `create_challenge` and `generate_single_test` functions in generate_test.py.
   - Add types to function signatures of `generate_single_call_report` and `finalize_reports` in reports.py.
   - Remove unnecessary `challenge_data` parameter (in generate_test.py) and fixture (in conftest.py).

* refactor(benchmark): Clean up generate_test.py, conftest.py and __main__.py

   - Cleaned up generate_test.py and conftest.py
      - Consolidated challenge creation logic in the `Challenge` class itself, most notably the new `Challenge.from_challenge_spec` method.
      - Moved challenge selection logic from generate_test.py to the `pytest_collection_modifyitems` hook in conftest.py.
   - Converted methods in the `Challenge` class to class methods where appropriate.
   - Improved argument handling in the `run_benchmark` function in `__main__.py`.

* refactor(benchmark/config): Merge AGBenchmarkPathManager into AgentBenchmarkConfig and reduce fragmented/global state

   - Merge the functionality of `AGBenchmarkPathManager` into `AgentBenchmarkConfig` to consolidate the configuration management.
   - Remove the `.path_manager` module containing `AGBenchmarkPathManager`.
   - Pass the `AgentBenchmarkConfig` and its attributes through function arguments to reduce global state and improve code clarity.

* feat(benchmark/serve): Configurable port for `serve` subcommand

   - Added `--port` option to `serve` subcommand to allow for specifying the port to run the API on.
   - If no `--port` option is provided, the port will default to the value specified in the `PORT` environment variable, or 8080 if not set.

* feat(benchmark/cli): Add `config` subcommand

   - Added a new subcommand `config` to the AGBenchmark CLI, to display information about the present AGBenchmark config.

* fix(benchmark): Gracefully handle incompatible challenge spec files in app.py

   - Added a check to skip deprecated challenges
   - Added logging to allow debugging of the loading process
   - Added handling of validation errors when parsing challenge spec files
   - Added missing `spec_file` attribute to `ChallengeData`

* refactor(benchmark): Move `run_benchmark` entrypoint to main.py, use it in `/reports` endpoint

   - Move `run_benchmark` and `validate_args` from __main__.py to main.py
   - Replace agbenchmark subprocess in `app.py:run_single_test` with `run_benchmark`
   - Move `get_unique_categories` from __main__.py to challenges/__init__.py
   - Move `OPTIONAL_CATEGORIES` from __main__.py to challenge.py
   - Reduce operations on updates.json (including `initialize_updates_file`) outside of API

* refactor(benchmark): Remove unused `/updates` endpoint and all related code

   - Remove `updates_json_file` attribute from `AgentBenchmarkConfig`
   - Remove `get_updates` and `_initialize_updates_file` in app.py
   - Remove `append_updates_file` and `create_update_json` functions in agent_api_interface.py
   - Remove call to `append_updates_file` in challenge.py

* refactor(benchmark/config): Clean up and update docstrings on `AgentBenchmarkConfig`

   - Add and update docstrings
   - Change base class from `BaseModel` to `BaseSettings`, allow extras for backwards compatibility
   - Make naming of path attributes on `AgentBenchmarkConfig` more consistent
   - Remove unused `agent_home_directory` attribute
   - Remove unused `workspace` attribute

* fix(benchmark): Restore mechanism to select (optional) categories in agent benchmark config

* fix(benchmark): Update agent-protocol-client to v1.1.0

   - Fixes issue with fetching task artifact listings
2024-01-02 22:23:09 +01:00
Reinier van der Leer 1bed3c6056
ci: Fix docker release workflow
- Update autogpt-docker-release.yml to correctly sanitize image tags
- This unbreaks the release workflow
2023-12-13 21:41:03 +01:00
Reinier van der Leer b083d3245d
ci/cd: Strip `autogpt-` from tag name for Docker release 2023-12-11 15:47:30 +01:00
Reinier van der Leer b9d7dd1514
ci/cd: Only run AutoGPT Docker Release workflow on releases linked to `autogpt-*` tag
- Add a condition to the job in autogpt-docker-release.yml to only run on `refs/tags/autogpt-`
2023-12-11 15:34:32 +01:00
Reinier van der Leer 1f40d72081
feat(agent/workspace): Add GCS and S3 FileWorkspace providers (#6485)
* refactor: Rename FileWorkspace to LocalFileWorkspace and create FileWorkspace abstract class
  - Rename `FileWorkspace` to `LocalFileWorkspace` to provide a more descriptive name for the class that represents a file workspace that works with local files.
  - Create a new base class `FileWorkspace` to serve as the parent class for `LocalFileWorkspace`. This allows for easier extension and customization of file workspaces in the future.
  - Update import statements and references to `FileWorkspace` throughout the codebase to use the new naming conventions.

* feat: Add S3FileWorkspace + tests + test setups for CI and Docker
  - Added S3FileWorkspace class to provide an interface for interacting with a file workspace and storing files in an S3 bucket.
  - Updated pyproject.toml to include dependencies for boto3 and boto3-stubs.
  - Implemented unit tests for S3FileWorkspace.
  - Added MinIO service to Docker CI to allow testing S3 features in CI.
  - Added autogpt-test service config to docker-compose.yml for local testing with MinIO.

* ci(docker): tee test output instead of capturing

* fix: Improve error handling in S3FileWorkspace.initialize()
  - Do not tolerate all `botocore.exceptions.ClientError`s
  - Raise the exception anyways if the error is not "NoSuchBucket"

* feat: Add S3 workspace backend support and S3Credentials
  - Added support for S3 workspace backend in the Autogpt configuration
  - Added a new sub-config `S3Credentials` to store S3 credentials
  - Modified the `.env.template` file to include variables related to S3 credentials
  - Added a new `s3_credentials` attribute on the `Config` class to store S3 credentials
  - Moved the `unmasked` method from `ModelProviderCredentials` to the parent `ProviderCredentials` class to handle unmasking for S3 credentials

* fix(agent/tests): Fix S3FileWorkspace initialization in test_s3_file_workspace.py
  - Update the S3FileWorkspace initialization in the test_s3_file_workspace.py file to include the required S3 Credentials.

* refactor: Remove S3Credentials and add get_workspace function
  - Remove `S3Credentials` as boto3 will fetch the config from the environment by itself
  - Add `get_workspace` function in `autogpt.file_workspace` module
  - Update `.env.template` and tests to reflect the changes

* feat(agent/workspace): Make agent workspace backend configurable
  - Modified `autogpt.file_workspace.get_workspace` function to either take a workspace `id` or `root_path`.
  - Modified `FileWorkspaceMixin` to use the `get_workspace` function to set up the workspace.
  - Updated the type hints and imports accordingly.

* feat(agent/workspace): Add GCSFileWorkspace for Google Cloud Storage
  - Added support for Google Cloud Storage as a storage backend option in the workspace.
  - Created the `GCSFileWorkspace` class to interface with a file workspace stored in a Google Cloud Storage bucket.
  - Implemented the `GCSFileWorkspaceConfiguration` class to handle the configuration for Google Cloud Storage workspaces.
  - Updated the `get_workspace` function to include the option to use Google Cloud Storage as a workspace backend.
  - Added unit tests for the new `GCSFileWorkspace` class.

* fix: Unbreak use of non-local workspaces in AgentProtocolServer
  - Modify the `_get_task_agent_file_workspace` method to handle both local and non-local workspaces correctly
2023-12-07 14:46:08 +01:00
Reinier van der Leer b8b792e844
ci: Fix issue in Docker CI
* Stop Docker CI pushing images from PR workflow runs
2023-12-03 17:35:03 +01:00
Reinier van der Leer fe96f6d783
refactor: Disable mypy and autoflake in CI and pre-commit hook
- Commented out the mypy and autoflake checks in the CI workflow and pre-commit config files.
- The intention is to enable the mypy check again later.
2023-12-02 06:11:51 +01:00
Reinier van der Leer a771b2c6c1
ci: Push dev build in Docker CI if tests succeed
- Added Docker Hub authentication in the CI workflow
- Added a new step to push the dev build to Docker Hub
2023-11-30 17:45:09 +01:00
Reinier van der Leer b106a61352
Clean up & fix GitHub workflows (#6313)
* ci: Mitigate security issues in autogpt-ci.yml

- Remove unnecessary pull_request_target paths and related variables and config
- Set permissions for contents to read only

* ci: Simplify steps in autogpt-ci.yml workflow using GitHub CLI

- Simplify step in 'autogpt-ci.yml' by using GitHub CLI instead of API for adding label and comment functionality
- Replace curl command with 'gh issue edit' to add "behaviour change" label to the pull request
- Replace gh api command with 'gh issue comment' to leave a comment about the changed behavior of AutoGPT in the pull request

* ci: Fix issues in workflows

- Move environment variable definition to top level in benchmark-ci.yml (because the other job also needs it)
- Removed invalid 'branches: [hackathon]' restriction in hackathon.yml workflow
- Removed redundant 'ref' and 'repository' fields in the 'checkout' step of both workflows.

* ci: Delete legacy benchmarks.yml workflow

* ci: Add triggers for CI workflows

- Add triggers to run CI workflows when they are edited.
- Update the paths for the CI workflows in the trigger configuration.

* fix: Fix benchmark lint error

- Removed unnecessary blank lines in report_types.py
- Fixed string quotes in challenge.py to maintain consistency

* fix: Update task description in password generator data.json

- Update task description in `data.json` file for the password generator challenge to clarify the input requirements and error handling.
- This change is made in an attempt to make the Benchmark CI pass.

* fix: Fix PasswordGenerator challenge in CI

- Fix the behavior of the reference password_generator.py to align with the task description
- Use default password length 8 instead of a random length in the generate_password function
- Retrieve the password length from the command line arguments if "--length" is provided, else set it to 8
2023-11-21 10:58:54 +01:00
SwiftyOS 787c71a9de update benchmarking workflow 2023-11-16 14:49:09 +01:00
Reinier van der Leer 60264d65db
Add fridge, project management labels to do-not-stale list for issues 2023-11-16 10:14:59 +01:00
Merwane Hamadi 5ff3f2dbbb Hackathon CI: use agbenchmark instead of mock 2023-10-27 07:44:02 -07:00
Merwane Hamadi bd496066dc Hackathon CI: change name of folder 2023-10-27 07:27:43 -07:00
Merwane Hamadi 336e78eca0 Update Hackathon CI 2023-10-27 07:21:29 -07:00
merwanehamadi 21b809794a
Update hackathon.yml (#5975) 2023-10-26 13:47:36 -07:00
Merwane Hamadi 5fd82c7f15 Add CI for the hackathon and fix TestAgent.json 2023-10-26 08:27:47 -07:00
Reinier van der Leer 16e266c65f
Set up CI for `development` branch; deprecate `stable` branch 2023-10-21 15:46:53 -07:00
Reinier van der Leer ae9fc68b37
Remove references to legacy challenges 2023-10-17 17:31:23 -07:00
Reinier van der Leer 8cf246bb9e
Unbreak benchmark-ci.yml 2023-10-17 11:48:40 -07:00
Reinier van der Leer eb7eb37e65
Add AutoGPT agent to autogpts-ci.yml 2023-10-17 11:08:17 -07:00
Reinier van der Leer 0bd5d4420e
Unbreak autogpts-ci.yml 2023-10-17 10:47:43 -07:00
Reinier van der Leer 1eadc64dc0
Fix AutoGPT Docker cache purge workflow 2023-10-16 22:32:55 -07:00
merwanehamadi a7c11a994b
Frontend ci (#5579)
* Fix agbenchmark client

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>

* Add frontend ci

---------

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
2023-10-06 12:20:01 -07:00
merwanehamadi bcb24c1a58
Fix challenges (#5561)
Fix challenges and CI

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
2023-10-05 10:59:50 -07:00
SwiftyOS 11cb40af88 Update git stats 2023-10-03 12:45:28 +02:00
merwanehamadi a30cbcc2ce
Fix benchmark ci (#5478)
Fix benchmark CI

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
2023-10-02 12:41:32 -07:00