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 Feb 28, 2024
1 parent 1d1f869 commit 8030db1
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 26 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
6 changes: 4 additions & 2 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 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
4 changes: 1 addition & 3 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
4 changes: 1 addition & 3 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

0 comments on commit 8030db1

Please sign in to comment.