Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

257 backend on aws #321

Merged
merged 4 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
# and which break the standard YAML check. The alternative would be to
# skip any unsafe errors (and thus break YAML compatibility) or use
# some other checker that may not work in general.
exclude: "^copilot/web/addons/.*$"
exclude: "^copilot/.*/addons/.*$"
- id: check-json
- id: check-case-conflict
- id: detect-private-key
Expand Down
38 changes: 38 additions & 0 deletions copilot/api/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# The manifest for the "api" service.
# Read the full specification for the "Load Balanced Web Service" type at:
# https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/

name: api
type: Load Balanced Web Service

http:
path: "/"
healthcheck:
path: "/docs"

image:
build:
dockerfile: docker/Dockerfile.backend
context: ./
port: 8080

cpu: 256
memory: 512
platform: linux/x86_64
count: 1
exec: true
network:
connect: true

environments:
staging:
variables:
# Note: this has to be a valid JSON list for Pydantic to parse it.
BACKEND_CORS_ORIGINS: '["https://web.staging.open-assistant.surfacedata.org"]'
DEBUG_ALLOW_ANY_API_KEY: True
DEBUG_SKIP_API_KEY_CHECK: True
MAX_WORKERS: 1

secrets:
# Note: URI, not URL.
DATABASE_URI: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/API_DATABASE_URL
161 changes: 0 additions & 161 deletions copilot/web/addons/web-cluster.yml

This file was deleted.

2 changes: 1 addition & 1 deletion copilot/web/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ environments:
staging:
variables:
NEXTAUTH_URL: https://web.staging.open-assistant.surfacedata.org
FASTAPI_URL: https://api.staging.open-assistant.surfacedata.org

secrets:
DATABASE_URL: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/DATABASE_URL
Expand All @@ -37,5 +38,4 @@ secrets:
EMAIL_SERVER_USER: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/EMAIL_SERVER_USER
EMAIL_FROM: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/EMAIL_FROM
FASTAPI_KEY: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/FASTAPI_KEY
FASTAPI_URL: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/FASTAPI_URL
NEXTAUTH_SECRET: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/NEXTAUTH_SECRET
1 change: 1 addition & 0 deletions docker/Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ COPY ./backend/requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt

ENV PORT 8080
EXPOSE 8080

COPY ./oasst-shared /oasst-shared
RUN pip install -e /oasst-shared
Expand Down