Skip to content

Commit

Permalink
Merge pull request #3 from sonia-auv/develop
Browse files Browse the repository at this point in the history
Merge to develop
  • Loading branch information
gauthiermartin authored Jul 31, 2020
2 parents 6e89144 + e42323f commit 378d226
Show file tree
Hide file tree
Showing 20 changed files with 681 additions and 144 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_imu",
// 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_imu,type=volume",
"workspaceFolder": "/home/sonia/ros_sonia_ws/src/provider_imu"
}
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
devel
113 changes: 113 additions & 0 deletions .github/workflows/docker-image-perception-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
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_imu
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 ${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_imu
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 ${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
103 changes: 103 additions & 0 deletions .github/workflows/docker-image-perception-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
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_imu
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 ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-${TARGET_VERSION}-${GITHUB_REF##*/}
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_imu
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 ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-${TARGET_VERSION}-${GITHUB_REF##*/}
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
146 changes: 146 additions & 0 deletions .github/workflows/docker-image-perception-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
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_imu
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 '::set-env name=TARGET_VERSION::release-'$(sed -n -e 's/.*<version>\(.*\)<\/version>.*/\1/p' package.xml)

- 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 ${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_imu
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 '::set-env name=TARGET_VERSION::release-'$(sed -n -e 's/.*<version>\(.*\)<\/version>.*/\1/p' package.xml)

- 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 ${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 '::set-env name=TARGET_VERSION::'$(sed -n -e 's/.*<version>\(.*\)<\/version>.*/\1/p' package.xml)

- 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 378d226

Please sign in to comment.