Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: stitch lag monitor secretsmanager #1770

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading