mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
- 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
156 lines
5.0 KiB
YAML
156 lines
5.0 KiB
YAML
name: AutoGPT Server CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master, development, ci-test*]
|
|
paths:
|
|
- ".github/workflows/autogpt-server-ci.yml"
|
|
- "rnd/autogpt_server/**"
|
|
pull_request:
|
|
branches: [master, development, release-*]
|
|
paths:
|
|
- ".github/workflows/autogpt-server-ci.yml"
|
|
- "rnd/autogpt_server/**"
|
|
|
|
concurrency:
|
|
group: ${{ format('autogpt-server-ci-{0}', github.head_ref && format('{0}-{1}', github.event_name, github.event.pull_request.number) || github.sha) }}
|
|
cancel-in-progress: ${{ startsWith(github.event_name, 'pull_request') }}
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: rnd/autogpt_server
|
|
|
|
jobs:
|
|
test:
|
|
permissions:
|
|
contents: read
|
|
timeout-minutes: 30
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ["3.10"]
|
|
platform-os: [ubuntu, macos, macos-arm64, windows]
|
|
runs-on: ${{ matrix.platform-os != 'macos-arm64' && format('{0}-latest', matrix.platform-os) || 'macos-14' }}
|
|
|
|
steps:
|
|
- name: Setup PostgreSQL
|
|
uses: ikalnytskyi/action-setup-postgres@v6
|
|
with:
|
|
username: ${{ secrets.DB_USER || 'postgres' }}
|
|
password: ${{ secrets.DB_PASS || 'postgres' }}
|
|
database: postgres
|
|
port: 5432
|
|
id: postgres
|
|
|
|
# Quite slow on macOS (2~4 minutes to set up Docker)
|
|
# - name: Set up Docker (macOS)
|
|
# if: runner.os == 'macOS'
|
|
# uses: crazy-max/ghaction-setup-docker@v3
|
|
|
|
- name: Start MinIO service (Linux)
|
|
if: runner.os == 'Linux'
|
|
working-directory: "."
|
|
run: |
|
|
docker pull minio/minio:edge-cicd
|
|
docker run -d -p 9000:9000 minio/minio:edge-cicd
|
|
|
|
- name: Start MinIO service (macOS)
|
|
if: runner.os == 'macOS'
|
|
working-directory: ${{ runner.temp }}
|
|
run: |
|
|
brew install minio/stable/minio
|
|
mkdir data
|
|
minio server ./data &
|
|
|
|
# No MinIO on Windows:
|
|
# - Windows doesn't support running Linux Docker containers
|
|
# - It doesn't seem possible to start background processes on Windows. They are
|
|
# killed after the step returns.
|
|
# See: https://github.com/actions/runner/issues/598#issuecomment-2011890429
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: true
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- id: get_date
|
|
name: Get date
|
|
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
|
|
|
|
- name: Set up Python dependency cache
|
|
# On Windows, unpacking cached dependencies takes longer than just installing them
|
|
if: runner.os != 'Windows'
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ runner.os == 'macOS' && '~/Library/Caches/pypoetry' || '~/.cache/pypoetry' }}
|
|
key: poetry-${{ runner.os }}-${{ hashFiles('rnd/autogpt_server/poetry.lock') }}
|
|
|
|
- name: Install Poetry (Unix)
|
|
if: runner.os != 'Windows'
|
|
run: |
|
|
curl -sSL https://install.python-poetry.org | python3 -
|
|
|
|
if [ "${{ runner.os }}" = "macOS" ]; then
|
|
PATH="$HOME/.local/bin:$PATH"
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
fi
|
|
|
|
- name: Install Poetry (Windows)
|
|
if: runner.os == 'Windows'
|
|
shell: pwsh
|
|
run: |
|
|
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
|
|
|
|
$env:PATH += ";$env:APPDATA\Python\Scripts"
|
|
echo "$env:APPDATA\Python\Scripts" >> $env:GITHUB_PATH
|
|
|
|
- name: Install Python dependencies
|
|
run: poetry install
|
|
|
|
- name: Generate Prisma Client
|
|
run: poetry run prisma generate
|
|
|
|
- name: Run Database Migrations
|
|
run: poetry run prisma migrate dev --name updates
|
|
env:
|
|
CONNECTION_STR: ${{ steps.postgres.outputs.connection-uri }}
|
|
|
|
- id: lint
|
|
name: Run Linter
|
|
run: poetry run lint
|
|
|
|
- name: Run pytest with coverage
|
|
run: |
|
|
if [[ "${{ runner.debug }}" == "1" ]]; then
|
|
poetry run pytest -vv -o log_cli=true -o log_cli_level=DEBUG test
|
|
else
|
|
poetry run pytest -vv test
|
|
fi
|
|
if: success() || (failure() && steps.lint.outcome == 'failure')
|
|
env:
|
|
LOG_LEVEL: ${{ runner.debug && 'DEBUG' || 'INFO' }}
|
|
env:
|
|
CI: true
|
|
PLAIN_OUTPUT: True
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
DB_USER: ${{ secrets.DB_USER || 'postgres' }}
|
|
DB_PASS: ${{ secrets.DB_PASS || 'postgres' }}
|
|
DB_NAME: postgres
|
|
DB_PORT: 5432
|
|
RUN_ENV: local
|
|
PORT: 8080
|
|
DATABASE_URL: postgresql://${{ secrets.DB_USER || 'postgres' }}:${{ secrets.DB_PASS || 'postgres' }}@localhost:5432/${{ secrets.DB_NAME || 'postgres'}}
|
|
|
|
# - name: Upload coverage reports to Codecov
|
|
# uses: codecov/codecov-action@v4
|
|
# with:
|
|
# token: ${{ secrets.CODECOV_TOKEN }}
|
|
# flags: autogpt-server,${{ runner.os }}
|