Skip to main content

Generated from aind-library-template

Project description

aind_watchdog_service

Since the transfer of aind_watchdog_service into SIPE's control, it now lives and builds on SIPE's gitlab, with a mirror pushing updates to AllenNeuralDynamic's github repo.

It is published to pypi via a github action that runs when a Github Release is created.

Usage

Watchdog runs in the background, and watches a directory for newly-created yaml files containing instructions to transfer files. To use, 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

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.

When deploying on a new rig that had previously had the non-SIPE version of watchdog installed, extra care must be taken.

  • First, delete any scheduled tasks relating to watchdog. Some of these may be in a folder called "GUI Automation" or "AIND".
  • Next, run tasklist to check if there active watchdog processes, and kill them all with repeated use of taskkill /F /PID pid_of_the_process.
    • One running instance of watchdog will have two processes listed by tasklist
  • Install the new watchdog via ansible and check for a start log.
  • SSH in and run a self test with aind_watchdog_service.exe --test (see below) and make sure you see successful logs.

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

After cloning the repo, watchdog can be installed from source with pip install .[service], and run with 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.6.dev2.tar.gz (397.2 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.6.dev2-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

Details for the file aind_watchdog_service-0.1.6.dev2.tar.gz.

File metadata

File hashes

Hashes for aind_watchdog_service-0.1.6.dev2.tar.gz
Algorithm Hash digest
SHA256 3ce94e63aef51a548ee26b4d7a3f8904470a351cc870db574998ba3dd3896c7f
MD5 3a4e2ad2e939115a8a09aeb8c1e04ded
BLAKE2b-256 6bd6f4d4b971d8a9022295fe2e901f53e8606bd7ed8b655095ccc9ddcc3462e8

See more details on using hashes here.

File details

Details for the file aind_watchdog_service-0.1.6.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for aind_watchdog_service-0.1.6.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 857849f8372973b7cc6e387b23fffafae2ff6507114969352ea3fb8e039f35d1
MD5 596123cdba17b072103fffcb1fc804be
BLAKE2b-256 cceb29139f31818e79c6a9160147f23f4ce5e7415c2c89340f2f2c37fa3c9146

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