CI Procedure for Adding a New Workflow Configuration(3.1)

Perform the following steps if you want to add a new workflow configuration to the CI pipeline:

  1. Export the configuration using the System Exporter(3.0) and set the property Output as Directory to the Configuration folder in the Git repository.

  2. Modify the packages.xml file and add a new section called package name="" version="" with the corresponding sub-sections. See packageexport(3.0).
    Set a new package name and version and point the configuration to your configuration as shown in the example below:

    Example - Modifying packages.xml file

    <pipeline>
        <packages>
            <package name="TcpBased" version="1.1">
                <configurations>
                    <configuration foldername="TCP_Based"/>
                </configurations>
            </package>
    	</packages>
    </pipeline>
  3. Create a Helm chart with one or more ECDs that will run your configuration by following these steps:

    1. Create an empty Helm chart in the Helm directory using the following command:

      helm create [name of helm chart]
    2. A new directory is created with the specified name.

    3. Delete all .yaml files in the templates directory in the new helm chart. Also delete the directory test inside the templates directory.
    4. Add your/yours ECD yaml file in the templates directory. If you don't have any ECD yaml file, you can create one using the Web Interface. Follow the steps to create an ECD of your choice and in the last step you will see a summary. Click on the Download button to download the yaml file of the ECD. Copy the yaml file into the templates directory.
    5. Add the following parameter in your ECD yaml file in the templates directory: 

      packageImage: "{{ .Values.package.image }}"

      See the following ECD as an example:

      Example - ECD yaml file

      metadata:
        name: "tcpbased"
        labels:
          version: v1
        annotations:
          traffic.sidecar.istio.io/excludeOutboundPorts: "6790"
      apiVersion: "mz.digitalroute.com/v1alpha1"
      kind: "ECDeployment"
      spec:
        ecGroups: "tcpbased"
        jvmArgs:
        - "Xms512m"
        - "Xmx512m"
        exportJmxMetrics: false
        packageImage: "{{ .Values.package.image }}"
        resources:
          requests:
            memory: "640.0Mi"
            cpu: "100m"
          limits:
            memory: "640.0Mi"
            cpu: "200m"
        workflows:
        - template: "TCP_Based.client"
          packageName: "TcpBased"
          packageVersion: "1.1"
          instances:
          - name: "client1"
            useExtRef: "{}"
            parameters: "{\"port\":1234}"
        - template: "TCP_Based.server"
          packageName: "TcpBased"
          packageVersion: "1.1"
          instances:
          - name: "server1"
            useExtRef: "{}"
            parameters: "{\"port\":1234,\"id\":\"1\"}"
    6. The values.yaml file in the helm chart directory must include the following value exactly as shown below. The REPLACE_ME_WITH_PACKAGE_IMAGE parameter will be replaced by the CI pipeline.

      package:
        image: REPLACE_ME_WITH_PACKAGE_IMAGE

      See this values.yaml file as an example:

      Example - values.yaml file

      # Default values for tcpecd.
      # This is a YAML-formatted file.
      # Declare variables to be passed into your templates.
      
      replicaCount: 1
      
      package:
        image: REPLACE_ME_WITH_PACKAGE_IMAGE

      Note!

      All the default values created by Helm can be deleted if you don't want to use them.

  4. Optional step: If there is a test corresponding to the configuration, it should be exported to the Test directory in the Git repository.

    Note!

    Only export the test configuration, not the real configuration, into the Test directory.
    In System Exporter, clear Select Dependencies and select Directory Output.
  5. Commit and push all files to Git. Then the Jenkins job can be started from Jenkins. The output from the job is accessed from the job view in Jenkins.