Skip to content

Commit

Permalink
Threads in docker build (#19)
Browse files Browse the repository at this point in the history
Co-authored-by: Stanislav Boboň <[email protected]>
  • Loading branch information
mmstanone and Stanislav Boboň authored Dec 16, 2024
1 parent 5c93a97 commit 79c17b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM ubuntu:20.04

# Avoid prompts from apt-get
ARG DEBIAN_FRONTEND=noninteractive
ARG NTHREADS=18

RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && apt-get update
Expand Down Expand Up @@ -34,7 +35,7 @@ RUN cd blocksci && \
mkdir build && \
cd build && \
CC=gcc-7 CXX=g++-7 cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j258 && \
make -j${NTHREADS} && \
make install


Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ To run BlockSci in Docker, the following steps are required:
1. Clone this repository
1. You also need to clone with submodules. For that, either use `--recurse-submodules` while cloning, or, in the cloned repository, follow with `git submodule init` and `git submodule update --recursive`.
2. Install [Docker](https://docs.docker.com/get-docker/)
3. Build the Docker image by running `docker build -t blocksci-cj .` in the root of the repository. This is just an initial setup to get all the libraries, and the *real* compilation will happen later.
3. Build the Docker image by running `docker build --build-arg NTHREADS=<number of threads> -t blocksci-cj .` in the root of the repository. This is just an initial setup to get all the libraries, and the *real* compilation will happen later.
1. We use `uv` to speed up the `blockscipy` installation, since it takes a long time.
2. Use NTHREADS build argument to control how many threads are used (passed to `make -j${NTHREADS}`).

Now - since BlockSci is a memory-intensive and disk-consuming tool, we **strongly** recommend you to not hold the BlockSci data directly in the image, but to mount a persistent volume to the container.

Expand Down

0 comments on commit 79c17b3

Please sign in to comment.