Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Automatic test of pip and docker #200

Merged
merged 43 commits into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c916dd8
Test pip installation
ad-daniel Jan 17, 2022
b134ac5
Trigger
ad-daniel Jan 17, 2022
6a42f3f
Fix
ad-daniel Jan 17, 2022
23cc3e4
Minor
ad-daniel Jan 17, 2022
7f170ce
Merge branch 'master' into feature-automatic-test
passalis Jan 19, 2022
f11129f
Updated wheel test
passalis Jan 19, 2022
5466a01
Added libopenblas install
passalis Jan 19, 2022
f9fbe9f
Temporary test disable
passalis Jan 19, 2022
ff7351e
Temporary test disable
passalis Jan 19, 2022
2849f75
Added libsndfile1 dependency
passalis Jan 19, 2022
6c709ef
Restored disabled test
passalis Jan 19, 2022
c1878f8
New wheel building pipeline
passalis Jan 19, 2022
758d95e
Update build_wheel.sh
passalis Jan 19, 2022
2140e32
Added libboost-dev dep
passalis Jan 20, 2022
19033ea
Update installation.md
passalis Jan 20, 2022
116fc14
Switch to sdist
passalis Jan 20, 2022
dec5392
sdist workflow
passalis Jan 20, 2022
20a3f95
Update tests_suite.yml
passalis Jan 20, 2022
79285e5
Added numpy include dirs
passalis Jan 20, 2022
321dce1
Merge branch 'feature-automatic-test' of https://github.com/opendr-eu…
passalis Jan 20, 2022
535c691
Disabled two 3d detection tests
passalis Jan 20, 2022
21d7575
Disabled three 3d detection tests
passalis Jan 20, 2022
724ecd2
Disabled five 3d detection tests
passalis Jan 20, 2022
693ea96
Disabled all 3d detection tests
passalis Jan 20, 2022
7e30ee9
Disabled model download - 3d test
passalis Jan 20, 2022
1b09f3e
Disabled everything?
passalis Jan 20, 2022
1aeb275
Removed imports from 3d object detection test
passalis Jan 20, 2022
52a993b
Import test
passalis Jan 20, 2022
d28155c
Import test
passalis Jan 20, 2022
dd2c778
Import test
passalis Jan 20, 2022
68dd58d
Import test
passalis Jan 20, 2022
51f9b04
Import test
passalis Jan 20, 2022
0a511be
Import test
passalis Jan 20, 2022
b8f941c
Restored test
passalis Jan 20, 2022
a4dd43f
Disabled object detection 3d test
passalis Jan 20, 2022
fca7395
Refactor workflow
ad-daniel Jan 21, 2022
c877aed
disable temporarely
ad-daniel Jan 21, 2022
bee8975
Fix docker mobile manipulation
ad-daniel Jan 21, 2022
073d2f1
Re-enable test
ad-daniel Jan 21, 2022
2b39395
add badge
ad-daniel Jan 21, 2022
b28a1fc
Fix changelog
ad-daniel Jan 21, 2022
198c68a
remove test install reference
ad-daniel Jan 21, 2022
fee4475
Restored pip installation
passalis Jan 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/workflows/test_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Test Packages
# This workflow tests the latest (third-party hosted) available builds

on:
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]
schedule:
- cron: '0 23 * * *'

defaults:
run:
shell: bash


jobs:
cleanup-runs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'test packages') || github.event_name == 'schedule' }}
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
test-wheel:
needs: cleanup-runs
if: ${{ contains(github.event.pull_request.labels.*.name, 'test packages') || github.event_name == 'schedule' }}
strategy:
matrix:
os: [ubuntu-20.04]
package:
- engine
- utils
- perception/activity_recognition
- perception/compressive_learning
- perception/face_recognition
- perception/heart_anomaly_detection
- perception/multimodal_human_centric
- perception/object_tracking_2d
- perception/pose_estimation
- perception/speech_recognition
- perception/skeleton_based_action_recognition
- perception/semantic_segmentation
- perception/object_detection_2d
- perception/facial_expression_recognition
# - perception/object_detection_3d
# - control/mobile_manipulation
# - simulation/human_model_generation
# - control/single_demo_grasp
# - perception/object_tracking_3d
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Test Wheel
run: |
export DISABLE_BCOLZ_AVX2=true
sudo apt -y install python3.8-venv libfreetype6-dev git build-essential cmake python3-dev wget libopenblas-dev libsndfile1 libboost-dev python3-dev
python3 -m venv venv
source venv/bin/activate
wget https://raw.githubusercontent.com/opendr-eu/opendr/master/dependencies/pip_requirements.txt
cat pip_requirements.txt | xargs -n 1 -L 1 pip install
# Test new package
pip install opendr-toolkit
python -m unittest discover -s tests/sources/tools/${{ matrix.package }}
test-docker:
needs: cleanup-runs
if: ${{ contains(github.event.pull_request.labels.*.name, 'test packages') || github.event_name == 'schedule' }}
strategy:
matrix:
os: [ubuntu-20.04]
package:
- engine
- utils
- perception/activity_recognition
- perception/compressive_learning
- perception/face_recognition
- perception/heart_anomaly_detection
- perception/multimodal_human_centric
- perception/object_tracking_2d
- perception/pose_estimation
- perception/speech_recognition
- perception/skeleton_based_action_recognition
- perception/semantic_segmentation
- perception/object_detection_2d
- perception/facial_expression_recognition
- perception/object_detection_3d
- control/mobile_manipulation
- simulation/human_model_generation
- control/single_demo_grasp
#- perception/object_tracking_3d
runs-on: ${{ matrix.os }}
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Test Docker
run: |
docker run --name toolkit -i opendr/opendr-toolkit:cpu_latest bash
docker start toolkit
docker exec -i toolkit bash -c "source bin/activate.sh && source tests/sources/tools/control/mobile_manipulation/run_ros.sh && python -m unittest discover -s tests/sources/tools/${{ matrix.package }}"
1 change: 1 addition & 0 deletions .github/workflows/tests_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ jobs:
source tests/sources/tools/control/mobile_manipulation/run_ros.sh
python -m unittest discover -s tests/sources/tools/${{ matrix.package }}
fi

3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ Released on XX, XXth, 2022.
- Enhancements:
- None.
- Bug Fixes:
- None.
- Updated wheel building pipeline to include missing files and removed unnecessary dependencies ([#200](https://github.com/opendr-eu/opendr/pull/200)).
- Dependency Updates:
- `heart anomaly detection`: upgraded scikit-learn runtime dependency from 0.21.3 to 0.22 ([#198](https://github.com/opendr-eu/opendr/pull/198)).


## Version 1.0
Released on December 31th, 2021.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive-include src/opendr *
include requirements.txt
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ______________________________________________________________________

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Test Suite (master)](https://github.com/opendr-eu/opendr/actions/workflows/tests_suite.yml/badge.svg)](https://github.com/opendr-eu/opendr/actions/workflows/tests_suite.yml)
[![Test Packages](https://github.com/opendr-eu/opendr/actions/workflows/test_packages.yml/badge.svg)](https://github.com/opendr-eu/opendr/actions/workflows/test_packages.yml)
</div>

## About
Expand Down
19 changes: 19 additions & 0 deletions bin/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Build all OpenDR dependecies
./bin/install.sh

# Activate OpenDR
source ./bin/activate.sh

# Prepare requirements.txt for wheel distributions
pip3 freeze > requirements.txt

# Remove detectron and git repositories (installation not supported through PyPI)
sed -i '/detectron2/d' requirements.txt
sed -i '/git/d' requirements.txt
sed -i '/pkg_resources/d' requirements.txt
sed -i '/auditwheel/d' requirements.txt

# Build binary wheel and repair it
python3 setup.py sdist
8 changes: 0 additions & 8 deletions bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,5 @@ make install_compilation_dependencies
make install_runtime_dependencies
make libopendr

# Prepare requirements.txt for wheel distributions
pip3 freeze > requirements.txt

# Remove detectron, since it was installed from git repo
sed -i '/detectron2/d' requirements.txt
sed -i '/git/d' requirements.txt
python3 setup.py bdist_wheel

deactivate

2 changes: 1 addition & 1 deletion docs/reference/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ You can directly install OpenDR toolkit for CPU-only inference using pip.
First, install the required dependencies:
```bash
export DISABLE_BCOLZ_AVX2=true
sudo apt install python3.8-venv libfreetype6-dev git build-essential cmake python3-dev wget
sudo apt install python3.8-venv libfreetype6-dev git build-essential cmake python3-dev wget libopenblas-dev libsndfile1 libboost-dev
python3 -m venv venv
source venv/bin/activate
wget https://raw.githubusercontent.com/opendr-eu/opendr/master/dependencies/pip_requirements.txt
Expand Down
20 changes: 18 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
import os
from os.path import join
from setuptools import setup
from setuptools import find_packages
from Cython.Build import cythonize
import numpy


packages = find_packages(where="./src")

# Get the requirements
with open('requirements.txt') as fp:
install_requires = fp.read().splitlines()

# Retrieve version
exec(open('src/opendr/_version.py').read())

try:
__version__
except NameError:
__version__ = '0.0'

# Gather all files
data_files = []
for root, dirs, files in os.walk("src/opendr"):
for file in files:
file_extension = file.split(".")[-1]
# Add all files except from shared libraries
if file_extension != "so" and file_extension != "py":
data_files.append(join(root.replace("src/opendr/", ""), file))

setup(
name='opendr-toolkit',
version=__version__,
Expand Down Expand Up @@ -49,5 +63,7 @@
license='LICENSE',
package_dir={"": "src"},
install_requires=install_requires,
ext_modules=cythonize(["src/opendr/perception/object_detection_2d/retinaface/algorithm/cython/*.pyx"])
package_data={'': data_files},
ext_modules=cythonize(["src/opendr/perception/object_detection_2d/retinaface/algorithm/cython/*.pyx"]),
include_dirs=[numpy.get_include()]
)