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

Re-use conan cache for built dependencies #187

Merged
merged 6 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 4 additions & 10 deletions .github/workflows/sanitisers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
branches: [master]
types: [opened, synchronize, reopened, ready_for_review]

defaults:
run:
shell: bash

jobs:
conan-cache:
if: github.event.pull_request.draft == false
Expand Down Expand Up @@ -37,12 +41,10 @@ jobs:
id: get-conan-version
run: |
echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')"
shell: bash
- name: Hash ExternalProjects
id: hash-external
run: |
echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)"
shell: bash
- uses: actions/cache@v2
with:
path: '~/.conan'
Expand Down Expand Up @@ -84,12 +86,10 @@ jobs:
id: get-conan-version
run: |
echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')"
shell: bash
- name: Hash ExternalProjects
id: hash-external
run: |
echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)"
shell: bash
- uses: actions/cache@v2
with:
path: '~/.conan'
Expand Down Expand Up @@ -136,12 +136,10 @@ jobs:
id: get-conan-version
run: |
echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')"
shell: bash
- name: Hash ExternalProjects
id: hash-external
run: |
echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)"
shell: bash
- uses: actions/cache@v2
with:
path: '~/.conan'
Expand Down Expand Up @@ -189,12 +187,10 @@ jobs:
id: get-conan-version
run: |
echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')"
shell: bash
- name: Hash ExternalProjects
id: hash-external
run: |
echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)"
shell: bash
- uses: actions/cache@v2
with:
path: '~/.conan'
Expand Down Expand Up @@ -242,12 +238,10 @@ jobs:
id: get-conan-version
run: |
echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')"
shell: bash
- name: Hash ExternalProjects
id: hash-external
run: |
echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)"
shell: bash
- uses: actions/cache@v2
with:
path: '~/.conan'
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
branches: [master]
types: [opened, synchronize, reopened, ready_for_review]

defaults:
run:
shell: bash

jobs:
formatting:
if: github.event.pull_request.draft == false
Expand Down Expand Up @@ -61,6 +65,22 @@ jobs:
# --- Set-up ---
- name: "Ping redis"
run: redis-cli -h redis ping
# --- Cache based on Conan version and ExternalProjects cmake source
- name: Get Conan version
id: get-conan-version
run: |
echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')"
- name: "Hash ExternalProjects"
id: hash-external
run: |
echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)"
- uses: actions/cache@v2
with:
path: '~/.conan'
key: ${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-${{ steps.hash-external.outputs.hash-external }}
restore-keys: |
${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-
${{ runner.os }}-
# --- Tests build - need a debug build for actually running tests ---
- name: "Run cmake for tests"
run: inv dev.cmake --build=Debug
Expand All @@ -78,6 +98,30 @@ jobs:
# --- Code update ---
- name: "Check out code"
uses: actions/checkout@v2
# --- Cache based on Conan version and ExternalProjects cmake source
- name: "Get Conan version"
id: get-conan-version
run: |
docker-compose run --rm cli conan --version 2>/tmp/conan-ver-log | tee /tmp/conan-ver
grep 'Conan version' /tmp/conan-ver || exit 1
sudo chown -R $(id -u):$(id -g) ~/.conan
echo "::set-output name=conan-version::$(grep 'Conan version' /tmp/conan-ver | tr -d '[:alpha:] ')"
env:
CONAN_CACHE_MOUNT_SOURCE: ~/.conan/
- name: "Get Conan Version - Show Log"
if: always()
run: cat /tmp/conan-ver-log
- name: "Hash ExternalProjects"
id: hash-external
run: |
echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)"
- uses: actions/cache@v2
with:
path: '~/.conan'
key: ${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-${{ steps.hash-external.outputs.hash-external }}
restore-keys: |
${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-
${{ runner.os }}-
# --- Build and test ---
- name: "Build distributed tests"
run: ./dist-test/build.sh
Expand Down Expand Up @@ -105,6 +149,23 @@ jobs:
run: git fetch origin ${GITHUB_REF}:ci-branch
- name: "Check out branch"
run: git checkout --force ci-branch
# --- Cache based on Conan version and ExternalProjects cmake source
- name: "Get Conan version"
id: get-conan-version
run: |
echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')"
- name: "Hash ExternalProjects"
id: hash-external
run: |
echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)"
- uses: actions/cache@v2
with:
path: '~/.conan'
key: release-${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-${{ steps.hash-external.outputs.hash-external }}
restore-keys: |
release-${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-${{ steps.hash-external.outputs.hash-external }}
release-${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-
release-${{ runner.os }}-
# --- Examples ---
- name: "Run cmake shared"
run: inv dev.cmake --shared --build=Release
Expand Down
4 changes: 4 additions & 0 deletions dist-test/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ set -e
export PROJ_ROOT=$(dirname $(dirname $(readlink -f $0)))
pushd ${PROJ_ROOT} >> /dev/null

export CONAN_CACHE_MOUNT_SOURCE=$HOME/.conan/
# Ensure the cache directory exists before starting the containers
mkdir -p ${CONAN_CACHE_MOUNT_SOURCE}

# Run the build
docker-compose \
run \
Expand Down
1 change: 1 addition & 0 deletions dist-test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export PROJ_ROOT=$(dirname $(dirname $(readlink -f $0)))
pushd ${PROJ_ROOT} >> /dev/null

export CONAN_CACHE_MOUNT_SOURCE=$HOME/.conan/
RETURN_VAL=0

# Run the test server in the background
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- /usr/bin/docker:/usr/bin/docker
- ./:/code/faabric
- ./build:/build/faabric
- ./conan-cache/:/root/.conan
- ${CONAN_CACHE_MOUNT_SOURCE:-./conan-cache/}:/root/.conan
working_dir: /code/faabric
stdin_open: true
tty: true
Expand Down
3 changes: 3 additions & 0 deletions thread-sanitizer-ignorelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ signal:*

# TODO: Remove: There's something weird going on with MPI code I don't understand
race:faabric::scheduler::MpiWorld::*

# Known Bug num. 1 in #189
race:faabric::transport::PointToPointGroup::*