From 723b767e4fde95a814228a0c8d3bc8bd34069204 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Tue, 18 Apr 2023 10:53:55 -0600 Subject: [PATCH 1/9] modify api container to start after db healthy --- docker-compose.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 112762da..39bfb22c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,12 @@ services: - '127.0.0.1:5432:5432' volumes: - ./dbdata:/var/lib/postgresql/data + healthcheck: + test: pg_isready -U postgres + interval: 10s + timeout: 3s + retries: 1 + start_period: 30s api: healthcheck: @@ -20,7 +26,8 @@ services: shm_size: '16gb' restart: always depends_on: - - db + db: + condition: service_healthy labels: autoheal: "true" # allow docker-autoheal to restart if unhealthy image: smsntia/scos-sensor:${DOCKER_TAG} # DOCKER_TAG will always be 'latest' for GitHub source From d06b3160b4a86c5f54302541448cefa4fb5179d3 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Tue, 18 Apr 2023 10:54:57 -0600 Subject: [PATCH 2/9] simplify commands in create_localhost_cert --- scripts/create_localhost_cert.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/create_localhost_cert.sh b/scripts/create_localhost_cert.sh index 6e787aaa..8f862f9b 100755 --- a/scripts/create_localhost_cert.sh +++ b/scripts/create_localhost_cert.sh @@ -11,7 +11,5 @@ DNS.1 = localhost IP.1 = 127.0.0.1" > localhost.ext openssl x509 -req -passin pass:"changeme" -CA scostestca.pem -CAkey scostestca.key -in localhost.csr -out localhost.pem -days 365 -sha256 -CAcreateserial -extfile localhost.ext cat localhost.key localhost.pem > localhost_combined.pem -cp scostestca.pem ../configs/certs/ -mv ../configs/certs/scostestca.pem ../configs/certs/scos_test_ca.crt -cp localhost_combined.pem ../configs/certs/ -mv ../configs/certs/localhost_combined.pem ../configs/certs/sensor01.pem +cp scostestca.pem ../configs/certs/scos_test_ca.crt +cp localhost_combined.pem ../configs/certs/sensor01.pem From 22dac6cd84a2b08f94c2ab8295969bce66e2fdee Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Thu, 20 Apr 2023 15:51:08 -0600 Subject: [PATCH 3/9] use scos-actions trigger_api_restart_after_failed_powercycle branch --- src/requirements-dev.txt | 4 ++-- src/requirements.in | 4 ++-- src/requirements.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/requirements-dev.txt b/src/requirements-dev.txt index 85fcd956..be666e49 100644 --- a/src/requirements-dev.txt +++ b/src/requirements-dev.txt @@ -300,11 +300,11 @@ scipy==1.10.1 # via # -r requirements.txt # scos-actions -scos_actions @ git+https://github.com/NTIA/scos-actions@6.2.1 +scos_actions @ git+https://github.com/NTIA/scos-actions@trigger_api_restart_after_failed_powercycle # via # -r requirements.txt # scos-tekrsa -scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@3.0.3 +scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@update_scos_actions_version # via -r requirements.txt sigmf @ git+https://github.com/NTIA/SigMF@multi-recording-archive # via diff --git a/src/requirements.in b/src/requirements.in index 0f2d1316..428a74fc 100644 --- a/src/requirements.in +++ b/src/requirements.in @@ -14,5 +14,5 @@ psycopg2-binary>=2.0, <3.0 pyjwt>=2.4.0, <3.0 requests-mock>=1.0, <2.0 requests_oauthlib>=1.0, <2.0 -scos_actions @ git+https://github.com/NTIA/scos-actions@6.2.1 -scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@3.0.3 +scos_actions @ git+https://github.com/NTIA/scos-actions@trigger_api_restart_after_failed_powercycle +scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@update_scos_actions_version diff --git a/src/requirements.txt b/src/requirements.txt index eb1ef0ba..9502c843 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -180,11 +180,11 @@ ruamel-yaml-clib==0.2.7 # via ruamel-yaml scipy==1.10.1 # via scos-actions -scos_actions @ git+https://github.com/NTIA/scos-actions@6.2.1 +scos_actions @ git+https://github.com/NTIA/scos-actions@trigger_api_restart_after_failed_powercycle # via # -r requirements.in # scos-tekrsa -scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@3.0.3 +scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@update_scos_actions_version # via -r requirements.in sigmf @ git+https://github.com/NTIA/SigMF@multi-recording-archive # via scos-actions From 2d3a04dba079802c19ca2804c652550afdfc2e6b Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Fri, 21 Apr 2023 15:14:47 -0600 Subject: [PATCH 4/9] update scos plugin versions --- src/requirements-dev.txt | 4 ++-- src/requirements.in | 4 ++-- src/requirements.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/requirements-dev.txt b/src/requirements-dev.txt index 5b724b9d..65e45424 100644 --- a/src/requirements-dev.txt +++ b/src/requirements-dev.txt @@ -300,11 +300,11 @@ scipy==1.10.1 # via # -r requirements.txt # scos-actions -scos_actions @ git+https://github.com/NTIA/scos-actions@6.2.2 +scos_actions @ git+https://github.com/NTIA/scos-actions@fix_host_reboot_error # via # -r requirements.txt # scos-tekrsa -scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@3.0.4 +scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@update_scos_actions_version # via -r requirements.txt sigmf @ git+https://github.com/NTIA/SigMF@multi-recording-archive # via diff --git a/src/requirements.in b/src/requirements.in index d87f11c4..8f7fe8b7 100644 --- a/src/requirements.in +++ b/src/requirements.in @@ -14,5 +14,5 @@ psycopg2-binary>=2.0, <3.0 pyjwt>=2.4.0, <3.0 requests-mock>=1.0, <2.0 requests_oauthlib>=1.0, <2.0 -scos_actions @ git+https://github.com/NTIA/scos-actions@6.2.2 -scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@3.0.4 +scos_actions @ git+https://github.com/NTIA/scos-actions@fix_host_reboot_error +scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@update_scos_actions_version diff --git a/src/requirements.txt b/src/requirements.txt index 9e619c4d..bd0ec88f 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -180,11 +180,11 @@ ruamel-yaml-clib==0.2.7 # via ruamel-yaml scipy==1.10.1 # via scos-actions -scos_actions @ git+https://github.com/NTIA/scos-actions@6.2.2 +scos_actions @ git+https://github.com/NTIA/scos-actions@fix_host_reboot_error # via # -r requirements.in # scos-tekrsa -scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@3.0.4 +scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@update_scos_actions_version # via -r requirements.in sigmf @ git+https://github.com/NTIA/SigMF@multi-recording-archive # via scos-actions From 4d4b7f66f5afbce3e2a2c148d677a99dc55e57f5 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Thu, 2 Nov 2023 09:41:03 -0600 Subject: [PATCH 5/9] fix dependabot alert --- src/requirements-dev.txt | 6 ++---- src/requirements.in | 1 + src/requirements.txt | 6 ++++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/requirements-dev.txt b/src/requirements-dev.txt index 9faf8e26..31e23184 100644 --- a/src/requirements-dev.txt +++ b/src/requirements-dev.txt @@ -69,9 +69,7 @@ coreschema==0.0.4 # coreapi # drf-yasg coverage[toml]==7.2.1 - # via - # coverage - # pytest-cov + # via pytest-cov cryptography==41.0.4 # via -r requirements.txt defusedxml==0.7.1 @@ -123,7 +121,7 @@ googleapis-common-protos==1.59.0 # via google-api-core gpustat==1.1 # via ray -grpcio==1.51.3 +grpcio==1.59.2 # via # -r requirements.txt # ray diff --git a/src/requirements.in b/src/requirements.in index 2a9e3b5a..00f20ab8 100644 --- a/src/requirements.in +++ b/src/requirements.in @@ -20,3 +20,4 @@ scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@3.1.5 # This is done to ensure the inclusion of specific security patches. pyyaml>=5.4.0 # CVE-2020-14343 urllib3>=1.26.18 # CVE-2023-45803 +grpcio>=1.53.0 # CVE-2023-1428, CVE-2023-32731, CVE-2023-32732 \ No newline at end of file diff --git a/src/requirements.txt b/src/requirements.txt index 7c33aa01..2b6b450f 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -57,8 +57,10 @@ frozenlist==1.3.3 # via # aiosignal # ray -grpcio==1.51.3 - # via ray +grpcio==1.59.2 + # via + # -r requirements.in + # ray gunicorn==20.1.0 # via -r requirements.in idna==3.4 From 89dcda0a6208089e648e57f131109b6c6c42024a Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Fri, 5 Jan 2024 08:42:18 -0700 Subject: [PATCH 6/9] change scos-tekrsa branch to test restart after power cycle sigan --- src/requirements-dev.txt | 2 +- src/requirements.in | 2 +- src/requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/requirements-dev.txt b/src/requirements-dev.txt index 2c5bdee8..7dcc9519 100644 --- a/src/requirements-dev.txt +++ b/src/requirements-dev.txt @@ -324,7 +324,7 @@ scos-actions @ git+https://github.com/NTIA/scos-actions@7.0.0 # via # -r requirements.txt # scos-tekrsa -scos-tekrsa @ git+https://github.com/NTIA/scos-tekrsa@4.0.0 +scos-tekrsa @ git+https://github.com/NTIA/scos-tekrsa@restart_container_after_connect_fail # via -r requirements.txt sigmf @ git+https://github.com/NTIA/SigMF@multi-recording-archive # via diff --git a/src/requirements.in b/src/requirements.in index 642f1bea..6ba84efa 100644 --- a/src/requirements.in +++ b/src/requirements.in @@ -13,7 +13,7 @@ psycopg2-binary>=2.0, <3.0 pyjwt>=2.4.0, <3.0 requests-mock>=1.0, <2.0 requests_oauthlib>=1.0, <2.0 -scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@4.0.0 +scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@restart_container_after_connect_fail # The following are sub-dependencies for which SCOS Sensor enforces a # higher minimum patch version than the dependencies which require them. diff --git a/src/requirements.txt b/src/requirements.txt index 075afef3..fe2628d9 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -153,7 +153,7 @@ scipy==1.10.1 # via scos-actions scos-actions @ git+https://github.com/NTIA/scos-actions@7.0.0 # via scos-tekrsa -scos-tekrsa @ git+https://github.com/NTIA/scos-tekrsa@4.0.0 +scos-tekrsa @ git+https://github.com/NTIA/scos-tekrsa@restart_container_after_connect_fail # via -r requirements.in sigmf @ git+https://github.com/NTIA/SigMF@multi-recording-archive # via scos-actions From a6c1a469683ac90695e05e2cb9d702554acafd47 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Fri, 5 Jan 2024 13:31:58 -0700 Subject: [PATCH 7/9] revert back to latest scos-tekrsa version --- src/requirements-dev.txt | 2 +- src/requirements.in | 2 +- src/requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/requirements-dev.txt b/src/requirements-dev.txt index 7dcc9519..2c5bdee8 100644 --- a/src/requirements-dev.txt +++ b/src/requirements-dev.txt @@ -324,7 +324,7 @@ scos-actions @ git+https://github.com/NTIA/scos-actions@7.0.0 # via # -r requirements.txt # scos-tekrsa -scos-tekrsa @ git+https://github.com/NTIA/scos-tekrsa@restart_container_after_connect_fail +scos-tekrsa @ git+https://github.com/NTIA/scos-tekrsa@4.0.0 # via -r requirements.txt sigmf @ git+https://github.com/NTIA/SigMF@multi-recording-archive # via diff --git a/src/requirements.in b/src/requirements.in index 6ba84efa..642f1bea 100644 --- a/src/requirements.in +++ b/src/requirements.in @@ -13,7 +13,7 @@ psycopg2-binary>=2.0, <3.0 pyjwt>=2.4.0, <3.0 requests-mock>=1.0, <2.0 requests_oauthlib>=1.0, <2.0 -scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@restart_container_after_connect_fail +scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@4.0.0 # The following are sub-dependencies for which SCOS Sensor enforces a # higher minimum patch version than the dependencies which require them. diff --git a/src/requirements.txt b/src/requirements.txt index fe2628d9..075afef3 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -153,7 +153,7 @@ scipy==1.10.1 # via scos-actions scos-actions @ git+https://github.com/NTIA/scos-actions@7.0.0 # via scos-tekrsa -scos-tekrsa @ git+https://github.com/NTIA/scos-tekrsa@restart_container_after_connect_fail +scos-tekrsa @ git+https://github.com/NTIA/scos-tekrsa@4.0.0 # via -r requirements.in sigmf @ git+https://github.com/NTIA/SigMF@multi-recording-archive # via scos-actions From 757bdef3d7247fe93df3dab6e3caa05bd2c4d5f0 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 11 Mar 2024 14:47:39 -0600 Subject: [PATCH 8/9] remove duplicative line in requirements.in --- src/requirements.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/requirements.in b/src/requirements.in index 54a345dd..e7e7819c 100644 --- a/src/requirements.in +++ b/src/requirements.in @@ -18,5 +18,4 @@ scos_tekrsa @ git+https://github.com/NTIA/scos-tekrsa@5.0.0 # This is done to ensure the inclusion of specific security patches. pyyaml>=5.4.0 # CVE-2020-14343 grpcio>=1.53.0 # CVE-2023-32732, CVE-2023-32731, CVE-2023-1428 -urllib3>=1.26.18 # CVE-2023-45803 -grpcio>=1.53.0 # CVE-2023-1428, CVE-2023-32731, CVE-2023-32732 \ No newline at end of file +urllib3>=1.26.18 # CVE-2023-45803 \ No newline at end of file From 84f189ac13556c27f301a6ddbc73ddf98167fdca Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Fri, 15 Mar 2024 10:45:09 -0600 Subject: [PATCH 9/9] decrease db healthcheck interval to 2s --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1494ab1a..4987bce3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: - ./dbdata:/var/lib/postgresql/data healthcheck: test: pg_isready -U postgres - interval: 10s + interval: 2s timeout: 3s retries: 1 start_period: 30s