From b76c8738448b5abb8620c8e59a4f5485402a2ef5 Mon Sep 17 00:00:00 2001 From: Nils Dijk Date: Mon, 9 Oct 2023 12:07:25 +0000 Subject: [PATCH] globally configure make to use the available cores --- .devcontainer/Dockerfile | 3 +++ .devcontainer/pgenv/config/default.conf | 2 +- CONTRIBUTING.md | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1be2dbd76..6b9a04f17 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -52,6 +52,9 @@ RUN useradd -ms /bin/bash citus \ WORKDIR /home/citus USER citus +# run all make commands with the number of cores available +RUN echo "export MAKEFLAGS=\"-j \$(nproc)\"" >> "/home/citus/.bashrc" + RUN git clone --branch v1.3.2 --depth 1 https://github.com/theory/pgenv.git .pgenv COPY --chown=citus:citus pgenv/config/ .pgenv/config/ ENV PATH="/home/citus/.pgenv/bin:${PATH}" diff --git a/.devcontainer/pgenv/config/default.conf b/.devcontainer/pgenv/config/default.conf index c74e18276..ab55493f9 100644 --- a/.devcontainer/pgenv/config/default.conf +++ b/.devcontainer/pgenv/config/default.conf @@ -1,4 +1,4 @@ -PGENV_MAKE_OPTIONS=(-sj8) +PGENV_MAKE_OPTIONS=(-s) PGENV_CONFIGURE_OPTIONS=( --enable-debug diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a7b44adac..eaec55c3e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ This will create an isolated Workspace in vscode, complete with all tools requir To quickly start we suggest splitting your terminal once to have two shells. The left one in the `/workspaces/citus`, the second one changed to `/data`. The left terminal will be used to interact with the project, the right one with a testing cluster. -To get citus installed from source we run `make install -sj8` in the first terminal, adjust `j8` to suite to the number of cores you have available. Once installed you can start a Citus cluster in the second terminal via `citus_dev make citus`. The cluster will run in the background, and can be interacted with via `citus_dev`. To get an overview of the available commands. +To get citus installed from source we run `make install -s` in the first terminal. Once installed you can start a Citus cluster in the second terminal via `citus_dev make citus`. The cluster will run in the background, and can be interacted with via `citus_dev`. To get an overview of the available commands. With the Citus cluster running you can connect to the coordinator in the first terminal via `psql -p9700`. Because the coordinator is the most common entrypoint the `PGPORT` environment is set accordingly, so a simple `psql` will connect directly to the coordinator.