Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circleci migration 5 #1250

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
55 changes: 37 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,13 @@ jobs:
echo "Run $py_script_path"
python -m pipenv run python $(basename ${py_script_path})

daily-l2-aggregate-later-loads:
description: "Daily L2 Chain Aggregate Later Loads"
convert-and-run-notebooks-to-py-and-push:
description: "Convert and run notebooks to Python scripts and push changes to GitHub"
parameters:
notebook-paths:
type: string
commit-message:
type: string
machine:
image: ubuntu-2004:current
steps:
Expand All @@ -147,17 +152,24 @@ jobs:

cd "op-analytics"

python -m pipenv run jupyter nbconvert --to python op_chains_tracking/dune_opchain_uploads.ipynb other_chains_tracking/get_filtered_deployers.ipynb other_chains_tracking/total_chain_data_to_uploads.ipynb
echo '<< parameters.notebook-paths >>' | jq -c '.[]' | while read -r notebook; do
dir=$(echo $notebook | jq -r '.dir')
notebook=$(echo $notebook | jq -r '.notebook')

cd op_chains_tracking
python -m pipenv run python dune_opchain_uploads.py
cd "$dir"

cd ../other_chains_tracking
python -m pipenv run python get_filtered_deployers.py total_chain_data_to_uploads.py
echo "Converting ${notebook}.ipynb to ${notebook}.py"
python -m pipenv run jupyter nbconvert --to python ${notebook}.ipynb

echo "Run ${notebook}.py"
python -m pipenv run python ${notebook}.py

cd - >/dev/null
done

- utils/get-github-access-token
- utils/github-commit-and-push-changes:
commit-message: "GH Action Update - Agg Downloads"
commit-message: "<< parameters.commit-message >>"
skip-ci: true
folder: "op-analytics"

Expand Down Expand Up @@ -305,18 +317,25 @@ workflows:
branches:
only: main

run-daily-l2-aggregate-later-loads:
when:
or:
- equal:
[<< pipeline.schedule.name >>, "daily_l2_aggregate_later_loads"]
- equal:
daily-l2-aggregate-later-loads:
# when:
# or:
# - equal:
# [<< pipeline.schedule.name >>, "daily_l2_aggregate_later_loads"]
# - equal:
# [
# << pipeline.parameters.run_job >>,
# "daily_l2_aggregate_later_loads",
# ]
jobs:
- convert-and-run-notebooks-to-py-and-push:
commit-message: "GH Action Update - Agg Downloads"
notebook-paths: >-
[
<< pipeline.parameters.run_job >>,
"daily_l2_aggregate_later_loads",
{"dir": "op_chains_tracking", "notebook": "dune_opchain_uploads"},
{"dir": "other_chains_tracking", "notebook": "get_filtered_deployers"},
{"dir": "other_chains_tracking", "notebook": "total_chain_data_to_uploads"}
]
jobs:
- daily-l2-aggregate-later-loads:
context:
- op-analytics-legacy
- circleci-repo-op-analytics
Expand Down
Loading