Registry regulations cleanup
🌐 This document is available in both English and Ukrainian. Use the language toggle in the top right corner to switch between versions. |
1. Overview
The cleanup pipeline (cleanup-job
) in Jenkins is an automated process designed to optimize the registry regulations by removing obsolete or unnecessary data, resources, and components. The process performs the following tasks:
-
Cleaning up temporary DB replicas deployed for version candidates.
-
Removing resources and services.
-
Cleaning up the Nexus repository.
-
Additional cleanup operations set up by an administrator.
We do not recommend running the cleanup job on production environments, as this may result in the loss of important data. |
2. Cleanup job stages and steps
The cleanup process includes the following stages:
- cleanup-of-version-candidate-dbs
-
During this stage, the job cleans up temporary databases for version candidates, which frees up disk space and helps to keep the system in order.
For details on deploying the databases for version candidates, see registry-admin/admin-portal/registry-modeling/tables/tables-data-structures.adoc#data-model-version-candidate. - delete-data-services
-
During this stage, the job removes
buildConfig
and Helm chart resources for the following data services:registry-kafka-api
,registry-soap-api
,registry-rest-api
, andregistry-model
. Also, the job removes Kafka topics for the registry API service (registry-rest-api
).Data services are services and tools that enable data collection, processing, storage, and provision for various applications, users, and systems.
- cleanup-trigger
-
This stage contains several steps:
-
Deleting the following data services:
registry-kafka-api
,registry-soap-api
,registry-rest-api
, andregistry-model
. -
Deleting
history-excerptor
.History excerptor is a tool that generates a readable excerpt with changes from a history table containing data about changes in all other registry database tables and enables downloading this excerpt in PDF format directly from the Jenkins console.
-
Cleaning up the Nexus artifacts repository.
-
One of the following options:
-
Deleting the registry regulations repository (
registry-regulations
) and cleaning the Redash database and resources (if theDELETE_REGISTRY_REGULATIONS_GERRIT_REPOSITORY
checkbox is selected). -
Leaving
registry-regulations
unchanged and cleaning the Redash database and resources (if theDELETE_REGISTRY_REGULATIONS_GERRIT_REPOSITORY
checkbox is cleared).
-
-
Creating new empty repositories for
history-excerptor
andregistry-regulations
.Creating registry-regulations
is skipped if the cleanup process did not remove this component. -
Starting the
MASTER-Build-registry-regulations
pipeline with theFULL_DEPLOY
option (provided that the cleanup process did not remove theregistry-regulations
component), which allows deploying the regulations correctly after the cleanup process.
3. Configuring and starting the cleanup process
You can configure and start the regulations cleanup process in the registry Jenkins service using the following link: https://admin-tools-<registry-name>.apps.<cluster-name>.dev.registry.eua.gov.ua/cicd
-
Sign in to the Control Plane admin console.
-
Go to Registries > Quick links and click the Jenkins service link.
For details, see Quick links to registry services. -
Open the
cleanup-job
pipeline and clickBuild with Parameters
in the leftmost menu.Before starting the cleanup pipeline, you need to specify the parameters to ensure the process works correctly.
All parameters are configured automatically, and changing their configuration is not recommended. The only parameter that needs to be set manually is the DELETE_REGISTRY_REGULATIONS_GERRIT_REPOSITORY
checkbox that defines the pipeline’s logic.- Here are the parameters with descriptions:
-
-
DELETE_REGISTRY_REGULATIONS_GERRIT_REPOSITORY
determines whether the registry-regulations repository should be deleted and re-created from an empty template.If this option is selected, the repository will be deleted and created from scratch. By default, the DELETE_REGISTRY_REGULATIONS_GERRIT_REPOSITORY
option is cleared. -
STAGES
contains options for configuring the various stages of the process (for details, see Cleanup job stages and steps). -
CODEBASE_NAME
contains the name of your CodeBase. Set it toregistry-regulations
. -
CODEBASE_HISTORY_NAME
contains the name of CodeBase history that shows the version and state of the code at a certain point in time. Set it tohistory-excerptor
. -
REPOSITORY_PATH
contains the path to your repository. This will help the system to find and work with the appropriate repository. -
LOG_LEVEL
determines the logging level for the process. Possible values areERROR
,WARN
,INFO
, orDEBUG
. This parameter allows you to control the level of detail of information that will be stored in the logs during the execution of the process.To view the process execution log, open the corresponding pipeline and click Console Output in the leftmost menu.
-
DEPLOYMENT_MODE
determines the system’s deployment mode. Possible values aredevelopment
orproduction
.
-
-
After setting all parameters, start the cleanup process by clicking the
Build
button. The system performs the specified operations according to the configuration and ensures the appropriate state of the codebase and repositories. -
As a result, the regulations cleanup process starts, which either deletes the
registry-regulations
repository or not, depending on theDELETE_REGISTRY_REGULATIONS_GERRIT_REPOSITORY
option at the cleanup-trigger stage. -
Completing the cleanup process automatically starts the
MASTER-Build-registry-regulations
pipeline with theFULL_DEPLOY
option (provided that the cleanup process did not remove theregistry-regulations
component), which allows deploying the regulations correctly after the cleanup process.