Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    How to find out package disk space?

    Scheduled Pinned Locked Moved Support
    7 Posts 4 Posters 21 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ZazcallabahZ Offline
      Zazcallabah
      last edited by

      Dealing with a low disk space situation, I'm having trouble locating which docker packages are taking up space. I know from the "manage registry" page that the whole feed is taking up some 99% of the disk, which isn't really helping me.

      I need to know how much disk space is claimed by each package - each of which can have hundreds of tagged versions. Is this information available anywhere?

      1 Reply Last reply Reply Quote 1
      • R Offline
        RoroTiti
        last edited by

        @peter-hamberg_8356 said in How to find out package disk space?:

        I need to know how much disk space is claimed by each package - each of which can have hundreds of tagged versions. Is this information available anywhere?

        I agree that this could be a very useful addition. Actually the best way to do what you describe is to estimate the sum of the sizes of all images layers, which is not very convenient...

        1 Reply Last reply Reply Quote 0
        • ZazcallabahZ Offline
          Zazcallabah
          last edited by Zazcallabah

          I managed to get somewhat what I needed from the native api.
          I wrote this script which displays the sum of each image layers, grouped by package

          $key = "<key with native api access>"
          $uribase="http://<proget server>/api/json/"
          $feedid = <feed id>
          $packages = Invoke-webrequest "$($uribase)DockerImages_GetRepositories?key=$($key)&Feed_ID=$feedid" | select -expandproperty Content | convertfrom-json
          
          $size_lookup = @{}
          
          
          $data = @()
          $total = $packages.length
          $count = 0;
          $packages | %{
          	$n = [uri]::EscapeDataString($_.Repository_Name)
          	$progressPreference = 'silentlyContinue'
          	$images = Invoke-webrequest "$($uribase)DockerImages_GetImages?key=$($key)&Feed_ID=$($feedid)&Repository_name=$n" | select -expandproperty Content | convertfrom-json
          	$progressPreference = 'Continue'
          	$images | %{
          
          		$manifest = [System.Text.Encoding]::UTF8.GetString( [Convert]::FromBase64String($_.ManifestJson_Bytes) ) | convertfrom-json
          		$layers = $manifest.layers
          		$sizesum = $layers | ?{$_.size -ne $null } | measure -sum size | select -ExpandProperty sum
          		$obj = @{}
          
          		$obj.Add("Feed",$_.feed_id)
          		$obj.Add("Repository",$_.Repository_name)
          		$obj.Add("Manifest",$manifest )
          		$obj.Add("Layersum", $sizesum )
          		$obj.Add("DownloadCount",$_.Download_Count)
          		$obj.Add("Published",$_.Published_Date)
          		$data += $obj
          
          	}
          
          	$count++
          	write-progress -PercentComplete ($count*100/$total) -Activity "Working..."
          }
          
          $data | convertto-json -depth 99 | set-content -encoding utf8 out.json
          
          $data | group-object Repository | %{
          	$s=$_.group | measure -sum layersum | select -ExpandProperty sum;
          	$n = $_.name;
          	new-object psobject -Property @{"name"=$n;"size"=$s}
          } | sort-object size
          
          
          
          
          
          1 Reply Last reply Reply Quote 2
          • apxltdA Offline
            apxltd inedo-engineer
            last edited by

            Great solution, thanks for sharing @Zazcallabah

            Founder and CEO, Inedo

            R 1 Reply Last reply Reply Quote 0
            • R Offline
              RoroTiti @apxltd
              last edited by

              @apxltd Can we expect this feature to be added to ProGet anytime soon ?

              1 Reply Last reply Reply Quote 0
              • atrippA Offline
                atripp inedo-engineer
                last edited by

                In ProGet 5.3, we plan to have a couple tabs on each Tag (i.e. container image) that would provide this info: Metadata (will be a key/value pair of a bunch of stuff), and Layers will show details about each of these layers.

                That might help, but otherwise, we have retention policies which are designed to clean up old and unused images.We'll also have a way to detect which images are actually being used :)

                1 Reply Last reply Reply Quote 1
                • apxltdA Offline
                  apxltd inedo-engineer
                  last edited by

                  Just a quick in-progress preview of what we've got coming; feedback welcome!

                  2aefec08-0033-4d19-8dad-bb75849bbcce-image.png

                  Founder and CEO, Inedo

                  1 Reply Last reply Reply Quote 0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • 1 / 1
                  • First post
                    Last post
                  Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation