Introduction
This article provides a detailed overview of how the Release Lifecycle in JFrog Artifactory operates, especially focusing on how artifact count and storage are impacted by the Copy and Move methods during promotions. Understanding this lifecycle is crucial for managing storage quotas efficiently and ensuring proper cleanup processes.
Key Concepts:
1. Binaries:
Binaries Size equals the amount of physical storage occupied by the binaries/files in the filestore. Each binary is only stored once due to Artifactory’s checksum-based storage, even if it has multiple copies(artifacts).
2. Artifacts:
Artifacts Size equals the amount of storage that would be occupied if every artifact was saved as a new file in the filestore, without checksum-based storage.
Example: If an artifact is deployed twice to different repositories, the binary will be stored only once in the filestore, but the artifact count will reflect the deployments.
JFrog’s Release Lifecycle Management delivers an approach to maturing releases that, among other benefits, ensures the immutability of the release from the build stage to production. This guarantees that the same release content, including all packages associated with the release, are promoted without changes, maintaining integrity and traceability.
The main component of RLM is a Release Bundle, which represents the release candidate version. Actions you can perform on the Release Bundle are: Create, Promote, Distribute.
We will focus on the Promote phase and its Tracking Lifecycle within Artifactory and how Copy VS Move methods affect Artifacts Count and Storage quota:
#When a Release Bundle is promoted from one environment repository to another “stage” (example: DEV → Test → Prod), its contents are tracked within Artifactory to ensure consistency and prevent premature deletions.
Lifecycle Scenarios: Move vs. Copy Methods
The promotion method chosen, Move or Copy, significantly impacts artifact count and storage in repositories. A key importance is when the RLM flow is handled within Projects - the Project Storage Quota can be significantly higher than expected if this mechanism is misunderstood.
To better visualize the Promotion phases via the Platform UI, please refer to the example in Promote a Release Bundle v2 Version in the Platform UI.
Move Method Flow
-
Initial Upload: Upload example-artifact.jar (1GB) to dev-repository-local.
-
Create Bundle: Incorporate example-artifact.jar.
-
Promotion: Move artifact from DEV to TEST to PROD, maintaining storage at 1GB in each stage.
-
Deletion: Original source artifact in DEV remains if the bundle is deleted in PROD.
Copy Method Flow
-
Initial Upload: Upload example-artifact.jar (1GB) to dev-repository-local.
-
Create Bundle: Incorporate example-artifact.jar.
-
Promotion: Copy artifact to TEST and PROD, increasing storage to 2GB (DEV and TEST), then 3GB (DEV, TEST, PROD).
-
Deletion: Removes the artifact from PROD, TEST, and DEV if solely tracked by the bundle; original source artifact in DEV may remain.
Summary of Key Points
-
Move Method: Transfers artifacts and deletes them from the source if solely tracked. Source artifacts in DEV remain after deletion.
-
Copy Method: Copies artifacts to each repository, increasing storage. Cleans up all bundle-tracked artifacts except source artifacts in DEV.
Conclusion
Understanding these processes is crucial for managing storage quotas, especially in projects. Strategic use of Move and Copy methods helps admins maintain performance and organization within repositories, ensuring compliance with storage quotas and efficient resource usage.
References:
ARTIFACTORY: The complete Garbage Collection Guide
RLM: Complete Walk Through