Skip to content

Commit

Permalink
pipelines, actions scripts, display functions finished, need adapted …
Browse files Browse the repository at this point in the history
…into uils lib
  • Loading branch information
Ishaan-Datta committed Dec 5, 2024
1 parent f3f72cf commit dab4f80
Show file tree
Hide file tree
Showing 13 changed files with 230 additions and 347 deletions.
6 changes: 3 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
52 changes: 46 additions & 6 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# runs on any merge, verifies ros2 package can be built, tests run
name: Integration Pipeline
run-name: Integration pipeline triggered by ${{ github.actor }}

Expand All @@ -12,6 +13,7 @@ on:
required: false
type: boolean
default: true
# pull_request:

workflow_dispatch:
inputs:
Expand All @@ -27,11 +29,49 @@ on:
type: boolean

jobs:
inputs:
- name: Print inputs
run: |
echo ${{ github.event.inputs.delivery }}
echo ${{ inputs.delivery }}
echo ${{ github.event.inputs.deployment }}
echo ${{ inputs.deployment }}
build:
# build here
- name: Compile
run: |
source /opt/ros/humble/setup.bash
cd /ros2_ws
rosdep install --from-paths src -y --ignore-src
colcon build --event-handlers console_cohesion+ --symlink-install
test:
# test here
# needs [build]

# should just build the ros package on the container and maybe peform unit tests
# copy of the merge pipeline?
- name: Run tests
needs: build
run: |
source /opt/ros/humble/setup.bash
cd /ros2_ws
source install/setup.bash
colcon test --event-handlers console_cohesion+
colcon test-result --verbose
# should pipe into markdown and display report...

# These are only triggered through workflow dispatch
delivery:
if: ${{ github.event.inputs.delivery }}
steps:
- run: echo "this was detected successfully as a boolean (delivery)"
# uses: ./.github/workflows/delivery.yml
# with:
# branch: {{ github.head_ref }}
# deployment: {{ github.events.inputs.deployment }}

deployment:
if: ${{ inputs.deployment }}
steps:
- run: echo "this was detected successfully as boolean (deployment)"
# needs: delivery
# uses: ./.github/workflows/deployment.yml
# with:
# container_branch: {{ github.head_ref }}
# container_version: {{ needs.delivery.outputs.version }}
40 changes: 37 additions & 3 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Linting pipeline
run-name: Linting pipeline triggered by ${{ github.actor }}

on:
workflow_call:
Expand All @@ -11,9 +12,43 @@ jobs:
runs-on: self-hosted
id: python
steps:

- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Print branch
run: |
echo "Checked out branch: ${{ github.head_ref }}"
- name: Show directory contents
run: |
echo "Current directory: $(pwd)"
echo "Directory contents:"
ls -la
- name: List files in the repository
run: |
echo "github workspace folder"
ls ${{ github.workspace }}
- name: Check current directory
run: pwd

- name: List files in current directory
run: ls -la

- name: List root directory
run: ls -la /

- name: List runner's work directory
run: ls -la /home/runner/work

- name: List GitHub workspace directory
run: ls -la ${{ github.workspace }}

- name: Show environment variables
run: env

- name: Format Python Code with Black
run: |
Expand All @@ -26,7 +61,6 @@ jobs:
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

Expand Down
113 changes: 0 additions & 113 deletions .github/workflows/merge.yml

This file was deleted.

48 changes: 7 additions & 41 deletions .github/workflows/model-conversion.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
# Converts a model from PyTorch to ONNX/TensorRT format and runs unit tests
name: Model Conversion Pipeline

## unit/integration testing

## particularly for building/running the tensorRT engine on the jetson with setup

# same thing for running onnx runtime model


## save images and upload as an artifact from pipeline

## include detection confidence scores
run-name: Model conversion pipeline triggered by ${{ github.actor }}

## should trigger second pipeline after for performance testing

# save
# copy same logic from integration pipeline for claling nother workflow

on:
workflow_dispatch:
Expand All @@ -27,25 +17,17 @@ on:
required: true
type: choice
options:
- pytorch-to-trt
- tensorflow-to-trt
- onnx-to-trt
- pytorch-to-onnx-to-trt
- tensorflow-to-onnx-to-trt

# refine default args after argparse + successful testing
- pytorch-onnx
- pytorch-onnx-tensorrt

jobs:
# container
convert-model:
runs-on: self-hosted

strategy:
matrix:
conversion_type: [pytorch-to-trt, tensorflow-to-trt, onnx-to-trt, pytorch-to-onnx-to-trt, tensorflow-to-onnx-to-trt]

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run Conversion
run: |
Expand All @@ -54,22 +36,6 @@ jobs:
docker run --rm -v ${{ github.workspace }}:/workspace nvcr.io/nvidia/tensorrt:23.06-py3 \
bash -c "cd /workspace && python3 convert_pytorch_to_trt.py --model ${{ github.event.inputs.file_name }}"
;;
"tensorflow-to-trt")
docker run --rm -v ${{ github.workspace }}:/workspace nvcr.io/nvidia/tensorrt:23.06-py3 \
bash -c "cd /workspace && python3 convert_tensorflow_to_trt.py --model ${{ github.event.inputs.file_name }}"
;;
"onnx-to-trt")
docker run --rm -v ${{ github.workspace }}:/workspace nvcr.io/nvidia/tensorrt:23.06-py3 \
bash -c "cd /workspace && python3 convert_onnx_to_trt.py --model ${{ github.event.inputs.file_name }}"
;;
"pytorch-to-onnx-to-trt")
docker run --rm -v ${{ github.workspace }}:/workspace nvcr.io/nvidia/tensorrt:23.06-py3 \
bash -c "cd /workspace && python3 convert_pytorch_to_onnx_to_trt.py --model ${{ github.event.inputs.file_name }}"
;;
"tensorflow-to-onnx-to-trt")
docker run --rm -v ${{ github.workspace }}:/workspace nvcr.io/nvidia/tensorrt:23.06-py3 \
bash -c "cd /workspace && python3 convert_tensorflow_to_onnx_to_trt.py --model ${{ github.event.inputs.file_name }}"
;;
*)
echo "Invalid conversion type!"
exit 1
Expand Down
Loading

0 comments on commit dab4f80

Please sign in to comment.