Skip to content

Commit

Permalink
Merge branch 'reversion' into 34-ros-package-repairs
Browse files Browse the repository at this point in the history
  • Loading branch information
vangeliq committed Dec 4, 2024
2 parents 0e9807b + 8f7f418 commit 97d73bc
Show file tree
Hide file tree
Showing 92 changed files with 1,780 additions and 4,082 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Jetson-Dev/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
"--ulimit=stack=67108864"
],
"postStartCommand": "bash -c 'echo source /opt/ros/humble/setup.bash >> ~/.bashrc && source /opt/ros/humble/setup.bash'"
}
}
39 changes: 39 additions & 0 deletions .devcontainer/Jetson-Runtime/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "Jetson Runtime Container",
"remoteUser": "root",
"image": "agrobotappliedai/jetsoncontainers-runtime:v1",
"customizations":{
"settings": {
"terminal.integrated.shell.linux": "bash"
}
},
"workspaceFolder": "/home/user/workspace",
"workspaceMount": "source=.,target=/home/user/workspace,type=bind,consistency=cached",
"mounts": [],
"runArgs": [
"--net=host",
"-it",
"--gpus=all",
"-e NVIDIA_DRIVER_CAPABILITIES=all",
"--ipc=host",
"--ulimit=memlock=-1",
"--ulimit=stack=67108864"
],
"postStartCommand": "bash -c 'source /opt/ros/humble/setup.bash'"
}

// {
// "containerEnv": {
// "DISPLAY": "unix:0",
// "ROS_LOCALHOST_ONLY": "1",
// "ROS_DOMAIN_ID": "42"
// },
// "runArgs": [
// "-e", "DISPLAY=${env:DISPLAY}"
// ],
// "mounts": [
// "source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached",
// "source=/dev/dri,target=/dev/dri,type=bind,consistency=cached"
// ],
// "postCreateCommand": "sudo rosdep update && sudo rosdep install --from-paths src --ignore-src -y && sudo chown -R $(whoami) /home/ws/"
// }
44 changes: 1 addition & 43 deletions .devcontainer/ROS/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,4 @@
"-it"
],
"postCreateCommand": "bash -c 'echo source /opt/ros/humble/setup.bash >> ~/.bashrc && source /opt/ros/humble/setup.bash'"
}

// {
// "name": "ROS 2 Development Container",
// "privileged": true,
// "remoteUser": "YOUR_USERNAME",
// "build": {
// "dockerfile": "Dockerfile",
// "args": {
// "USERNAME": "YOUR_USERNAME"
// }
// },
// "workspaceFolder": "/home/ws",
// "workspaceMount": "source=${localWorkspaceFolder},target=/home/ws,type=bind",
// "customizations": {
// "vscode": {
// "extensions":[
// "ms-vscode.cpptools",
// "ms-vscode.cpptools-themes",
// "twxs.cmake",
// "donjayamanne.python-extension-pack",
// "eamodio.gitlens",
// "ms-iot.vscode-ros"
// ]
// }
// },
// "containerEnv": {
// "DISPLAY": "unix:0",
// "ROS_LOCALHOST_ONLY": "1",
// "ROS_DOMAIN_ID": "42"
// },
// "runArgs": [
// "--net=host",
// "--pid=host",
// "--ipc=host",
// "-e", "DISPLAY=${env:DISPLAY}"
// ],
// "mounts": [
// "source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached",
// "source=/dev/dri,target=/dev/dri,type=bind,consistency=cached"
// ],
// "postCreateCommand": "sudo rosdep update && sudo rosdep install --from-paths src --ignore-src -y && sudo chown -R $(whoami) /home/ws/"
// }
}
7 changes: 4 additions & 3 deletions .github/workflows/delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Delivery Pipeline
run-name: Delivery pipeline triggered by ${{ github.actor }}

on:
push: # pushes to the main branch only occur if the merge request has been accepted
branches:
- main
# push: # pushes to the main branch only occur if the merge request has been accepted
# branches:
# - main

workflow_call:
outputs:
Expand Down Expand Up @@ -77,6 +77,7 @@ jobs:
echo "github workspace folder"
ls ${{ github.workspace }}
# other build args required?
- name: Build and push multi-platform Docker image
uses: docker/build-push-action@v6
with:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Deployment Pipeline
run-name: Deployment pipeline triggered by ${{ github.actor }}

on:
# push:
# branches:
# - main

workflow_call:
inputs:
container_branch:
Expand Down Expand Up @@ -38,6 +42,9 @@ jobs:
IMAGE_TAG="jetson_ros:${CONTAINER_BRANCH}-v${CONTAINER_VERSION}"
echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
# should verify flags for running th econtainer work
# using actions_scripts folder

# testing:
# runs-on: self-hosted
# needs: image_filter
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Integration Pipeline
run-name: Integration pipeline triggered by ${{ github.actor }}

on:
workflow_call:
inputs:
delivery:
required: false
type: boolean
default: true
deployment:
required: false
type: boolean
default: true

workflow_dispatch:
inputs:
delivery:
description: 'Would you like to update the official image?'
required: false
default: true
type: boolean
deployment:
description: 'Would you like to run unit and benchmarking tests?'
required: false
default: true
type: boolean

jobs:
build:
# build here
test:
# test here
# needs [build]

# should just build the ros package on the container and maybe peform unit tests
# copy of the merge pipeline?
117 changes: 65 additions & 52 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,73 @@
# Lints the code of a branch
name: Linting pipeline

on:
workflow_call:
# push:
# branches-ignore:
# - main

jobs:
lint-python:
runs-on: self-hosted
id: python
steps:

- name: Checkout Code
uses: actions/checkout@v3

- name: Format Python Code with Black
run: |
black .
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add .
git commit -m "Apply Black formatting" || echo "No changes to commit"
git push origin HEAD
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


# for main branch should verify the ros package gets built sucessfully, unit tests run
# for this, if the normal cpp format dont work with I() then use the ament_lint from ros

lint-cpp:
runs-on: self-hosted
permissions:
checks: write
pull-requests: write
id: cpp
steps:
- name: C++ lint
uses: cpp-linter/cpp-linter-action@v2
with:
style: "file"
tidy-checks: ""
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}
- name: Checkout Code
uses: actions/checkout@v3

lint-python:
runs-on: self-hosted
permissions:
checks: write
pull-requests: write
id: python
steps:
- name: Lint with pylint
run: |
pylint --disable=C0301 --disable=C0326 *.py
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Check for linting errors
id: lint-check
run: |
if [ -f lint-results.txt ]; then
echo "Linting issues found"
cat lint-results.txt
exit 1
else
echo "No linting issues found"
fi
update-pr:
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
if [[ $(git status --porcelain) ]]; then
# path agnostic ros2 colcon build
- name: Run Colcon build


- name: Locate and Run Clang-Tidy
run: |
COMPILE_COMMANDS_PATH=$(find build/ -name compile_commands.json | head -n 1)
if [ -z "$COMPILE_COMMANDS_PATH" ]; then
echo "Error: compile_commands.json not found!"
exit 1
fi
echo "Using compile_commands.json located at: $COMPILE_COMMANDS_PATH"
find src/ -name "*.cpp" | xargs clang-tidy --fix --fix-errors -p $(dirname $COMPILE_COMMANDS_PATH)
# Format C++ files with clang-format
- name: Auto-fix C++ Formatting Issues
run: |
find . -name '*.cpp' -o -name '*.hpp' | xargs clang-format -i
- name: Commit and Push Changes
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add .
git commit -m "Auto-fix lint issues"
git push origin HEAD:${{ github.head_ref }}
else
echo "No lint fixes applied, nothing to commit."
fi
git commit -m "Auto-format code with clang-tidy/clang-format" || echo "No changes to commit"
git push origin HEAD
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# bug checks
# compilation
Expand All @@ -70,4 +77,10 @@ jobs:
# Ament_xmllint
# Black
# Clang-tidy
# Isort
# Isort

# flake8 --fix or autopep8 --in-place --aggressive --aggressive
# git config --global user.email "[email protected]"
# how to run inside container, need to make linting/formatting container w/ git, python, etc.
# git config --global user.name "github-actions"
# git config --global user.email "[email protected]"
2 changes: 1 addition & 1 deletion .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Integration pipeline
run-name: Integration pipeline triggered by ${{ github.actor }}

on:
pull_request:
# pull_request:

workflow_dispatch:
inputs:
Expand Down
Loading

0 comments on commit 97d73bc

Please sign in to comment.