Skip to content

Commit

Permalink
Merge pull request #10 from sonia-auv/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
supertoto29 authored Aug 25, 2022
2 parents 9358cb2 + 4a82e2c commit d023c84
Show file tree
Hide file tree
Showing 17 changed files with 504 additions and 55 deletions.
30 changes: 30 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.128.0/containers/docker-existing-dockerfile
{
"name": "provider_system",
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile",
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "bash"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-iot.vscode-ros"
],
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined",
"--rm",
"--network",
"host"
],
"mounts": [
"source=vscode-server-extension,target=/home/sonia/.vscode-server/extensions,type=volume"
],
"workspaceMount": "target=/home/sonia/ros_sonia_ws/src/provider_system,type=volume",
"workspaceFolder": "/home/sonia/ros_sonia_ws/src/provider_system"
}
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
devel
16 changes: 7 additions & 9 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
blank_issues_enabled: false
# TODO: enter appropriate contacts
"""

contact_links:
- name: GitHub Community Forum
url: https://git.luolix.topmunity/
about: Please ask and answer questions here.
- name: GitHub Security Bug Bounty
url: https://bounty.github.com/
about: Please report security vulnerabilities here.
"""
- name: SONIA AUV official documentation
url: https://wiki.sonia.etsmtl.ca/
about: Visit our documentation for more information.
- name: SONIA AUV website
url: https://sonia.etsmtl.ca/
about: Visit our website and feel free to ask any questions.
103 changes: 103 additions & 0 deletions .github/workflows/docker-image-perception-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Docker Image CI - Develop Branch

on:
push:
branches: [develop]

jobs:
build-ros-perception-x86-64:
name: "Build ROS perception X86/64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:x86-perception-latest"
ARCH: x86
TARGET_TYPE: perception
TARGET_VERSION: develop
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Build the docker image (perception based)
run: |
docker build . --tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE}
- name: Run Module Unit Test
run: |
docker run build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} catkin_make run_tests
docker run build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} catkin_make tests
- name: Create Docker Image Tag
run: |
docker tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-${TARGET_VERSION}
- name: Push Image to Github Packages Registry
run: |
docker push --all-tags ${GITHUB_REMOTE_URL}/${IMAGE_NAME}
build-ros-perception-arm64:
name: "Build ROS perception ARM64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:arm64-perception-latest"
ARCH: arm64
TARGET_TYPE: perception
TARGET_VERSION: develop
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Enable Docker Daemon Experimental Features
run: |
sudo rm /etc/docker/daemon.json
echo '{"experimental": true , "cgroup-parent": "/actions_job" }' | sudo tee -a /etc/docker/daemon.json
sudo service docker restart
docker version
- name: Install QEMU to be able to compile on X86 into ARM64
run: |
sudo apt-get update
sudo apt-get install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build the docker image (perception based)
run: |
docker build . --tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE}
- name: Run Module Unit Test
run: |
docker run build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} catkin_make run_tests
docker run build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} catkin_make tests
- name: Create Docker Image Tag
run: |
docker tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-${TARGET_VERSION}
- name: Push Image to Github Packages Registry
run: |
docker push --all-tags ${GITHUB_REMOTE_URL}/${IMAGE_NAME}
notify-success:
name: "Notify Slack - Success"
runs-on: ubuntu-latest
needs: [build-ros-perception-x86-64, build-ros-perception-arm64]
if: success()
steps:
- name: Notify Slack Success
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: github-ci-notifications
status: SUCCESS
color: good

notify-fail:
name: "Notify Slack - Failure"
runs-on: ubuntu-latest
needs: [build-ros-perception-x86-64, build-ros-perception-arm64]
if: failure()
steps:
- name: Notify Slack Fail
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: github-ci-notifications
status: FAILED
color: dange
95 changes: 95 additions & 0 deletions .github/workflows/docker-image-perception-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Docker Image CI - Feature Branch

on:
push:
branches: [feature/**]

jobs:
build-ros-perception-x86-64:
name: "Build ROS perception X86/64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:x86-perception-latest"
ARCH: x86
TARGET_TYPE: perception
TARGET_VERSION: feature
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Build the docker image (perception based)
run: |
docker build . --tag build-feature-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE}
- name: Create Docker Image Tag
run: |
docker tag build-feature-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-${TARGET_VERSION}-${GITHUB_REF##*/}
- name: Push Image to Github Packages Registry
run: |
docker push --all-tags ${GITHUB_REMOTE_URL}/${IMAGE_NAME}
build-ros-perception-arm64:
name: "Build ROS perception ARM64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:arm64-perception-latest"
ARCH: arm64
TARGET_TYPE: perception
TARGET_VERSION: feature
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Enable Docker Daemon Experimental Features
run: |
sudo rm /etc/docker/daemon.json
echo '{"experimental": true , "cgroup-parent": "/actions_job" }' | sudo tee -a /etc/docker/daemon.json
sudo service docker restart
docker version
- name: Install QEMU to be able to compile on X86 into ARM64
run: |
sudo apt-get update
sudo apt-get install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build the docker image (perception based)
run: |
docker build . --tag build-feature-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE}
- name: Create Docker Image Tag
run: |
docker tag build-feature-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-${TARGET_VERSION}-${GITHUB_REF##*/}
- name: Push Image to Github Packages Registry
run: |
docker push --all-tags ${GITHUB_REMOTE_URL}/${IMAGE_NAME}
notify-success:
name: "Notify Slack - Success"
runs-on: ubuntu-latest
needs: [build-ros-perception-x86-64, build-ros-perception-arm64]
if: success()
steps:
- name: Notify Slack Success
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: github-ci-notifications
status: SUCCESS
color: good

notify-fail:
name: "Notify Slack - Failure"
runs-on: ubuntu-latest
needs: [build-ros-perception-x86-64, build-ros-perception-arm64]
if: failure()
steps:
- name: Notify Slack Fail
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: github-ci-notifications
status: FAILED
color: danger
135 changes: 135 additions & 0 deletions .github/workflows/docker-image-perception-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Docker Image CI - Master Branch

on:
push:
branches: [master]

jobs:
build-ros-perception-x86-64:
name: "Build ROS perception X86/64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:x86-perception-latest"
ARCH: x86
TARGET_TYPE: perception
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Set Target version
run: echo "TARGET_VERSION=release-$(sed -n -e 's/.*<version>\(.*\)<\/version>.*/\1/p' package.xml)" >> $GITHUB_ENV

- name: Build the docker image (perception based)
run: |
docker build . --tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date '+%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE}
- name: Run Module Unit Test
run: |
docker run build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} catkin_make run_tests
docker run build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} catkin_make tests
- name: Create Docker Image Tag
run: |
docker tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-${TARGET_VERSION}
docker tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-latest
docker tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:latest
- name: Push Image to Github Packages Registry
run: |
docker push --all-tags ${GITHUB_REMOTE_URL}/${IMAGE_NAME}
build-ros-perception-arm64:
name: "Build ROS perception ARM64"
runs-on: ubuntu-latest
env:
BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:arm64-perception-latest"
ARCH: arm64
TARGET_TYPE: perception
IMAGE_NAME: provider_system
GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Login to Github Package Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Set Target version
run: echo "TARGET_VERSION=release-$(sed -n -e 's/.*<version>\(.*\)<\/version>.*/\1/p' package.xml)" >> $GITHUB_ENV

- name: Enable Docker Daemon Experimental Features
run: |
sudo rm /etc/docker/daemon.json
echo '{"experimental": true , "cgroup-parent": "/actions_job" }' | sudo tee -a /etc/docker/daemon.json
sudo service docker restart
docker version
- name: Install QEMU to be able to compile on X86 into ARM64
run: |
sudo apt-get update
sudo apt-get install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build the docker image (perception based)
run: |
docker build . --tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE}
- name: Run Module Unit Test
run: |
docker run build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} catkin_make run_tests
docker run build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} catkin_make tests
- name: Create Docker Image Tag
run: |
docker tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-${TARGET_VERSION}
docker tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-latest
- name: Push Image to Github Packages Registry
run: |
docker push --all-tags ${GITHUB_REMOTE_URL}/${IMAGE_NAME}
create-release:
name: "Create Github Release"
runs-on: ubuntu-latest
needs: [build-ros-perception-x86-64, build-ros-perception-arm64]
steps:
- uses: actions/checkout@v2
- name: Set Target version
run: echo "TARGET_VERSION=release-$(sed -n -e 's/.*<version>\(.*\)<\/version>.*/\1/p' package.xml)" >> $GITHUB_ENV

- name: Create Git Tag
run: |
git tag ${TARGET_VERSION}
git push origin --tags
- name: Create Github Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TARGET_VERSION }}
release_name: Release ${{ env.TARGET_VERSION }}
body: |
A new release for this package has been created
draft: false
prerelease: false

notify-success:
name: "Notify Slack - Success"
runs-on: ubuntu-latest
needs: [build-ros-perception-x86-64, build-ros-perception-arm64, create-release]
if: success()
steps:
- name: Notify Slack Success
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: github-ci-notifications
status: SUCCESS
color: good

notify-fail:
name: "Notify Slack - Failure"
runs-on: ubuntu-latest
needs: [build-ros-perception-x86-64, build-ros-perception-arm64, create-release]
if: failure()
steps:
- name: Notify Slack Fail
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: github-ci-notifications
status: FAILED
color: danger
Loading

0 comments on commit d023c84

Please sign in to comment.