Skip to content

Commit

Permalink
Merge pull request #321 from LAION-AI/257-backend-on-aws
Browse files Browse the repository at this point in the history
257 backend on aws
  • Loading branch information
fozziethebeat committed Jan 3, 2023
2 parents 9ae593f + 22cf775 commit e835e44
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 163 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,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

0 comments on commit e835e44

Please sign in to comment.