<commit_before>#!/usr/bin/env bash

set -ex

# Create and activate a virtualenv.  In case we ever change the concurrency
# setting on the jenkins worker, it would be safest to keep the builds from
# clobbering each other's virtualenvs.
VENV="venv-${BUILD_NUMBER}"
virtualenv --python=python3.8 --clear "${VENV}"
source "${VENV}/bin/activate"


# prepare tubular
cd $WORKSPACE/tubular
# snapshot the current latest versions of pip and setuptools.
pip install 'pip==21.0.1' 'setuptools==53.0.0'
pip install -r requirements.txt

# Call the script to cleanup the reports
python scripts/delete_expired_partner_gdpr_reports.py \
    --config_file=$WORKSPACE/user-retirement-secure/$ENVIRONMENT.yml \
    --google_secrets_file=$WORKSPACE/user-retirement-secure/google-service-accounts/service-account-$ENVIRONMENT.json \
    --age_in_days=$AGE_IN_DAYS<commit_msg>chore: Update partner report cleanup script to switch to using user accounts<commit_after>#!/usr/bin/env bash

set -ex

# Create and activate a virtualenv.  In case we ever change the concurrency
# setting on the jenkins worker, it would be safest to keep the builds from
# clobbering each other's virtualenvs.
VENV="venv-${BUILD_NUMBER}"
virtualenv --python=python3.8 --clear "${VENV}"
source "${VENV}/bin/activate"


# prepare tubular
cd $WORKSPACE/tubular
# snapshot the current latest versions of pip and setuptools.
pip install 'pip==21.0.1' 'setuptools==53.0.0'
pip install -r requirements.txt

# Call the script to cleanup the reports
# This section is for long term use
# python scripts/delete_expired_partner_gdpr_reports.py \
#     --config_file=$WORKSPACE/user-retirement-secure/$ENVIRONMENT.yml \
#     --google_secrets_file=$WORKSPACE/user-retirement-secure/google-service-accounts/service-account-$ENVIRONMENT.json \
#     --age_in_days=$AGE_IN_DAYS
# This line is for use until 2022-05-13. Please make sure to uncomment
# the script invocation above to make sure we revert back to using service accounts.
# Please see DENG-1215 for more information
python scripts/delete_expired_partner_gdpr_reports.py \
    --config_file=$WORKSPACE/user-retirement-secure/$ENVIRONMENT.yml \
    --google_secrets_file=$WORKSPACE/user-retirement-secure/google-service-accounts/no-reply-user-oauth2-token.json \
    --age_in_days=$AGE_IN_DAYS \
    --as_user_account
{'fraction_non_alphanumeric': 0.10435532557136697, 'fraction_numerical': 0.014230271668822769, 'mean_word_length': 4.563549160671463, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7055166', 'n_tokens_mistral': 776, 'n_tokens_neox': 742, 'n_words': 203}