Skip to content

Commit

Permalink
Merge pull request #1770 from edx/katebygrace/stitch-monitor-fix
Browse files Browse the repository at this point in the history
chore: stitch lag monitor secretsmanager
  • Loading branch information
HassanJaveed84 authored May 29, 2024
2 parents 9489814 + 5b49fe8 commit c0c39b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
5 changes: 1 addition & 4 deletions dataeng/jobs/analytics/StitchSnowflakeLagMonitor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ import static org.edx.jenkins.dsl.AnalyticsConstants.common_log_rotator
import static org.edx.jenkins.dsl.AnalyticsConstants.common_wrappers
import static org.edx.jenkins.dsl.AnalyticsConstants.common_publishers
import static org.edx.jenkins.dsl.AnalyticsConstants.common_triggers
import static org.edx.jenkins.dsl.AnalyticsConstants.secure_scm_parameters
import static org.edx.jenkins.dsl.AnalyticsConstants.secure_scm



class StitchSnowflakeLagMonitor {
public static def job = { dslFactory, allVars ->
dslFactory.job("stitch-snowflake-lag-monitor") {
logRotator common_log_rotator(allVars)
parameters secure_scm_parameters(allVars)
parameters {
stringParam('ANALYTICS_TOOLS_URL', allVars.get('ANALYTICS_TOOLS_URL'), 'URL for the analytics tools repo.')
stringParam('ANALYTICS_TOOLS_BRANCH', allVars.get('ANALYTICS_TOOLS_BRANCH'), 'Branch of analtyics tools repo to use.')
Expand All @@ -29,7 +26,7 @@ class StitchSnowflakeLagMonitor {
env('ACCOUNT', allVars.get('ACCOUNT'))
}
logRotator common_log_rotator(allVars)
multiscm secure_scm(allVars) << {
multiscm {
git {
remote {
url('$ANALYTICS_TOOLS_URL')
Expand Down
19 changes: 11 additions & 8 deletions dataeng/resources/stitch-snowflake-lag-monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ source "${PYTHON_VENV}/bin/activate"
cd $WORKSPACE/analytics-tools/snowflake
make requirements

source secrets-manager.sh analytics-secure/job-configs/STITCH_SNOWFLAKE_LAG_MONITOR_JOB_EXTRA_VARS KEY_PATH
source secrets-manager.sh analytics-secure/job-configs/STITCH_SNOWFLAKE_LAG_MONITOR_JOB_EXTRA_VARS PASSPHRASE_PATH
source secrets-manager.sh analytics-secure/job-configs/STITCH_SNOWFLAKE_LAG_MONITOR_JOB_EXTRA_VARS USER
source secrets-manager.sh analytics-secure/job-configs/STITCH_SNOWFLAKE_LAG_MONITOR_JOB_EXTRA_VARS ACCOUNT

python3 secrets-manager.py -w -n analytics-secure/snowflake/rsa_key_stitch_loader.p8 -v rsa_key_stitch_loader
python3 secrets-manager.py -w -n analytics-secure/snowflake/rsa_key_passphrase_stitch_loader -v rsa_key_passphrase_stitch_loader


python stitch-snowflake-monitoring.py \
--key_path $WORKSPACE/analytics-secure/$KEY_PATH \
--passphrase_path $WORKSPACE/analytics-secure/$PASSPHRASE_PATH \
--user $USER \
--account $ACCOUNT
--user "STITCH_LOADER" \
--account "edx.us-east-1" \
--key_file "$(cat "rsa_key_stitch_loader")" \
--passphrase_file "$(cat "rsa_key_passphrase_stitch_loader")"

rm rsa_key_stitch_loader
rm rsa_key_passphrase_stitch_loader

0 comments on commit c0c39b2

Please sign in to comment.