Skip to content

Package Cloud Download Schedule #1374

Package Cloud Download Schedule

Package Cloud Download Schedule #1374

name: Package Cloud Download Schedule
env:
DB_USER_NAME: ${{ secrets.STATS_DB_USER_NAME }}
DB_PASSWORD: ${{ secrets.STATS_DB_PASSWORD }}
DB_HOST_AND_PORT: ${{ secrets.STATS_DB_HOST_AND_PORT }}
DB_NAME: ${{ secrets.STATS_DB_NAME }}
PACKAGE_CLOUD_API_TOKEN: ${{ secrets.PACKAGE_CLOUD_API_TOKEN }}
PACKAGE_CLOUD_ADMIN_API_TOKEN: ${{ secrets.PACKAGE_CLOUD_ADMIN_API_TOKEN }}
on:
schedule:
- cron: "0 16 * * *" # https://crontab.guru/#0_16_*_*_*
workflow_dispatch:
jobs:
statistics_fetch:
name: Fetch Statistics
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
parallel_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
repo: [community, enterprise]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install package dependencies
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources
- name: Install python requirements
run: python -m pip install -r packaging_automation/requirements.txt
- name: Execute 'Package Cloud Statistics Collector'
run: |
python -m packaging_automation.package_cloud_statistics_collector \
--organization citusdata \
--repo_name "${{ matrix.repo }}" \
--db_user_name "${DB_USER_NAME}" \
--db_password "${DB_PASSWORD}" \
--db_host_and_port "${DB_HOST_AND_PORT}" \
--db_name "${DB_NAME}" \
--package_cloud_api_token "${PACKAGE_CLOUD_API_TOKEN}" \
--package_cloud_admin_api_token "${PACKAGE_CLOUD_ADMIN_API_TOKEN}" \
--parallel_count 10 \
--parallel_exec_index "${{ matrix.parallel_index }}" \
--page_record_count 100