diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-23 06:08:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-23 06:08:53 +0300 |
commit | ccaa94488202341c25d24f6f16a70a9f658fc742 (patch) | |
tree | 886b8d0d4c14585243f3ccb439057e19f1860767 /doc/administration | |
parent | d65442b1d9621da6749d59ea1a544a2ea39b3a79 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/administration')
-rw-r--r-- | doc/administration/job_artifacts.md | 4 | ||||
-rw-r--r-- | doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md | 36 |
2 files changed, 38 insertions, 2 deletions
diff --git a/doc/administration/job_artifacts.md b/doc/administration/job_artifacts.md index 7a3d116ea58..99f4033e8fd 100644 --- a/doc/administration/job_artifacts.md +++ b/doc/administration/job_artifacts.md @@ -403,13 +403,13 @@ If you need to manually remove ALL job artifacts associated with multiple jobs, ```ruby project = Project.find_by_full_path('path/to/project') - builds_with_artifacts = project.builds.with_existing_job_artifacts + builds_with_artifacts = project.builds.with_existing_job_artifacts(Ci::JobArtifact.trace) ``` To select jobs with artifacts across the entire GitLab instance: ```ruby - builds_with_artifacts = Ci::Build.with_existing_job_artifacts + builds_with_artifacts = Ci::Build.with_existing_job_artifacts(Ci::JobArtifact.trace) ``` 1. Select the user which will be mentioned in the web UI as erasing the job: diff --git a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md index 0ab8d629b61..baadc2c6c56 100644 --- a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md +++ b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @@ -895,6 +895,42 @@ loop do end ``` +## Registry + +### Registry Disk Space Usage by Project + +As a GitLab administrator, you may need to reduce disk space consumption. +A common culprit is Docker Registry images that are no longer in use. To find +the storage broken down by each project, run the following in the +GitLab Rails console: + +```ruby +projects_and_size = [] +# a list of projects you want to look at, can get these however +projects = Project.last(100) + +projects.each do |p| + project_total_size = 0 + container_repositories = p.container_repositories + + container_repositories.each do |c| + c.tags.each do |t| + project_total_size = project_total_size + t.total_size + end + end + + if project_total_size > 0 + projects_and_size << [p.full_path,project_total_size] + end +end + +# projects_and_size is filled out now +# maybe print it as comma separated output? +projects_and_size.each do |ps| + puts "%s,%s" % ps +end +``` + ## Sidekiq ### Size of a queue |