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

Refactor the main Makefile #3988

Merged
merged 29 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
da33c9f
Refactor the main Makefile
jtraglia Oct 18, 2024
5d9181a
Update docs & CI files
jtraglia Oct 18, 2024
d7a81f5
Add preset & bls options for make test
jtraglia Oct 18, 2024
d431420
Remove old reference to codespell rule
jtraglia Oct 18, 2024
788fae8
Fix CI linter checks
jtraglia Oct 18, 2024
ab59dca
Maybe fix CI
jtraglia Oct 18, 2024
27847a7
Maybe fix CI lint
jtraglia Oct 18, 2024
e64f951
Change pip to pip3
jtraglia Oct 18, 2024
132fad0
Try manually installing python3
jtraglia Oct 18, 2024
05c9399
Try latest node image
jtraglia Oct 18, 2024
4b130d8
Use node 23
jtraglia Oct 18, 2024
8a7adbd
Apt install python3
jtraglia Oct 18, 2024
a7519ae
Clean things up
jtraglia Oct 18, 2024
fc22d81
Comment out caching
jtraglia Oct 19, 2024
0a22b75
Restore some cache
jtraglia Oct 19, 2024
1e34930
Update cache venv name
jtraglia Oct 19, 2024
c01392c
Use same image for all tasks
jtraglia Oct 19, 2024
f7a860b
Update version number
jtraglia Oct 19, 2024
2e5cdfd
Base eth2spec rule on file in venv
jtraglia Oct 19, 2024
f7cf667
Set venv as an order-only prereq
jtraglia Oct 19, 2024
64f29e3
Split linter config into 3 parts
jtraglia Oct 19, 2024
c269847
Mark setup.py as a dep of eth2spec
jtraglia Oct 19, 2024
13ac2f7
Merge remote-tracking branch 'origin/dev' into refactor-makefile
jtraglia Nov 6, 2024
acfd9b9
Move kzg_setups rule outside of gen_*
jtraglia Nov 6, 2024
344adf2
Merge branch 'dev' into refactor-makefile
jtraglia Dec 3, 2024
85fdc3a
Merge branch 'dev' into refactor-makefile
jtraglia Dec 11, 2024
b232357
Merge branch 'dev' into refactor-makefile
jtraglia Dec 12, 2024
915e9e0
Update cached venv version
jtraglia Dec 12, 2024
46f595d
Remove distribution rules
jtraglia Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 25 additions & 45 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ commands:
description: "Restore the cache with pyspec keys"
steps:
- restore_cached_venv:
venv_name: v25-pyspec
venv_name: v30-pyspec
reqs_checksum: cache-{{ checksum "setup.py" }}-{{ checksum "requirements_preinstallation.txt" }}
save_pyspec_cached_venv:
description: Save a venv into a cache with pyspec keys"
steps:
- save_cached_venv:
venv_name: v25-pyspec
venv_name: v30-pyspec
reqs_checksum: cache-{{ checksum "setup.py" }}-{{ checksum "requirements_preinstallation.txt" }}
venv_path: ./venv
jobs:
checkout_specs:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
# Restore git repo at point close to target branch/revision, to speed up checkout
Expand All @@ -67,152 +67,134 @@ jobs:
- ~/specs-repo
install_pyspec_test:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Install pyspec requirements
command: make install_test
command: make eth2spec
- save_pyspec_cached_venv
test-phase0:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=phase0
command: make test fork=phase0
- store_test_results:
path: tests/core/pyspec/test-reports
test-altair:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=altair
command: make test fork=altair
- store_test_results:
path: tests/core/pyspec/test-reports
test-bellatrix:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=bellatrix
command: make test fork=bellatrix
- store_test_results:
path: tests/core/pyspec/test-reports
test-capella:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=capella
command: make test fork=capella
- store_test_results:
path: tests/core/pyspec/test-reports
test-deneb:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=deneb
command: make test fork=deneb
- store_test_results:
path: tests/core/pyspec/test-reports
test-electra:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=electra
command: make test fork=electra
- store_test_results:
path: tests/core/pyspec/test-reports
test-fulu:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=fulu
command: make test fork=fulu
- store_test_results:
path: tests/core/pyspec/test-reports
test-whisk:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=whisk
command: make test fork=whisk
- store_test_results:
path: tests/core/pyspec/test-reports
table_of_contents:
docker:
- image: circleci/node:10.16.3
working_directory: ~/specs-repo
steps:
- checkout
- run:
name: Check table of contents
command: sudo npm install -g [email protected] && make check_toc
codespell:
docker:
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- checkout
- run:
name: Check codespell
command: pip install 'codespell<3.0.0,>=2.0.0' --user && make codespell
lint:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Install doctoc
command: sudo npm install -g [email protected]
- run:
name: Run linter for pyspec
command: make lint
- run:
name: Run linter for test generators
command: make lint_generators
workflows:
version: 2.1
test_spec:
Expand Down Expand Up @@ -245,8 +227,6 @@ workflows:
- test-whisk:
requires:
- install_pyspec_test
- table_of_contents
- codespell
- lint:
requires:
- install_pyspec_test
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Build docs
run: make copy_docs
run: make _copy_docs
- uses: actions/setup-python@v4
with:
python-version: 3.x
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/generate_vectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,10 @@ jobs:
with:
python-version: '3.12.4'
cache: ''
- name: Clean up Spec Repository
run: |
cd consensus-specs
make clean
- name: Install dependencies and generate pyspec
run: |
cd consensus-specs
make install_test
make -B pyspec
- name: Generate tests
run: |
cd consensus-specs
make -j 16 generate_tests 2>&1 | tee ../consensustestgen.log
make -j 16 gen_all 2>&1 | tee ../consensustestgen.log
cp -r presets/ ../consensus-spec-tests/presets
cp -r configs/ ../consensus-spec-tests/configs
find . -type d -empty -delete
Expand Down
55 changes: 13 additions & 42 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,50 +24,25 @@ on:
- cron: '0 0 * * *'

jobs:
table_of_contents:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
lint:
runs-on: [self-hosted-ghr-custom, size-l-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: ''
- name: Check table of contents
run: npm install -g [email protected] && make check_toc

codespell:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.4'
cache: ''
- name: Check codespell
run: make codespell

lint:
runs-on: [self-hosted-ghr-custom, size-l-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust for dependencies
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.4'
cache: ''
- name: Install pyspec requirements
run: make install_test
- name: Install doctoc
run: npm install -g [email protected]
- name: Run linter for pyspec
run: make lint
- name: Run linter for test generators
run: make lint_generators

whitespace:
runs-on: [self-hosted-ghr-custom, size-l-x64, profile-consensusSpecs]
Expand All @@ -83,7 +58,7 @@ jobs:
pyspec-tests:
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
needs: [lint,codespell,table_of_contents]
needs: [lint]
strategy:
matrix:
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "electra", "fulu", "whisk"]
Expand All @@ -97,26 +72,24 @@ jobs:
with:
python-version: '3.12.4'
cache: ''
- name: set TEST_PRESET_TYPE
- name: set preset
if: github.event.inputs.test_preset_type != ''
run: |
echo "spec_test_preset_type=${{ github.event.inputs.test_preset_type || env.TEST_PRESET_TYPE }}" >> $GITHUB_ENV
- name: set TEST_PRESET_TYPE
- name: set preset
if: ${{ (github.event_name == 'push' && github.ref_name != 'master') || github.event_name == 'pull_request' }}
run: |
echo "spec_test_preset_type=${{ env.TEST_PRESET_TYPE}}" >> $GITHUB_ENV
- name: set TEST_PRESET_TYPE
echo "spec_test_preset_type=${{ env.TEST_PRESET_TYPE }}" >> $GITHUB_ENV
- name: set preset
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
run: |
echo "spec_test_preset_type=mainnet" >> $GITHUB_ENV
- name: set TEST_PRESET_TYPE
- name: set preset
if: github.event.schedule=='0 0 * * *'
run: |
echo "spec_test_preset_type=mainnet" >> $GITHUB_ENV
- name: Install pyspec requirements
run: make install_test
- name: test-${{ matrix.version }}
run: make citest fork=${{ matrix.version }} TEST_PRESET_TYPE=${{env.spec_test_preset_type}}
run: make test fork=${{ matrix.version }} preset=${{ env.spec_test_preset_type }}
- uses: actions/upload-artifact@v4
if: always()
with:
Expand All @@ -133,10 +106,8 @@ jobs:
with:
python-version: '3.12.4'
cache: ''
- name: Install pyspec requirements
run: make install_test
- name: Run generators with --modcheck
run: make generate_tests modcheck=true 2>&1 | tee consensustestgen.log
run: make gen_all modcheck=true 2>&1 | tee consensustestgen.log
- name: Check for errors
run: |
if grep -q "\[ERROR\]" consensustestgen.log; then
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ venv
.venv
/.pytest_cache
*.swp
.eth2spec

build/
output/
Expand Down
Loading