Comments (3)
As seen done by another project recently, the Agent JAR could be built into a simple JAR-carrier container image, ex:
FROM scratch
COPY ./target/cryostat-agent.jar /cryostat/
This would be an easy way for application images to consume the Agent JAR - rather than manually downloading the JAR to the build machine and copying it into the container build, they could use a multi-stage container build like:
FROM cryostat/agent-carrier:latest as cryostat-agent
RUN echo '' # no-op, can this be removed?
FROM base-image
COPY --from=cryostat-agent /cryostat/cryostat-agent.jar /app/deployment/lib
... copy application artifacts in
Alternatively, this JAR-carrier image can be used as an init container in the application's Deployment to achieve the same result dynamically, if there is a volume shared between the init container and the application container:
initContainers:
- name: download-agent
image: agent-carrier:latest
imagePullPolicy: Always
command: [ 'cp', '/cryostat/cryostat-agent.jar','/etc/agent/ ]
volumeMounts: # this must also be defined on the container that runs the host JVM which the Agent should attach to, so that the JAR is available on its filesystem as well
- name: shared
mountPath: /etc/agent/
from cryostat-agent.
This is a good reference for the same/similar technique, which also includes the technique of modifying the target container's JAVA_TOOL_OPTIONS
environment variable to include -javaagent
to launch the agent via static attach. This would necessitate a target container restart for agent instrumentation to begin.
Discussion on dynamic attach mechanisms over here: cryostatio/cryostat-operator#784
from cryostat-agent.
Since the init container needs at least cp
in order to copy the carried JAR into the shared volume, FROM scratch
alone won't be quite enough. It could be a FROM scratch
that also has a standalone cp
binary copied into it, or else a very minimal base image with some coreutils in it instead:
FROM docker.io/library/busybox:latest
COPY ./target/cryostat-agent.jar /cryostat/
from cryostat-agent.
Related Issues (20)
- [Epic] Smart Triggers Usability Improvements
- [Story] Smart Triggers API
- [Story] Smart Triggers from file/resource
- [Task] Require server URL to use private-range IP by default
- [Task] Test Smart Triggers with downgraded protobuf
- [Bug] Agent startup failure with JBoss EAP HOT 7
- [Bug] Avoid using `localhost:0` "self-reference" JMX connection
- [Bug] Shaded JAR Manifest includes `Class-Path` entry
- [Bug] Agent cannot accept `ALL` event template in recording start requests HOT 1
- [Question] Drop Dagger DI? HOT 3
- [Bug] Agent loses registration with server, does not re-attempt HOT 1
- [Task] Publish to Maven Central
- [Task] Basic auth user should be configurable
- [Bug] Use SSLContext with TLS v1.2 or v1.3
- [Request] Audit log levels and ensure appropriate level is selected
- [Epic] Kubernetes/OpenShift awareness
- [Task] detect default service account token and try to present this for Cryostat authorization, if nothing else specified
- [Bug] Harvester-created snapshots are left behind if they are empty when created
- [Request] Shut down Agent without exiting host JVM
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cryostat-agent.