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

Allow load command to read Jenkinsfile without occupying a node, or enable delayed execution after loading.

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • groovy-plugin
    • None
    • Version 2.462.1

      I am using the Multi-Branch Pipeline plugin and dynamically generating a declarative Jenkinsfile from a stored template in the Git repository. For this process, I use the built-in node block. Once the Jenkinsfile is created, I attempt to load it using the load method, which works as expected.

      However, as soon as the declarative script is loaded, the load command tries to execute immediately. Since the pipeline is long-running and utilizes multiple nodes throughout its execution, the initial node used for creating the Jenkinsfile remains occupied, leading to resource contention.

      I would like to load the Jenkinsfile similarly to how readTrusted works, but without using a node block. Alternatively, I am looking for a way to introduce a delayed execution after the script is loaded, ensuring that the initial node is not occupied unnecessarily during the delay.                                                

          [JENKINS-73840] Allow load command to read Jenkinsfile without occupying a node, or enable delayed execution after loading.

          Krishnan PR created issue -
          Krishnan PR made changes -
          Description Original: I am using multi branch plugin and dynamically creating a declarative jenkins file from the stored jenkins file in the git repo.  For creating  I am the built-in node. Once the jenkins file is created I am trying to load using "load" method. That is also working. But as soon as the  I load the declarative script, load command tries to execute. The pipeline is long running and uses many nodes internally. But since the load executes without any wait, the initial node where jenkins file is created also kept busy.

          I would like to load the jenkins file like readTrusted without any node or provide a delayed execution after the script is loaded                                                 
          New: I am using multi branch plugin and dynamically creating a declarative jenkins file from the stored jenkins file in the git repo.  For creating  I am using the built-in node. Once the jenkins file is created I am trying to load using "load" method. That is also working. But as soon as the  I load the declarative script, load command tries to execute. The pipeline is long running and uses many nodes internally. But since the load executes without any wait, the initial node where jenkins file is created also kept busy.

          I would like to load the jenkins file like readTrusted without any node or provide a delayed execution after the script is loaded                                                 
          Krishnan PR made changes -
          Description Original: I am using multi branch plugin and dynamically creating a declarative jenkins file from the stored jenkins file in the git repo.  For creating  I am using the built-in node. Once the jenkins file is created I am trying to load using "load" method. That is also working. But as soon as the  I load the declarative script, load command tries to execute. The pipeline is long running and uses many nodes internally. But since the load executes without any wait, the initial node where jenkins file is created also kept busy.

          I would like to load the jenkins file like readTrusted without any node or provide a delayed execution after the script is loaded                                                 
          New: I am using the Multi-Branch Pipeline plugin and dynamically generating a declarative {{Jenkinsfile}} from a stored template in the Git repository. For this process, I use the built-in {{node}} block. Once the {{Jenkinsfile}} is created, I attempt to load it using the {{load}} method, which works as expected.

          However, as soon as the declarative script is loaded, the {{load}} command tries to execute immediately. Since the pipeline is long-running and utilizes multiple nodes throughout its execution, the initial node used for creating the {{Jenkinsfile}} remains occupied, leading to resource contention.

          I would like to load the {{Jenkinsfile}} similarly to how {{readTrusted}} works, but without using a {{node}} block. Alternatively, I am looking for a way to introduce a delayed execution after the script is loaded, ensuring that the initial node is not occupied unnecessarily during the delay.                                                
          Krishnan PR made changes -
          Summary Original: Pipeline load command should not use node while reading files or provide the actual start method after node is used New: Allow load command to read Jenkinsfile without occupying a node, or enable delayed execution after loading.

            vjuranek vjuranek
            krishgcek Krishnan PR
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: