gitlab-exporter: Clean up gems
What does this MR do?
We already clean up gems in all the other Ruby containers. This cleanup removes unnecessary .gemspec files and avoids false positives in security scanners.
This has a side benefit of decreasing the image size by 19 MB on the Debian and UBI-8 images:
$ docker images | grep exporter
registry.gitlab.com/gitlab-org/build/cng/gitlab-exporter sh-cleanup-gems-postgres-exporter-ubi8-ubi8 330707160d63 16 minutes ago 356MB
registry.gitlab.com/gitlab-org/build/cng/gitlab-exporter sh-cleanup-gems-postgres-exporter 757237957d9c 57 minutes ago 271MB
registry.gitlab.com/gitlab-org/build/cng/gitlab-exporter master-fips 072de017f0dc 40 hours ago 375MB
registry.gitlab.com/gitlab-org/build/cng/gitlab-exporter master da443f4cab9f 2 days ago 290MB
Related issues
See https://gitlab.com/gitlab-org/gitlab/-/issues/371623#note_1079821129.
QA
Debian
git@gitlab-gitlab-exporter-6cc97fc9b6-6xdff:/$ curl -s http://localhost:9168/metrics | tail
gitlab_database_rows{query_name="container_repositories_stalled_pre_import_done"} 0.0
gitlab_database_rows{query_name="container_repositories_stalled_importing"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_not_in_plan"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_too_many_retries"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_too_many_tags"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_deny_list"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_canceled"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_not_found"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_native"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_force_canceled"} 0.0
UBI-8
[git@gitlab-gitlab-exporter-86c4c84d59-4cqz7 /]$ curl -s http://localhost:9168/metrics | tail
gitlab_database_rows{query_name="container_repositories_stalled_pre_import_done"} 0.0
gitlab_database_rows{query_name="container_repositories_stalled_importing"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_not_in_plan"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_too_many_retries"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_too_many_tags"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_deny_list"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_canceled"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_not_found"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_native"} 0.0
gitlab_database_rows{query_name="container_repositories_skipped_force_canceled"} 0.0
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion
Required
-
Merge Request Title, and Description are up to date, accurate, and descriptive -
MR targeting the appropriate branch -
MR has a green pipeline on GitLab.com
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes -
Documentation created/updated -
Integration tests added to GitLab QA -
The impact any change in container size has should be evaluated
Edited by Stan Hu