Skip to content

Commit

Permalink
Merge pull request #4 from Ahelsamahy/GH-tests
Browse files Browse the repository at this point in the history
GitHub actions
  • Loading branch information
bernase authored Oct 26, 2023
2 parents b813459 + d2497f0 commit 7f1d4d1
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 76 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Comment Check
name: Check comments percentage

on:
push:
branches:
- main
pull_request:
branches:
- main
- '*'

jobs:
build:
Expand All @@ -16,6 +14,9 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Give execute permission for script
run: chmod +x ./.github/workflows/check_comments.sh

- name: Check comment percentage
run: |
./.github/workflows/check_comments.sh
44 changes: 44 additions & 0 deletions .github/workflows/docker-compose-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Docker Compose Test

on:
push:
branches:
- main
- '*'

jobs:
Test_Nano_Docker:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v2
# Exculding inference because it needs .oonx and .ini files, which are private
# Add docker-compose.override.yml to overcome CPU higher than 1 in pilot service
- name: Docker compose build (root without inference)
run: docker-compose -f docker-compose.yml -f docker-compose.override.yml build $(docker-compose -f docker-compose.yml -f docker-compose.override.yml config --services | grep -v inference)

# Make sure it would run good for at least 30 seconds
- name: Docker compose up (root without inference)
run: |
docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d $(docker-compose -f docker-compose.yml -f docker-compose.override.yml config --services | grep -v inference)
sleep 30
docker-compose -f docker-compose.yml -f docker-compose.override.yml down

Test_Pi_Docker:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v2
# Build the Docker services: This validates the build process and catches issues related to the Dockerfile and dependencies.
- name: Docker compose build (raspi)
run: docker-compose -f raspi/docker-compose.yml build

# Run (up): Ensures that the application behaves correctly in a containerized environment.
- name: Docker compose up (raspi)
run: |
docker-compose -f raspi/docker-compose.yml up -d
sleep 30
docker-compose -f raspi/docker-compose.yml down
34 changes: 34 additions & 0 deletions .github/workflows/python-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Python CI

on:
push:
branches:
- main
- '*'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black
- name: Check code formatting with Black on changed files
run: |
FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '\.py$' | xargs)
if [ ! -z "$FILES" ]; then
# Check the formatting of those files with black
black --check $FILES
else
echo "No Python files have changed."
fi
5 changes: 5 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: '3' # or whatever version you're using

services:
pilot:
cpuset: '' # Clearing the CPU set constraint for testing
72 changes: 24 additions & 48 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "2"
version: '2'
volumes:
volume_zerotier_config:
volume_wireguard_config:
Expand All @@ -10,76 +10,76 @@ volumes:
volume_byodr_sessions:
services:
zerotier:
cpuset: "0"
cpuset: '0'
image: zyclonite/zerotier:1.6.6
restart: always
network_mode: host
devices:
- "/dev/net/tun"
- '/dev/net/tun'
cap_add:
- SYS_ADMIN
- NET_ADMIN
- CAP_SYS_RAWIO
volumes:
- volume_zerotier_config:/var/lib/zerotier-one:rw
wireguard:
cpuset: "0"
cpuset: '0'
image: masipcat/wireguard-go
container_name: wireguard
restart: always
network_mode: host
devices:
- "/dev/net/tun"
- '/dev/net/tun'
cap_add:
- SYS_ADMIN
- NET_ADMIN
- CAP_SYS_RAWIO
volumes:
- volume_wireguard_config:/etc/wireguard:rw
httpd:
cpuset: "0"
cpuset: '0'
build:
context: .
dockerfile: httpd/Dockerfile
restart: always
network_mode: host
command: ["python", "wrap.py"]
command: ['python', 'wrap.py']
stop_signal: SIGKILL
volumes:
- volume_byodr_config:/config:rw
ftpd:
cpuset: "0"
cpuset: '0'
build:
context: .
dockerfile: ftpd/Dockerfile
restart: always
command: ["python3", "wrap.py"]
command: ['python3', 'wrap.py']
stop_signal: SIGKILL
ports:
- "21:21"
- "30000-30009:30000-30009"
- '21:21'
- '30000-30009:30000-30009'
volumes:
- volume_ftpd_config:/etc/pureftpd:rw
- volume_byodr_sessions:/home/ftpuser:rw
rosnode:
cpuset: "0"
cpuset: '0'
build:
context: .
dockerfile: rosnode/Dockerfile
restart: always
command: ["python3", "app.py", "--name", "rosnode"]
command: ['python3', 'app.py', '--name', 'rosnode']
network_mode: host
stop_signal: SIGKILL
volumes:
- volume_byodr_sockets:/byodr:rw
- volume_byodr_config:/config:ro
mongodb:
cpuset: "0"
cpuset: '0'
build:
context: .
dockerfile: mongodb/Dockerfile
restart: always
command: ["python3", "wrap.py"]
command: ['python3', 'wrap.py']
network_mode: host
stop_signal: SIGKILL
environment:
Expand All @@ -89,17 +89,12 @@ services:
- volume_mongodb_config:/config:rw
- volume_mongodb_data:/data/db:rw
teleop:
cpuset: "0"
cpuset: '0'
build:
context: .
dockerfile: teleop/Dockerfile
restart: always
command:
[
"sh",
"-c",
"python3 -m teleop.app --name teleop --routes /sessions/routes",
]
command: ['sh', '-c', 'python3 -m teleop.app --name teleop --routes /sessions/routes']
network_mode: host
environment:
LD_PRELOAD: libgomp.so.1
Expand All @@ -108,12 +103,12 @@ services:
- volume_byodr_config:/config:rw
- volume_byodr_sessions:/sessions:rw
vehicle:
cpuset: "1"
cpuset: '1'
build:
context: .
dockerfile: vehicles/rover/rover_vehicle.dockerfile
restart: always
command: ["python", "app.py", "--name", "vehicle"]
command: ['python', 'app.py', '--name', 'vehicle']
privileged: true # NvMedia device creation for omx decoder.
network_mode: host
environment:
Expand All @@ -122,24 +117,15 @@ services:
- volume_byodr_sockets:/byodr:rw
- volume_byodr_config:/config:rw
pilot:
cpuset: "2"
cpuset: '2'
build:
context: .
dockerfile: pilot/Dockerfile
restart: always
privileged: true # Access to usb devices without udev rules.
command:
[
"python3",
"-m",
"pilot.app",
"--name",
"pilot",
"--routes",
"/sessions/routes",
]
command: ['python3', '-m', 'pilot.app', '--name', 'pilot', '--routes', '/sessions/routes']
ports:
- "8082:8082"
- '8082:8082'
environment:
LD_PRELOAD: libgomp.so.1
volumes:
Expand All @@ -153,20 +139,10 @@ services:
dockerfile: inference/runtime-cp36-jp441.dockerfile
restart: always
privileged: true
command:
[
"python3",
"-m",
"inference.app",
"--user",
"/sessions/models",
"--routes",
"/sessions/routes",
]
command: ['python3', '-m', 'inference.app', '--user', '/sessions/models', '--routes', '/sessions/routes']
environment:
LD_PRELOAD: libgomp.so.1
OMP_PLACES: "{3}"
OMP_PLACES: '{3}'
volumes:
- volume_byodr_sockets:/byodr:rw
- volume_byodr_config:/config:ro
- volume_byodr_sessions:/sessions:rw
24 changes: 0 additions & 24 deletions requirements.txt

This file was deleted.

0 comments on commit 7f1d4d1

Please sign in to comment.