Skip to content

Commit

Permalink
Merge pull request #282 from NTIA/all-config-with-env
Browse files Browse the repository at this point in the history
Handle Docker Compose configuration entirely with environment variables
  • Loading branch information
jhazentia authored Jan 14, 2025
2 parents 1ba2a7a + ce9b28f commit f298d1f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/github-actions-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
source ./env.template
export MOCK_SIGAN=1
export MOCK_SIGAN_RANDOM=1
export SSD_DEVICE=/dev/nvme0n1
docker compose build --no-cache
docker compose up -d
Expand Down
4 changes: 2 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
interval: 6s
timeout: 3s
retries: 1
shm_size: '16gb'
shm_size: ${API_SHM_SIZE}
restart: always
depends_on:
db:
Expand Down Expand Up @@ -95,7 +95,7 @@ services:
- SYS_ADMIN # required for ^ with NVMe drives
devices:
- /dev/bus/usb:/dev/bus/usb:rw
- /dev/nvme0n1:/dev/nvme0n1:ro
- ${SSD_DEVICE}:/dev/nvme0n1:ro
extra_hosts:
- "${MANAGER_FQDN}:${MANAGER_IP}"
logging:
Expand Down
21 changes: 15 additions & 6 deletions env.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

# Copy env.template to env and modify


# Mark all the following variables for export
set -o allexport

#Any names here will be added as additional users with the
#specified additional user password
# Any names here will be added as additional users with the
# specified additional user password
ADDITIONAL_USER_NAMES="" # comma separated
ADDITIONAL_USER_PASSWORD=""

Expand All @@ -18,15 +17,15 @@ ADMIN_PASSWORD=password

# set to CERT to enable scos-sensor certificate authentication
AUTHENTICATION=TOKEN
CALIBRATION_EXPIRATION_LIMIT=360

# Default callback api/results
# Set to CERT for certificate authentication
CALLBACK_AUTHENTICATION=TOKEN
# Set to false to disable SSL cert verification in the callback POST request
CALLBACK_SSL_VERIFICATION=false

#Set the number of seconds before timeout in postback when a scheduled
#action completes
# Set the number of seconds before timeout in postback when a scheduled
# action completes
CALLBACK_TIMEOUT=2

# SECURITY WARNING: don't run with debug turned on in production!
Expand Down Expand Up @@ -89,12 +88,22 @@ SSL_CA_PATH=scos_test_ca.crt
SSL_CERT_PATH=sensor01.pem
SSL_KEY_PATH=sensor01.pem

# SSD Device made available to SCOS Plugins, e.g. for getting SMART data
SSD_DEVICE=/dev/nvme0n1

# Size of shared memory for API container (/dev/shm), used for parallel processing
# See https://docs.docker.com/compose/compose-file/compose-file-v3/#shm_size
API_SHM_SIZE=16gb

# Calibration action selection
# The action specified here will be used to attempt an onboard
# sensor calibration on startup, if no onboard calibration data
# is available on startup. The specified action must be available.
STARTUP_CALIBRATION_ACTION=SEA_CBRS_Calibrate_Baseline

# How many seconds until calibration data is considered stale
CALIBRATION_EXPIRATION_LIMIT=3600

# Debug dependant settings
if $DEBUG; then
GUNICORN_LOG_LEVEL=debug
Expand Down
4 changes: 2 additions & 2 deletions src/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,11 @@ scipy==1.13.1
# via
# -r requirements.txt
# scos-actions
scos-actions @ git+https://github.com/NTIA/scos-actions@11.0.0
scos-actions @ git+https://github.com/NTIA/scos-actions@11.1.0
# via
# -r requirements.txt
# scos-tekrsa
scos-tekrsa @ git+https://github.com/NTIA/scos-tekrsa@8.0.0
scos-tekrsa @ git+https://github.com/NTIA/scos-tekrsa@8.1.0
# via -r requirements.txt
sigmf @ git+https://github.com/NTIA/SigMF@multi-recording-archive
# via
Expand Down
2 changes: 1 addition & 1 deletion src/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ psycopg2-binary>=2.0, <3.0
tzdata # https://code.djangoproject.com/ticket/33814
requests>=2.32.0
requests-mock>=1.0, <2.0
scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@8.0.0
scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@8.1.0

# The following are sub-dependencies for which SCOS Sensor enforces a
# higher minimum patch version than the dependencies which require them.
Expand Down
4 changes: 2 additions & 2 deletions src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ ruamel-yaml-clib==0.2.8
# via ruamel-yaml
scipy==1.13.1
# via scos-actions
scos-actions @ git+https://github.com/NTIA/scos-actions@11.0.0
scos-actions @ git+https://github.com/NTIA/scos-actions@11.1.0
# via scos-tekrsa
scos-tekrsa @ git+https://github.com/NTIA/scos-tekrsa@8.0.0
scos-tekrsa @ git+https://github.com/NTIA/scos-tekrsa@8.1.0
# via -r requirements.in
sigmf @ git+https://github.com/NTIA/SigMF@multi-recording-archive
# via scos-actions
Expand Down

0 comments on commit f298d1f

Please sign in to comment.