- Dokumentáció
- Fejlesztőknek
- Your first add-on in 30 minutes
Ez az oldal még nem érhető el a következő nyelven: Magyar. Angolul jelenik meg.
Your first add-on in 30 minutes1.7.1 óta
Install the Add-on Kit, scaffold an add-on, test it against a fake server, check its manifest, try it on your own server in developer mode and submit it for review.
This page takes you from nothing to an add-on running on your own Vigiora server, with every command in order. It uses the Add-on Kit. The rules behind each step (the manifest, permissions, the compose file and the review) are on Write and share an add-on.
Before you start#
You need:
- A computer with Python 3.10 or newer and Git.
- A free account on github.com (or gitlab.com). An add-on is shared as a public repository there.
- Vigiora Server 1.7.1 or newer on a Linux server with native Docker. For now, community add-ons install only there. You can write and test the add-on on any computer.
- An admin account on that server.
Install the kit#
The kit is not on a package index yet, so install it from a checkout.
git clone https://github.com/data-tamer/vigiora-addon-kit
python3 -m venv .venv && . .venv/bin/activate
pip install -e ./vigiora-addon-kitThis gives you the vigiora-addon command and the vigiora_addon Python package.
Create your add-on#
vigiora-addon new my-addon
cd my-addon
pip install -e '.[dev]'vigiora-addon new copies the add-on template: a manifest, a compose file, a Dockerfile, a small program in src/, tests, a how-to and an icon. The program enrols with the server, reads the cameras assigned to it and posts one hello result per camera every 30 seconds.
Pick your own id with vigiora-addon new my-addon --id my-addon --name "My Add-on". The id never changes after you submit, and some ids are reserved: see Ids.
Open vigiora-addon.yaml. It is the manifest, and every line is commented. For now, check two parts:
permissions.scopes: ask for only what you use. The administrator sees this list before turning the add-on on.run.source: build: the server builds the image from your repository, using theDockerfile.
Run the tests#
pytestThe tests start the kit's fake Vigiora server, run your add-on against it and check what it posted. You need no Vigiora install for this. The fake server has the answers of Vigiora Server for the calls the kit makes, and nothing else: no database, no rate limits, no real video.
To watch the add-on work by hand, use two terminals. In the first, start the fake server. It prints the environment to use.
vigiora-addon run-fake --cameras 2 --service my-addonIn the second, paste the export lines it printed, then start your add-on with a short interval:
HELLO_INTERVAL_SEC=3 my-addonThe first terminal prints every result the add-on posts.
Check the manifest#
vigiora-addon validate .This runs the same checks the Vigiora cloud runs when you submit: the manifest, the required files and their limits, the compose file and the Dockerfile. It lists every problem with the field and a plain sentence. When it prints OK, it also tells you what it cannot check: that the id is yours and that the version is higher than your last approved one. Only the cloud knows those. Run it again after every change. See What the check rejects.
Before you go on, replace the placeholder text in README.md and docs/how-to.md and the files in images/: the Community shows them to the people who install your add-on.
Put it in a public repository#
Create an empty public repository on github.com, then push your add-on to it. The kit has no command for this, so use Git by hand:
git init
git add .
git commit -m "First version"
git branch -M main
git remote add origin https://github.com/<your-name>/my-addon
git push -u origin mainReplace <your-name> with your account. The address Vigiora reads is exactly https://github.com/<owner>/<repo>. Push every change you want to try before you install it: the server reads the repository, not your computer.
Install it on your server#
Turn on developer mode
On your server, an admin opens Settings → System → Updates and turns on Add-on developer mode.
Install from git
Open Settings → AI and add-ons → Add-ons and the Installed tab. Fill in Git address with your repository address, optionally a branch, tag or commit, and Your password. Click Install from git.
Wait for it to start
The add-on shows its progress: Waiting, Downloading, Building, Starting, Running. If it shows Failed, the reason is under it. Click Try again after you fix it.
Developer mode installs without a review, so it runs code nobody at Vigiora has looked at. Install only your own add-ons. See Developer mode.
To try a new version, push it and install it again from the git address: an add-on installed in developer mode has no Update button.
See it on a camera#
An installed add-on appears under Community add-ons on the Installed tab. Assign it to a camera: on the add-on's card, pick the cameras it should serve, or switch it on in the camera's AI Guardian tab.
Within about 30 seconds the add-on reads its assigned cameras and posts its first hello result. The camera's detection events and its list of labels show it. For where results appear, see Where the results appear.
To raise alerts and fetch pictures, see Raising alerts and Getting pictures.
Submit it for review#
When it works on your server:
- Check that
versionin the manifest is higher than any version you submitted before, and push. - Sign in at vigiora.com with a verified email and open Dashboard, Add-ons, Submit an add-on.
- Paste the repository address and choose Check repository. Fix any problem it lists.
- Read the preview, which is the page the Community will show, then choose Submit for review.
A reviewer approves or rejects every version. A rejection comes with a reason. The details are in Submit and review.
Where to go next#
- Write and share an add-on: every rule, the permission list and the review.
- Add-ons: how an add-on looks to the person who installs it.
- The Add-on Kit has the full API of the client and the fake server.
- The smallest working example is vigiora-addon-hello-camera.