Skip to content

adoptium-packages-linux-pipeline_new does not work across nodes with different workspace directory #1042

@andrew-m-leonard

Description

@andrew-m-leonard

Some ci.adoptium.net nodes use /home/jenkins and some (Azure Cloud VMs) use /home/adoptopenjdk.

The problem is not actually the VM, it's due to the Artifactory installer upload pipeline incorrectly combining "Declarative" and "Scripted" Jenkins pipeline syntax: https://github.com/adoptium/installer/blob/master/linux/Jenkinsfile
As stated in the Jfrog-cli doc: https://jfrog.com/help/r/jfrog-integrations-documentation/use-declarative-or-scripted-syntax-with-pipelines

When working with the Jenkins Artifactory plugin, be sure to choose either scripted or declarative.
In other words, do not use declarative and scripted steps within a single pipeline.
This will not work.

The jfrog-cli Declarative tools definition sets up the pipeline environment for the agent the top-level pipeline runs on, the pipeline then switches to "scripted" mode and switches context using node(), the jfrog-cli will then not necessarily work in that context.

The https://github.com/adoptium/installer/blob/master/linux/Jenkinsfile needs re-working as either a pure "Declarative" pipeline using the jfrog plugin, or as a "Scripted" pipeline (will need server config and credentials adding...).

There is also a secondary issue in that the installer jenkins file locks two "dockerBuild&&linux&&x64" nodes, which inevitably causes a deadlock given there are only 2 of these nodes and in the situation where 2 jobs have been queued.
The top-level agent lock is not required to remain when calling the stages, and is an unfortunate consequence of using a top-level "Declarative" pipeline which then calls "scripted" pipeline that then uses node() locking...

I think the easiest way to refactor this is to split this job into two, the top-level one being a "Scripted" pipeline that does the "what we need to build and where" logic, and a second "Declarative" upload pipeline job which it calls. As it is only the second "upload" job that needs to use the jfrog-cli plugin. The second job then be called multiple times by the top-level job with the appropriate parameters.
Important note: the top-level job does not need to reserve a agent node while calling the sub-jobs...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions