Setting up to run an IBM Dependency Based Build User Build on Wazi Sandbox

The following steps explain running an IBM Dependency Based Build (DBB) user build on the Wazi Sandbox virtualized z/OS system that comes pre-configured with DBB.

  1. Switch to the wazi-master branch of the zopeneditor-sample repo.

  2. Open the zowecli-create-profiles.sh script and replace the parameter values with the appropriate values for Wazi Sandbox.

  3. In the terminal window, run the script:

    . SCRIPTS/zowecli-create-profiles.sh

    It will:

    • Create the RSE and SSH profiles

    • Set them as default profiles

  4. Verify the RSE profile using either Zowe Explorer or Zowe CLI commands:

    • Zowe Explorer

      • Click the refresh button and add the new RSE profile.

      • Click the magnifying glass icon and run a search on IMBUSER.* data sets and /u/ibmuser uss files

    • Zowe CLI

      • In the terminal window, run the commands:

        zowe rse ls ds "IBMUSER"
        zowe rse ls uss "/u/ibmuser"
  5. Open the dbb-prepare-uss-folder.sh script and verify the parameter values for Wazi Sandbox.

  6. In the terminal window, run the script:

    . SCRIPTS/dbb-prepare-uss-folder.sh

    It will:

    • Create a project folder /u/ibmuser/projects where the source code will be uploaded and built.

    • Clone the DBB zappbuild repo to the uss working directory. zAppBuild is a generic build solution for building z/OS applications by using Apache Groovy build scripts and IBM Dependency Based Build (DBB) APIs.

    • Upload the pre-configured datasets.properties file.

  7. Open .theia/settings.json, find the zopeneditor.userbuild.userSettings setting and replace IBMUSER with the TSO User ID assigned to you.

    Note: On the Wazi Sandbox, there is a limitation loading JVM classes for groovy into memory which has a negative impact on the perfomance of DBB build commands. To significantly increase performance, DBB provides a daemon to manage the JAVA processes to avoid JVM startup issues. To engage the daemon, the following option has been added to the groovyz build command in the zopeneditor.userbuild.workspaceSettings setting:

    "zopeneditor.userbuild.workspaceSettings": {
       "dbb": {
          "command": "$DBB_HOME/bin/groovyz -DBB_PERSONAL_DAEMON",
          "commandArgs": [],
          "buildScriptPath": "${zopeneditor.userbuild.userSettings.dbbWorkspace}/dbb-zappbuild/build.groovy",
          "buildScriptArgs": [
             "--userBuild",
             "--workspace ${zopeneditor.userbuild.userSettings.dbbWorkspace}",
             "--application zopeneditor-sample",
             "--hlq ${zopeneditor.userbuild.userSettings.dbbHlq}",
             "--outDir ${zopeneditor.userbuild.userSettings.dbbWorkspace}/zopeneditor-sample/logs"
          ],

    Learn more about the DBB daemon.

  8. Open one of the following files in VS Code. zopeneditor-sample/COBOL/SAM1.cbl zopeneditor-sample/PLI/PSAM2.pli zopeneditor-sample/ASM/ASAM1.asm

    Note: When using the zopeneditor-sample repository, PSAM2.pli will need to be built prior to building PSAM1.pli in order for the linkedit step to complete successfully.

  9. Right-click inside the file to view the user build options. There are three user build options in the pop-up menu:

    • Run IBM User Build

    • Run IBM User Build with full upload

    • Run Setup for IBM User Build

  10. Click Run Setup for IBM User Build. This option uploads the application-conf folder to z/OS and creates zopeneditor-sample inside /u/ibmuser/projects if it does not exist.

    You will see output similar to the following text:

    =====================
    Running setup for user build...
    Setup will upload files or folders defined in your ZAPP file or in .vscode/settings.json under "zopeneditor.userbuild.userSettings.additionalDependencies".
    Checking ZAPP file or workspace settings...
    DBB ZAPP or workspace settings should be defined in either your repository's zapp.yaml, zapp.json or .vscode/settings.json file.
        command: $DBB_HOME/bin/groovyz -DBB_PERSONAL_DAEMON
        buildScriptArgs: --userBuild,--workspace /u/ibmuser/projects,--application zopeneditor-sample,--hlq IBMUSER.SAMPLE,--outDir /u/ibmuser/projects/zopeneditor-sample/logs
        buildScriptPath: /u/ibmuser/projects/dbb-zappbuild/build.groovy
        additionalDependencies: application-conf
    ---------------------
    Checking user settings...
    User settings should be defined in your VS Code or Theia Settings under zopeneditor.userbuild.userSettings
        localWorkspacePath: **Optional setting is missing**
        dbbWorkspace: /u/ibmuser/projects
        dbbHlq: IBMUSER.SAMPLE
        dbbLogDir: /u/ibmuser/projects/logs
    ---------------------
    Using ssh profile mySSHProfile
    Using zowe profile profile myCLIProfile
    Identified local root workspace path a/wazi/zopeneditor-sample
    Running setup to build /Users/user/wazi/zopeneditor-sample/COBOL/SAM1.cbl program.
    Executing ssh command:
    mkdir -p '/u/ibmuser/projects/zopeneditor-sample'
    $
    Uploading additional dependencies...
    Uploadin/wazi/zopeneditor-sample/application-conf
    Executing ssh command:
    mkdir -p '/u/ibmuser/projects/zopeneditor-sample/application-conf'
    $
    User build setup FINISHED.
  11. Right-click inside the program file in the editor again and select Run IBM User Build.

    You will see output similar to the following text:

    =====================
    Running user build...
    Identified local root workspace path as /Users/user/zopeneditor-sample
    ---------------------
    Checking workspace settings...
    Workspace settings should be defined in your repository's .vscode/settings.json file under zopeneditor.userbuild.workspaceSettings.dbb
       command: $DBB_HOME/bin/groovyz -DBB_PERSONAL_DAEMON
       buildScriptArgs: --userBuild,--workspace /u/ibmuser/projects,--application wazi-sample,--hlq IBMUSER.SAMPLE,--outDir /u/ibmuser/projects/zopeneditor-sample/logs
       buildScriptPath: /u/ibmuser/zAppBuild/build.groovy
       additionalDependencies: application-conf
    ---------------------
    Checking user settings...
    User settings should be defined in your VS Code or Theia Settings under zopeneditor.userbuild.userSettings
       localWorkspacePath: **Optional setting is missing**
       dbbWorkspace: /u/ibmuser/projects
       dbbHlq: IBMUSER.SAMPLE
       dbbLogDir: /u/ibmuser/projects/zopeneditor-sample/logs
    ---------------------
    Using ssh profile mySSHProfile
    Using zowe profile profile myZoweCLIProfile
    Executing ssh command:
    mkdir -p /u/ibmuser/projects/zopeneditor-sample/COBOL
    Uploading /Users/user/zoweDev/zopeneditor-sample/COBOL/SAM1.cbl program.
    Found total of 2 local copybooks.
    Checking if copybook files were updated since last build...
    Executing ssh command:
    mkdir -p /u/ibmuser/projects/zopeneditor-sample/COPYBOOK
    Updating 2/2 local copybooks.
    Uploading /Users/user/zopeneditor-sample/COPYBOOK/CUSTCOPY.cpy
    Uploading /Users/user/zopeneditor-sample/COPYBOOK/TRANREC.cpy
    ---------------------
    Executing ssh command:
    $DBB_HOME/bin/groovyz -DBB_PERSONAL_DAEMON /u/ibmuser/zAppBuild/build.groovy --userBuild --workspace /u/ibmuser/projects --application zopeneditor-sample --hlq IBMUSER.SAMPLE --outDir /u/ibmuser/projects/zopeneditor-sample/logs /u/ibmuser/projects/zopeneditor-sample/COBOL/SAM1.cbl
    $
    ** Build start at 20200820.101012.010
    ** Build output located at /u/ibmuser/projects/zopeneditor-sample/logs
    ** Adding /u/ibmuser/projects/zopeneditor-sample/COBOL/SAM1.cbl to Building build list
    ** Writing build list file to /u/ibmuser/projects/zopeneditor-sample/logs/buildList.txt
    ** Invoking build scripts according to build order: BMS.groovy,Cobol.groovy,Assembler.groovy,PLI.groovy,LinkEdit.groovy
    ** Building files mapped to BMS.groovy script
    ** Building files mapped to Cobol.groovy script
    *** Building file zopeneditor-sample/COBOL/SAM1.cbl
    ** Building files mapped to Assembler.groovy script
    ** Building files mapped to PLI.groovy script
    ** Building files mapped to LinkEdit.groovy script
    ** Writing build report data to /u/ibmuser/projects/zopeneditor-sample/logs/BuildReport.json
    ** Writing build report to /u/ibmuser/projects/zopeneditor-sample/logs/BuildReport.html
    ** Build ended at Thu Aug 20 10:10:18 EDT 2020
    ** Build State : CLEAN
    ** Total files processed : 1
    ** Total build time  : 5.441 seconds
    ** Build finished
    Looking for user-build logs in "/u/ibmuser/projects/zopeneditor-sample/logs".
    Downloading logs to /Users/user/zopeneditor-sample/logs
    Downloading log file /u/ibmuser/projects/zopeneditor-sample/logs/buildList.txt. Binary: false
    Downloading log file /u/ibmuser/projects/zopeneditor-sample/logs/SAM1.log. Binary: false
    Downloading log file /u/ibmuser/projects/zopeneditor-sample/logs/BuildReport.json. Binary: true
    Downloading log file /u/ibmuser/projects/zopeneditor-sample/logs/BuildReport.html. Binary: true
    Downloading log file /u/ibmuser/projects/zopeneditor-sample/logs/SAM2.log. Binary: false
    Downloading of 5 log files to /Users/user/zopeneditor-sample/logs finished successfully.
    
  12. Check your local repository for log files. The build created a logs folder in the local zopeneditor-sample directory and downloaded build log files from z/OS.

    To avoid committing changes in the logs folder, you can add it to .gitignore so Git would not show new changes in the repository when you run builds.

NOTE If you need to start with a fresh setup or just need to remove the working directory when finished, you can run the dbb-remove-uss-folder.sh script.