Memory Profiler #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy umm v from ops to uat | |
name: Memory Profiler | |
# Controls when the workflow will run | |
on: | |
schedule: | |
# Run at midnight (00:00) every Sunday | |
- cron: "0 0 * * 0" | |
workflow_dispatch: | |
jobs: | |
# First job in the workflow installs and verifies the software | |
build: | |
name: Build, Test | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
steps: | |
######################################################################### | |
# Environment Setup | |
######################################################################### | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
######################################################################### | |
# Install backfill tool | |
######################################################################### | |
- name: Install backfill tool | |
run: | | |
pip install git+https://github.com/podaac/hitide-backfill-tool.git@feature/parallel_memory_profiler | |
pip install gspread oauth2client | |
######################################################################### | |
# Setup AWS profile | |
######################################################################### | |
- name: Set AWS profile environment variable | |
run: | | |
echo "AWS_PROFILE=service-ops" >> $GITHUB_ENV | |
echo "AWS_REGION=us-west-2" >> $GITHUB_ENV | |
- name: Configure custom AWS profile | |
run: | | |
mkdir -p ~/.aws | |
echo "[service-ops]" >> ~/.aws/credentials | |
echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID_SERVICES_OPS }}" >> ~/.aws/credentials | |
echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY_SERVICES_OPS }}" >> ~/.aws/credentials | |
echo "[cumulus-ops]" >> ~/.aws/credentials | |
echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID_CUMULUS_OPS }}" >> ~/.aws/credentials | |
echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY_CUMULUS_OPS }}" >> ~/.aws/credentials | |
# Create the config file | |
echo "[service-ops]" >> ~/.aws/config | |
echo "region=us-west-2" >> ~/.aws/config | |
echo "[cumulus-ops]" >> ~/.aws/config | |
echo "region=us-west-2" >> ~/.aws/config | |
######################################################################### | |
# Setup Token for GSpread | |
######################################################################### | |
- name: Setup Token | |
env: | |
GOOGLE_TOKEN: ${{ secrets.GOOGLE_TOKEN }} | |
run: | | |
mkdir -p ~/.config/gspread | |
echo "$GOOGLE_TOKEN" > ~/.config/gspread/service_account.json | |
######################################################################### | |
# Run memory profiler and Write to google spreadsheet | |
# Profile memory of tig in service ops for the last week | |
######################################################################### | |
- name: Running Memory Profiler | |
working-directory: memory_profiler | |
env: | |
SPREADSHEET_ID: ${{ secrets.HITIDE_AWS_SHEET_ID }} | |
run: | | |
backfill_memory_profiler --aws_lambda_log svc-tig-podaac-services-ops-hitide-backfill-lambda --aws_profile service-ops --start_time 168 | |
python spreadsheet_write.py "TIG Service OPS Lambdas" | |
backfill_memory_profiler --aws_lambda_log svc-tig-podaac-ops-cumulus-lambda --aws_profile cumulus-ops --start_time 168 | |
python spreadsheet_write.py "TIG Cumulus OPS Lambdas" | |