Skip to content

Commit

Permalink
docs: update docs and workflows for script split
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Stuewe <stuewe@mit.edu>
  • Loading branch information
HalosGhost committed Mar 1, 2024
1 parent 9910693 commit 83e50ef
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 31 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ charts/
# Prevent copying scripts that are unused in docker
scripts/
!scripts/test.sh
!scripts/configure.sh
!scripts/install-build-tools.sh
!scripts/setup-dependencies.sh
!scripts/test-transaction.sh
!scripts/wait-for-it.sh

Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Configure
run: sudo ./scripts/configure.sh
- name: Setup Build Env
run: sudo ./scripts/install-build-tools.sh
- name: Setup Local Dependencies
run: ./scripts/setup-dependencies.sh
- name: Build
run: scripts/build.sh
lint:
Expand All @@ -36,8 +38,10 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Configure
run: sudo ./scripts/configure.sh
- name: Setup Build Env
run: sudo ./scripts/install-build-tools.sh
- name: Setup Local Dependencies
run: ./scripts/setup-dependencies.sh
- name: Build
run: scripts/build.sh
- name: Lint
Expand All @@ -50,8 +54,10 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Configure
run: sudo ./scripts/configure.sh
- name: Setup Build Env
run: sudo ./scripts/install-build-tools.sh
- name: Setup Local Dependencies
run: ./scripts/setup-dependencies.sh
- name: Build
run: scripts/build.sh
- name: Run Unit Tests
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ ENV BUILD_RELEASE 1

RUN mkdir -p /opt/tx-processor/scripts

COPY scripts/configure.sh /opt/tx-processor/scripts/configure.sh
COPY scripts/install-build-tools.sh /opt/tx-processor/scripts/install-build-tools.sh
COPY scripts/setup-dependencies.sh /opt/tx-processor/scripts/setup-dependencies.sh

# Set working directory
WORKDIR /opt/tx-processor

RUN scripts/configure.sh
RUN scripts/install-build-tools.sh
RUN scripts/setup-dependencies.sh

# Create Build Image
FROM $BASE_IMAGE AS builder
Expand All @@ -30,7 +32,7 @@ COPY . .
# Build binaries
RUN mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} .. && \
cmake -DCMAKE_PREFIX_PATH="prefix" -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} .. && \
make -j$(nproc)

# Create 2PC Deployment Image
Expand Down
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,33 @@ If you want to dive straight in, take a look at our issue tracker's list of [goo
1. Clone the repository (including submodules)
- `git clone --recurse-submodules https://github.com/mit-dci/opencbdc-tx`

# Build
# Setup the build envirnoment

Use these directions if you want to build the source on your machine.
If you just want to run the system, see "Run the Code" below.

1. Install the necessary libraries and resources
```terminal
# ./scripts/configure.sh
```
1. Setup the build-environment.
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
# ./scripts/install-build-tools.sh
```
1. 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.
Furthermore, it should always be safe to delete `prefix` and rerun this script.
```console
$ ./scripts/setup-dependencies.sh
```
1. Run the build
```terminal
# ./scripts/build.sh
```
```console
$ ./scripts/build.sh
```

## macOS
Note that if you have not already installed the xcode cli tools you will need to:

```terminal
```console
# xcode-select --install
```
# Run the Code
Expand All @@ -100,11 +109,11 @@ See the [PArSEC User Guide](docs/parsec_user_guide.md)
Running Unit & Integration Tests

1. Build all docker images
```terminal
```console
$ ./scripts/build-docker.sh
```
1. Run Unit & Integration Tests
```terminal
```console
$ docker run -ti opencbdc-tx-builder ./scripts/test.sh
```

Expand Down
10 changes: 4 additions & 6 deletions scripts/install-build-tools.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/bash

echo "Installing build tools..."

echo "test local pipeline changes"
echo "Setting up build environment..."

green="\033[0;32m"
cyan="\033[0;36m"
Expand Down Expand Up @@ -32,8 +30,8 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
fi

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
apt update
apt install -y build-essential wget cmake libgtest-dev libbenchmark-dev lcov git software-properties-common rsync unzip
$SUDO apt update
$SUDO apt install -y build-essential wget cmake libgtest-dev libbenchmark-dev lcov git software-properties-common rsync unzip

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | $SUDO apt-key add -
$SUDO add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"
Expand All @@ -44,7 +42,7 @@ fi

PYTHON_TIDY=/usr/local/bin/run-clang-tidy.py
if [ ! -f "${PYTHON_TIDY}" ]; then
echo -e "${green}Copying run-clang-tidy to /usr/local/bin"
echo -e "${green}Copying run-clang-tidy to /usr/local/bin${end}"
wget https://raw.githubusercontent.com/llvm/llvm-project/e837ce2a32369b2e9e8e5d60270c072c7dd63827/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
$SUDO mv run-clang-tidy.py /usr/local/bin
fi
6 changes: 2 additions & 4 deletions scripts/configure.sh → scripts/setup-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/bash

echo "Configuring..."

echo "test local pipeline changes"
echo "Setting up dependencies..."

green="\033[0;32m"
cyan="\033[0;36m"
Expand Down Expand Up @@ -65,7 +63,7 @@ cd build
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DDISABLE_SSL=1 ..
make -j$CPUS static_lib

echo -e "${green}Copying nuraft to $PREFIX/lib and $PREFIX/include"
echo -e "${green}Copying nuraft to $PREFIX/lib and $PREFIX/include${end}"
cp libnuraft.a $PREFIX/lib
cp -r ../include/libnuraft $PREFIX/include

Expand Down

0 comments on commit 83e50ef

Please sign in to comment.