Skip to main content

Generated from aind-library-template

Project description

aind_watchdog_service

Usage

Watchdog runs in the background (see deployment), and watches a directory for newly-created yaml files containing instructions to transfer files.

On a computer where the watchdog service is running, manifests can be submitted by creating a file in the right folder. To do this in your software, pip install aind-watchdog-service and use the aind_watchdog_service.models.ManifestConfig object to write your manifest file in the proper format. See the examples/ folder in this repo for more details.

Configuration

Watchdog is configured using SIPE's configuration zookeeper server. The configuration options are listed in /src/aind_watchdog_service/models/watch_config.py.

Monitoring

Watchdog logs can be monitored from the main SIPE logserver (http://eng-logtools:8080/?channel_filter=watchdog&hide=location,count) or this grafana dashboard.

Deployment

Deployment in the institute is handled by SIPE systems engineers, submit a SIPE Request if you need watchdog installed somewhere.

Github actions are used to compile aind-watchdog-service into an executable using pyinstaller. This executable is attached to a Github Release and uploaded to SIPE's software /releases storage, where it can be deployed to rigs in the institute.

Watchdog should be deployed on a SIPE-accessible rig via the install-aind_watchdog_service.yml ansible script. This will download the app and set up a windows scheduled task to run the service. By default, the scheduled task includes a nightly restart at 11:30pm. If the task is running, the scheduler will kill the old instance and start the new one - due to how task scheduler force kills processes, the death of an old process will not generate a stop log.

Testing

Watchdog has a bundled test function that will create some dummy data on the rig and create a manifest file to transfer that data. Once Run it with the below commands:

cd "C://Program Files/AIBS_MPE/aind_watchdog_service"
aind_watchdog_service.exe --test

It will print something like the following:

Data created at C:\ProgramData\AIBS_MPE\aind_watchdog_service\logs\test_data
Manifest created at C:\Users\svc_mpe\Documents\aind_watchdog_service\manifest\test_manifest_2024-11-15_17-31-25.yml

Make sure that the running instance of watchdog picks up the manifest and completes the transfer.

Development

Clone the repo Install dependencies with uv sync --extra service --extra dev Run the service with uv run src/aind_watchdog_service/main.py

(If not using uv, use pip install .[service] and python src/aind_watchdog_service/main.py)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aind_watchdog_service-0.1.7.tar.gz (390.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aind_watchdog_service-0.1.7-py3-none-any.whl (47.8 kB view details)

Uploaded Python 3

File details

Details for the file aind_watchdog_service-0.1.7.tar.gz.

File metadata

  • Download URL: aind_watchdog_service-0.1.7.tar.gz
  • Upload date:
  • Size: 390.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aind_watchdog_service-0.1.7.tar.gz
Algorithm Hash digest
SHA256 922a000eedc693a39fa081aeca8b673e5242eada470bcebcae7f9213c50814d0
MD5 a8c7306be2c4619ad4c037c56774543d
BLAKE2b-256 99d123c99b4eacf7464e8bf83f6cd3cdef753d797b880d1eebd6cc403d9c6785

See more details on using hashes here.

File details

Details for the file aind_watchdog_service-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for aind_watchdog_service-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3dbd91b71ecb01698c4bddac5f322aae0854dbee7f16a1d4fd85e63677afe40d
MD5 4686ee2f9e15d4fafa205aa469c686e7
BLAKE2b-256 d4bbe40d5c7ef4a53b6eefd3b406c4e62fb09d9263de5ef602dd57732decc404

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page