Skip to content

Commit

Permalink
squash! [Docs] Add hybrid plugin system notebook
Browse files Browse the repository at this point in the history
Use a custom hybrid plugin created especially for the notebook, rather
than sellotaping BAL and SimpleCppManager together. This allows the
notebook to avoid potentially confusing readers with misleading text
about configuring two completely independent plugins to work together.

Also add a section about information sharing between plugins via the
`Context.managerState`.

For the custom plugin sources, use linter config lifted from the main
OpenAssetIO repo, with little modification.

Signed-off-by: David Feltell <[email protected]>
  • Loading branch information
feltech committed Sep 20, 2024
1 parent 8918168 commit 179e1f9
Show file tree
Hide file tree
Showing 16 changed files with 738 additions and 257 deletions.
17 changes: 7 additions & 10 deletions .github/build_openassetio/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

name: Build OpenAssetIO
description: Builds OpenAssetIO and publishes an artifact
inputs:
install-prefix:
description: Where to install OpenAssetIO once built
required: true
runs:
using: "composite"
steps:
Expand All @@ -20,13 +24,6 @@ runs:
- name: Build OpenAssetIO
shell: bash
run: |
cd openassetio-checkout
mkdir build
cmake -G Ninja -S . -B build -DOPENASSETIO_ENABLE_SIMPLECPPMANAGER=ON
cmake --build build
cmake --install build
- uses: actions/upload-artifact@v3
with:
name: OpenAssetIO Build
path: openassetio-checkout/build/dist
retention-days: 1
cmake -G Ninja -S openassetio-checkout -B openassetio-checkout/build
cmake --build openassetio-checkout/build
cmake --install openassetio-checkout/build --prefix ${{ inputs.install-prefix }}
33 changes: 25 additions & 8 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,44 @@ jobs:
test-cpp-notebooks:
# A special job just for the Hybrid Plugin System because it needs a
# build of SimpleCppManager. Use the OpenAssetIO Docker container to
# get a build. If/when OpenAssetIO publishes SimpleCppManager with
# its release artifacts, this could be simplified.
# C++ build.
name: Test Hybrid Plugin System notebook
runs-on: ubuntu-latest
container:
image: ghcr.io/openassetio/openassetio-build
env:
SIMPLEHYBRIDMANAGER_SUBDIR: examples/resources/hybrid_plugin_system/SimpleHybridManager
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: |
python -m pip install .
python -m pip install -r examples/resources/requirements.txt
python -m pip install openassetio-traitgen
- name: Build SimpleCppManager
- name: Build/install OpenAssetIO
uses: ./.github/build_openassetio
with:
install-prefix: ${{ env.SIMPLEHYBRIDMANAGER_SUBDIR }}/dependencies

- name: Copy SimpleCppManager to expected location for notebook
run: >
cp openassetio-checkout/build/dist/SimpleCppManager.so
examples/resources/hybrid_plugin_system/SimpleCppManager/
- name: Build/install MediaCreation
run: |
cmake -S . -B build -G Ninja
cmake --build build
cmake --install build --prefix $SIMPLEHYBRIDMANAGER_SUBDIR/dependencies
- name: Build/install SimpleHybridManager
run: |
cmake -S src -B build -G Ninja
cmake --build build
cmake --install build --prefix plugin
env:
CMAKE_PREFIX_PATH: dependencies
# Since we're in a Docker container, `github.workspace` doesn't
# give the correct location, except, for some reason, when used
# in a `working-directory` option. See
# https://github.com/actions/runner/issues/2058#issuecomment-1541828550
working-directory: ${{ github.workspace }}/${{ env.SIMPLEHYBRIDMANAGER_SUBDIR }}

- name: Test notebook
run: jupyter nbconvert --to html --execute examples/hybrid_plugin_system.ipynb
Expand Down
29 changes: 8 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ concurrency:
cancel-in-progress: true

jobs:
build-openassetio:
name: Build OpenAssetIO
runs-on: ubuntu-latest
container:
image: ghcr.io/openassetio/openassetio-build
steps:
- uses: actions/checkout@v3
- name: Build
uses: ./.github/build_openassetio

test-python:
name: "${{ matrix.os }} python-${{ matrix.python }}"
runs-on: ${{ matrix.os }}
Expand All @@ -43,25 +33,22 @@ jobs:
test-cpp:
name: Test Cpp
runs-on: ubuntu-latest
needs: build-openassetio
container:
image: aswf/ci-base:2024
image: ghcr.io/openassetio/openassetio-build
steps:
- uses: actions/checkout@v3

- name: Build OpenAssetIO
uses: ./.github/build_openassetio
with:
install-prefix: openassetio

- name: Install Traitgen
run: python -m pip install openassetio-traitgen==1.0.0a10

- name: Get OpenAssetIO
uses: actions/download-artifact@v3
with:
name: OpenAssetIO Build
path: ./openassetio-build

- name: Configure CMake build
run: >
cmake -S . -DCMAKE_PREFIX_PATH=`pwd`/openassetio-build -B build -G Ninja
--preset test
run: |
cmake -S . -DCMAKE_PREFIX_PATH=$(pwd)/openassetio -B build -G Ninja --preset test
- name: Build tests
run: cmake --build build
Expand Down
Loading

0 comments on commit 179e1f9

Please sign in to comment.