Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/build-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
echo "USER_UID=$(id -u)" >> .env
echo "USER_GID=$(id -g)" >> .env

- name: Build and run Docker container
- name: Build Docker image
run: ./docker-build.sh --github-action

- name: Run Docker container
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/publish-foxglove-extensions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: publish-foxglove-extensions

on:
push:
branches:
- main

concurrency:
group: publish-foxglove-extensions
cancel-in-progress: true

jobs:
publish-foxglove-extensions:
name: Publish Foxglove extensions
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create .env file
run: |
echo "ENABLE_GIT=false" >> .env
echo "USER_UID=$(id -u)" >> .env
echo "USER_GID=$(id -g)" >> .env

- name: Build Docker image
run: ./docker-build.sh --github-action

- name: Run Docker container
id: run-docker
run: docker compose up -d

- name: Build Foxglove environment
if: steps.run-docker.outcome == 'success'
run: |
docker compose exec robosub-ros2 bash /home/ubuntu/robosub-ros2/.github/workflows/build-foxglove.sh

- name: Configure Foxglove authentication
if: steps.run-docker.outcome == 'success'
env:
FOXGLOVE_API_KEY: ${{ secrets.FOXGLOVE_API_KEY }}
run: |
docker compose exec -T robosub-ros2 bash -c "printf 'auth_type: 2\nbase_url: https://api.foxglove.dev\nbearer_token: %s\n' \"${FOXGLOVE_API_KEY}\" > /home/ubuntu/.foxgloverc"

- name: Publish Foxglove extensions
if: steps.run-docker.outcome == 'success'
run: |
docker compose exec -T robosub-ros2 bash /home/ubuntu/robosub-ros2/.github/workflows/publish-foxglove.sh

- name: Stop Docker container
if: always() && steps.run-docker.outcome == 'success'
run: docker compose down
9 changes: 9 additions & 0 deletions .github/workflows/publish-foxglove.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# shellcheck disable=SC1091
# This script is used by GitHub Actions to publish all custom Foxglove extensions

set -e

source /home/ubuntu/ros_bashrc.sh

/home/ubuntu/venv/bin/python3 /home/ubuntu/robosub-ros2/foxglove/foxglove.py publish --github-action
7 changes: 3 additions & 4 deletions foxglove/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ fox publish [extensions ...]
- `extensions`: A list of extensions to publish. If no extensions are given, all extensions are published.
- `-v, --version`: Version to publish extensions under. If no version is given, the short (length 7) HEAD commit hash is used. A version is required if the `robosub-ros2` git reposititory is dirty.
- `-f, --force`: Publish extensions even if the repository is dirty.
- `--github-action`: Append `-prod` to the publish version (to avoid version collisions).

#### Clean
To clean up the Foxglove monorepo, run:
Expand Down Expand Up @@ -144,9 +145,7 @@ This command will exit with a non-zero status if any potential problems are foun

## Monorepo Structure
### Extensions
- [`call-service-panel`](extensions/call-service-panel/README.md) - Example panel to call services
- [`publish-topic-panel`](extensions/publish-topic-panel/README.md) - Example panel to publish topics
- [`subscribe-topic-panel`](extensions/subscribe-topic-panel/README.md) - Example panel to subscribe to topics
- [`publish-topic-panel`](extensions/publish-topic-panel/README.md) - Panel to publish topics
- [`toggle-controls-panel`](extensions/toggle-controls-panel/README.md) - Panel to toggle controls on/off
- [`system-status-panel`](extensions/system-status-panel/README.md) - Panel that displays system usage of the onboard computer
- [`sensors-status-panel`](extensions/sensors-status-panel/README.md) - Panel that displays the connected/disconnected status of sensors
Expand Down Expand Up @@ -181,7 +180,7 @@ Running `fox build` will automatically apply these patches.

## Contributing
### Adding a New Extension
Copy an existing Duke Robotics example extension (`call-service-panel`, `publish-topic-panel`, or `subscribe-topic-panel`) as a starting point. This ensures that all of our extensions have the same code structure and use the same core set of dependencies.
Copy an existing Duke Robotics extension as a starting point. This ensures that all of our extensions have the same code structure and use the same core set of dependencies.

### Adding a New Local Dependency
All local dependencies must expose an `npm run build` command in `package.json`. During build, `foxglove.py` will compile each local dependency to `node_modules` where they can be consumed by an extension.
Expand Down
22 changes: 0 additions & 22 deletions foxglove/extensions/call-service-panel/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions foxglove/extensions/call-service-panel/package.json

This file was deleted.

168 changes: 0 additions & 168 deletions foxglove/extensions/call-service-panel/src/CallServicePanel.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions foxglove/extensions/call-service-panel/src/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions foxglove/extensions/call-service-panel/tsconfig.json

This file was deleted.

Loading
Loading