Skip to content

Commit c187f5f

Browse files
committed
Merge branch 'main' into baseline_solution
2 parents 7c95b2a + 424dd60 commit c187f5f

File tree

12 files changed

+880
-27
lines changed

12 files changed

+880
-27
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
load: true
3232
push: true
3333
tags: ghcr.io/opencv/bpc/bpc_pose_estimator:example
34+
cache-from: type=gha
35+
cache-to: type=gha,mode=max
3436
-
3537
name: Build tester
3638
uses: docker/build-push-action@v6
@@ -39,3 +41,5 @@ jobs:
3941
load: true
4042
push: true
4143
tags: ghcr.io/opencv/bpc/bpc_tester:latest
44+
cache-from: type=gha
45+
cache-to: type=gha,mode=max

.github/workflows/style.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: style
22
on:
33
pull_request:
44
push:
5-
branches: [ main ]
65
defaults:
76
run:
87
shell: bash

.github/workflows/test.yaml

Lines changed: 99 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,36 @@ name: Basic CI
22
on: [push]
33

44
jobs:
5-
basic_ci:
6-
name: Basic CI
5+
ipd_fetch:
6+
name: Fetch ipd dataset
7+
runs-on: ubuntu-latest
8+
timeout-minutes: 30
9+
steps:
10+
-
11+
name: Checkout
12+
uses: actions/checkout@v4
13+
-
14+
name: Build ibpc_py
15+
run: |
16+
cd ibpc_py
17+
python -m pip install -e .
18+
- name: Check space
19+
run: |
20+
df -h
21+
-
22+
name: Run bpc fetch
23+
run: |
24+
bpc fetch ipd --remove-zip-after-extract
25+
df -h
26+
-
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: ipd-dataset
30+
path: ipd
31+
32+
local_build:
33+
name: Test Local Build
34+
needs: ipd_fetch
735
runs-on: ubuntu-latest
836
timeout-minutes: 30
937
steps:
@@ -39,13 +67,17 @@ jobs:
3967
file: Dockerfile.estimator
4068
load: true
4169
tags: pose_estimator:latest
70+
cache-from: type=gha
71+
cache-to: type=gha,mode=max
4272
-
4373
name: Build tester
4474
uses: docker/build-push-action@v6
4575
with:
4676
file: Dockerfile.tester
4777
load: true
4878
tags: estimator-tester:latest
79+
cache-from: type=gha
80+
cache-to: type=gha,mode=max
4981
-
5082
name: Build ibpc_py
5183
run: |
@@ -55,13 +87,14 @@ jobs:
5587
run: |
5688
df -h
5789
docker images
90+
- uses: actions/download-artifact@v4
91+
with:
92+
name: ipd-dataset
93+
path: ipd
94+
- name: Display structure of downloaded files
95+
run: ls -lR
5896
-
59-
name: Run bpc fetch
60-
run: |
61-
bpc fetch ipd --remove-zip-after-extract
62-
df -h
63-
-
64-
name: Run bpc test
97+
name: Run bpc test local build
6598
continue-on-error: true
6699
run: |
67100
bpc test pose_estimator:latest ipd --tester-image estimator-tester:latest --no-gpu
@@ -70,12 +103,67 @@ jobs:
70103
run: |
71104
df -h
72105
-
73-
name: Check results
106+
name: Check results exist
107+
run: |
108+
cat ibpc_test_output.log
109+
cat ibpc_zenoh_output.log
110+
cat submission.csv
111+
public_image:
112+
name: Test Public Image
113+
needs: ipd_fetch
114+
runs-on: ubuntu-latest
115+
timeout-minutes: 30
116+
steps:
117+
-
118+
name: Remove unused content for disk space
119+
shell: bash
120+
run: |
121+
df -h
122+
sudo rm -rf /usr/share/dotnet
123+
sudo rm -rf /usr/local/lib/android
124+
sudo rm -rf /opt/ghc
125+
sudo rm -rf /opt/hostedtoolcache/CodeQL
126+
sudo docker image prune --all --force
127+
sudo docker builder prune -a
128+
df -h
129+
-
130+
name: Checkout
131+
uses: actions/checkout@v4
132+
-
133+
name: Set up Docker Buildx
134+
uses: docker/setup-buildx-action@v3
135+
# -
136+
# name: Login to GitHub Container Registry
137+
# uses: docker/login-action@v3
138+
# with:
139+
# registry: ghcr.io
140+
# username: ${{ github.actor }}
141+
# password: ${{ secrets.GITHUB_TOKEN }}
142+
-
143+
name: Build ibpc_py
144+
run: |
145+
cd ibpc_py
146+
python -m pip install -e .
147+
- name: Check space
148+
run: |
149+
df -h
150+
docker images
151+
- uses: actions/download-artifact@v4
152+
with:
153+
name: ipd-dataset
154+
path: ipd
155+
- name: Display structure of downloaded files
156+
run: ls -lR
157+
-
158+
name: Run bpc test public build
159+
continue-on-error: true
160+
run: |
161+
bpc test ghcr.io/opencv/bpc/bpc_pose_estimator:example ipd
162+
-
163+
name: Check results exist
74164
run: |
75165
cat ibpc_test_output.log
76166
cat ibpc_zenoh_output.log
77167
cat submission.csv
78-
79-
#TODO(tfoote) Also add tests for public images
80168
81169

Dockerfile.estimator

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,8 @@ RUN pip install -r requirements.txt --break-system-packages
6464
ARG SERVICE_PACKAGE=ibpc_pose_estimator_py
6565
ARG SERVICE_EXECUTABLE_NAME=ibpc_pose_estimator
6666

67-
RUN apt update \
68-
&& sudo apt install curl -y \
69-
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
70-
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2-testing/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
71-
7267
RUN apt-get update \
68+
&& apt upgrade -y \
7369
&& apt install -y ros-jazzy-rmw-zenoh-cpp python3-imageio python3-png python3-pip python3-scipy \
7470
&& rm -rf /var/lib/apt/lists/*
7571

Dockerfile.tester

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,8 @@ RUN . /opt/ros/jazzy/setup.sh \
4141
# result stage: base + copied install folders from the overlay + service setup.
4242
FROM base
4343

44-
RUN apt update \
45-
&& sudo apt install curl -y \
46-
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
47-
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2-testing/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
48-
4944
RUN apt-get update \
45+
&& apt upgrade -y \
5046
&& apt install -y ros-jazzy-rmw-zenoh-cpp python3-imageio python3-pandas python3-png python3-pip python3-scipy \
5147
&& rm -rf /var/lib/apt/lists/*
5248

flowstate/services/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bpc_pose_estimator.tar
2+
bpc_pose_estimator.bundle.tar
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Use the bpc pose estimator image as the base image.
2+
ARG BASE_IMAGE=bpc_pose_estimator:example
3+
4+
FROM ${BASE_IMAGE}
5+
6+
# Copy the zenoh config file.
7+
# TODO(Yadunund): Switch to ZENOH_CONFIG_OVERRIDE after the next jazzy sync.
8+
COPY zenoh_config.json5 /opt/zenoh_config.json5
9+
10+
# Set environment variables
11+
ENV ZENOH_SESSION_CONFIG_URI=/opt/zenoh_config.json5
12+
ENV ZENOH_ROUTER_CHECK_ATTEMPTS=5
13+
# (Optional) If you need to override the entrypoint or command, do it here.
14+
# For example:
15+
# ENTRYPOINT ["/your/new/entrypoint.sh"]
16+
# CMD ["your", "new", "command"]

flowstate/services/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## Flowstate Service
2+
3+
The Pose Estimators developed can be run as a service on [Intrinsic Flowstate](https://www.intrinsic.ai/) solutions to build applications with robotic systems.
4+
5+
First, build another Docker image that wraps the pose estimator Docker image generated [previously](../README.md#build-and-test-custom-bpc_pose_estimator-image) with some environment variables to communicate with the Intrinsic Platform.
6+
7+
```bash
8+
# Replace POSE_ESTIMATOR_DOCKER_TAG with tag of the pose estimator image generated previously.
9+
# Replace "bpc_pose_estimator_fs:team_name" with a different tag if needed.
10+
cd ~/bpc_ws/bpc/flowstate
11+
docker buildx build -t bpc_pose_estimator_fs:team_name \
12+
--file Dockerfile.service \
13+
--build-arg BASE_IMAGE=<POSE_ESTIMATOR_DOCKER_TAG> \
14+
.
15+
16+
```
17+
18+
Next, save this Docker image locally. Note, the name of the output file must remain `bpc_pose_estimator.tar`.
19+
20+
```bash
21+
docker save bpc_pose_estimator_fs:example -o bpc_pose_estimator.tar
22+
23+
```
24+
25+
Then build a Flowstate Service bundle.
26+
27+
```bash
28+
cd ~/
29+
git clone https://github.com/intrinsic-ai/sdk.git
30+
cd sdk
31+
bazel run //intrinsic/tools/inbuild -- service bundle \
32+
--manifest ~/bpc_ws/src/bpc/services/flowstate/bpc_pose_estimator.manifest.textproto \
33+
--oci_image ~/bpc_ws/src/bpc/services/flowstate/bpc_pose_estimator.tar \
34+
--output ~/bpc_ws/src/bpc/services/flowstate/bpc_pose_estimator.bundle.tar
35+
```
36+
37+
Finally install the Service in a running solution.
38+
39+
```bash
40+
bazel run //intrinsic/tools/inctl -- service install ~/bpc_ws/src/bpc/services/flowstate/bpc_pose_estimator.bundle.tar \
41+
--cluster CLUSTER_ID \
42+
--org ORG \
43+
--registry REGISTRY \
44+
--skip_direct_upload
45+
```
46+
47+
To uninstall the Service,
48+
49+
```bash
50+
bazel run //intrinsic/tools/inctl -- service uninstall ai.intrinsic.bpc_pose_estimator \
51+
--solution SOLUTION_ID \
52+
--org ORG
53+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
metadata {
2+
id {
3+
package: "ai.intrinsic"
4+
name: "bpc_pose_estimator"
5+
}
6+
vendor {
7+
display_name: "Intrinsic"
8+
}
9+
documentation {
10+
description: "A 6D pose estimator for objects in the BPC challenge."
11+
}
12+
display_name: "BPC Pose Estimator"
13+
}
14+
service_def {
15+
real_spec {
16+
image {
17+
archive_filename: "bpc_pose_estimator.tar"
18+
}
19+
}
20+
sim_spec {
21+
image {
22+
archive_filename: "bpc_pose_estimator.tar"
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)