Need 'cost' < 1000 for copr repos
by Richard Hughes
Hi all,
I've done ~180 builds in COPR now, and the system works really well,
thanks! One little issue I've had is the last of "cost" to the
non-copr repos. For instance, targeting f20, i386&x64:
f20-updates:
* glib-2.0
* gnome-desktop-3.10.0 (which uses glib)
* control-center-3.10.0 (and this uses a library in gnome-desktop)
* gnome-shell-3.10.0 (and this uses a library in gnome-desktop)
Then I build gnome-desktop-3.11.1 in a copr which bumps the soname,
which means any package that depend on it also have to be rebuilt. If
I then re-submit the control-center-3.10.0 srpm this succeeds and
these packages are loaded into the buildroot:
* glib-2.0 (updates)
* gnome-desktop-3.11.1 (copr)
* control-center-3.10.0 (local)
If I then re-submit the gnome-shell-3.10.0 build, the following set of
packages is chosen:
* glib-2.0 (updates)
* gnome-desktop-3.11.1 (copr)
* control-center-3.10.0 (**UPDATES**)
* gnome-shell-3.10.0 (local)
So the control-center-3.10.0 build is coming from the updates repo
(built against the old soname) rather than the identically versioned
build control-center-3.10.0 from the copr repo (built against the new
soname).
Now yum and dnf have a way to prefer one repo over another, and this
is the "cost" value in the .repo file. Can I suggest that either the
fedora&updates repo either have a cost value set to above 1000, or
that the copr repo has cost less than the default value of 1000? This
should fix the issue and ensure deps are chosen from the copr rather
than the fedora repos.
Thanks,
Richard
9 years, 9 months
copr-1.27 released
by Miroslav Suchý
Hi,
I just released copr-1.27. It contains just bugfixes (notably for
createrepo_c which was cause of recent outages).
Only new features are:
- new api call which shows last modification (i.e. time of last build)
of project
- you can now do: copr-cli build msuchy/foobar. I.e. build into projects
you do not own.
I just deployed new version on copr.fedoraproject.org.
I decided to not release this version in Fedora as last one is still too
fresh. I will release in Fedora next version.
Mirek
9 years, 9 months
Re: [copr] search: api: implement search (8d9fd2a)
by Miroslav Suchý
On 02/17/2014 08:10 AM, ignatenkobrain(a)fedoraproject.org wrote:
> +
> +(a)api_ns.route("/coprs/search/")
> +(a)api_ns.route("/coprs/search/<project>/")
> +def api_coprs_search_by_project(project=None):
> + """ Return the list of coprs found in search by the given project.
> + project is taken either from GET params or from the URL itself
> + (in this order).
> +
> + :arg project: the project one would like find for coprs.
> +
> + """
> + project = flask.request.args.get("project", None) or project
> + httpcode = 200
> + if project:
> + query = coprs_logic.CoprsLogic.get_multiple(
> + flask.g.user, coprname=project)
> +
> + repos = query.all()
> + output = {"output": "ok", "users": []}
> + for repo in repos:
> + output["users"].append({"name": repo.owner})
> + else:
> + output = {"output": "notok", "error": "Invalid request"}
> + httpcode = 500
> +
> + jsonout = flask.jsonify(output)
> + jsonout.status_code = httpcode
> + return jsonout
Hmm, I would expect that this api call would do fulltext search using whooshe.
Same as /coprs/fulltext/ in WebUI.
--
Miroslav Suchy, RHCE, RHCDS
Red Hat, Senior Software Engineer, #brno, #devexp, #fedora-buildsys
9 years, 9 months
Memory limit on builders?
by Richard Hughes
I tried building webkitgtk3 in a copr and the linker segfaulted as it
was out of memory. I had to use a custom srpm with the debuginfo
turned off before it would succeed -- is this expected given the
fedora webkitgtk3 package builds fine in koji?
Thanks,
Richard.
9 years, 9 months
COPR down?
by Richard Hughes
Hi all,
I've not had any builds be scheduled for a couple of hours, is copr
stuck / crashed? Thanks.
Richard.
9 years, 9 months
Building for RHEL / Centos 7
by Richard Hughes
Hi all,
I'm trying to build some packages against RHEL-7. I can see there's an
epel-7-x86_64 target, but I need the core packages as well. As I can't
point copr to our RH internal brew instance, and none of the centos
mirrors have centos-7 content yet. Ideas?
Richard
9 years, 9 months
[PATCH] [frontend] add copr modification to web api
by Matej Stuchlik
I've yet to update the API documentation page [0], I'll send the relevant patch
if this one passes the review.
[0] http://copr-fe.cloud.fedoraproject.org/api/
I've also enhanced copr-cli to make use of this newly exposed API, I'll send that
patch in a little bit.
---
Allows for:
* modification of description, instructions and repos of a copr
via POST to $copr_api_url/coprs/<username>/<coprname>/modify
* adding packages to minimal buildroot of a chroot via POST to
$copr_api_url/coprs/<username>/<coprname>/modify/<chroot>
* reading what packages are currently added to minimal buildroot of a chroot
via POST to $copr_api_url/coprs/<username>/<coprname>/details/<chroot>
---
coprs_frontend/coprs/forms.py | 15 ++++
coprs_frontend/coprs/views/api_ns/api_general.py | 90 +++++++++++++++++++++++-
2 files changed, 104 insertions(+), 1 deletion(-)
diff --git a/coprs_frontend/coprs/forms.py b/coprs_frontend/coprs/forms.py
index c5dfa42..62711d5 100644
--- a/coprs_frontend/coprs/forms.py
+++ b/coprs_frontend/coprs/forms.py
@@ -250,3 +250,18 @@ class PermissionsFormFactory(object):
coerce=int))
return F
+
+class CoprModifyForm(wtf.Form):
+ description = wtforms.TextAreaField('Description',
+ validators=[wtforms.validators.Optional()])
+
+ instructions = wtforms.TextAreaField('Instructions',
+ validators=[wtforms.validators.Optional()])
+
+ repos = wtforms.TextAreaField('Repos',
+ validators=[UrlListValidator(),
+ wtforms.validators.Optional()],
+ filters=[StringListFilter()])
+
+class ModifyChrootForm(wtf.Form):
+ buildroot_pkgs = wtforms.TextField('Additional packages to be always present in minimal buildroot')
diff --git a/coprs_frontend/coprs/views/api_ns/api_general.py b/coprs_frontend/coprs/views/api_ns/api_general.py
index 6dcdaa6..8ecdc29 100644
--- a/coprs_frontend/coprs/views/api_ns/api_general.py
+++ b/coprs_frontend/coprs/views/api_ns/api_general.py
@@ -156,7 +156,6 @@ def copr_new_build(username, coprname):
output = {'output': 'notok', 'error':
'Copr with name {0} does not exist.'.format(coprname)}
httpcode = 500
-
else:
if form.validate_on_submit() and flask.g.user.can_build_in(copr):
# we're checking authorization above for now
@@ -203,3 +202,92 @@ def build_status(build_id):
jsonout.status_code = httpcode
return jsonout
+(a)api_ns.route('/coprs/<username>/<coprname>/modify/', methods=["POST"])
+@api_login_required
+def copr_modify(username, coprname):
+ form = forms.CoprModifyForm(csrf_enabled=False)
+ copr = coprs_logic.CoprsLogic.get(flask.g.user, username, coprname).first()
+
+ if copr is None:
+ output = {'output': 'notok', 'error': 'Invalid copr name or username'}
+ httpcode = 500
+ elif not form.validate_on_submit():
+ output = {'output': 'notok', 'error': 'Invalid request'}
+ httpcode = 500
+ else:
+ # .raw_data needs to be inspected to figure out whether the field
+ # was not sent or was sent empty
+ if form.description.raw_data and len(form.description.raw_data):
+ copr.description = form.description.data
+ if form.instructions.raw_data and len(form.instructions.raw_data):
+ copr.instructions = form.instructions.data
+ if form.repos.raw_data and len(form.repos.raw_data):
+ copr.repos = form.repos.data
+
+ try:
+ coprs_logic.CoprsLogic.update(flask.g.user, copr)
+ except (exceptions.ActionInProgressException, exceptions.InsufficientRightsException) as e:
+ db.session.rollback()
+
+ output = {'output': 'notok', 'error': str(e)}
+ httpcode = 500
+ else:
+ db.session.commit()
+
+ output = {'output': 'ok',
+ 'description': copr.description,
+ 'instructions': copr.instructions,
+ 'repos': copr.repos}
+ httpcode = 200
+
+ jsonout = flask.jsonify(output)
+ jsonout.status_code = httpcode
+ return jsonout
+
+(a)api_ns.route('/coprs/<username>/<coprname>/modify/<chrootname>/', methods=["POST"])
+@api_login_required
+def copr_modify_chroot(username, coprname, chrootname):
+ form = forms.ModifyChrootForm(csrf_enabled=False)
+ copr = coprs_logic.CoprsLogic.get(flask.g.user, username, coprname).first()
+ chroot = coprs_logic.MockChrootsLogic.get_from_name(chrootname, active_only=True).first()
+
+ if copr is None:
+ output = {'output': 'notok', 'error': 'Invalid copr name or username'}
+ httpcode = 500
+ elif chroot is None:
+ output = {'output': 'notok', 'error': 'Invalid chroot name'}
+ httpcode = 500
+ elif not form.validate_on_submit():
+ output = {'output': 'notok', 'error': 'Invalid request'}
+ httpcode = 500
+ else:
+ coprs_logic.CoprChrootsLogic.update_buildroot_pkgs(copr, chroot, form.buildroot_pkgs.data)
+ db.session.commit()
+
+ ch = copr.check_copr_chroot(chroot)
+ output = {'output': 'ok', 'buildroot_pkgs': ch.buildroot_pkgs}
+ httpcode = 200
+
+ jsonout = flask.jsonify(output)
+ jsonout.status_code = httpcode
+ return jsonout
+
+(a)api_ns.route('/coprs/<username>/<coprname>/details/<chrootname>/', methods=["POST"])
+def copr_chroot_details(username, coprname, chrootname):
+ copr = coprs_logic.CoprsLogic.get(flask.g.user, username, coprname).first()
+ chroot = coprs_logic.MockChrootsLogic.get_from_name(chrootname, active_only=True).first()
+
+ if copr is None:
+ output = {'output': 'notok', 'error': 'Invalid copr name or username'}
+ httpcode = 500
+ elif chroot is None:
+ output = {'output': 'notok', 'error': 'Invalid chroot name'}
+ httpcode = 500
+ else:
+ ch = copr.check_copr_chroot(chroot)
+ output = {'output': 'ok', 'buildroot_pkgs': ch.buildroot_pkgs}
+ httpcode = 200
+
+ jsonout = flask.jsonify(output)
+ jsonout.status_code = httpcode
+ return jsonout
--
1.8.4.2
9 years, 10 months