Bark - HearstCorp/rover-wiki GitHub Wiki

Resource change notifications

When a resource is created, changed, or deleted, Rover publishes a notification to that resource's SNS topic. For example, calling Rover like

curl -sk -X PATCH -d '{"title": "New Title"}' -H 'Content-Type: application/json' \
  https://rover.mediaos.hearst.io/v2/videos/46ed3231-f46a-421f-bb51-34a0fbeab989

will result in any subscriber to the Video model's topic getting a message like

{
  "type": "Video",
  "action": "update",
  "resource": {"title": "New Title"},
  "id": "46ed3231-f46a-421f-bb51-34a0fbeab989"
}

Other services can post-process new and changed Rover resources by subscribing SQS queues to these topics, rather than by querying Rover periodically.

bark data flow w rq - bark data flow-4

Docker

As of 3 Apr 2017, Bark is merged into the develop and staging branches, but feature-flagged off in all environments. If you'd like to start using it in your service, you can turn it on in your Rover repo's docker-compose.override.yml file:

version: '2'
services:

  rover:
    environment:
      - DISPATCHR_SCHEME=http
      - DISPATCHR_HOST=dispatchr
      - BARK_VIDEO_TOPIC=saved-models
      - BARK_TAG_TOPIC=saved-models
      - BARK_USER_TOPIC=saved-models
      - FEATURE_BARK=True
    depends_on:
      - dispatchr

  dispatchr:
    container_name: dispatchr
    image: quay.io/hearst/dispatchr
    ports:
      - 80
    environment:
      - DISPATCHR_AWS_KEY=${AWS_ACCESS_KEY_ID}
      - DISPATCHR_AWS_SECRET=${AWS_SECRET_ACCESS_KEY}
      - DISPATCHR_AWS_ACCOUNT_NUMBER=${AWS_ACCOUNT_NUMBER}
      - DISPATCHR_SENTRY_KEY=Foo
      - DISPATCHR_SENTRY_SECRET=Foo
      - DISPATCHR_SENTRY_PROJECT_ID=Foo
      - DISPATCHR_ENDPOINT_PREFIX=dispatchr
      - DISPATCHR_APP_HEALTHCHECK_TOKEN=Foo

networks:
  default:
    external:
      name: vpc

and then add that networks section to your project's docker-compose.override.yml file, so its services join the same network. You'll need to export those AWS credentials in your environment before running docker-compose up, and create the dispatchr-saved-models topic in your AWS account.