kopia lustrzana https://github.com/bugout-dev/moonstream
commit
60e90219a8
|
@ -3,20 +3,25 @@
|
|||
# Deployment script - intended to run on Moonstream servers
|
||||
|
||||
# Main
|
||||
APP_DIR="${APP_DIR:-/home/ubuntu/app}"
|
||||
APP_DIR="${APP_DIR:-/home/ubuntu/moonstream}"
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}"
|
||||
PYTHON_ENV_DIR="${PYTHON_ENV_DIR:-/home/ubuntu/app-env}"
|
||||
PYTHON_ENV_DIR="${PYTHON_ENV_DIR:-/home/ubuntu/moonstream-env}"
|
||||
PYTHON="${PYTHON_ENV_DIR}/bin/python"
|
||||
PIP="${PYTHON_ENV_DIR}/bin/pip"
|
||||
SCRIPT_DIR="$(realpath $(dirname $0))"
|
||||
PARAMETERS_SCRIPT="${SCRIPT_DIR}/parameters.py"
|
||||
SECRETS_DIR="${SECRETS_DIR:-/home/ubuntu/app-secrets}"
|
||||
SECRETS_DIR="${SECRETS_DIR:-/home/ubuntu/moonstream-secrets}"
|
||||
PARAMETERS_ENV_PATH="${SECRETS_DIR}/app.env"
|
||||
AWS_SSM_PARAMETER_PATH="${AWS_SSM_PARAMETER_PATH:-/moonstream/prod}"
|
||||
SERVICE_FILE="${SCRIPT_DIR}/moonstream.service"
|
||||
|
||||
set -eu
|
||||
|
||||
echo
|
||||
echo
|
||||
echo "Updating pip and setuptools"
|
||||
"${PIP}" install -U pip setuptools
|
||||
|
||||
echo
|
||||
echo
|
||||
echo "Updating Python dependencies"
|
||||
|
|
|
@ -5,9 +5,9 @@ After=network.target
|
|||
[Service]
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/app
|
||||
EnvironmentFile=/home/ubuntu/secrets/app.env
|
||||
ExecStart=/home/ubuntu/server-env/bin/uvicorn --host 0.0.0.0 --port 7481 --workers 8 moonstream.api:app
|
||||
WorkingDirectory=/home/ubuntu/moonstream
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/uvicorn --host 0.0.0.0 --port 7481 --workers 8 moonstream.api:app
|
||||
SyslogIdentifier=moonstream
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -162,4 +162,6 @@ cython_debug/
|
|||
# Custom
|
||||
dev.env
|
||||
prod.env
|
||||
prod.env.ps1
|
||||
dev.env.ps1
|
||||
.venv
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
export MOONSTREAM_IPC_PATH=null
|
||||
export MOONSTREAM_CRAWL_WORKERS_RAW=4
|
||||
export MOONSTREAM_CRAWL_WORKERS=4
|
||||
export EXPLORATION_DB_URI="<moonstream_database_uri>"
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
PYTHONPATH=".:$PYTHONPATH" alembic "$@"
|
|
@ -17,7 +17,7 @@ fileConfig(config.config_file_name)
|
|||
# for 'autogenerate' support
|
||||
# from myapp import mymodel
|
||||
# target_metadata = mymodel.Base.metadata
|
||||
from db.models import Base as ExplorationBase
|
||||
from moonstreamdb.models import Base as ExplorationBase
|
||||
|
||||
target_metadata = ExplorationBase.metadata
|
||||
|
||||
|
@ -25,7 +25,7 @@ target_metadata = ExplorationBase.metadata
|
|||
# can be acquired:
|
||||
# my_important_option = config.get_main_option("my_important_option")
|
||||
# ... etc.
|
||||
from db.models import EthereumBlock, EthereumTransaction, EthereumPendingTransaction
|
||||
from moonstreamdb.models import EthereumBlock, EthereumTransaction, EthereumPendingTransaction
|
||||
|
||||
|
||||
def include_symbol(tablename, schema):
|
||||
|
|
Ładowanie…
Reference in New Issue