Skip to content

Commit

Permalink
added standalone pylint.sh script; improved install-build-tools.sh ov…
Browse files Browse the repository at this point in the history
…er prev commit

Signed-off-by: Morgan Rockett <[email protected]>
  • Loading branch information
rockett-m committed Jun 20, 2024
1 parent 7323f53 commit 43daacc
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 67 deletions.
35 changes: 16 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
jobs:
build-release:
name: Build Release Candidate
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
BUILD_RELEASE: 1
steps:
Expand All @@ -28,9 +28,9 @@ jobs:
- name: Setup Build Env
run: sudo ./scripts/install-build-tools.sh
- name: Setup Local Dependencies
run: ./scripts/setup-dependencies.sh
run: sudo ./scripts/setup-dependencies.sh
- name: Build
run: scripts/build.sh
run: ./scripts/build.sh
lint:
name: Lint
runs-on: ubuntu-20.04
Expand All @@ -43,14 +43,14 @@ jobs:
- name: Setup Local Dependencies
run: ./scripts/setup-dependencies.sh
- name: Build
run: scripts/build.sh
run: sudo ./scripts/build.sh
- name: Lint
run: scripts/lint.sh
run: ./scripts/lint.sh
pylint:
name: Pylint
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
continue-on-error: true
timeout-minutes: 5
timeout-minutes: 10
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
Expand All @@ -62,18 +62,15 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
if [ -f requirements_py.txt ]; then pip install -r requirements_py.txt; fi
pip install pylint
- name: Setup Build Env
run: sudo ./scripts/install-build-tools.sh
- name: Lint with Pylint
run: |
# In the future we should have (minimum score of 8.0/10.0 or 9.0/10.0)
pylint --rcfile=.pylintrc $(git ls-files '*.py') --fail-under=5.0
MIN_CODE_QUALITY=5.0
./scripts/pylint.sh $MIN_CODE_QUALITY
unit-and-integration-test:
name: Unit and Integration Tests
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
Expand All @@ -82,11 +79,11 @@ jobs:
- name: Setup Build Env
run: sudo ./scripts/install-build-tools.sh
- name: Setup Local Dependencies
run: ./scripts/setup-dependencies.sh
run: sudo ./scripts/setup-dependencies.sh
- name: Build
run: scripts/build.sh
run: ./scripts/build.sh
- name: Run Unit Tests
run: scripts/test.sh
run: ./scripts/test.sh
- name: Shorten SHA
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
Expand All @@ -101,7 +98,7 @@ jobs:
retention-days: 7
doxygen:
name: doxygen
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/docker-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
with:
files: |
Dockerfile
**/configure.sh
########################
# Build Base #
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ ethash*/
lua-*/
benchmark-results/
CMakeFiles/
Python-*/
plots/
.deps/
.libs/
Expand All @@ -74,3 +73,5 @@ build/tests
# E2E Test results
testruns/

# Virtualenv
opencbdc_env/
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ There are two UHS-based architectures as follows:
- Maximum demonstrated throughput ~1.7M transactions per second.
- Geo-replicated latency <1 second.

Read the [2PC &amp; Atomizer architecture guide](docs/uhs-architectures.md) for a detailed description of the system components and implementation of each architecture.
Read the [2PC & Atomizer architecture guide](docs/uhs-architectures.md) for a detailed description of the system components and implementation of each architecture.

## Parallel Architecture for Scalably Executing smart Contracts ("PArSEC")

Expand Down Expand Up @@ -87,8 +87,13 @@ If you just want to run the system, see "Run the Code" below.
Note that this script is just a convenience to install system-wide dependencies we expect.
As a result, it uses the system package manager, requires `sudo`, and should only be run **once**.
```console
sudo ./scripts/install-build-tools.sh
```
Note: Running Homebrew as root on mac via shell script is not supported, so run without sudo and when prompted, enter the root password.
```console
./scripts/install-build-tools.sh
```

2. Setup project dependencies
This script builds and installs a local copy of several build-dependencies which are not widely packaged.
Because it installs to a local, configurable prefix (defaulting to `./prefix`), it does not need root permissions to run.
Expand Down Expand Up @@ -116,7 +121,7 @@ See the [live deployment](https://mit-dci.github.io/opencbdc-tx-pages/) to brows

## UHS-based Architectures (2PC & Atomizer)

See the [2PC &amp; Atomizer User Guide](docs/2pc_atomizer_user_guide.md)
See the [2PC & Atomizer User Guide](docs/2pc_atomizer_user_guide.md)

## PArSEC Architecture

Expand Down Expand Up @@ -159,7 +164,7 @@ Review results and logs at `testruns/<testrun-uuid>/`
## Linting

### General
This script checks for newlines at the end of files.
This script checks for newlines at the end of all tracked git files except images.
Then it runs clang-format and clang-tidy on `.cpp` files in the following directories:
`src`, `tests`, `cmake-tests`, `tools`.
```console
Expand All @@ -168,6 +173,7 @@ Then it runs clang-format and clang-tidy on `.cpp` files in the following direct

### Python
Lint all python files according to ruleset defined in `.pylintrc`.
Optional code quality value >= 5.0 and <= 10.0 can be entered as a threshold of failure.
```console
pylint --rcfile=.pylintrc $(git ls-files '*.py') --fail-under=8.0
./scripts/pylint.sh 8.0
```
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
setuptools
eth-hash
matplotlib
numpy
pylint
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi

echo "Building..."

# see PREFIX in ./scripts/configure.sh
# see PREFIX in ./scripts/setup-dependencies.sh
PREFIX="$(cd "$(dirname "$0")"/.. && pwd)/prefix"

if [ -z ${BUILD_DIR+x} ]; then
Expand Down
Loading

0 comments on commit 43daacc

Please sign in to comment.