Skip to content

Commit

Permalink
Merge pull request #656 from saagie/SDKTECHNO-269
Browse files Browse the repository at this point in the history
[SDKTECHNO-269] Add timeout environment variable on SUM
  • Loading branch information
mikailcngr authored Sep 10, 2024
2 parents 71d65ed + 22d4640 commit e5135dd
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 9 deletions.
1 change: 1 addition & 0 deletions technologies/app/saagie-usage-monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
2 changes: 1 addition & 1 deletion technologies/app/saagie-usage-monitoring/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions version.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version.buildmeta=
version.buildmeta=SDKTECHNO-269
version.major=1
version.minor=188
version.patch=0
version.patch=1
version.prerelease=
version.semver=1.188.0
version.semver=1.188.1+SDKTECHNO-269

0 comments on commit e5135dd

Please sign in to comment.