Skip to content

Setup in Cloud Foundry

Overview


You can deploy XSK in the SAP BTP1, Cloud Foundry environment.

Prerequisites

  • Install the Cloud Foundry Command Line Interface.
  • Access to an SAP BTP global account. To create an SAP BTP Trial account, navigate to the SAP BTP Trial home page.
  • Create a SAP HANA Cloud service instance in SAP BTP Cloud Foundry space.
  • Create a separate SAP HANA Cloud user that will be used from the XSK engine.

Steps


  1. Set the SAP BTP Cloud Foundry API host:

    cf api <cloud-foundry-api-host>
    
  2. Log in to the SAP BTP, Cloud Foundry environment with:

    cf login
    
  3. Create an XSUAA service instance:

    • Copy and paste the following content into xs-security.json:

      {
         "xsappname": "<applicationName>-xsuaa",
         "tenant-mode": "shared",
         "scopes": [
            {
               "name": "$XSAPPNAME.Developer",
               "description": "Developer scope"
            },
            {
               "name": "$XSAPPNAME.Operator",
               "description": "Operator scope"
            }
         ],
         "role-templates": [
            {
               "name": "Developer",
               "description": "Developer related roles",
               "scope-references": [
                  "$XSAPPNAME.Developer"
               ]
            },
            {
               "name": "Operator",
               "description": "Operator related roles",
               "scope-references": [
                  "$XSAPPNAME.Operator"
               ]
            }
         ],
         "role-collections": [
            {
               "name": "XSK Developer",
               "description": "XSK Developer",
               "role-template-references": [
                  "$XSAPPNAME.Developer"
               ]
            },
            {
               "name": "XSK Operator",
               "description": "XSK Operator",
               "role-template-references": [
                  "$XSAPPNAME.Operator"
               ]
            }
         ]
      }
      

      Note

      Replace the <applicationName> placeholder with your application name, e.g. xsk.

    • Create an XSUAA service instance:

      cf create-service xsuaa application <applicationName>-xsuaa -c xs-security.json
      

      Note

      Use the same <applicationName> as in the previous step.

  4. Create map route:

    cf create-route <org-name> --hostname xsk 
    cf map-route xsk <org-name> --hostname xsk
    

  5. Deploy XSK:

    cf push xsk \
    --docker-image=dirigiblelabs/xsk-cf:latest \
    -m 2G -k 2G
    

    Note

    • Replace the <org-name> placeholder with your subaccount's Subdomain value.

    XSK versions

    Instead of using the latest tag (version), for production and development use cases it is recommended that you use a stable release version:

    • Bind the XSUAA and HANA Cloud service instances to the XSK deployment:

      cf bind-service xsk <applicationName>-xsuaa
      cf bind-service xsk <hanaCloudInstanceName>
      cf set-env xsk HANA_USERNAME <hanaCloudUsername>
      cf set-env xsk HANA_PASSWORD <hanaCloudPassword>
      

      Note

      • Replace the <applicationName> placeholder with the application name used in the previous steps.
      • Replace the <hanaCloudInstanceName> placeholder with the HANA Cloud service instance name that will be used.
      • Replace the <hanaUsername> placeholder with the HANA Cloud username that will be used.
      • Replace the <hanaPassword> placeholder with the HANA Cloud password that will be used.
    • Restart the xsk deployment:

      cf restart xsk
      
    • Download the sap-cf binaries from the downloads site: https://github.com/SAP/xsk/releases
    • Unzip the downloaded archive to extract the ROOT.war file.
    • Create manifest.yaml file in the same directory where the ROOT.war is located:

      applications:
      - name: xsk
        host: xsk-<org-name>
        memory: 2G
        buildpack: sap_java_buildpack
        path: ROOT.war
        env:
          JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jdk.SAPMachineJDK']"
          JBP_CONFIG_SAP_MACHINE_JRE: 'jre: { version: 11.+ }'
          HANA_USERNAME: <hanaUsername>
          HANA_PASSWORD: <hanaPassword>
        services:
          - <applicationName>-xsuaa
          - <hanaCloudInstanceName>
      

      Note

      • Replace the <org-name> placeholder with your subaccount's Subdomain value.
      • Replace the <applicationName> placeholder with the application name used in the previous steps.
      • Replace the <hanaUsername> placeholder with the HANA Cloud username that will be used.
      • Replace the <hanaPassword> placeholder with the HANA Cloud password that will be used.
      • Replace the <hanaCloudInstanceName> placeholder with the HANA Cloud service instance name that will be used.
    • Deploy with:

      cf push
      

  6. Assign the Developer and Operator roles.

  7. Log in.

Additional Information

For more details, see the step-by-step tutorial How to deploy Eclipse Dirigible in the SAP Cloud Platform Cloud Foundry environment on SAP Community.


  1. SAP Cloud Platform is called SAP Business Technology Platform (SAP BTP) as of 2021.