Install - Java Dynamic Agent on Containerized Payara


Installation Steps

  1. Download the latest vFunction Sudoless Controller Installation TGZ
  2. Create a folder for vFunction artifacts in the Artifact Repository accessible by the Docker Build
  3. Add the vFunction Sudoless Controller Installation TGZ to the Artifact Repository
  4. Create a vFunction specific branch to add the vFunction artificats to the Application’s Dockerfile
  5. Modify the Application’s Dockerfile. For example:
FROM payara/micro:5.2022.4-jdk11

USER root

COPY EXISTING_FLOW

### vFunction Details
ARG VF_CONTROLLER_DEFAULT_JAVA_AGENT_APPLICATION_SERVER="payara"
ARG VF_CONTROLLER_DEFAULT_JAVA_AGENT_APPLICATION_JAVA_VERSION=11

### See https://kb.vfunction.com/installations/configurable-settings/mono-dynamic-agent/java/linux for more details about each of the settings below
ARG VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_HOST="http://vfunction.myorg.com"
ARG VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_NAME="docker-agent"
ARG VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_ORG_ID="1111-11-11-1111"
ARG VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_APP_ID="1111-11-11-1111"
ARG VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_CLIENT_ID="1111-11-11-1111"
ARG VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_CLIENT_SECRET="1111-11-11-1111"
ARG VF_CONTROLLER_DEFAULT_JAVA_CONTROLLER_INSTANCE_ID="container"

COPY ARTIFACT_REPOSITORY/vfunction/vfunction-controller-sudo-less-installation*.tgz /tmp/vfunction-controller-sudo-less-installation.tgz

RUN cd /tmp/ && tar -xvzf /tmp/vfunction-controller-sudo-less-installation.tgz  && \
 rm -rf /tmp/vfunction-controller-sudo-less-installation.tgz  && \
 bash /tmp/vfunction/opt/vfunction/controller-installation/install.sh -i default-java -n && \
 chmod -R 777 /tmp/vfunction 

ENV JVM_ARGS="-agentpath:/tmp/vfunction/opt/vfunction/agent/libJVMTIAgent.so=conf=/tmp/vfunction/etc/sysconfig/vfunction/agent/instances/default-java/native-conf.json -javaagent:/tmp/vfunction/opt/vfunction/agent/runtime-agent.jar=ConfigLocation=/tmp/vfunction/etc/sysconfig/vfunction/agent/instances/default-java/vfunction-runtime-override.properties --add-opens=java.base/java.lang=ALL-UNNAMED -Dcom.vfunction.runtime.offload.tmpFolder=/tmp/vfunction/opt/vfunction/agent/instances/default-java/temp/ -Dcom.vfunction.logging.logFile=/tmp/vfunction/var/log/vfunction/instances/default-java/vfagent.log"

RUN EXISTING_FLOW

USER payara

ENTRYPOINT ["EXIST_FLOW"]
  1. Build and deploy the Application
  2. Confirm that the Application comes up and functions as expected
  3. If any issues arise: