Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Agenta-AI/agenta into fix/l…
Browse files Browse the repository at this point in the history
…lm-provider-keys
  • Loading branch information
MohammedMaaz committed Mar 5, 2024
2 parents cb0f291 + 12cd6af commit 6d75761
Show file tree
Hide file tree
Showing 161 changed files with 6,714 additions and 4,070 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,15 @@
"contributions": [
"code"
]
},
{
"login": "HeonHeo23",
"name": "Heon Heo",
"avatar_url": "https://avatars.githubusercontent.com/u/76820291?v=4",
"profile": "http://heonheo.com",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/bump-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Bump versions

on:
workflow_dispatch:
inputs:
bump-type:
description: "Bump Type"
required: true
default: "patch"
type: choice
options:
- patch
- minor
- major

jobs:
migrate-db-schema-stage:
name: Bump version
continue-on-error: false
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Bump versions
run: |
BUMP_TYPE=${{ inputs.bump-type }}
echo "Bumping versions to $BUMP_TYPE"
cd agenta-web
npm version $BUMP_TYPE
cd ..
cd agenta-cli
poetry version $BUMP_TYPE
cd ..
cd agenta-backend
poetry version $BUMP_TYPE
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: Bump versions
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
branch: bump-versions
delete-branch: true
title: 'Bump versions'
body: |
New version in
- agenta-web
- agenta-backend
- agenta-cli
2 changes: 1 addition & 1 deletion .github/workflows/check-python-code-black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
- uses: psf/black@23.12.0
20 changes: 14 additions & 6 deletions .github/workflows/run-backend-tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
name: Run Backend tests

on: [pull_request]
on:
pull_request:
paths:
- 'agenta-backend/**'
- 'docker-compose.yml'
- 'docker-compose.*.yml'
workflow_dispatch:
inputs:
debug:
description: 'Run Docker logs step (true/false)'
required: true
default: 'false'

jobs:
continous_integration:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -33,8 +44,5 @@ jobs:
run: sleep 10 && docker exec agenta-backend-test pytest

- name: Docker logs
if: always() #
if: github.event_name == 'workflow_dispatch' && github.event.inputs.debug == 'true'
run: docker ps -q | xargs -I {} docker logs {}

- name: Stop Docker Compose
run: docker-compose down
19 changes: 14 additions & 5 deletions .github/workflows/run-frontend-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
name: Run Frontend tests

on: [pull_request]
on:
pull_request:
paths:
- 'agenta-web/**'
- 'docker-compose.yml'
- 'docker-compose.*.yml'
workflow_dispatch:
inputs:
debug:
description: 'Run Docker logs step (true/false)'
required: true
default: 'false'

env:
OPENAI_API_KEY: ${{ secrets.NEXT_PUBLIC_OPENAI_API_KEY }}

Expand Down Expand Up @@ -49,8 +61,5 @@ jobs:
run: cd agenta-web/ && npm run test

- name: Docker logs
if: always() #
if: github.event_name == 'workflow_dispatch' && github.event.inputs.debug == 'true'
run: docker ps -q | xargs -I {} docker logs {}

- name: Stop Docker Compose
run: docker-compose down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,7 @@ agenta-web/cypress/screenshots/
agenta-web/cypress/videos/
.nextjs_cache/

rabbitmq_data
rabbitmq_data

# docker compose override
docker-compose.*override.yaml
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Check out our [Contributing Guide](https://docs.agenta.ai/contributing/getting-s
## Contributors ✨

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-39-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-40-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Expand Down Expand Up @@ -219,6 +219,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/brockWith"><img src="https://avatars.githubusercontent.com/u/105627491?v=4?s=100" width="100px;" alt="brockWith"/><br /><sub><b>brockWith</b></sub></a><br /><a href="https://github.com/Agenta-AI/agenta/commits?author=brockWith" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://denniszelada.wordpress.com/"><img src="https://avatars.githubusercontent.com/u/219311?v=4?s=100" width="100px;" alt="Dennis Zelada"/><br /><sub><b>Dennis Zelada</b></sub></a><br /><a href="https://github.com/Agenta-AI/agenta/commits?author=denniszelada" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/romainrbr"><img src="https://avatars.githubusercontent.com/u/10381609?v=4?s=100" width="100px;" alt="Romain Brucker"/><br /><sub><b>Romain Brucker</b></sub></a><br /><a href="https://github.com/Agenta-AI/agenta/commits?author=romainrbr" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://heonheo.com"><img src="https://avatars.githubusercontent.com/u/76820291?v=4?s=100" width="100px;" alt="Heon Heo"/><br /><sub><b>Heon Heo</b></sub></a><br /><a href="https://github.com/Agenta-AI/agenta/commits?author=HeonHeo23" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
14 changes: 5 additions & 9 deletions agenta-backend/agenta_backend/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import asyncio
from contextlib import asynccontextmanager

Expand All @@ -12,18 +11,18 @@
human_evaluation_router,
evaluators_router,
observability_router,
organization_router,
testset_router,
user_profile,
variants_router,
bases_router,
configs_router,
health_router,
)
from agenta_backend.utils.common import isCloudEE
from agenta_backend.models.db_engine import DBEngine
from agenta_backend.open_api import open_api_tags_metadata

if os.environ["FEATURE_FLAG"] in ["cloud", "ee"]:
if isCloudEE():
from agenta_backend.commons.services import templates_manager
else:
from agenta_backend.services import templates_manager
Expand Down Expand Up @@ -71,12 +70,12 @@ async def lifespan(application: FastAPI, cache=True):
allow_headers=allow_headers,
)

if os.environ["FEATURE_FLAG"] not in ["cloud", "ee"]:
if not isCloudEE():
from agenta_backend.services.auth_helper import authentication_middleware

app.middleware("http")(authentication_middleware)

if os.environ["FEATURE_FLAG"] in ["cloud", "ee"]:
if isCloudEE():
import agenta_backend.cloud.main as cloud

app, allow_headers = cloud.extend_main(app)
Expand All @@ -102,13 +101,10 @@ async def lifespan(application: FastAPI, cache=True):
app.include_router(
observability_router.router, prefix="/observability", tags=["Observability"]
)
app.include_router(
organization_router.router, prefix="/organizations", tags=["Organizations"]
)
app.include_router(bases_router.router, prefix="/bases", tags=["Bases"])
app.include_router(configs_router.router, prefix="/configs", tags=["Configs"])

if os.environ["FEATURE_FLAG"] in ["cloud", "ee"]:
if isCloudEE():
import agenta_backend.cloud.main as cloud

app = cloud.extend_app_schema(app)
51 changes: 0 additions & 51 deletions agenta-backend/agenta_backend/migrations/README.md

This file was deleted.

Loading

0 comments on commit 6d75761

Please sign in to comment.