-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy path.env.template
More file actions
107 lines (96 loc) · 5.57 KB
/
.env.template
File metadata and controls
107 lines (96 loc) · 5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
########################################################################################################################
# [TEMPLATE FOR] USER specific ENVIRONMENT variables for local environment
# After copying this file to ./.env these ENV VAR values will be read-in in two places
# (1) docker configuration
# - Variables defined here will be substituted for variables like ${THIS_VAR} that exist in docker-compose.yml
# - To see the interpolated config values in use, run:
# > docker compose config
# or
# > make docker-compose-config
# (2) Runtime env configuration via usaspending_api.config.* modules
# - Variables defined here will override variables of the same name in default or env-specific
# config data classes (e.g. DefaultConfig in default.py and/or LocalConfig local.py)
########################################################################################################################
# ==== [Python] ====
PYTHON_VERSION=3.10.12
# ==== [App] ====
# MATVIEW_SQL_DIR has to be inside of the project (check the docker-compose file)
MATVIEW_SQL_DIR=matview_sql
PROJECT_LOG_DIR=./usaspending_api/logs
# ==== [Local Development] ====
IS_LOCAL=True
RUN_LOCAL_DOWNLOAD_IN_PROCESS=False
# ==== [Django] ====
# Use env var to toggle Django's DEBUG mode for local docker envs
DJANGO_DEBUG=False
# ==== [Postgres] ====
# All values of USASPENDING_DB_* must match what is in DATABASE_URL if BOTH are given
DATABASE_URL=postgres://usaspending:usaspender@usaspending-db:5432/data_store_api
# Change USASPENDING_DB_HOST to host.docker.internal if you are running a local Postgres server on the host machine
# Otherwise leave as-is, so other docker containerized services will use the Postgres created by Compose.
USASPENDING_DB_HOST=usaspending-db
USASPENDING_DB_PORT=5432
USASPENDING_DB_USER=usaspending
USASPENDING_DB_PASSWORD=usaspender
# The Broker configuration below supports tests creating a Broker DB on the usaspending-db
# container as part of standing up the test suite.
# All values of BROKER_DB_* must match what is in BROKER_DB if BOTH are given
BROKER_DB=postgres://usaspending:usaspender@usaspending-db:5432/data_broker
# Configuration values for a connection string to a Broker database
# Only necessary for some management commands
BROKER_DB_HOST=usaspending-db
BROKER_DB_PORT=5432
BROKER_DB_USER=usaspending
BROKER_DB_PASSWORD=usaspender
# ==== [Elasticsearch] ====
# Where to connect to elasticsearch.
# All values of ES_* must match what is in ES_HOSTNAME if BOTH are given
# NOTE: DO NOT include trailing slash on ES_HOSTNAME url
ES_HOSTNAME=http://usaspending-es:9200
ES_HOST=usaspending-es
ES_PORT=9200
# ==== [Spark] ====
SPARK_MASTER_PORT=7077
SPARK_MASTER_WEBUI_PORT=4040
SPARK_HISTORY_SERVER_PORT=18080
# Should point to a path where data can be persisted beyond docker restarts, outside of the git source repository
# The specified directory needs to exist before Docker can mount it
SPARK_CLUSTER_DATA_DIR=${HOME}/Development/data/usaspending/docker/usaspending-spark
# Optionally uncomment these sql warehouse and hive metastore env vars to use the explicit locations specified below
# If NOT uncommented, config should fall back to matching values in
# 1) These vars' values in local.py LocalConfig directed at a spark-warehouse dir under the project root
# 2) docker-compose.yml not finding these env vars, would ALSO fall back to a spark-warehouse dir under the project root
#SPARK_SQL_WAREHOUSE_DIR=${SPARK_CLUSTER_DATA_DIR}/spark-warehouse
#HIVE_METASTORE_DERBY_DB_DIR=${SPARK_SQL_WAREHOUSE_DIR}/metastore_db
# Uncomment if on MacOS. See note here: https://github.com/fedspendingtransparency/usaspending-api#test-setup for below
#OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
# ==== [AWS] ====
# AWS_PROFILE needs to be left defaulted to None in python if not intending to use it. No way to set it to None in the .env file
# Uncomment below and set to the profile desired IF you want to use an AWS_PROFILE
#AWS_PROFILE=
# ==== [MinIO] ====
MINIO_HOST=minio
MINIO_PORT=10001
MINIO_CONSOLE_PORT=10002
# Should point to a path where data can be persisted beyond docker restarts, outside of the git source repository
# The specified directory needs to exist before Docker can mount it
MINIO_DATA_DIR=${HOME}/Development/data/usaspending/docker/usaspending-s3
# ==== [Open Telemetry Configuration] ====
DEBUG=True
OTEL_SERVICE_NAME=usaspending-api
OTEL_TRACES_EXPORTER=console,otlp
OTEL_METRICS_EXPORTER=console
OTEL_PYTHON_LOG_CORRELATION=true
OTEL_PYTHON_LOG_FORMAT="[SPAN_ID=%(otelSpanID)s TRACE_ID=%(otelTraceID)s] %(msg)s"
OTEL_EXPORTER_OTLP_CERTIFICATE="/etc/ssl/certs/ca-certificates.crt"
OTEL_PYTHON_LOG_LEVEL=debug # have the option between info (default), debug, warning, error
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST="content-length,content-type,host,origin,referer,ua-is-bot,user-agent,x-forwarded-for,x-requested-with,allow,cache-trace,is-dynamically-rendered,key,strict-transport-security" # Use ".*" to capture all request headers
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE="content-length,content-type,host,origin,referer,ua-is-bot,user-agent,x-forwarded-for,x-requested-with,allow,cache-trace,is-dynamically-rendered,key,strict-transport-security"
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS=".*session.*,set-cookie"
OTEL_EXPORTER_OTLP_TIMEOUT=30000
GRPC_VERBOSITY=debug
GRPC_TRACE=handshaker,connectivity_state,client_channel,call_error,subchannel
TOGGLE_OTEL_CONSOLE_LOGGING=False
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://otel-collector:4318/v1/traces