Mailinglist Archive: opensuse-buildservice (137 mails)

< Previous Next >
Re: [opensuse-buildservice] buildlog lacks info about diskspace
On Tuesday 27 October 2015 17:35:52 Adrian Schröter wrote:
On Dienstag, 27. Oktober 2015, 17:32:57 CET wrote Olaf Hering:
The buildlog of a package which failed due to ENOSPC has no info how
much diskspace was actually available. This makes it cumbersome to
create a _constraints file. How much diskspace has a VM?

there are different ones ... and we don't have an interface to request
this information yet.

However, it is actually more interessting how much space is needed by
the job. If you still have a successfull job from this build you
can check the used resources via the _statistics file.

The webui is showing this here for example:
The docs do not list default values:


I just wanted to know the resources required for a larger number of packages
and repos. Instead of clicking through the webui, a hacked an osc plugin to do
it for me.

$> osc prjresources Kernel:stable "standard,PPC,ARM" "ppc64,aarch64,x86_64"
--- Kernel:stable standard x86_64 ---
kernel-debug: Disk: 15711 MByte Memory: 885 MByte Time: 10034 s
kernel-default: Disk: 15675 MByte Memory: 1262 MByte Time: 6245 s
kernel-vanilla: Disk: 16273 MByte Memory: 728 MByte Time: 20519 s
kernel-xen: Disk: 14564 MByte Memory: 1277 MByte Time: 6617 s
kernel-pv: Disk: 15815 MByte Memory: 764 MByte Time: 11427 s
--- Kernel:stable PPC ppc64 ---
kernel-debug: Disk: 14029 MByte Memory: 725 MByte Time: 7518 s
kernel-default: Disk: 13998 MByte Memory: 783 MByte Time: 7351 s
kernel-vanilla: Disk: 14667 MByte Memory: 1123 MByte Time: 6225 s
--- Kernel:stable ARM aarch64 ---
kernel-default: Disk: 13884 MByte Memory: 1098 MByte Time: 12511 s
kernel-vanilla: Disk: 14530 MByte Memory: 748 MByte Time: 9972 s

Kind regards,


Stefan Brüns / Bergstraße 21 / 52062 Aachen
home: +49 241 53809034 mobile: +49 151 50412019
work: +49 2405 49936-424#
# (C) 2015 stefan.bruens@xxxxxxxxxxxxxx
# Distribute under GPLv2 or GPLv3
# Copy this script to ~/.osc-plugins/ or /var/lib/osc-plugins .
# Then try to run 'osc checker --help' to see the usage.

# import os
import re
# import shutil
# import subprocess
# import sys
# import urllib2
from xml.etree import cElementTree as ET

# from osc.core import checkout_package
from osc.core import http_GET
# from osc.core import http_POST
# # from osc.core import link_pac
from osc.core import makeurl
# # from osc.core import show_upstream_rev_vrev
from osc import cmdln
from osc.core import meta_get_packagelist
from osc.core import get_repos_of_project, get_repositories_of_project

class Statistics:
def __init__(self):
self.diskusage = None
self.memory = None
self.totaltime = None

def read(self, statistics):
self.diskusage = self.readBytes(statistics.find("./disk/usage/size"))
self.memory = self.readBytes(statistics.find("./memory/usage/size"))
self.totaltime = self.readSeconds(statistics.find("./times/total/time"))

def readSeconds(self, node):
if node.get('unit') == 's':
return int(node.text)

def readBytes(self, node):
if node.get('unit') == 'M':
return int(node.text)

@cmdln.option('-v', '--verbose', action='store_true', help="verbose output")
@cmdln.option('-p', '--package', metavar='PACKAGE',
help='show results only for specified packages(s)')
@cmdln.option('-a', '--arch', metavar='ARCH',
help='show results only for specified architecture(s)')
@cmdln.option('-r', '--repo', metavar='REPO',
help='show results only for specified repo(s)')

def do_prjresources(self, subcmd, opts, *args):
"""${cmd_name}: checker review of submit requests.
osc prjresources (inside working copy)
osc prjresources PROJECT [REPO [ARCH [PACKAGE]]]
Shows resources used to build packages


apiurl = self.get_api_url()
#project = repo = arch = package = None
project = None

if args:
if len(args) > 4:
raise oscerr.WrongArgs('Wrong number of arguments.')
if len(args) >= 1:
project = args[0]
if len(args) >= 2:
opts.repo = args[1]
if len(args) >= 3:
opts.arch = args[2]
if len(args) == 4:
opts.package = args[3]

if not project:
wd = os.curdir
project = store_read_project(wd)

if opts.package:
opts.package = re.split(' |,|;', opts.package);
opts.package = meta_get_packagelist(apiurl, project)

if opts.repo:
opts.repo = re.split(' |,|;', opts.repo);
repo_filter = lambda r: in opts.repo
repo_filter = lambda r: True

if opts.arch:
opts.arch = re.split(' |,|;', opts.arch);
arch_filter = lambda r: r.arch in opts.arch
arch_filter = lambda r: True

repo_gen = get_repos_of_project(apiurl, project)
repos = [r for r in repo_gen if repo_filter(r) and arch_filter(r)]

for r in repos:
print("--- %s %s %s ---" % (project,, r.arch))
for pac in opts.package:

u = makeurl(apiurl, ['build', project,, r.arch, pac,
f = http_GET(u)
except HTTPError as e:

tree = ET.parse(f)
s = Statistics()
print("{0:<15} Disk: {1.diskusage:>5} MByte Memory: {1.memory:>5}
MByte Time: {1.totaltime:>5} s".format(pac + ":", s))

< Previous Next >
List Navigation
This Thread
  • No further messages