Skip to content

Artifact Management

In IBM Garage Method, one of the Develop practices is to automate continuous delivery through a delivery pipeline, in part by using an artifact repository for storing output of the build stage. The uses Artifactory as an artifact repository manager, which it uses to host its Helm repository.

What is Artifactory

Artifactory is an artifact management repository.

An artifact repository manager hosts multiple binary repositories, like a database management system for artifacts. The binary repository compliments the source code repository: the code from an SCM is the input to the build process, whereas a binary repository stores the output of the build process, often called artifacts. The artifacts are often individual application components that can later be assembled into a full product.

An artifact repository manager is an integral part of a CI/CD solution, a companion to the pipeline. As the pipeline builds artifacts, they're stored in the repositories. When the pipeline later needs artifacts that have already been built, they're retrieved from the repositories. This enables a build to be broken into smaller stages with well-defined inputs and outputs and provides better tracking of each stage's results. Often a failed pipeline can restart in the middle using artifacts that were already built and stored.

An artifact repository often serves as the storage for a package manager, which assembles an application from artifacts. Here are some common package managers and their repositories: - Maven: Builds Java artifacts (such as Jar, War, Ear, etc.) and projects stored in Maven repositories such as Maven Central - npm: Assembles programs from JavaScript packages stored in npm-registries such as the public npm registry - PIP: Installs Python packages from index repositories such as the Python Package Index (PyPI) - Helm: Deploys applications to Kubernetes using charts stored in Helm repositories such as the Helm Hub catalog of repositories

Docker is not a package manager, but its architecture includes an artifact repository: - Docker: Stores images in Docker registries such as Docker Hub

Note that you do not need a very large team to start reaping benefits from an artifact repository manager. The initial investment is not very large and the benefits are felt immediately.

Artifact management in the Pipeline

The will eventually be extended to store a number of artifact types in Artifactory. Thus far, the CI and CD pipelines exchange two types of artifacts: Docker images and Helm charts. The CI pipeline (Jenkins, Tekton, etc.) builds these artifacts and ArgoCD deploys them. To store and share the artifacts, the pipeline uses two repositories: - Docker images: The Developer Tools Image Registry - Helm charts: A Helm repository in Artifactory

The have also been configured to store their Helm charts in Artifactory.

Artifactory is part of the 's complete CI/CD solution:

Artifactory dashboard

Use the Artifactory dashboard to browse the repositories and their artifacts.

Open the Artifactory web UI for your environment.

  • Go to the OpenShift console. On the top, you will find an icon of a square made of 9 small squares.
  • Clicking on that icon will give you all the tools shortcut. Select Artifactory to navigate to the Artifactory dashboard.

Browse the Helm repository. - In the sidebar on the left, select Artifactory > Artifacts. - Expand the tree for the generic-local repository, which is the Helm repository - Expand the branch for your environment's cluster, such as showcase-dev-iks

The artifacts in the cluster's branch follow the Helm chart repository structure: - index.yaml: Helm's index of all of the charts in the repository - charts: The tgz files named for the application they deploy Artifact Repository Browser

Browse the artifacts to see how a Helm repository is organized. - Select the index.yaml file and View it to see its contents Helm Repository Index - Expand a chart's branch to see that the tgz file contains the chart directory structure Helm Chart Structure

Notice that each chart has its own URL in Artifactory, and index lists the URL for a chart.

Conclusion

The includes an artifact repository manager called Artifactory, which it uses to host a Helm repository. As the CI pipeline builds the Helm chart for an application, it stores the chart in the Artifactory repository. When the ArgoCD pipeline deploys an application, it retrieves the chart from the Artifactory repository.