Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for configurable post-start hooks #1699

Merged
merged 2 commits into from Jun 2, 2021

Conversation

dominiklohmann
Copy link
Member

@dominiklohmann dominiklohmann commented May 31, 2021

馃摂 Description

The new option vast.start.commands allows for specifying an ordered list of VAST commands that run inside the node after successful startup. This is useful for declarative deployments that run sources or matchers (via the proprietary Live Matching plugin) in the node.

馃摑 Checklist

  • All user-facing changes have changelog entries.
  • The changes are reflected on docs.tenzir.com/vast, if necessary.
  • The PR description contains instructions for the reviewer, if necessary.

馃幆 Review Instructions

Try locally. This can hardly be tested, sadly, since we do not have unit tests for the start command and cannot reliably test remote sources in the integration test framework. I played around with the following:

vast:
  start:
    hooks:
      # Requires PCAP plugin
      - spawn source pcap -i en0
      # Requires NetFlow  plugin
      - spawn source netflow -i :4739/udp
      # Requires Live Matching plugin
      - matcher start --match-types=address ips

@dominiklohmann dominiklohmann added the feature New functionality label May 31, 2021
@dominiklohmann dominiklohmann requested a review from a team May 31, 2021 17:04
@dominiklohmann dominiklohmann force-pushed the story/ch26003/post-start-hooks branch from 8ff8c9c to 8014af3 Compare May 31, 2021 17:05
Copy link
Member

@mavam mavam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "hook" is too generic. We can be more specific here: it's really just a sequence of commands and we can call them what they are.

changelog/unreleased/features/1699--post-start-hooks.md Outdated Show resolved Hide resolved
libvast/src/system/application.cpp Outdated Show resolved Hide resolved
libvast/src/system/start_command.cpp Outdated Show resolved Hide resolved
vast.yaml.example Outdated Show resolved Hide resolved
libvast/src/system/start_command.cpp Outdated Show resolved Hide resolved
The new option `vast.start.hooks` allows for specifying an ordered list
of VAST commands that run inside the node after successful startup. This
is useful for declarative deployments that run sources or matchers (via
the proprietary Live Matching plugin) in the node.
Copy link
Member

@mavam mavam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a good middleground to get experience with post-hoc configuration of VAST using commands with side effects.

That said, I cringe a bit in that it could be more declarative to fit the surrounding configuration. I don't think that's a dealbreaker though; this is better than the current state.

@tobim @lava any objections from your side?

This works around the static assertion failure "passing views as lvalues
is disallowed" that occured only with the pinned {fmt} revision in CI.
@dominiklohmann
Copy link
Member Author

I received @lava's approval to go ahead with this design in a call earlier.

@dominiklohmann dominiklohmann merged commit fa8a968 into master Jun 2, 2021
@dominiklohmann dominiklohmann deleted the story/ch26003/post-start-hooks branch June 2, 2021 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality
Projects
None yet
2 participants