Skip to content

Commit

Permalink
feat: Add env files examples (#239)
Browse files Browse the repository at this point in the history
* feat: add-env-examples

* Include new README and fix requirements

* feat: config local database

---------

Co-authored-by: remg1997 <re.mosquera@uniandes.edu.co>
  • Loading branch information
Ciroye and remg1997 authored Jan 15, 2024
1 parent a6fc75d commit 1ba67ab
Show file tree
Hide file tree
Showing 7 changed files with 878 additions and 8 deletions.
47 changes: 47 additions & 0 deletions api/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# BD
DB_HOST=local
DB_PORT=3306
DB_NAME=dynabench
DB_USER=user
DB_PASSWORD=password
# Frontend
FRONTEND_IP=https://dynabench.org/
MAIL_LOGIN=
MAIL_PASSWORD=
# Certificates Email
RUNNING_MODE=
SSL_CRT_FILE=
SSL_ORG_PEM_FILE=
SMTP_HOST=
SMTP_USER=
SMTP_SECRET=
SMTP_FROM_ADDRESS=
#AWS-api
DATAPERF_AWS_ACCESS_KEY_ID=
DATAPERF_AWS_SECRET_ACCESS_KEY=
DATAPERF_AWS_REGION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
DATASET_S3_PROFILE=
AWS_S3_BUCKET=
#AWS-eval
DATASET_S3_BUCKET=
EVALUATION_SQS_QUEUE=
DECEN_EAAS_SECRET=""
TASK_CODE=""
EVAL_AWS_ACCESS_KEY_ID=
EVAL_AWS_SECRET_ACCESS_KEY=
EVAL_AWS_REGION=
#AWS-build
BUILD_AWS_ACCESS_KEY_ID=
BUILD_AWS_SECRET_ACCESS_KEY=
BUILD_AWS_REGION=
SAGEMAKER_ROLE=
SQS_BUILDER=
SQS_EVAL=
DYNABENCH_API=
AWS_SECURITY_TOKEN=""
AWS_SESSION_TOKEN=""
SQS_NEW_BUILDER =
JWT_SECRET=
13 changes: 7 additions & 6 deletions api/server.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/usr/bin/env python3

# Copyright (c) MLCommons and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

import os
import sys

import boto3
Expand All @@ -15,7 +18,6 @@
from common.helpers import check_fields, is_fields_blank
from common.logging import init_logger
from common.mail_service import get_mail_session
from common.migrator import run_migrations
from controllers.auth import * # noqa
from controllers.badges import * # noqa
from controllers.contexts import * # noqa
Expand All @@ -40,9 +42,9 @@
init_logger(running_mode)


# Run migration only for the parent
if not os.environ.get("BOTTLE_CHILD", False):
run_migrations()
# # Run migration only for the parent
# if not os.environ.get("BOTTLE_CHILD", False):
# run_migrations()

app = bottle.default_app()
for k in [
Expand Down Expand Up @@ -111,7 +113,6 @@
timeout=60,
)
elif running_mode == "prod":

# Assertion for necessary configuration
if not check_fields(
config, ["smtp_user", "smtp_host", "smtp_port", "smtp_secret"]
Expand Down
46 changes: 46 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# BD
DB_HOST=local
DB_PORT=3306
DB_NAME=dynabench
DB_USER=user
DB_PASSWORD=password
#AWS-api
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
AWS_S3_BUCKET=
AWS_S3_DATAPERF_BUCKET=
DYNABENCH_API=
SQS_NEW_BUILDER=
SECURITY_GROUP=
CLUSTER_TASK_EVALUATION=
SUBNET_1=
SUBNET_2=
ROLE_ARN_LAMBDA=
EXECUTION_ROLE_ARN=
CPU_UTILIZATION=
MEMORY_UTILIZATION=
LAMBDA_MEMORY_SIZE=
LAUNCH_TYPE=
#Auth
AUTH_ACCESS_TOKEN_EXPIRE_MINUTES=30
AUTH_REFRESH_TOKEN_EXPIRE_MINUTES=10080
AUTH_HASH_ALGORITHM=
AUTH_JWT_SECRET_KEY=
#Builder and evaluator
CENTRALIZED_HOST=
DECENTRALIZED_HOST=
#Email
MAIL_LOGIN=
MAIL_PASSWORD=
##External services
OPENAI=
STABLE_DIFFUSION=
OPENAI_API_KEY=
PERDI_OPENAI_API_KEY=
HF=
ANTHROPIC=
COHERE=
ALEPHALPHA=
GOOGLE=
REPLICATE=
2 changes: 1 addition & 1 deletion backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ scikit-learn
cloudwatch==1.0.5
jsonlines==3.1.0
gunicorn==20.1.0
transformers==4.12.5
transformers==4.36.2
torch==1.11.0
python-jose
openai==0.27.2
Expand Down
Loading

0 comments on commit 1ba67ab

Please sign in to comment.