On 06/26/2013 02:25 PM, Miroslav Suchy wrote:
> On 06/26/2013 04:53 PM, seth vidal wrote:
>> 1. remember that the user can add random repos to their mock configs in
>> addition to the urls for their own srpms. Those repos can be from
>> anywhere - not just from coprs. This is on purpose - so we can support
>> a wide variety of systems and packages - w/ buildreqs from all over.
>
> Why we have such requirement?
Per first paragraph of http://fedoraproject.org/wiki/Category:Copr
"... to help make building and managing third party package repositories
*easy*." (emphasis mine).
Without this feature, copr's would lose a lot of what makes this easy.
-- rex
Hi list,
I'd like to start yet another discussion about some functionality of copr, here it is:
One of nice use cases for copr would be building software collections [1]. These however require modified mock chroot (modified config_opts['root'] and config_opts['chroot_setup_cmd']).
I'm trying to think of a way how to do this:
- We would need to allow users to create their own chroots (or more precisely allow them to do certain modifications).
- We would need to be able to send these chroots from frontend to backend.
- We would need some mechanism for sane naming, so that we can distinguish between builds of collections for different releases and architectures. E.g. ruby193-x86_64 is not enough, we need to also store the information about os name (epel/fedora) and os version (epel 6, fedora 18, ...).
My proposal:
- Use chroot names like ruby193_fedora-18-x86_64.
- Allow users to create these chroots by modifying config_opts['chroot_setup_cmd'] (config_opts['root'] would be autogenerated from the chroot name).
- Store the modified information in the MockChroot table and create these on backend using communication channel proposed in [2] (parts of it already implemented in frontend).
- Allow selecting these on copr creation/modification as more options for mock chroots, by default hidden under some kind of fancy clickable JS dropdown.
Thoughts?
--
Regards,
Bohuslav "Slavek" Kabrda.
[1] https://fedorahosted.org/SoftwareCollections/
[2] https://fedorahosted.org/copr/ticket/8
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 38707907e468d7314ad27056934576e0d1dee5c0
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jun 25 13:56:55 2013 +0200
remove sentence which does not have meaning
"you are you" does not have sense. I tried to rephrase it, but it is probably better without this sentece.
I think we do not need to explain why token expires.
>---------------------------------------------------------------
coprs_frontend/coprs/templates/api.html | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/coprs_frontend/coprs/templates/api.html b/coprs_frontend/coprs/templates/api.html
index c57e49f..6501147 100644
--- a/coprs_frontend/coprs/templates/api.html
+++ b/coprs_frontend/coprs/templates/api.html
@@ -13,8 +13,7 @@
should not be shared!</span>.
</p>
- <p>The API token is valid for {{ config['API_TOKEN_EXPIRATION'] }} days after you generated it, this
- in order to ensure you are you every {{ config['API_TOKEN_EXPIRATION'] }} days.
+ <p>The API token is valid for {{ config['API_TOKEN_EXPIRATION'] }} days after you generated it.
</p>
{% if g.user %}
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 171dd27b1dd78072766f3828975f78226de20049
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jun 25 13:50:59 2013 +0200
change api token expiration to 120 days and make it configurable
>---------------------------------------------------------------
coprs_frontend/coprs/templates/api.html | 4 ++--
coprs_frontend/coprs/views/api_ns/api_general.py | 2 +-
coprs_frontend/coprs/views/misc.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/coprs_frontend/coprs/templates/api.html b/coprs_frontend/coprs/templates/api.html
index 0ea30b2..c57e49f 100644
--- a/coprs_frontend/coprs/templates/api.html
+++ b/coprs_frontend/coprs/templates/api.html
@@ -13,8 +13,8 @@
should not be shared!</span>.
</p>
- <p>The API token is valid for 30 days after you generated it, this
- in order to ensure you are you every 30 days.
+ <p>The API token is valid for {{ config['API_TOKEN_EXPIRATION'] }} days after you generated it, this
+ in order to ensure you are you every {{ config['API_TOKEN_EXPIRATION'] }} days.
</p>
{% if g.user %}
diff --git a/coprs_frontend/coprs/views/api_ns/api_general.py b/coprs_frontend/coprs/views/api_ns/api_general.py
index 6d90033..7130509 100644
--- a/coprs_frontend/coprs/views/api_ns/api_general.py
+++ b/coprs_frontend/coprs/views/api_ns/api_general.py
@@ -38,7 +38,7 @@ def api_new_token():
user.api_token = helpers.generate_api_token(
flask.current_app.config['API_TOKEN_LENGTH'])
user.api_token_expiration = datetime.date.today() \
- + datetime.timedelta(days=30)
+ + datetime.timedelta(days=flask.current_app.config['API_TOKEN_EXPIRATION'])
db.session.add(user)
db.session.commit()
return flask.redirect(flask.url_for('api_ns.api_home'))
diff --git a/coprs_frontend/coprs/views/misc.py b/coprs_frontend/coprs/views/misc.py
index 7ffad6b..ea79640 100644
--- a/coprs_frontend/coprs/views/misc.py
+++ b/coprs_frontend/coprs/views/misc.py
@@ -56,7 +56,7 @@ def create_or_login(resp):
models.User.openid_name == resp.identity_url).first()
if not user: # create if not created already
expiration_date_token = datetime.date.today() \
- + datetime.timedelta(days=30)
+ + datetime.timedelta(days=flask.current_app.config['API_TOKEN_EXPIRATION'])
copr64 = base64.b64encode('copr') + '##'
user = models.User(openid_name = resp.identity_url, mail = resp.email,
api_login = copr64 + helpers.generate_api_token(
I've been noodling around with how to allow for arbitrary things to be
run prior to the actual building of the pkgs. This is to allow for a
wide range of 'sources' of pkgs.
I talked with Slavek at summit briefly and we talked about a way to
handle the giturl-of-doom or turning various arbitrary blobs into srpms.
The gist of it is this - we have a place we can do it in the code we
have but we will need to change how builds are being spawned.
Right now we just a direct ansible call to execute mockchain and get
the srpms building. This is simple and immediate but it means we have
to modify code every time we want to add another step.
I'm thinking we use a playbook instead of a direct call. This helps us
b/c it means the playbook is easier to modify and we can get the log
results out of its objects.
for anyone not familiar with ansible playbooks see here:
http://www.ansibleworks.com/docs/playbooks.html
Here's is the framework I was thinking of:
playbook:
play
- setup/create builder
- provision it
- add mock configs, etc
play
- verify state of the builder
play
- download srpms/pkgs/giturls/etc
- make into srpms (optionally)
- check integrity of srpms
- check licenses - essentially run the rpmlint license checker
- attempt buildorder sort? (optional but could be handy for a number of
cases - this is using this code:
http://skvidal.fedorapeople.org/misc/buildorder/
- mockchain build srpms
- async (perhaps to make it easier to timeout - harder to retrieve
logs)
play
- download results
play
- destroy builder
This playbook would let us modify the playbook for the type of system
(for example the mechanism to spin up an arm-builder is very very
different from an x86[_64] vm.
The way I figure this would allow us to insert a set of random tasks
into the entire build process w/o having to add more code - just add
more plays into the playbook.
thoughts?
-sv