-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
2,034 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
pages: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: Development | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 21 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y python3-pip python3-venv | ||
npm install @semantic-release/[email protected] | ||
npm install @semantic-release/[email protected] | ||
npm install @semantic-release/[email protected] | ||
npm install @semantic-release/[email protected] | ||
npm install @saithodev/[email protected] | ||
- name: Make release | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
run: npx semantic-release --debug | ||
|
||
- name: Create documentation | ||
run: | | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
pip install flask | ||
pip install flask_cors | ||
pip install sphinx | ||
pip install sphinx_rtd_theme | ||
pip install sphinx-mdinclude | ||
cd docs && make html && cd .. | ||
mkdir public | ||
mv docs/build/html/* public/ | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./public | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
#vscode | ||
.history/ | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
.pdm.toml | ||
.pdm-python | ||
.pdm-build/ | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# This script has to be called from the root of the repository | ||
|
||
if [[ $# -eq 0 ]] ; then | ||
echo "Usage: $0 <VERSION_NUMBER>" | ||
exit 0 | ||
fi | ||
|
||
VERSION=${1} | ||
|
||
# ## PTZ Microservice 0.0.0 | ||
sed -i "s/## PTZ Microservice [[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/## PTZ Microservice ${VERSION}/g" README.md | ||
#version="a.b.c" | ||
sed -i "s/version=\"[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\"/version=\"${VERSION}\"/g" setup.py | ||
# release = 'a.b.c' | ||
sed -i "s/release = '[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+'/release = '${VERSION}'/g" docs/source/conf.py | ||
# version: a.b.c | ||
sed -i "s/version: [[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/version: ${VERSION}/g" api/openapi.yaml | ||
# Welcome to PTZ Microservice documentation va.b.c | ||
sed -i "s/Welcome to PTZ Microservice documentation v[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/Welcome to PTZ Microservice documentation v${VERSION}/g" docs/source/index.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
["@semantic-release/exec", { | ||
"prepareCmd": "./.release/update_version_number.sh ${nextRelease.version}" | ||
}], | ||
["@semantic-release/changelog", { | ||
"changelogFile": "CHANGELOG.md" | ||
}], | ||
["@semantic-release/git", { | ||
"assets": ["CHANGELOG.md", "README.md", "api/openapi.yaml", "docs/source/conf.py", "setup.py", "docs/source/index.rst"], | ||
"message": "Bump version number to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
}], | ||
"@semantic-release/github" | ||
] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,86 @@ | ||
# ptz-service | ||
## PTZ Microservice 1.0.0 | ||
|
||
PTZ Microservice allows you to navigate a video through PTZ. | ||
|
||
It leverages the RidgeRun [Spherical Video PTZ](https://developer.ridgerun.com/wiki/index.php/Spherical_Video_PTZ ) | ||
to make possible the selection of your region of interest within the sphere. This is specified through pan (horizontal), tilt (vertical), and zoom controls, which can be updated at any time during execution. | ||
|
||
This service receives an RTSP stream, performs the PTZ depending on the user instructions, and then returns the stream using the same protocol, RTSP. By default the service uses the first VST | ||
stream available as input and uses rtsp://<IP>:5021/ptz_out as output stream. | ||
|
||
### API configuration | ||
|
||
Take a look at the [API Documentation](api/openapi.yaml) for a list of the available requests. | ||
|
||
### Running the service | ||
|
||
Before running the service, you should make sure you have all the dependencies installed. The intructions to do it can be found [here](https://developer.ridgerun.com/wiki/index.php/Spherical_Video_PTZ/User_Guide/Building_and_Installation#) | ||
|
||
The project is configured (via setup.py) to install the service with the name __ptz__. So to install it run: | ||
|
||
```bash | ||
pip install . | ||
``` | ||
|
||
Then you will have the service with the following options: | ||
|
||
```bash | ||
usage: ptz [-h] [--port PORT] [--host HOST] [--ptz-window-size PTZ_WINDOW_SIZE] | ||
|
||
options: | ||
-h, --help show this help message and exit | ||
--port PORT Port for server | ||
--host HOST Server ip address | ||
--ptz-window-size PTZ_WINDOW_SIZE | ||
Size of the PTZ output window in pixels. The final resolution will be (Size x Size) | ||
``` | ||
|
||
|
||
## PTZ Microservice Docker | ||
|
||
Before starting with docker support make sure you have nvidia runtime in your system. Follow [these instructions](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuration) to have docker up and runing in your Jetson Board. | ||
|
||
### Build the container | ||
|
||
We can build the ptz microservice container using the Dockerfile in the docker directory. This includes a base NVIDA image and the dependencies to run the ptz microservice application. | ||
|
||
First, we need to prepare the context directory for this build, please create a directory and include all the needed repositories (listed below). The Dockerfile will look for all the source code in the context directory and copy them to the container. | ||
|
||
```bash | ||
ptz-context/ | ||
. | ||
├── gst-cuda | ||
├── gst-rr-panoramaptz | ||
├── gst-rtsp-sink | ||
├── libpanorama | ||
├── ptz | ||
└── rrms-utils | ||
``` | ||
|
||
Then build the container image running the following command from the folder contaning the Dockerfile and context directory: | ||
|
||
```bash | ||
sudo docker build \ | ||
--network=host \ | ||
-f Dockerfile \ | ||
-t ridgerun/ptz-service:latest ptz-context/ | ||
``` | ||
|
||
Change __ptz-context__ to your context's path and the tag (-t) to the name you want to give to your image. | ||
|
||
### Launch the container | ||
|
||
The container can be launched by running the following command: | ||
|
||
|
||
```bash | ||
sudo docker run --runtime nvidia -it --privileged --net=host --ipc=host --name ptz-service ridgerun/ptz-service:latest | ||
``` | ||
|
||
You can modify the name you want to give to your container with the option __--name__. | ||
|
||
Here we are creating a container called __ptz-service__ that will start the ptz-service application in the default address and port and using the default output resolution. If a different address, port, or output resolution has to be used, you can do it by running: | ||
|
||
```bash | ||
sudo docker run --runtime nvidia -it --privileged --net=host --ipc=host --name ptz-service ridgerun/ptz-service:latest --host=HOST --port=PORT --ptz-window-size=PTZ_WINDOW_SIZE | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Swagger UI</title> | ||
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist/swagger-ui.css"> | ||
<style> | ||
html { | ||
box-sizing: border-box; | ||
overflow: -moz-scrollbars-vertical; | ||
overflow-y: scroll; | ||
} | ||
*, | ||
*:before, | ||
*:after { | ||
box-sizing: inherit; | ||
} | ||
body { | ||
margin: 0; | ||
background: #fafafa; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="swagger-ui"></div> | ||
|
||
<script src="https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"></script> | ||
<script src="https://unpkg.com/swagger-ui-dist/swagger-ui-standalone-preset.js"></script> | ||
<script> | ||
window.onload = function() { | ||
const ui = SwaggerUIBundle({ | ||
url: "openapi.yaml", | ||
dom_id: '#swagger-ui', | ||
deepLinking: true, | ||
presets: [ | ||
SwaggerUIBundle.presets.apis, | ||
SwaggerUIStandalonePreset.slice(1) | ||
], | ||
plugins: [ | ||
SwaggerUIBundle.plugins.DownloadUrl | ||
], | ||
layout: "StandaloneLayout", | ||
}); | ||
|
||
window.ui = ui; | ||
} | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.