Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37341

Add support of z/OS USS to sh step

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: durable-task-plugin
    • Labels:
      None
    • Environment:
      durable-task-1.10
    • Similar Issues:
    • Released As:
      durable-task 1.29

      Description

      We are going to use the pipeline plugin with build nodes running under z/OS Unix System Services (USS). Unfortunately, the sh step does not work out of the box on that platform because (text) files are encoded by default in IBM1047 (some EBCDIC variant) but the implementation within the durable-task-plugin seems to assume implicitly that the shell input and output is in UTF-8 or ASCII based.

      First experiments on top of durable-task-1.10 adding character set conversion in BourneShellScript and FileMonitoringTask to any read/write of files script.sh, pid, jenkins-result.txt and jenkins-log.txt were promising.

      Update : - the Script.sh file is untagged in z/OS USS , if its tagged as ASCII the script can be executed in z/OS USS. when the script is pushed it need to be tagged as ASCII.

        Attachments

          Issue Links

            Activity

            Hide
            johnanu Anu George added a comment -

            I am curious, do we need all three  plugins for this to work. I do have all,  but just checking. thanks . I need to check whether IBM1047 is supported.

            Show
            johnanu Anu George added a comment - I am curious, do we need all three  plugins for this to work. I do have all,  but just checking. thanks . I need to check whether IBM1047 is supported.
            Hide
            lne Lutz Neugebauer added a comment -

            IBM1047 vs IBM-1047 doesn't make a difference at my end. So you might want to double check your plugin versions. Here it is running fine with:

            • durable-task 1.29
            • workflow-durable-task-step 2.24
            • workflow-job 2.21
              Due to the error message you might also want to check whether IBM1047 is supported by the involved JVMs.
            Show
            lne Lutz Neugebauer added a comment - IBM1047 vs IBM-1047 doesn't make a difference at my end. So you might want to double check your plugin versions. Here it is running fine with: durable-task 1.29 workflow-durable-task-step 2.24 workflow-job 2.21 Due to the error message you might also want to check whether IBM1047 is supported by the involved JVMs.
            Hide
            johnanu Anu George added a comment - - edited

            Thanks Lutz Neugebauer , I tried the below  and it still doesn't work, same error

             

            pipeline {
            agent { node

            { label 'KanplexUSSAgent' }

            }
            stages {
            stage('build') {
            steps

            { //sh 'pwd' sh(encoding: 'IBM-1047', script:'pwd') }

            }
            }
            }

            Show
            johnanu Anu George added a comment - - edited Thanks Lutz Neugebauer , I tried the below  and it still doesn't work, same error   pipeline { agent { node { label 'KanplexUSSAgent' } } stages { stage('build') { steps { //sh 'pwd' sh(encoding: 'IBM-1047', script:'pwd') } } } }
            Hide
            lne Lutz Neugebauer added a comment -

            try

            sh(encoding:'IBM1047', script:'pwd')

            for the shell step

            Show
            lne Lutz Neugebauer added a comment - try sh(encoding:'IBM1047', script:'pwd') for the shell step
            Hide
            johnanu Anu George added a comment -

            I was trying to use this plugin to execute a sh file in z/OS USS, but gives error, so I just tried a simple step as below

            pipeline {
            agent { node

            { label 'KanplexUSSAgent' }

            }
            stages {
            stage('build') {
            steps

            { sh 'pwd' }

            }
            }
            }

            even this does not work. If anyone can give me suggestions, it will be helpful. Thanks in advance

            Show
            johnanu Anu George added a comment - I was trying to use this plugin to execute a sh file in z/OS USS, but gives error, so I just tried a simple step as below pipeline { agent { node { label 'KanplexUSSAgent' } } stages { stage('build') { steps { sh 'pwd' } } } } even this does not work. If anyone can give me suggestions, it will be helpful. Thanks in advance
            Hide
            dnusbaum Devin Nusbaum added a comment -

            This feature was just added in version 1.29 of the Durable Task plugin.

            Show
            dnusbaum Devin Nusbaum added a comment - This feature was just added in version 1.29 of the Durable Task plugin.
            Hide
            dnusbaum Devin Nusbaum added a comment -

            PR 80 was merged, so z/OS support will be available in the next release.

            Show
            dnusbaum Devin Nusbaum added a comment - PR 80 was merged, so z/OS support will be available in the next release.
            Hide
            kepler2 Bruce Griffith added a comment -

            I am stumbling over exactly the same issue using Multibranch Pipelines.  It seems to me that either script.sh needs to be created in the native character encoding, or script.sh should be tagged in z/OS UNIX System Services filesystems as ASCII.  Writing in the native character encoding seems, to me, to be a more generic implementation.  Maybe this is z/OS unique and it doesn't matter how it is implemented ...

            I have not found any possible workaround.  For a Freestyle project, you set Java environment variables and the Java slave takes care of it.

            Show
            kepler2 Bruce Griffith added a comment - I am stumbling over exactly the same issue using Multibranch Pipelines.  It seems to me that either script.sh needs to be created in the native character encoding, or script.sh should be tagged in z/OS UNIX System Services filesystems as ASCII.  Writing in the native character encoding seems, to me, to be a more generic implementation.  Maybe this is z/OS unique and it doesn't matter how it is implemented ... I have not found any possible workaround.  For a Freestyle project, you set Java environment variables and the Java slave takes care of it.

              People

              • Assignee:
                Unassigned
                Reporter:
                lne Lutz Neugebauer
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: