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

Add Larod #120

Draft
wants to merge 55 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
151cd8c
Add larod-sys crate
JsGjKJzi Oct 25, 2024
8d3defa
Add bindings.
JsGjKJzi Oct 25, 2024
709d58c
Drop back to ACAP SDK 1.3. Get larod crate fleshed out a little to do…
JsGjKJzi Oct 26, 2024
e158693
Swap back to x86_64
JsGjKJzi Oct 28, 2024
024e491
Start implementing LarodMap
JsGjKJzi Oct 28, 2024
56d3720
Implement get_string, get_int_arr2, get_int_arr4.
JsGjKJzi Oct 29, 2024
51e2518
Merge remote-tracking branch 'origin/main' into feature/larod
JsGjKJzi Oct 29, 2024
3d510b6
- Improved error handling to always deallocate a larodError object if…
JsGjKJzi Oct 30, 2024
3e004a0
Added builder pattern for LarodClient.
JsGjKJzi Oct 30, 2024
021ea65
Add log.
JsGjKJzi Oct 31, 2024
f9e0506
Start adding LarodDevice and Session
JsGjKJzi Oct 31, 2024
c05a0a1
Add remote testing
JsGjKJzi Nov 2, 2024
e0fa140
Hide on-device tests behind a device-tests feature
JsGjKJzi Nov 2, 2024
147e438
Inverted remote-test.sh check for CARGO_TEST_CAMERA definition
JsGjKJzi Nov 2, 2024
32db020
Update larod_sys/src/bindings.rs to match new enum style.
JsGjKJzi Nov 4, 2024
b3607bf
Change to EnumVariation::Rust as default bindgen enum style.
JsGjKJzi Nov 6, 2024
a5d62d5
Improve error handling and add documentation
JsGjKJzi Nov 6, 2024
4309ed6
Fix test failure due to renamed method.
JsGjKJzi Nov 6, 2024
de2367b
Remove note that is no longer needed.
JsGjKJzi Nov 6, 2024
1dc6896
Run executable is no camera.
JsGjKJzi Nov 6, 2024
55a7158
Explicitly tie the lifetime of LarodDevice to the lifetime of the Ses…
JsGjKJzi Nov 7, 2024
b294ca3
Don't copy larodDevice data from C to Rust, just provide access via f…
JsGjKJzi Nov 9, 2024
bdeda81
Unwrap result for test listing devices.
JsGjKJzi Nov 9, 2024
1eb3252
Make LarodDevice.get_name() and LarodDevice.get_instance() public.
JsGjKJzi Nov 9, 2024
7941c92
Align getters/setters with RFC344.
JsGjKJzi Nov 9, 2024
59b9ac5
Fix getter names missed in previous commit.
JsGjKJzi Nov 9, 2024
4373b18
Start stubbing LarodModel.
JsGjKJzi Nov 9, 2024
cdaf42b
Remove `bin` crate type from [[example]]
JsGjKJzi Nov 15, 2024
ff868cb
Stub out Tensor struct.
JsGjKJzi Nov 15, 2024
0382a94
Add LarodModel Trait
JsGjKJzi Dec 3, 2024
c03e898
Merge branch 'main' into feature/larod
JsGjKJzi Dec 3, 2024
300af7e
Explicitly use height and width parameters for setting sizes.
JsGjKJzi Dec 17, 2024
4b2f2cb
Implement Send and Sync for LarodError.
JsGjKJzi Dec 18, 2024
486757a
Rename LarodModel.start() to LarodModel.start_job().
JsGjKJzi Dec 18, 2024
714a8bd
Add env_logger as dev dependency for printing data during test.
JsGjKJzi Dec 18, 2024
60b770f
Merge branch 'main' into feature/larod
JsGjKJzi Dec 19, 2024
ec86ed3
Delete remote-test.sh in root directory.
JsGjKJzi Dec 19, 2024
2380e9c
Remove default build target.
JsGjKJzi Dec 19, 2024
c3a87f4
Implement iterating over `Tensors` pointed to by `LarodTensorContainer`.
JsGjKJzi Dec 19, 2024
ae1384c
Add compiler failure tests.
JsGjKJzi Dec 19, 2024
0eea902
Update larod basic example.
JsGjKJzi Dec 19, 2024
d6a0e22
Merge branch 'main' into feature/larod
JsGjKJzi Dec 31, 2024
63e4875
Clean up a few lints for unused results and imports.
JsGjKJzi Dec 31, 2024
9be7b76
Implement iterating over Tensors.
JsGjKJzi Dec 31, 2024
65de920
Update basic example for iterating over tensors.
JsGjKJzi Dec 31, 2024
682cb21
Add anyhow development dependency for basic example.
JsGjKJzi Dec 31, 2024
670fb23
Update cargo lock file for anyhow dependency.
JsGjKJzi Dec 31, 2024
845fadb
Implement ops::Deref for LarodTensorContainer<'a> for Target = [Tenso…
JsGjKJzi Jan 2, 2025
44e00d7
Implement ops::DerefMut for LarodTensorContainer<'a> for Target = [Te…
JsGjKJzi Jan 2, 2025
620808d
Add memory mapped buffer for Tensor.
JsGjKJzi Jan 2, 2025
fff440f
Use file, not self.buffer when setting buffer on Tensor.
JsGjKJzi Jan 2, 2025
9c96b53
Create model outputs.
JsGjKJzi Jan 2, 2025
295dfc8
Add JobRequest struct from larodCreateJobRequest.
JsGjKJzi Jan 2, 2025
90430cc
Add missing lifetime parameters.
JsGjKJzi Jan 7, 2025
6aa9c1e
Add InferenceModel job creation.
JsGjKJzi Jan 16, 2025
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
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build]
target = "aarch64-unknown-linux-gnu"

[target.aarch64-unknown-linux-gnu]
runner = ["/workspaces/acap-rs/remote-test.sh"]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ Important workflows are documented in the [Makefile](./Makefile) and can now be
Development environments outside containers are more difficult to reproduce and maintain.
Should it nonetheless be of interest, one procedure is documented in [this workflow](.github/workflows/on-host-workflow.yml).

## Testing
Some items in this workspace rely on libraries or hardware on Axis cameras. This makes testing difficult since these tests cannot run on an arbitrary x86_64 host. Below are some steps to enable running unit test on device.

1. Connect an Axis camera to your network and ensure it is accessible.
2. The user will likely need to be `root`, such that the Axis camera file system is writable.
3. Set the `CARGO_TEST_CAMERA` environment variable to the user and IP of the camera with the format `user@ip`
4. Set up an identity based SSH connection to the camera.
1. Create an ID via `ssh-keygen`
2. Copy the id to the device via `ssh-copy-id`

Now, via the [remote-test.sh](remote-test.sh) script, and the `runner = ["/workspaces/acap-rs/remote-test.sh"]` line in the .cargo/config.toml, tests with the `aarch64-unknown-linux-gnu` target triplet will automatically be copied to the remote camera and executed there. Run these tests via `cargo test --target aarch64-unknown-linux-gnu`.

If you want to run tests locally, just make sure you clear the `CARGO_TEST_CAMERA` environment variable via `unset CARGO_TEST_CAMERA`.

## Example applications

Below is the list of examples available in the repository.
Expand Down
10 changes: 10 additions & 0 deletions remote-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
set -e
if [[ -z "${CARGO_TEST_CAMERA}" ]]; then
apljungquist marked this conversation as resolved.
Show resolved Hide resolved
f=`basename $1`
scp "$1" $CARGO_TEST_CAMERA:.
# echo $f
ssh $CARGO_TEST_CAMERA "chmod +x /root/$f"
ssh $CARGO_TEST_CAMERA "/root/$f"
# ^ note: may need to change this line, see https://stackoverflow.com/q/9379400
apljungquist marked this conversation as resolved.
Show resolved Hide resolved
fi