Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
George Burton committed Sep 4, 2024
1 parent a6e3466 commit a4fb89d
Show file tree
Hide file tree
Showing 31 changed files with 63 additions and 4,483 deletions.
2 changes: 0 additions & 2 deletions .env.django
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ POSTGRES_DB=redbox-core
POSTGRES_PASSWORD=insecure
CONTACT_EMAIL=redbox-support@cabinetoffice.gov.uk
POSTGRES_HOST=db
CORE_API_HOST=core-api
CORE_API_PORT=5002
EMAIL_BACKEND_TYPE=CONSOLE
GOV_NOTIFY_API_KEY=f4k3_k3y
FROM_EMAIL=test@example.com
Expand Down
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ POSTGRES_DB=redbox-core
POSTGRES_PASSWORD=insecure
CONTACT_EMAIL=redbox-support@cabinetoffice.gov.uk
POSTGRES_HOST=db
CORE_API_HOST=core-api
CORE_API_PORT=5002
EMAIL_BACKEND_TYPE=CONSOLE
GOV_NOTIFY_API_KEY=f4k3_k3y
FROM_EMAIL=test@example.com
Expand Down
2 changes: 0 additions & 2 deletions .env.integration
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ POSTGRES_DB=redbox-core
POSTGRES_PASSWORD=insecure
CONTACT_EMAIL=redbox-support@cabinetoffice.gov.uk
POSTGRES_HOST=db
CORE_API_HOST=core-api
CORE_API_PORT=5002

EMAIL_BACKEND_TYPE=CONSOLE
GOV_NOTIFY_API_KEY=f4k3_k3y
Expand Down
2 changes: 0 additions & 2 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ POSTGRES_DB=redbox-core
POSTGRES_PASSWORD=insecure
CONTACT_EMAIL=redbox-support@cabinetoffice.gov.uk
POSTGRES_HOST=localhost
CORE_API_HOST=localhost
CORE_API_PORT=5002
EMAIL_BACKEND_TYPE=FILE
GOV_NOTIFY_API_KEY=f4k3_k3y
FROM_EMAIL=test@example.com
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
- name: Run DeepEval Unit Tests
run: |
cp .env core-api/.env
cd core-api
poetry install
poetry run deepeval test run tests/test_ai.py --mark ai
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,6 @@ permissions:
contents: read

jobs:
test-core-api:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.12"

- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.7.0

- name: Build Containers
run: |
mkdir -p data/elastic/
chmod 777 data/elastic/
cp .env.test .env
docker compose up -d --wait elasticsearch
- name: Test core with pytest
run: |
make test-core-api
test-redbox:

runs-on: ubuntu-latest
Expand Down
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ build:
rebuild: stop prune ## Rebuild all images
docker compose build --no-cache

.PHONY: test-core-api
test-core-api: ## Test core-api
cd core-api && poetry install --with dev && poetry run python -m pytest --cov=core_api -v --cov-report=term-missing --cov-fail-under=75

.PHONY: test-ai
test-ai: ## Test code with live LLM
cd redbox-core && poetry install --with dev && poetry run python -m pytest -m "ai" --cov=redbox -v --cov-report=term-missing --cov-fail-under=80
Expand Down Expand Up @@ -131,7 +127,6 @@ AUTO_APPLY_RESOURCES = module.django-app.aws_ecs_task_definition.aws-ecs-task \
module.worker.data.aws_ecs_task_definition.main \
aws_secretsmanager_secret.django-app-secret \
aws_secretsmanager_secret.worker-secret \
aws_secretsmanager_secret.core-api-secret \
module.django-lambda.aws_lambda_function.lambda_function

target_modules = $(foreach resource,$(AUTO_APPLY_RESOURCES),-target $(resource))
Expand Down Expand Up @@ -178,7 +173,7 @@ docker_push:

.PHONY: docker_update_tag
docker_update_tag:
for service in django-app core-api worker; do \
for service in django-app worker; do \
MANIFEST=$$(aws ecr batch-get-image --repository-name $(ECR_REPO_NAME)-$$service --image-ids imageTag=$(IMAGE_TAG) --query 'images[].imageManifest' --output text) ; \
aws ecr put-image --repository-name $(ECR_REPO_NAME)-$$service --image-tag $(tag) --image-manifest "$$MANIFEST" ; \
done
Expand Down Expand Up @@ -259,7 +254,7 @@ release: ## Deploy app

.PHONY: eval_backend
eval_backend: ## Runs the only the necessary backend for evaluation BUCKET_NAME
docker compose up -d --wait core-api --build
docker compose up -d --wait worker --build
docker exec -it $$(docker ps -q --filter "name=minio") mc mb data/${BUCKET_NAME}

.PHONY: help
Expand Down
27 changes: 0 additions & 27 deletions core-api/.vscode/launch.json

This file was deleted.

17 changes: 0 additions & 17 deletions core-api/.vscode/settings.json

This file was deleted.

17 changes: 0 additions & 17 deletions core-api/Dockerfile

This file was deleted.

Empty file removed core-api/core_api/__init__.py
Empty file.
88 changes: 0 additions & 88 deletions core-api/core_api/app.py

This file was deleted.

33 changes: 0 additions & 33 deletions core-api/core_api/auth.py

This file was deleted.

58 changes: 0 additions & 58 deletions core-api/core_api/dependencies.py

This file was deleted.

23 changes: 0 additions & 23 deletions core-api/core_api/publisher_handler.py

This file was deleted.

Empty file.
Loading

0 comments on commit a4fb89d

Please sign in to comment.