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

Diagram

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.

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, and registry-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, and registry-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 the DELETE_REGISTRY_REGULATIONS_GERRIT_REPOSITORY checkbox is selected).

    • Leaving registry-regulations unchanged and cleaning the Redash database and resources (if the DELETE_REGISTRY_REGULATIONS_GERRIT_REPOSITORY checkbox is cleared).

  • Creating new empty repositories for history-excerptor and registry-regulations.

    Creating registry-regulations is skipped if the cleanup process did not remove this component.
  • Starting the MASTER-Build-registry-regulations pipeline with the FULL_DEPLOY option (provided that the cleanup process did not remove the registry-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

  1. Sign in to the Control Plane admin console.

  2. Go to Registries > Quick links and click the Jenkins service link.

    cleanup job 1

  3. Open the cleanup-job pipeline and click Build with Parameters in the leftmost menu.

    cleanup job 2

    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 to registry-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 to history-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 are ERROR, WARN, INFO, or DEBUG. 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.

      cleanup job 5

    • DEPLOYMENT_MODE determines the system’s deployment mode. Possible values are development or production.

      cleanup job 3

  4. 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.

  5. As a result, the regulations cleanup process starts, which either deletes the registry-regulations repository or not, depending on the DELETE_REGISTRY_REGULATIONS_GERRIT_REPOSITORY option at the cleanup-trigger stage.

  6. Completing the cleanup process automatically starts the MASTER-Build-registry-regulations pipeline with the FULL_DEPLOY option (provided that the cleanup process did not remove the registry-regulations component), which allows deploying the regulations correctly after the cleanup process.

    cleanup job 4