Perform Cleanup Operations

BuildStream supports a maximum of 50 build images. When the build image count exceeds this limit, you must manually perform cleanup operations to remove old images before creating new ones.

Note

Do not cancel a running GitLab pipeline or stage. Cancellation prevents some pipeline steps from executing, which leaves the BuildStreaM job in an intermediate, inconsistent state. Note that backend BuildStreaM tasks already in progress will continue running to completion regardless of the cancellation.

Prerequisites

Before performing cleanup operations, ensure the following:

  • You have administrative access to the OIM

  • BuildStream API server is running

  • PostgreSQL database is accessible

Procedure

  1. Navigate to the GitLab project URL:

    https://<gitlab_host>:<gitlab_https_port>/root/<gitlab_project_name>
    
  2. Navigate to BuildPipelines.

  3. Click New Pipeline.

  4. In the Run new pipeline dialog box, enter the variable name as PIPELINE_TYPE and enter the value as cleanup.

GitLab Clean Pipeline Variable
  1. Click Run Pipeline to execute the cleanup pipeline.

  2. In the pipeline, select the image to be cleaned up from the select_image stage.

    ../../_images/gitlab-clean-select-image.png
    alt:

    GitLab Clean Select Image

  3. Click the Play button on the cleanup stage to execute the cleanup.

    GitLab Clean Run Stage
  4. Monitor the pipeline progress through the GitLab web interface:

    1. Click on the running pipeline to view details.

    2. Monitor the cleanup stage as it progresses to completion.

    GitLab Clean Monitor Pipeline
  1. Review the stage status indicators:
    • success Green checkmark: Stage completed successfully

    • failed Red X: Stage failed (click for error details)

    • running Blue circle: Stage currently running

Verification

  1. Check the GitLab pipeline status to ensure the cleanup stage passed.

  2. Verify the Image Group count is within the configured retention limit.

  3. Review the cleanup pipeline logs in GitLab for specific details about which Image Groups were removed.