Skip to content

Commit 94f9613

Browse files
authored
Merge pull request #1758 from edx/katebygrace/fix-refresh-job
chore: fix refresh job
2 parents 83d7195 + 8c2d2fe commit 94f9613

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

dataeng/jobs/analytics/SnowflakeRefreshSnowpipe.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ class SnowflakeRefreshSnowpipe {
8282
}
8383
publishers common_publishers(allVars)
8484
steps {
85-
shell(dslFactory.readFileFromWorkspace('dataeng/resources/secrets-manager-setup.sh'))
8685
shell(dslFactory.readFileFromWorkspace('dataeng/resources/snowflake-refresh-snowpipe.sh'))
8786
}
8887
}

dataeng/resources/secrets-manager.sh

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ else
3535
exit 1
3636
fi
3737
fetch_specific_key "$1" "$2"
38-
fi
38+
fi

dataeng/resources/snowflake-refresh-snowpipe.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ source "${PYTHON_VENV}/bin/activate"
1010
cd $WORKSPACE/analytics-tools/snowflake
1111
make requirements
1212

13-
# Source the secrets-manager.sh script to make the function available
14-
source $WORKSPACE/secrets-manager.sh
15-
# Fetch the secrets from AWS
16-
set +x
1713

1814

19-
secrets-manager.sh -w analytics-secure/job-configs/SNOWFLAKE_REFRESH_SNOWPIPE_JOB_EXTRA_VARS snowflake/rsa_key_snowpipe_user.p8
20-
secrets-manager.sh -w analytics-secure/job-configs/SNOWFLAKE_REFRESH_SNOWPIPE_JOB_EXTRA_VARS snowflake/rsa_key_passphrase_snowpipe_user
15+
python3 secrets-manager.py -w -n analytics-secure/snowflake/rsa_key_snowpipe_user.p8 -v rsa_key_snowpipe_user
16+
python3 secrets-manager.py -w -n analytics-secure/snowflake/rsa_key_passphrase_snowpipe_user -v rsa_key_passphrase_snowpipe_user
17+
#set -x
2118

22-
set -x
19+
unset KEY_PATH
20+
unset PASSPHRASE_PATH
2321

2422
python refresh_snowpipe.py \
2523
--user 'SNOWPIPE' \
@@ -28,6 +26,10 @@ python refresh_snowpipe.py \
2826
--pipe_name $PIPE_NAME \
2927
--table_name $TABLE_NAME \
3028
--delay $DELAY \
31-
--limit $LIMIT
32-
--key_file $KEY_PATH \
33-
--passphrase_file $PASSPHRASE_PATH
29+
--limit $LIMIT \
30+
--key_file "$(cat "rsa_key_snowpipe_user")" \
31+
--passphrase_file "$(cat "rsa_key_passphrase_snowpipe_user")"
32+
33+
rm rsa_key_snowpipe_user
34+
rm rsa_key_passphrase_snowpipe_user
35+

0 commit comments

Comments
 (0)