Skip to content

Commit

Permalink
add options for logging in for different accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
Avery Wang authored and sheridancbio committed Feb 8, 2024
1 parent c98def9 commit 908cbf6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion import-scripts/backup-eks-dbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ for db in ${DBS[@]}; do
$(set -o pipefail && mysqldump --login-path=mysql_localhost --quick $db | gzip > $SQLDUMP_FULLPATH)
if [ $? -eq 0 ]; then
echo "Successfully dumped: '${SQLDUMP_FILENAME}'"
. /data/portal-cron/git-repos/portal-configuration/eks-cluster/pipelines/authenticate_service_account.sh
. /data/portal-cron/git-repos/portal-configuration/eks-cluster/pipelines/authenticate_service_account.sh eks
aws s3 cp ${SQLDUMP_FULLPATH} s3://cbioportal-backups/${SQLDUMP_FILENAME} --profile saml
if [ $? -ne 0 ]; then
echo "ERROR: failed to cp '${SQLDUMP_FILENAME}' to S3"
Expand Down
3 changes: 2 additions & 1 deletion import-scripts/clear_cbioportal_persistence_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ fi

unset KUBECONFIG_ARG
if [ "$cluster_id" == "$CLUSTER_ID_DIGITS" ] ; then
/data/portal-cron/scripts/authenticate_service_account.sh
/data/portal-cron/scripts/authenticate_service_account.sh eks
else
if ! [ -z $PUBLIC_CLUSTER_KUBECONFIG ] ; then
/data/portal-cron/scripts/authenticate_service_account.sh public
KUBECONFIG_ARG="--kubeconfig $PUBLIC_CLUSTER_KUBECONFIG"
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion import-scripts/delete_slow_to_terminate_pods.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ MY_FLOCK_FILEPATH="/data/portal-cron/cron-lock/delete_slow_to_terminate_pods.loc
mv $temp_file $POD_TERMINATING_TIMESTAMP_FILE
}

/data/portal-cron/scripts/authenticate_service_account.sh
/data/portal-cron/scripts/authenticate_service_account.sh eks
check_for_dependencies
now=$(date +%s)
make_work_dir_if_necessary
Expand Down
2 changes: 1 addition & 1 deletion import-scripts/precache-portals.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

def authenticate_service_account():
try:
subprocess.check_output(["/data/portal-cron/scripts/authenticate_service_account.sh"])
subprocess.check_output(["/data/portal-cron/scripts/authenticate_service_account.sh public"])
except:
print "Attempt to authenticate to k8s cluster failed with non-zero exit status, exiting..."
sys.exit(1)
Expand Down

0 comments on commit 908cbf6

Please sign in to comment.