Install - Java Viper Controller on a Containerized App for Static Analysis


Installation Steps

  1. Download the latest vFunction Sudoless Controller Installation TGZ
  2. Download a sample installation.yaml
  3. Download a sample startup.sh
  4. Set the Configurable Settings in the downloaded installation.yaml
  5. Modify the downloaded startup.sh under the “Restarting the controller” Section to be relevant for Viper
#!/usr/bin/env bash

set -x

echo "Restarting the controller"

bash /tmp/vfunction/opt/vfunction/controller-installation/restart-controller.sh -i default-java

while true
do
      sleep 60
done
  1. Create a folder for vFunction artifacts in the Artifact Repository accessible by the Docker Build
  2. Add the vFunction Sudoless Controller Installation TGZ, the binaries for the Application, the installation.yaml and the startup.sh to the Artifact Repository
  3. Create a vFunction Viper-specific project in your CI/CD Pipeline
  4. Modify the Dockerfile that was downloaded
FROM almalinux:9

### Copy the Application's Binaries to the image

COPY /artifact_repository/app.war /tmp/vfunction/

### vFunction Copy workflow

COPY /artifact_repository/vfunction/vfunction-controller-sudo-less-installation*.tgz /tmp/vfunction-controller-sudo-less-installation.tgz
COPY /artifact_repository/vfunction/installation.yaml /tmp/
COPY /artifact_repository/vfunction/startup.sh /tmp/

### vFunction Run workflow

RUN cd /tmp && tar -xvf /tmp/vfunction-controller-sudo-less-installation.tgz    && \
      rm -f /tmp/vfunction-controller-sudo-less-installation.tgz   && \
      mv /tmp/installation.yaml /tmp/vfunction/etc/sysconfig/vfunction/installation/instances/default-java/             && \
      mv /tmp/startup.sh /tmp/vfunction/                            && \
      bash /tmp/vfunction/opt/vfunction/controller-installation/install.sh -i default-java -n -v             && \  
      chmod -R 777 /tmp/vfunction
      
### vFunction ENTRYPOINT workflow

ENTRYPOINT ["/bin/sh"]
CMD ["/tmp/vfunction/startup.sh"]

  1. Build and deploy the Viper Container
  2. Confirm that the Viper comes up as expected in the vFunction Server UI