Customer-provided Adapters and Processors

Describes how to upload adapters buit by a customer.

Jenkins job "upload-customer-built-adapter" is for uploading adapters built by customers, it is accessed using the Jenkins web console:

To upload a customer-built adapter:
  • Click "Browse..." button to select the adapter file.
  • Click "Build" to upload the adapter to Jenkins server.
Note that:
  • A customer-built adapter is built by a customer using Mashery SDK,
  • A customer-built adapter is a zip file,
  • The zip file is uploaded to "/var/jenkins_home/userContent/proxy-extension" in the tml-installer container.

When a docker image for Traffic Manager is built, the customer-built adapter will be built into the docker image. See the following example build output:

15:50:14 * Connected to tmgc-installer-host (192.168.4.60) port 8080 (#0)
15:50:14 > GET /userContent/proxy-extension/customer_extension.zip HTTP/1.1
15:50:14 > User-Agent: curl/7.29.0
15:50:14 > Host: tmgc-installer-host:8080
15:50:14 > Accept: */*
15:50:14 > 
15:50:14 [0m[91m< HTTP/1.1 200 OK
15:50:14 < Date: Sat, 17 Nov 2018 23:50:14 GMT
15:50:14 < X-Content-Type-Options: nosniff
15:50:14 < Content-Security-Policy: sandbox; default-src 'none'; img-src 'self'; style-src 'self';
15:50:14 < X-WebKit-CSP: sandbox; default-src 'none'; img-src 'self'; style-src 'self';
15:50:14 < X-Content-Security-Policy: sandbox; default-src 'none'; img-src 'self'; style-src 'self';
15:50:14 < Last-Modified: Sat, 17 Nov 2018 23:42:06 GMT
15:50:14 < Expires: Sat, 17 Nov 2018 23:42:06 GMT
15:50:14 < Accept-Ranges: bytes
15:50:14 < Content-Type: application/zip
15:50:14 < Content-Length: 126649
15:50:14 < Server: Jetty(9.4.z-SNAPSHOT)
15:50:14 < 
15:50:14 { [data not shown]
15:50:14 
100  123k  100  123k    0     0  18.9M      0 --:--:-- --:--:-- --:--:-- 20.1M
15:50:14 * Connection #0 to host tmgc-installer-host left intact
15:50:14 [0mArchive:  /tmp/customer_extension.zip
15:50:14   inflating: /tmp/customer-bundles/Base64Adapter-1.0.jar  
15:50:14   inflating: /tmp/customer-bundles/Base64UrlAdapter-1.0.jar  
15:50:14   inflating: /tmp/customer-bundles/Base64UrlAdapter2-1.0.jar  
15:50:14   inflating: /tmp/customer-bundles/lib/codec-1.3.0.v201101211617.jar  
15:50:14   inflating: /tmp/customer-bundles/lib/codec-1.4.0.v201209201156.jar  
15:50:14 /opt/javaproxy/tools/packager /opt/javaproxy
15:50:15 Buildfile: /opt/javaproxy/tools/packager/build.xml
15:50:15 
15:50:15 all:
15:50:15 
15:50:15 setUp:
15:50:15     [mkdir] Created dir: /tmp/dist-repository
15:50:15     [mkdir] Created dir: /tmp/dist-repository/source
15:50:15     [mkdir] Created dir: /tmp/dist-repository/source/plugins
15:50:15     [mkdir] Created dir: /tmp/dist-repository/source/features
15:50:15     [mkdir] Created dir: /tmp/dist-repository/destination
15:50:15 
15:50:15 packageRepository:
15:50:15      [copy] Copying 2 files to /tmp/dist-repository/source/features
15:50:15 
15:50:15 publishRepository:
15:50:15       [zip] Building zip: /tmp/dist-repository/repository.zip
15:50:15 BUILD SUCCESSFUL
15:50:15 
15:50:15 BUILD SUCCESSFUL
15:50:15 Total time: 0 seconds
15:50:15 /opt/javaproxy
15:50:15 Archive:  /tmp/dist-repository/repository.zip
15:50:15    creating: /tmp/dist-install/features/
15:50:15    creating: /tmp/dist-install/plugins/
15:50:15   inflating: /tmp/dist-install/artifacts.xml  
15:50:15   inflating: /tmp/dist-install/content.xml  
15:50:15   inflating: /tmp/dist-install/features/com.mashery.proxy.local.customer.extensions_1.0.0.201811172350.jar  
15:50:15   inflating: /tmp/dist-install/plugins/com.mashery.customer.Base64Adapter-1.0_1.0.0.201811172350.jar  
15:50:15   inflating: /tmp/dist-install/plugins/com.mashery.customer.Base64UrlAdapter-1.0_1.0.0.201811172350.jar  
15:50:15   inflating: /tmp/dist-install/plugins/com.mashery.customer.Base64UrlAdapter2-1.0_1.0.0.201811172350.jar  
15:50:15 Updating /opt/javaproxy/proxy...
15:50:16 INFO  Profile Local
15:50:16 INFO  Timestamp Sat, 17 Nov 2018 23:50:13 GMT
15:50:16 INFO  Found com.mashery.apiserver.oauth.feature.group 1.16.0.v20181116-0033 Mashery API Server
15:50:16 INFO  Found com.mashery.proxy.local.customer.extensions.feature.group 1.0.0 Customer Extensions
15:50:16 INFO  Found com.mashery.proxy.local.customer.feature.group 1.59.0.v20180813-0728 Customer-specific Bundles
15:50:16 INFO  Found com.mashery.proxy.local.product 1.46.0.v20181116-2143 Mashery Proxy
15:50:16 INFO  Installing com.mashery.proxy.local.customer.extensions.feature.group 1.0.0.201811172350
15:50:17 INFO  Profile updated.
15:50:17 INFO  Timestamp Sat, 17 Nov 2018 23:50:17 GMT
15:50:17 INFO  Found com.mashery.apiserver.oauth.feature.group 1.16.0.v20181116-0033 Mashery API Server
15:50:17 INFO  Found com.mashery.proxy.local.customer.extensions.feature.group 1.0.0.201811172350 Mashery Customer Extensions
15:50:17 INFO  Found com.mashery.proxy.local.customer.feature.group 1.59.0.v20180813-0728 Customer-specific Bundles
15:50:17 INFO  Found com.mashery.proxy.local.product 1.46.0.v20181116-2143 Mashery Proxy
15:50:17 INFO  Operation completed in 1350 ms.

Build in Jenkins

Jenkins job "build-docker" for building docker images can be accessed using the Jenkins web console:

Jenkins job "build-docker" can also be started remotely using the Jenkins API as seen in the example below:

curl -v -X POST http://docker_host:8080/job/build-docker/buildWithParameters \
    --data-urlencode json='{"RELEASE_VERSION":"5.0.0", \
        "BUILD_NOSQL":"true", \
        "BUILD_LOG":"true", \
        "BUILD_SQL":"true", \
        "BUILD_CACHE":"true", \
        "BUILD_TM":"true", \
        "BUILD_CM":"true"}'

After a successful build, the docker images are available. See the following example:

docker images
 
REPOSITORY             TAG                  IMAGE ID            CREATED             SIZE
tmgc-cm                 v5.0.0.1             68b326911a77        2 hours ago         511MB
tmgc-tm                 v5.0.0.1             a93a38c331dd        2 hours ago         630MB
tmgc-cache              v5.0.0.1             20f58738793e        2 hours ago         552MB
tmgc-sql                v5.0.0.1             1091817ad763        2 hours ago         1.5GB
tmgc-log                v5.0.0.1             590d05b637b7        3 hours ago         637MB
tmgc-nosql              v5.0.0.1             b4265e78d765        3 hours ago         536MB

Docker images are downloaded by clicking the job number.