Skip to content

Conversation

@dennis-behm
Copy link
Member

@dennis-behm dennis-behm commented Jan 31, 2025

This is extending the existing common backend scripts dbbBuild.sh and zBuilder.sh to automatically fetch external dependencies from an artifact repository (instead of any concatenation).

It updates the structure how tar files are store in the Artifact repository.

wazideploy-generate.sh script to enhanced to re-compute the url of the package, to be able to download the the package with the Wazi Deploy provided mechanics.

High-level capabilities for fetch capability:

  • Read build dependency configuration defined in the Application Descriptor.
  • Load external dependencies based on naming conventions of the CBS from an artifact repository (Nexus, Artifactory)
  • Implement a central cache of external packages
  • Expand the external dependencies in the build workspace for consumption by the build framework

Deployment:

  • Enable wazideploy-generate to automatically pull the tar from the Artifact repository

Additional changes:

  • Common backend scripts no longer carry configuration parameters to point to existing scripts that sit in the same repository. It references the scripts within this repo.
  • ArtifactRepositoryHelpers methods upload and download are enhanced to return their return code

Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Copy link
Member

@M-DLB M-DLB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments.


# Path to main build script build.groovy.
zAppBuild="$HOME/dbb-zappbuild"
# DBEHM: MyCustomization for Path to build.groovy.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to remove this line and the next one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be just for testing for the moment


# (Optional) Additional property files to customize the build framework
zAppBuildPropFiles=""
zAppBuildPropFiles="/var/dbb/dbb-zappbuild-config/build.properties,/var/dbb/dbb-zappbuild-config/datasets.properties,/var/dbb/dbb-zappbuild-config/buildFolder.properties"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to remove this line?

importFolder.mkdirs()

// setup package cache
cacheFolder = new File("/tmp/.pkg")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we externalize this cache folder location with a property in the pipelineBackend.config?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the pipelineBackend.config with new settings and implemented the logic for the fetch


println("** Downloading application package '$artifactUrl' from Artifact Repository into ${cacheFolder}/${artifactRelPath}.")
def rc = artifactRepositoryHelpers.download(artifactUrl, tarFile as String, user, password, true)
println "download complete $rc" // TODO: Error handling in helper
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have a better info message, and a handling of rc != 0?

}
}

// Do we actually need this or can this just be obtained from the dependencies?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Baseline section of the AD file is meant to describe "dependency" on itself for a given application. It can serve two purposes: the first one is downloading the packages from earlier version that can be used as a base for artifacts that are not rebuilt (i.e., private object decks, generated include files from BMS, ...). The second one is to detect the baselineReference tag during an impact build.

I think the next section is necessary. Maybe it can be optimized to be turned into a method, to minimize the common code with the previous section.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still disagree to use the dependencies section to load our own baseline, we should use the baseline section of the AD file to retrieve the baseline archive from the artifactory repository.

yamlBuilder externalDependencies

externalDependencyFile = new File(props.externalDependenciesFilePath)
externalDependencyFile.withWriter("IBM-1047") { extDepWriter ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the sake of clarity, tagging is missing, even if it might not be useful.

dennis-behm and others added 21 commits February 5, 2025 16:47
Co-authored-by: Mathieu Dalbin <mathieu.dalbin@fr.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
dennis-behm and others added 5 commits March 28, 2025 14:15
Co-authored-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Copy link
Member

@M-DLB M-DLB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of changes. I think we're close, but we could simplify it a bit more, especially with not printing "packageUrl=" when calling computePackageUrl. By the way can we rename it to computeArchiveUrl? :)
I've tried to remove occurrences of Package as much as I can and i know I missed a few, if you can have a look, please.

dependency.name = applicationDependency
dependency.version = version
dependency.type = type
dependency.type = type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a mix a tabs and spaces in the indentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format applied

* If an existing baseline for a given branch already exists, the method replaces it
*/

def addBaseline(ApplicationDescriptor applicationDescriptor, String branch, String baseline) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this method dropped?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is derived from the MM. We don't need it here - @M-DLB do you want me to add it back in? Then we can share the entire utils interchangeability?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please. For easy management, we should have the exact same version than in the MM. You then might want to open a PR on the MM, to update it as well there :)

if [[ ! ${PackageInputFile:0:1} == "/" ]] ; then
checkWorkspace
PackageInputFile="$(getLogDir)/${PackageInputFile}"
if [ ! ${PackageInputFile:0:1} == "/" ] && [ -z "${usePackageUrl}" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ArchiveInputFile? I know WD uses packageInputFile...
No need to change...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With introducing the Archive - we already start with a new terminology. We should apply the Wazi Deploy terms here.

dennis-behm and others added 12 commits April 1, 2025 17:15
Co-authored-by: Mathieu Dalbin <mathieu.dalbin@fr.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Copy link
Member

@M-DLB M-DLB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dennis-behm for these great enhancements!

@dennis-behm dennis-behm merged commit 28eb9a5 into IBM:main Apr 7, 2025
1 check failed
dennis-behm added a commit to dennis-behm/dbb that referenced this pull request Apr 8, 2025
…etch external dependencies (IBM#299)

* (CBS) packageBuildOutputs.sh to follow implemented naming conventions how archives are published to Artifact repository
* (CBS) dbbBuild.sh and zBuilder.sh to process build dependency configuration defined in the Application Descriptor
* (CBS) Download external dependencies based on naming conventions from the artifact repository (Nexus, Artifactory) using the ArtifactRepositoryHelpers
* (CBS) Expanding the external dependencies in the build workspace for consumption by the build framework
* (CBS) Central cache of external archives
* (CBS) Enable wazideploy-generate to automatically download the tar from the Artifact repository
* (CBS) Scripts no longer carry configuration parameters to point to existing scripts. It references the scripts directly within this repo.

---------

Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Co-authored-by: Mathieu Dalbin <mathieu.dalbin@fr.ibm.com>
Co-authored-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants