Install - .NET Agent Controller on a Containerized App running a Linux image


Installation Steps

  1. Download the latest vFunction Sudoless Controller Installation TGZ
  2. Download a sample installation.yaml
  3. Download a sample startup.sh script
  4. Modify the installation.yaml to be relevant to your environment
### Modify the CHANGE_ME values below
controller:
 name: CHANGE_ME #... use a string that indicates what and where this is, e.g. UAT tomcat1
 host: CHANGE_ME #... use the VF Server's address, e.g. http://10.0.0.49
 org_id: CHANGE_ME #... taken from the VF Server UI after you've created the Application
 app_id: CHANGE_ME #... taken from the VF Server UI after you've created the Application
 client_id: CHANGE_ME #... taken from the VF Server UI after you've created the Application
 client_secret: CHANGE_ME #... taken from the VF Server UI after you've created the Application
 instance_id: containerized
 type: dotnet
 agent_port: 9778
 instrconf_additions:
   inclusions:
#      - a.b.c.
   exclusions:
#      - a.b.c.
 tags:
#    - tag1

server_application:
#  name: 
#  include_classes: 
#  allowed_users:

agent:
#  application_name:
#  architecture: x86
#  application_command:

viper:
 port: 8091
 assemblies:
   - /opt/dummy
  1. Modify the startup.sh script to be relevant to your environment
### Add the workflow to run the application after the line #RunApp
### If needed, find-and-replace the base path "/tmp/vfunction"
### If needed, find-and-replace the instance name "default-dotnet"
#!/usr/bin/env sh

set -x

echo "Starting vFunction Process(es)"

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

echo "Adding vFunction environmental variables"

export VF_AGENT_CONF_LOCATION=/tmp/vfunction/etc/sysconfig/vfunction/agent/instances/default-dotnet/conf.json
export CORECLR_PROFILER_PATH_64=/tmp/vfunction/opt/vfunction/agent/libvfagent.net.so
export CORECLR_ENABLE_PROFILING=1
export CORECLR_PROFILER={cd7d4b53-96c8-4552-9c11-6e41df8eab8a}
export DOTNET_TailCallOpt=0

echo "Starting Application"

#RunApp
  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 installation.yaml and the startup.sh to the Artifact Repository
  3. Create a vFunction specific branch to add the vFunction artificats to the Application’s Dockerfile
  4. Modify the Application’s Dockerfile
### Note that this is meant to be a sample where you copy-and-paste the relevant vFunction details into your existing Dockerfile, hence the references to EXISTING_DOCKER_IMAGE and EXISTING_WORKFLOW
### In the Dockerfile, replace ARTIFACT_REPOSITORY with the actual path to the Build location where the vFunction artifacts are stored
### Replace APP_USER with the user running the application and APP_GROUP with that user's group
FROM EXISTING_DOCKER_IMAGE

COPY EXISTING_WORKFLOW

### 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 /usr/bin/

RUN EXISTING_WORKFLOW

### vFunction RUN workflow

RUN cd /tmp && tar zxvf /tmp/vfunction-controller-sudo-less-installation.tgz                                                             && \
        rm -rf /tmp/vfunction-controller-sudo-less-installation.tgz                                                                     && \
        mv /tmp/installation.yaml /tmp/vfunction/etc/sysconfig/vfunction/installation/instances/default-dotnet/                         && \
        bash /tmp/vfunction/opt/vfunction/controller-installation/install.sh -i default-dotnet -n -a                                    && \
        chmod -R 777 /tmp/vfunction                                                                                                     && \
        chmod +x /usr/bin/startup.sh                                                                                                    && \
        chown -R APP_USER:APP_GROUP /tmp/vfunction                                             

ENTRYPOINT ["/bin/sh"]
CMD ["/usr/bin/startup.sh"]

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