diff --git a/README.md b/README.md index 4b396d8..5e0b721 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,6 @@ As with any C++ API, the header files are necessary for use. `./racesdk/package/LINUX*/` will be `./racesdk/package/ANDROID*/` when building for Android. - ## Testing using race-cli See race-email channel README.md for examples @@ -40,6 +39,7 @@ NOTE: see `FileSystem::makePluginInstallBasePath()` for path requirements of whe NOTE: `--param hostname=localhost` does not work in this test. You can use the ip addresses reported from ifconfig on both nodes. ### server ```bash + docker run -it -v $(pwd):/code/ -v /tmp/:/tmp/ race-sdk:latest bash cp -r /code/private-race-core/plugin-comms-twosix-cpp/kit/artifacts/linux-arm64-v8a-server/PluginCommsTwoSixStub/* /tmp/race/plugins/unix/arm64-v8a/PluginCommsTwoSixStub ln -s /code/private-raceboat/build/LINUX_arm64-v8a/source/libraceboat.so /usr/local/lib/raceSdkCommon.so @@ -74,3 +74,33 @@ cmake --build --preset=LINUX_x86_64 --target check_format -j ## APIs See CommPluginDeveloperGuide.md in the `race-docs` repository for information about working with Comms plugins. + + +## Updated Running Instructions +Work-in-progress as we make small tweaks/improvements to the race-cli user experience. + +___Preliminaries:___ +This approach volume-mounts plugin(s) of the appropriate architecture, so "path/to/plugin" would look something like: `/your/path/to/race-core/plugin-comms-twosix-cpp/kit/artifacts/linux-arm64-v8a-server/` to use channels from PluginCommsTwoSixStub on an arm64-v8a host. + +### Server: + +```bash +docker run --rm -it --name=rbserv \ +--network=rib-overlay-network --ip=10.11.1.2 \ + -v /path/to/plugin:/kits \ +raceboat:latest bash + +echo "Hello from the Raceboat Server!" | race-cli --dir /kits -m --recv-reply --send-channel twoSixDirectCpp --recv-channel twoSixDirectCpp --param hostname="10.11.1.2" --param PluginCommsTwoSixStub.startPort=26262 --param PluginCommsTwoSixStub.endPort=26264 +``` + +### Client: + +```bash +docker run --rm -it --name=raceboat-client \ +--network=rib-overlay-network --ip=10.11.1.3 \ + -v /path/to/plugin:/kits \ +raceboat:latest bash + +echo "Hi, I'm the client!" | race-cli --dir /kits -m --send-recv --send-channel twoSixDirectCpp --recv-channel twoSixDirectCpp --param hostname="10.11.1.3" --param PluginCommsTwoSixStub.startPort=26262 --param PluginCommsTwoSixStub.endPort=26264 --send-address="{\"hostname\":\"10.11.1.2\",\"port\":26262}" + +``` diff --git a/docker-image/Dockerfile b/docker-image/Dockerfile index 770fb85..e882860 100644 --- a/docker-image/Dockerfile +++ b/docker-image/Dockerfile @@ -15,7 +15,7 @@ # # TODO: from race-compile:main once arm platform supported -FROM --platform=$TARGETPLATFORM ghcr.io/tst-race/race-images/race-compile:initial-image-setup as base +FROM --platform=$TARGETPLATFORM ghcr.io/tst-race/race-images/race-runtime-linux:main as base LABEL maintainer="Two Six Labs " ARG TARGETARCH @@ -33,6 +33,7 @@ FROM base as amd64-linux COPY racesdk/package/LINUX_x86_64/lib /linux/x86_64/lib RUN ln -s /linux/x86_64/lib/libraceboat.so /linux/x86_64/lib/libraceSdkCommon.so ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/linux/x86_64/lib" +COPY build/LINUX_x86_64/app/race-cli/race-cli /usr/local/bin/race-cli # preserve include structure assumed by go SWIG RUN mkdir -p /linux/x86_64/include/race/common @@ -43,8 +44,9 @@ COPY racesdk/package/LINUX_x86_64/go /usr/local/go # arm64 linux FROM base as arm64-linux COPY racesdk/package/LINUX_arm64-v8a/lib /linux/arm64-v8a/lib -ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/linux/arm64-v8a/lib" RUN ln -s /linux/arm64-v8a/lib/libraceboat.so /linux/arm64-v8a/lib/libraceSdkCommon.so +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/linux/arm64-v8a/lib" +COPY build/LINUX_arm64-v8a/app/race-cli/race-cli/ /usr/local/bin/race-cli # preserve include structure assumed by go SWIG RUN mkdir -p /linux/arm64-v8a/include/race/common diff --git a/source/FileSystem.cpp b/source/FileSystem.cpp index 54be4c4..9b2254f 100644 --- a/source/FileSystem.cpp +++ b/source/FileSystem.cpp @@ -170,8 +170,9 @@ std::vector FileSystem::listInstalledPluginDirs() { } fs::path FileSystem::makePluginInstallBasePath() { - fs::path basePath = - pluginsInstallPath / "plugins" / getHostOsType() / getHostArch(); + fs::path basePath = pluginsInstallPath; + // Previously: + // pluginsInstallPath / "plugins" / getHostOsType() / getHostArch(); createDirectories(basePath); return basePath; }