mirror of
https://github.com/hexbabe/python-appimage-module.git
synced 2025-07-21 13:01:49 +02:00
Change model to be unique; Remove mentions of OAK-D; Update README.md to include note of caution
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
This is an example of using AppImageBuilder to bundle a Python module as an AppImage (only supported on AArch64 for now), and then running it on a robot.
|
This is an example of using AppImageBuilder to bundle a Python module as an AppImage (only supported on AArch64 for now), and then running it on a robot.
|
||||||
|
|
||||||
The built AppImage is a binary that runs the Viam module on any Linux AArch64 robot without installing anything else or worrying about the system Python runtime and package dependencies. It is executed via `run.sh`, and packaged to the Viam Modular Registry as a tar.gz file (see Makefile for details).
|
The built AppImage is a binary that runs the Viam module on any Linux AArch64 robot without installing anything else or worrying about the system Python runtime and package dependencies. It is executed via `run.sh`, and packaged to the Viam Modular Registry as a tar.gz file (see Makefile for details). Note that the AppImage bundling isn't always the best solution for packaging Viam Python modules, but likely the best choice for some use cases.
|
||||||
|
|
||||||
Use this repository's build process as boilerplate to deploy your own Python Viam module as an AppImage.
|
Use this repository's build process as boilerplate to deploy your own Python Viam module as an AppImage.
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
"models": [
|
"models": [
|
||||||
{
|
{
|
||||||
"api": "rdk:component:camera",
|
"api": "rdk:component:camera",
|
||||||
"model": "viam:camera:oak-d"
|
"model": "viam:camera:python-appimage-example"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"entrypoint": "run.sh"
|
"entrypoint": "run.sh"
|
||||||
|
@@ -2,7 +2,7 @@ version: 1
|
|||||||
script:
|
script:
|
||||||
- python3 -m pip install -r requirements.txt # install dependency packages as modules in root (modules in this context means Python modules)
|
- python3 -m pip install -r requirements.txt # install dependency packages as modules in root (modules in this context means Python modules)
|
||||||
- mkdir -p AppDir/usr/lib/python3.10 && cp -r /usr/local/lib/python3.10/site-packages AppDir/usr/lib/python3.10 # cp from root into appdir; site-packages contains all our modules including dependencies
|
- mkdir -p AppDir/usr/lib/python3.10 && cp -r /usr/local/lib/python3.10/site-packages AppDir/usr/lib/python3.10 # cp from root into appdir; site-packages contains all our modules including dependencies
|
||||||
- cp -r src AppDir/usr/lib/python3.10/site-packages # add source code dir to site-packages so the OAK-D module can be discovered in PYTHONPATH and be run as a Python module
|
- cp -r src AppDir/usr/lib/python3.10/site-packages # add source code dir to site-packages so the module can be discovered in PYTHONPATH and be run as a Python module
|
||||||
- mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps/ && cp viam-server.png AppDir/usr/share/icons/hicolor/256x256/apps/ # icon is required
|
- mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps/ && cp viam-server.png AppDir/usr/share/icons/hicolor/256x256/apps/ # icon is required
|
||||||
|
|
||||||
AppDir:
|
AppDir:
|
||||||
|
@@ -30,7 +30,7 @@ class MyModule(Camera, Reconfigurable): # use a better name than this
|
|||||||
"""The distortion parameters of the camera"""
|
"""The distortion parameters of the camera"""
|
||||||
|
|
||||||
|
|
||||||
MODEL: ClassVar[Model] = Model(ModelFamily("viam", "camera"), "oak-d") # make sure this matches the model in meta.json
|
MODEL: ClassVar[Model] = Model(ModelFamily("viam", "camera"), "python-appimage-example") # make sure this matches the model in meta.json
|
||||||
|
|
||||||
# create any class parameters here, 'some_pin' is used as an example (change/add as needed)
|
# create any class parameters here, 'some_pin' is used as an example (change/add as needed)
|
||||||
some_pin: int
|
some_pin: int
|
||||||
|
Reference in New Issue
Block a user