From b65cbe2f124b3a7f45ac01ac4821e0685f1df86f Mon Sep 17 00:00:00 2001 From: Mikail Congar Date: Thu, 5 Sep 2024 10:16:05 +0200 Subject: [PATCH 1/2] SDKTECHNO-269: Add SaagieAPI request timeout env var on SUM --- technologies/app/saagie-usage-monitoring/README.md | 1 + .../saagie-usage-monitoring-2023.05/code/requirements.txt | 5 +++-- .../saagie-usage-monitoring-2023.05/code/utils.py | 4 +++- .../saagie-usage-monitoring-2023.05/entrypoint.sh | 6 ++++++ version.properties | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/technologies/app/saagie-usage-monitoring/README.md b/technologies/app/saagie-usage-monitoring/README.md index 30b6f8f0d..7e47d1560 100644 --- a/technologies/app/saagie-usage-monitoring/README.md +++ b/technologies/app/saagie-usage-monitoring/README.md @@ -19,6 +19,7 @@ To deploy Saagie Usage Monitoring on your platform, you need to create a user wi - IP_HDFS (Required if MONITORING_OPT=`SAAGIE_AND_DATALAKE`) : Namenode IP - AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_S3_ENDPOINT and AWS_REGION_NAME (Required if MONITORING_OPT=`SAAGIE_AND_S3`) - SAAGIE_SUM_CRON : Cron to collect Saagie informations on API (Optionnal, Default value : `0 * * * *`) +- REQUEST_TIMEOUT : Manage SaagieAPI request timeout (Default value in seconds : `10`) For an external Postgres database : - SAAGIE_PG_HOST : Postgresql host (Default value : `localhost`) diff --git a/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/code/requirements.txt b/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/code/requirements.txt index 6c6ca03d9..3f175ca0e 100644 --- a/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/code/requirements.txt +++ b/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/code/requirements.txt @@ -1,6 +1,7 @@ boto3==1.28.54 urllib3==1.26.5 psycopg2==2.9.2 -pyarrow==6.0.1 +pyarrow==7.0 +numpy>=1.22,<1.23 hdfs -saagieapi==2.9.2 +saagieapi==2.13.0 diff --git a/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/code/utils.py b/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/code/utils.py index 246775f4d..0e950f5f9 100644 --- a/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/code/utils.py +++ b/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/code/utils.py @@ -27,6 +27,7 @@ saagie_realm = os.environ["SAAGIE_REALM"] saagie_platform = os.environ["SAAGIE_PLATFORM_ID"] +timeout = int(os.environ["REQUEST_TIMEOUT"]) # Workaround for platforms with too many instances MAX_INSTANCES_FETCHED = os.environ.get("SMT_MAX_INSTANCES_FETCHED", 1000) @@ -39,7 +40,8 @@ def __init__(self): id_platform=saagie_platform, user=saagie_login, password=saagie_password, - realm=saagie_realm) + realm=saagie_realm, + timeout=timeout) def __enter__(self): return self diff --git a/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/entrypoint.sh b/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/entrypoint.sh index 89fc8cec1..71f53ac4d 100644 --- a/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/entrypoint.sh +++ b/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/entrypoint.sh @@ -8,6 +8,11 @@ if [[ -z ${SAAGIE_SUPERVISION_LOGIN} || -z ${SAAGIE_SUPERVISION_PASSWORD} || -z exit 1 fi +if [[ -z ${REQUEST_TIMEOUT} ]]; then + echo "$(date '+%Y-%m-%d %H:%M:%S') [WARN] REQUEST_TIMEOUT not set, default timeout is 10 seconds" + export REQUEST_TIMEOUT=10 +fi + if [[ -z ${MONITORING_OPT} ]]; then echo "$(date '+%Y-%m-%d %H:%M:%S') [WARN] MONITORING_OPT not set, Saagie Usage Monitoring will only monitor Saagie" export MONITORING_OPT="SAAGIE" @@ -48,6 +53,7 @@ echo \#!/bin/bash echo export SAAGIE_URL="$SAAGIE_URL" echo export SAAGIE_REALM="$SAAGIE_REALM" echo export SAAGIE_PLATFORM_ID="$SAAGIE_PLATFORM_ID" + echo export REQUEST_TIMEOUT=$REQUEST_TIMEOUT echo export MONITORING_OPT=$MONITORING_OPT echo export IP_HDFS="$IP_HDFS" echo export HADOOP_HOME=/hadoop/hadoop-2.6.5 diff --git a/version.properties b/version.properties index be45b4139..85dd40861 100644 --- a/version.properties +++ b/version.properties @@ -1,6 +1,6 @@ version.buildmeta= version.major=1 version.minor=188 -version.patch=0 +version.patch=1 version.prerelease= version.semver=1.188.0 From 22d4640f31647e330dc48b020383756271314b81 Mon Sep 17 00:00:00 2001 From: GitHub Action Bot Date: Fri, 6 Sep 2024 09:28:57 +0000 Subject: [PATCH 2/2] [BOT] Set version for this branch --- technologies/app/saagie-usage-monitoring/metadata.yaml | 2 +- .../saagie-usage-monitoring-2023.05/dockerInfo.yaml | 4 ++-- version.properties | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/technologies/app/saagie-usage-monitoring/metadata.yaml b/technologies/app/saagie-usage-monitoring/metadata.yaml index da49c568b..1fc76af0f 100644 --- a/technologies/app/saagie-usage-monitoring/metadata.yaml +++ b/technologies/app/saagie-usage-monitoring/metadata.yaml @@ -87,7 +87,7 @@ contexts: dockerInfo: image: "saagie/saagie-usage-monitoring" baseTag: "2023.05-0.1" - version: "2023.05-0.1-1.175.0" + version: "2023.05-0.1-1.188.1_SDKTECHNO-269" - id: saagie-usage-monitoring-3.0 label: For Saagie 3.x releaseNotes: "" diff --git a/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/dockerInfo.yaml b/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/dockerInfo.yaml index 6eeafbfae..fa7aa324e 100644 --- a/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/dockerInfo.yaml +++ b/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-2023.05/dockerInfo.yaml @@ -1,4 +1,4 @@ image: saagie/saagie-usage-monitoring baseTag: 2023.05-0.1 -dynamicVersion: 1.175.0_SDKTECHNO-252 -version: 2023.05-0.1-1.175.0 +dynamicVersion: 1.188.1_SDKTECHNO-269 +version: 2023.05-0.1-1.188.1_SDKTECHNO-269 diff --git a/version.properties b/version.properties index 85dd40861..e7fa9c0cb 100644 --- a/version.properties +++ b/version.properties @@ -1,6 +1,6 @@ -version.buildmeta= +version.buildmeta=SDKTECHNO-269 version.major=1 version.minor=188 version.patch=1 version.prerelease= -version.semver=1.188.0 +version.semver=1.188.1+SDKTECHNO-269