Skip to content

Commit

Permalink
*install dep shell script
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-crypto committed Jan 9, 2024
1 parent 75b1486 commit 8dfdd78
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@

## Getting started

To run the benchmarks, you need to first install python, rust and scarb on your machine. Then, you can run the following commands to install the dependencies and run the benchmarks. The data will stored in a `benchmarks.json` file in the root directory.
To run the benchmarks, you need to first install python (version 3.9.18 specifically), rust and scarb on your machine. If you are using a mac, execute the `install_dep_run.sh` at the root of the directory to install of these dependencies in one go.

### Setup Virtual Python Env
After that we need to setup our python virtual environment:

```bash
python3 -m venv venv; source .env/bin/activate;
# Setup Python virtual environment
python3.9 -m venv venv
source venv/bin/activate
```

### Run Benchmarks
Finally run this cargo nextest test command to get the benchmarks:

```bash
source .env/bin/activate; cargo nextest run benchmarking_tests::tests::run_benchmarks_ --test-threads 1
```
```

The data will stored in a `benchmarks.json` file in the root directory.

If you run into any issues feel free to open a PR and we will try to help you out ASAP.

Enjoy! :)

35 changes: 35 additions & 0 deletions install_dep_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Initialize a flag to track if all dependencies are already installed
all_dependencies_installed=true

# Check Python 3.9
if ! command -v python3.9 &> /dev/null
then
echo "Python 3.9 not found, installing Python 3.9..."
brew install [email protected]
all_dependencies_installed=false
fi

# Check Rust
if ! command -v rustc &> /dev/null
then
echo "Rust not found, installing Rust..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# The script needs to source the cargo environment or restart the terminal
source $HOME/.cargo/env
all_dependencies_installed=false
fi

# Check Scarb
if ! command -v scarb &> /dev/null
then
echo "Scarb not found, installing Scarb..."
curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh
all_dependencies_installed=false
fi

# Check if all dependencies were already installed
if [ "$all_dependencies_installed" = true ]; then
echo "All dependencies (Python 3.9, Rust, and Scarb) are already installed."
fi

0 comments on commit 8dfdd78

Please sign in to comment.