Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Dockerised benchmark tool (#4494)
Browse files Browse the repository at this point in the history
* ci: add docker support for benchmark tool

* feat: add dockerised version of benchmark tool

* docs: add instruction on running dockerised version of benchmark tool
  • Loading branch information
connorjburton authored May 21, 2023
1 parent 8c77c01 commit ef6544c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
benchmark/node_modules
benchmark/target
17 changes: 17 additions & 0 deletions Dockerfile.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM rust:1.69.0
WORKDIR /usr/src/

# https://github.com/nodesource/distributions
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
RUN cargo install hyperfine

COPY Cargo.toml Cargo.lock ./
COPY ./crates ./crates
COPY ./xtask ./xtask

WORKDIR /usr/src/benchmark

COPY ./benchmark .

RUN npm ci
RUN node run.js
8 changes: 7 additions & 1 deletion benchmark/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Benchmarks
## Getting Started
## Running in Docker

Run in the root directory, not `./benchmark`

1. `docker build --rm -f Dockerfile.benchmark . --progress plain`

## Running locally
1. Install hyperfine: `cargo install hyperfine`
2. Install node modules: `npm i`
3. Run the benchmarks: `node run.js`
Expand Down
2 changes: 1 addition & 1 deletion benchmark/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function cloneProject(name, repository, dirs = []) {
console.log(`Updating git repository in directory ${projectDirectory}`);
inProjectDirectory.run("git reset --hard @{u}");
inProjectDirectory.run("git clean -df");
inProjectDirectory.run("git pull --depth=1");
inProjectDirectory.run("git pull --depth=1 --ff-only");
} else {
console.log("Clone project...");

Expand Down

0 comments on commit ef6544c

Please sign in to comment.