Giter Club home page Giter Club logo

Comments (5)

andrewazores avatar andrewazores commented on September 26, 2024 1

Here's some info I put elsewhere for another reason, but which I just had the thought could be very relevant here as well:

https://github.com/cryostatio/cryostat/issues/990#issuecomment-1613364915

tl;dr "Common Expression Language" looks like it would be a good syntax for describing smart triggers, and this looks a lot like the JavaScript-based matchExpressions already used by the Cryostat server for Automated Rules and Stored Credentials. This could be used with either Idea 1 or Idea 2 from the original issue I filed here. For Idea 2 I think it is relatively straightforward, an expression or list of expression strings would be passed as part of the Java command line and would become arguments to the agentmain. For Idea 2, the expressions could be provided as the value of a SmallRye Config property, or perhaps a series of properties with a common key format so that multiple expressions can be provided. For the follow-up about using a mounted ConfigMap, this still slots in well, since these CEL expressions can be easily embedded into ex. a YAML document that backs a ConfigMap.

from cryostat-agent.

andrewazores avatar andrewazores commented on September 26, 2024

The idea of using a configuration file for this purpose could also fit with simply defining an optional path to such a file via SmallRye Config property.

In a containers/k8s/OpenShift story, this could be supplied by a ConfigMap:
https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/

The ConfigMap can be mounted as a file in the container, and a config property used to tell the agent to load that file to figure out what triggers it should set up.

This same technique can already be used to override the agent's own default microprofile-config.properties, so this idea does also slot in with Idea 1 above in that sense.

If the trigger definition syntax can be expressed in terms of environment variables then the user can either perform this configuration by environment variable or by ConfigMap and embedding the trigger configuration into the existing .properties.

If the trigger syntax cannot be expressed as environment variables or otherwise does not work well with SmallRye Config properties, then a separate config file (ex. ConfigMap) defined in some other format such as JSON/YAML could be used.

from cryostat-agent.

andrewazores avatar andrewazores commented on September 26, 2024

@Josh-Matsuoka ^

from cryostat-agent.

Josh-Matsuoka avatar Josh-Matsuoka commented on September 26, 2024

Sounds like a good approach to me, I'll do some reading/look into it!

from cryostat-agent.

andrewazores avatar andrewazores commented on September 26, 2024

Done in #197

from cryostat-agent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.