Skip to content

Four core workers of shotit: watcher, hasher, loader and searcher.

License

Notifications You must be signed in to change notification settings

shotit/shotit-worker

Repository files navigation

Shotit-worker

License GitHub Workflow Status GitHub release Watcher Docker Watcher Docker Image Size Hasher Docker Hasher Docker Image Size Loader Docker Loader Docker Image Size Searcher Docker Searcher Docker Image Size

Backend workers for shotit. Four core workers of shotit: watcher, hasher, loader and searcher.

Features

  • watch file system changes and upload hash to shotit-media
  • download video from shotit-media, hash, and upload to shotit-api
  • download hash from shotit-api, deduplicate, and upload to milvus

Prerequisites

  • Node.js 16.x, 18.x
  • ffmpeg 4.x
  • java (openjdk 1.8.0)
  • git
  • pm2

Local Development Guide

Install Prerequisites first, then:

git clone https://github.com/shotit/shotit-worker.git
cd shotit-worker
yarn install

Configuration

  • Copy .env.example to .env
  • Edit .env as appropriate for your setup, as is for the first time.

Start workers

You can use pm2 to run this in background in cluster mode.

Use below commands to start / restart / stop server.

yarn start
yarn stop
yarn reload
yarn restart
yarn delete
yarn logs

To change the number of nodejs instances, edit ecosystem.config.json