Skip to content

Commit

Permalink
temp ros docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishaan-Datta committed Oct 16, 2024
1 parent 253712b commit 9b7b324
Show file tree
Hide file tree
Showing 217 changed files with 25,589 additions and 25,567 deletions.
180 changes: 90 additions & 90 deletions .github/workflows/delivery.yml
Original file line number Diff line number Diff line change
@@ -1,91 +1,91 @@
# Compiling code into container and uploading to repository
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

workflow_call:
outputs:
version:
description: "The latest docker image version"
value: ${{ jobs.build.outputs.container_version }}
inputs:
deployment:
required: true
default: true
type: boolean

workflow_dispatch:
inputs:
deployment:
description: 'Run unit and benchmarking tests?'
required: true
default: false
type: boolean

jobs:
build:
runs-on: self-hosted
outputs:
container_version: ${{ steps.get_next_version.outputs.version }}
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Retrieve Docker Hub tags and determine the next version
id: get_next_version
run: |
BRANCH_NAME="${{ github.ref_name }}"
IMAGE_PREFIX="jetson_ros:${BRANCH_NAME}-v"
TAGS=$(wget -q -O - "https://hub.docker.com/v2/namespaces/agrobotappliedai/repositories/jetsoncontainers-dev/tags?page_size=100" | grep -o '"name": *"[^"]*' | grep -o '[^"]*$')
VERSION_TAGS=$(echo "$TAGS" | grep -E "^${IMAGE_PREFIX}[0-9]+$" || true)
if [ -z "$VERSION_TAGS" ]; then
echo "No matching tags found, setting version to 1"
echo "version=1" >> $GITHUB_OUTPUT
else
MAX_VERSION=$(echo "$VERSION_TAGS" | sed -e "s/^${IMAGE_PREFIX}//" | sort -n | tail -1)
NEXT_VERSION=$((MAX_VERSION + 1))
echo "Found existing versions. Incrementing to version $NEXT_VERSION"
echo "version=$NEXT_VERSION" >> $GITHUB_OUTPUT
fi
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- run: echo ${{ steps.get_next_version.outputs.version }}
- name: Show directory contents
run: |
echo "Current directory: $(pwd)"
echo "Directory contents:"
tree
- name: List files in the repository
run: |
echo "github workspace folder"
ls ${{ github.workspace }}
- name: Build and push multi-platform Docker image
uses: docker/build-push-action@v6
with:
push: true
context: "{{defaultContext}}:Containers"
platforms: linux/arm64
file: ./Jetson.Dockerfile
network: host
build-args: BRANCH_NAME="${{ github.ref_name }}"
tags: |
"agrobotappliedai/jetson_ros:${{ github.ref_name }}-latest"
# Compiling code into container and uploading to repository
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

workflow_call:
outputs:
version:
description: "The latest docker image version"
value: ${{ jobs.build.outputs.container_version }}
inputs:
deployment:
required: true
default: true
type: boolean

workflow_dispatch:
inputs:
deployment:
description: 'Run unit and benchmarking tests?'
required: true
default: false
type: boolean

jobs:
build:
runs-on: self-hosted
outputs:
container_version: ${{ steps.get_next_version.outputs.version }}
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Retrieve Docker Hub tags and determine the next version
id: get_next_version
run: |
BRANCH_NAME="${{ github.ref_name }}"
IMAGE_PREFIX="jetson_ros:${BRANCH_NAME}-v"
TAGS=$(wget -q -O - "https://hub.docker.com/v2/namespaces/agrobotappliedai/repositories/jetsoncontainers-dev/tags?page_size=100" | grep -o '"name": *"[^"]*' | grep -o '[^"]*$')
VERSION_TAGS=$(echo "$TAGS" | grep -E "^${IMAGE_PREFIX}[0-9]+$" || true)
if [ -z "$VERSION_TAGS" ]; then
echo "No matching tags found, setting version to 1"
echo "version=1" >> $GITHUB_OUTPUT
else
MAX_VERSION=$(echo "$VERSION_TAGS" | sed -e "s/^${IMAGE_PREFIX}//" | sort -n | tail -1)
NEXT_VERSION=$((MAX_VERSION + 1))
echo "Found existing versions. Incrementing to version $NEXT_VERSION"
echo "version=$NEXT_VERSION" >> $GITHUB_OUTPUT
fi
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- run: echo ${{ steps.get_next_version.outputs.version }}
- name: Show directory contents
run: |
echo "Current directory: $(pwd)"
echo "Directory contents:"
tree
- name: List files in the repository
run: |
echo "github workspace folder"
ls ${{ github.workspace }}
- name: Build and push multi-platform Docker image
uses: docker/build-push-action@v6
with:
push: true
context: "{{defaultContext}}:Containers"
platforms: linux/arm64
file: ./Jetson.Dockerfile
network: host
build-args: BRANCH_NAME="${{ github.ref_name }}"
tags: |
"agrobotappliedai/jetson_ros:${{ github.ref_name }}-latest"
"agrobotappliedai/jetson_ros:${{ github.ref_name }}-v${{ steps.get_next_version.outputs.version }}"
186 changes: 93 additions & 93 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -1,94 +1,94 @@
# Runs unit tests and benchmarking inside the container
name: Deployment Pipeline
run-name: Deployment pipeline triggered by ${{ github.actor }}

on:
workflow_call:
inputs:
container_branch:
required: false
type: string
default: 'main'
container_version:
required: true
type: number

workflow_dispatch:
inputs:
container_branch:
description: 'What branch container would you like to run?'
required: true
type: string
container_version:
description: 'Which container version would you like to run?'
required: true
type: number

jobs:
image_filter:
runs-on: self-hosted
outputs:
image_tag: ${{ steps.set-tag.outputs.image_tag }}
steps:
- name: Set image tag
id: set-tag
run: |
CONTAINER_BRANCH=${{ github.event.inputs.container_branch }}
CONTAINER_VERSION=${{ github.event.inputs.container_version }}
IMAGE_TAG="jetson_ros:${CONTAINER_BRANCH}-v${CONTAINER_VERSION}"
echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
# testing:
# runs-on: self-hosted
# needs: image_filter
# container:
# image: ${needs.set-image-tag.outputs.image_tag}

# # directory managing here...
# steps:
# - name: Run unit tests
# run: ./deployment-scripts/unit_tests.sh > ./unit_test_results.txt

# - name: Generate unit test markdown report
# run: |
# echo "# Unit Test Results" > unit_test_report.md
# echo "\n\n## Results:" >> unit_test_report.md
# cat unit_test_results.txt >> unit_test_report.md

# - name: Upload unit test report artifact
# id: upload_artifact
# uses: actions/upload-artifact@v4
# with:
# name: '${github.event.inputs.container_branch}-${github.event.inputs.container_version}-unit-test-report-${github.run_number}'
# path: ./unit_test_report.md
# if-no-files-found: error

# - name: Run benchmarking tests
# run: ./deployment-scripts/benchmark.sh > ./benchmark_results.txt

# - name: Generate unit test markdown report
# run: |
# echo "# Benchmarking Results" > benchmark_report.md
# echo "\n\n## Results:" >> benchmark_report.md
# cat benchmark_results.txt >> benchmark_report.md

# - name: Upload unit test report artifact
# id: upload_artifact
# uses: actions/upload-artifact@v4
# with:
# name: '${github.event.inputs.container_branch}-${github.event.inputs.container_version}-benchmark-report-${github.run_number}'
# path: ./benchmark_report.md
# if-no-files-found: error

# - name: Output artifact URL
# run: |
# REPO_URL="https://github.com/${{ github.repository }}"
# ARTIFACT_URL="$REPO_URL/actions/runs/${{ github.run_id }}/artifacts"
# echo "Artifact URL: $ARTIFACT_URL"

# - name: Add reports to workflow summary
# if: always()
# run: |
# cat unit_test_report.md >> $GITHUB_STEP_SUMMARY
# echo "/n/n" >> $GITHUB_STEP_SUMMARY
# Runs unit tests and benchmarking inside the container
name: Deployment Pipeline
run-name: Deployment pipeline triggered by ${{ github.actor }}

on:
workflow_call:
inputs:
container_branch:
required: false
type: string
default: 'main'
container_version:
required: true
type: number

workflow_dispatch:
inputs:
container_branch:
description: 'What branch container would you like to run?'
required: true
type: string
container_version:
description: 'Which container version would you like to run?'
required: true
type: number

jobs:
image_filter:
runs-on: self-hosted
outputs:
image_tag: ${{ steps.set-tag.outputs.image_tag }}
steps:
- name: Set image tag
id: set-tag
run: |
CONTAINER_BRANCH=${{ github.event.inputs.container_branch }}
CONTAINER_VERSION=${{ github.event.inputs.container_version }}
IMAGE_TAG="jetson_ros:${CONTAINER_BRANCH}-v${CONTAINER_VERSION}"
echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
# testing:
# runs-on: self-hosted
# needs: image_filter
# container:
# image: ${needs.set-image-tag.outputs.image_tag}

# # directory managing here...
# steps:
# - name: Run unit tests
# run: ./deployment-scripts/unit_tests.sh > ./unit_test_results.txt

# - name: Generate unit test markdown report
# run: |
# echo "# Unit Test Results" > unit_test_report.md
# echo "\n\n## Results:" >> unit_test_report.md
# cat unit_test_results.txt >> unit_test_report.md

# - name: Upload unit test report artifact
# id: upload_artifact
# uses: actions/upload-artifact@v4
# with:
# name: '${github.event.inputs.container_branch}-${github.event.inputs.container_version}-unit-test-report-${github.run_number}'
# path: ./unit_test_report.md
# if-no-files-found: error

# - name: Run benchmarking tests
# run: ./deployment-scripts/benchmark.sh > ./benchmark_results.txt

# - name: Generate unit test markdown report
# run: |
# echo "# Benchmarking Results" > benchmark_report.md
# echo "\n\n## Results:" >> benchmark_report.md
# cat benchmark_results.txt >> benchmark_report.md

# - name: Upload unit test report artifact
# id: upload_artifact
# uses: actions/upload-artifact@v4
# with:
# name: '${github.event.inputs.container_branch}-${github.event.inputs.container_version}-benchmark-report-${github.run_number}'
# path: ./benchmark_report.md
# if-no-files-found: error

# - name: Output artifact URL
# run: |
# REPO_URL="https://github.com/${{ github.repository }}"
# ARTIFACT_URL="$REPO_URL/actions/runs/${{ github.run_id }}/artifacts"
# echo "Artifact URL: $ARTIFACT_URL"

# - name: Add reports to workflow summary
# if: always()
# run: |
# cat unit_test_report.md >> $GITHUB_STEP_SUMMARY
# echo "/n/n" >> $GITHUB_STEP_SUMMARY
# cat benchmark_report.md >> $GITHUB_STEP_SUMMARY
Loading

0 comments on commit 9b7b324

Please sign in to comment.