Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci builds #18

Merged
merged 70 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
7f390c8
Additional fixes, renamed runtime image directory
Dec 11, 2024
00cbc35
Updated README
Dec 11, 2024
e7af1b2
Addeing builder CI
Dec 11, 2024
b73c9f3
CI debugging
Dec 11, 2024
f1af781
CI debugging
Dec 11, 2024
b8c89d7
CI debugging
Dec 11, 2024
12345fa
CI debugging
Dec 12, 2024
455a0c2
CI debugging
Dec 12, 2024
e95e271
CI debugging
Dec 14, 2024
4b1b384
CI debugging
Dec 14, 2024
8ee3350
CI debugging
Dec 14, 2024
17f1982
CI debugging
Dec 14, 2024
7fb1800
CI debugging
Dec 14, 2024
b11fdd6
CI debugging
Dec 14, 2024
26acaba
CI debugging
Dec 16, 2024
d7df2d7
CI debugging
Dec 16, 2024
748cb5a
CI debugging
Dec 16, 2024
cc423a9
CI debugging
Dec 16, 2024
71d8bba
CI debugging
Dec 16, 2024
b14832d
CI debugging
Dec 16, 2024
661f59a
CI debugging
Dec 17, 2024
42687ac
CI debugging
Dec 17, 2024
7fc10c7
CI debugging
Dec 17, 2024
dcd823f
CI debugging
Dec 17, 2024
1fc5fe4
CI debugging
Dec 17, 2024
4a0ad05
CI debugging
Dec 17, 2024
02e9b47
CI debugging
Dec 17, 2024
98baa4a
CI debugging
Dec 18, 2024
41d8591
CI debugging
Dec 18, 2024
d756234
CI debugging
Dec 18, 2024
c3f590e
CI debugging
Dec 18, 2024
d356816
CI debugging
Dec 18, 2024
5c933cd
CI debugging
Dec 18, 2024
fcd099c
CI debugging
Dec 18, 2024
887a09f
CI debugging
Dec 18, 2024
db24348
CI debugging
Dec 18, 2024
c3e5999
CI debugging
Dec 18, 2024
a3656b2
CI debugging
Dec 18, 2024
c59ca1b
CI debugging
Dec 18, 2024
c6f1cfc
CI debugging
Dec 18, 2024
0d916ab
CI debugging
Dec 18, 2024
f467532
CI debugging
Dec 18, 2024
64d1ce3
CI debugging
Dec 18, 2024
a17edc6
CI debugging
Dec 18, 2024
27877d9
CI debugging
Dec 18, 2024
b50751e
CI debugging
Dec 18, 2024
55fca9b
CI debugging
Dec 18, 2024
42651da
CI debugging
Dec 18, 2024
453ab68
CI debugging
Dec 18, 2024
b3e8c04
CI debugging
Dec 18, 2024
86c2eb1
CI debugging
Dec 18, 2024
2f7caac
CI debugging
Dec 18, 2024
1b0a443
CI debugging
Dec 19, 2024
6bbee45
CI debugging
Dec 19, 2024
e053edd
CI debugging
Dec 19, 2024
865b569
CI debugging
Dec 19, 2024
c988ce4
CI debugging
Dec 19, 2024
92cb0f5
CI debugging
Dec 19, 2024
4196fe8
CI debugging
Dec 19, 2024
8956cc6
CI debugging
Dec 20, 2024
865b2d3
CI debugging
Dec 20, 2024
21d5eeb
CI debugging
Dec 20, 2024
254ef84
CI debugging
Dec 20, 2024
9bf87f6
CI debugging
Dec 20, 2024
6785795
CI debugging
Dec 20, 2024
2ec4178
CI debugging
Dec 20, 2024
fbb83af
CI debugging
Dec 20, 2024
579c47c
CI debugging
Dec 21, 2024
0d2edf5
Test fixes
Dec 27, 2024
c283aa4
Cleanup some files
Dec 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
255 changes: 203 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,87 +9,238 @@ on:

permissions:
contents: write
packages: read
packages: write

jobs:
build:
builder-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}/raceboat-builder
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{raw}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}

- name: Configure Docker Caching
id: cache
uses: int128/docker-build-cache-config-action@v1
with:
image: ghcr.io/${{ github.repository }}/raceboat-builder/cache

- name: Build and Push raceboat-builder Docker Image
uses: docker/build-push-action@v4
with:
context: raceboat-builder-image
file: raceboat-builder-image/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: ${{ steps.cache.outputs.cache-from }}
cache-to: ${{ steps.cache.outputs.cache-to }}

build-framework:
needs: [builder-image]
runs-on: ubuntu-latest
container:
image: ghcr.io/tst-race/race-images/race-compile:main
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
image: ghcr.io/tst-race/raceboat/raceboat-builder:${{ github.head_ref || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build
run: ./build_it_all.sh

- name: Build-pt
run: ./pluggable-transport/build.sh -p=build/LINUX_x86_64/language-shims/source/include/src/core
run: ./build.sh

- name: Create Build Artifact
# NOTE: _commsPluginBindings.so not in racesdk/package/
run: "tar cvf ${{ github.event.repository.name }}.tar.gz -C racesdk/package/ ."
run: "tar cvf ${{ github.event.repository.name }}.tar.gz -C /__w/raceboat/raceboat/ ./racesdk"

- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: "${{ github.event.repository.name }}-linux-x86_64.tar.gz"
path: "${{ github.event.repository.name }}-linux-x86_64.tar.gz"
name: "${{ github.event.repository.name }}.tar.gz"
path: "${{ github.event.repository.name }}.tar.gz"
retention-days: 10

# todo base these on the raceboat image
test-unit:
# needs: build
compile-image:
needs: [build-framework]
runs-on: ubuntu-latest
container:
image: ghcr.io/tst-race/race-images/race-compile:main
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: unit test
- name: Checkout
uses: actions/checkout@v3

- name: Build and Run Unit Tests
# shuffle the order of the tests to potentially uncover weirdness
# note that you can reproduce the test results by finding the seed in the log output and
# setting the environment variable GTEST_RANDOM_SEED to that value.
env:
GTEST_SHUFFLE: 1
run: |
./build_it_all.sh
cmake --build --preset=LINUX_x86_64 --target run_tests -j
test-coverage:
# needs: build
- name: Download Framework Artifacts
uses: actions/download-artifact@v3
with:
name: "${{ github.event.repository.name }}.tar.gz"

- name: debug ls
run: ls -R .

- name: untar
run: tar xf ${{ github.event.repository.name }}.tar.gz

- name: debug ls
run: ls -R racesdk

- name: debu pwdg
run: pwd

- name: env
run: env

- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}/raceboat-compile
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{raw}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}

- name: Configure Docker Caching
id: cache
uses: int128/docker-build-cache-config-action@v1
with:
image: ghcr.io/${{ github.repository }}/raceboat-compile/cache

- name: Build and Push raceboat-compile Docker Image
uses: docker/build-push-action@v4
with:
context: /home/runner/work/raceboat/raceboat
file: raceboat-compile-image/Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: ${{ steps.cache.outputs.cache-from }}
cache-to: ${{ steps.cache.outputs.cache-to }}

run-tests:
needs: [compile-image]
runs-on: ubuntu-latest
container:
image: ghcr.io/tst-race/race-images/race-compile:main
image: ghcr.io/tst-race/raceboat/raceboat-compile:${{ github.head_ref || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build and Run Unit Tests
# shuffle the order of the tests to potentially uncover weirdness
# note that you can reproduce the test results by finding the seed in the log output and
# setting the environment variable GTEST_RANDOM_SEED to that value.
env:
GTEST_SHUFFLE: 1
run: |
cmake --preset=coverage
cmake --build --preset=coverage --target coverage
test-format:
# needs: build
- name: Test
run: ./test.sh

runtime-image:
needs: [compile-image]
runs-on: ubuntu-latest
container:
image: ghcr.io/tst-race/race-images/race-compile:main
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Check Format
run: |
./build_it_all.sh
cmake --build --preset=LINUX_x86_64 --target check_format -j
- name: Download Framework Artifacts
uses: actions/download-artifact@v3
with:
name: "${{ github.event.repository.name }}.tar.gz"

- name: debug ls
run: ls -R .

- name: untar
run: tar xf ${{ github.event.repository.name }}.tar.gz

- name: debug ls
run: ls -R racesdk

- name: debu pwdg
run: pwd

- name: env
run: env

- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}/raceboat-runtime
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{raw}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}

- name: Configure Docker Caching
id: cache
uses: int128/docker-build-cache-config-action@v1
with:
image: ghcr.io/${{ github.repository }}/raceboat-runtime/cache

- name: Build and Push raceboat-runtime Docker Image
uses: docker/build-push-action@v4
with:
context: /home/runner/work/raceboat/raceboat
file: raceboat-runtime-image/Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: ${{ steps.cache.outputs.cache-from }}
cache-to: ${{ steps.cache.outputs.cache-to }}
build-contexts: ghcr.io/tst-race/raceboat/raceboat-compile=docker-image://ghcr.io/tst-race/raceboat/raceboat-compile:${{ steps.meta.outputs.version }}
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ include(race/test-targets)
include(race/valgrind)
include(race/warnings)

# setup_project_test_targets(raceSdkCommon UNIT INTEGRATION)
# setup_project_format_targets(raceSdkCommon)
setup_project_test_targets(raceSdkCommon UNIT INTEGRATION)
setup_project_format_targets(raceSdkCommon)

add_subdirectory(language-shims)
add_subdirectory(source)
Expand All @@ -54,6 +54,12 @@ if(NOT ANDROID)
add_subdirectory(test/common/DecomposedTestStub EXCLUDE_FROM_ALL)
add_subdirectory(test/common/plugins/DecomposedTestImplementation EXCLUDE_FROM_ALL)
add_subdirectory(test/source EXCLUDE_FROM_ALL)
install(
TARGETS
race-cli
bridge-distro
RUNTIME DESTINATION app
)
endif()

# Create this after all subdirectories have been added
Expand All @@ -63,6 +69,7 @@ install(
TARGETS
raceSdkCommon
EXPORT raceSdkCommon
RUNTIME DESTINATION app
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include
)
Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,32 @@ Raceboat provides two different interfaces for censorship circumvention channels


## **Building**
Raceboat uses a docker-based build process, running the below may take some time to download the compilation image. This build command also creates a `raceboat` docker image with the shared objects and executable built into it for easy testing and execution. To build a x86_64 image:
Raceboat uses a docker-based build process, running the below may take some time to download the compilation image. This build command also creates a `raceboat` runtumie docker image with the shared objects and executable built into it for easy testing and execution. **These are all built in GitHub CI and available from the `ghcr.io/tst-race/raceboat` namespace.

- `ghcr.io/tst-race/raceboat/raceboat-builder:main`: an image for building the raceboat framework itself (i.e. the code in this repository)

- `ghcr.io/tst-race/raceboat/raceboat-compile:main`: extension of the raceboat-builder with prebuilt framework binaries, used to compile plugins that provide channels or components for raceboat to use.

- `ghcr.io/tst-race/raceboat/raceboat:main`: runtime image which contains both prebuilt framework binaries and runtime dependencies.

Use the following commands to build a local set of x86_64 images:

```bash
pushd raceboat-builder-image && \
./build_image.sh -n ghcr.io/tst-race/raceboat --platform-x86_64 && \
popd && \
docker run -it --rm --name=build-pt \
-e MAKEFLAGS="-j" \
-v $(pwd)/:/code/ \
-w /code \
raceboat-builder:latest \
./build.sh && docker-image/build_image.sh
./build.sh && \
pushd raceboat-compile-image && \
./build_image.sh -n ghcr.io/tst-race/raceboat --platform-x86_64 && \
popd && \
pushd runtime-image && \
./build_image.sh -n ghcr.io/tst-race/raceboat --platform-x86_64 && \
popd
```

To build an aarch64 raceboat image locally:
Expand Down
Loading
Loading