Re: mockremote with RHEL??

2017-01-31 Thread Pavel Raiskup
On Tuesday, January 31, 2017 2:52:59 PM CET Martin Juhl wrote:
> Sound right... hmm
> 
> By adding the following, the dist-git import seems to work, but now the 
> rpkg-copr fails..

Well, this is (probably) where pull-request [1] could help.  I was unable
to re-iterate so far, but that's on my todo list.  Maybe you want to give
it a try (I use that code downstream in my deployment, because I also
build against RHEL).

There are probably other ways around this issue, but it is really worth
having a look deeply how the fedpkg-copr works, and what is needed to let
all the parts of copr deployment work.  Also, you might try to workaround
all of this by something similar to the [2] proposal.

[1] https://pagure.io/copr/copr/pull-request/11
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1410403

Pavel


> [mockbuilder@copr03 python-blinker]$ fedpkg-copr -v --dist rhel7 srpm
> /usr/lib/python2.7/site-packages/pyrpkg/cli.py:37: DeprecationWarning: --dist 
> is deprecated and will be removed in future version. Use --release instead.
>   'Use --release instead.', DeprecationWarning)
> Creating repo object from /tmp/build_package_repo/python-blinker
> Could not determine the remote name: 'git config --get branch.rhel7.remote' 
> returned with exit code 1
> Falling back to default remote name 'origin'
> Could not execute srpm: Could not find the dist from branch name rhel7
> Traceback (most recent call last):
>   File "/bin/fedpkg-copr", line 193, in 
> main()
>   File "/bin/fedpkg-copr", line 183, in main
> sys.exit(client.args.command())
>   File "/usr/lib/python2.7/site-packages/pyrpkg/cli.py", line 1321, in srpm
> self.cmd.srpm(hashtype=self.args.hash)
>   File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 2402, in 
> srpm
> % (self.module_name, self.ver, self.rel))
>   File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 870, in ver
> self.load_nameverrel()
>   File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 668, in 
> load_nameverrel
> cmd.extend(self.rpmdefines)
>   File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 731, in 
> rpmdefines
> self.load_rpmdefines()
>   File "/bin/fedpkg-copr", line 83, in load_rpmdefines
> '%s' % self.branch_merge)
> pyrpkg.errors.rpkgError: Could not find the dist from branch name rhel7
> 
> 
> Any hints???
> 
> 
> 
> 
> --- filters.py.old  2017-01-31 14:49:40.173894506 +0100
> +++ filters.py  2017-01-31 14:43:21.575014808 +0100
> @@ -51,6 +51,8 @@
>  return "fc.{0}".format(os_version)
>  elif os_name == "epel":
>  return "el{0}".format(os_version)
> +   elif os_name == "rhel":
> +return "rhel{0}".format(os_version)
>  return os_name
> 
> 
> --- helpers.py.old  2017-01-31 14:51:04.863520441 +0100
> +++ helpers.py  2017-01-31 14:24:19.095712364 +0100
> @@ -230,6 +230,9 @@
>  elif branch[:4] == "epel" or branch[:2] == "el":
>  os = "epel"
>  version = branch[-1:]
> +elif branch[:4] == "rhel" or branch[:2] == "rh":
> +    os = "rhel"
> +version = branch[-1:]
>  elif branch[:6] == "custom":
>  os = "custom"
>  version = branch[-1:]
> 
> 
> 
> 
> - Original meddelelse -
> Fra: "Michal Novotny" <cl...@redhat.com>
> Til: "copr-devel" <copr-devel@lists.fedorahosted.org>
> Sendt: tirsdag, 31. januar 2017 14:06:41
> Emne: Re: mockremote with RHEL??
> 
> Martin, I think you go in the right direction. If you follow 
> /usr/share/copr/coprs_frontend/coprs/views/backend_ns/backend_general.py", 
> line 71 back to the cause, you will come to branch_to_os_version method that 
> does support epel but not rhel. That might as well be the cause of the 
> problem. M. 
> 
> On Tue, Jan 31, 2017 at 12:55 PM, Martin Juhl < m...@casalogic.dk > wrote: 
> 
> 
> Hmmm 
> 
> After digging a bit, I think that problem is actually with the import to 
> dist-git... Works fine with epel, but with RHEL it fails: 
> 
> ==> httpd/error_log <== 
> [Tue Jan 31 12:52:33.152277 2017] [:error] [pid 1029] 
> 
>  
> [Tue Jan 31 12:52:33.152313 2017] [:error] [pid 1029] DEBUG in 
> backend_general 
> [/usr/share/copr/coprs_frontend/coprs/views/backend_ns/backend_general.py:68]:
>  
> [Tue Jan 31 12:52:33.152316 2017] [:error] [pid 1029] {"pkg_version": 
> "1.36-1.

Re: mockremote with RHEL??

2017-01-31 Thread Martin Juhl
Sound right... hmm

By adding the following, the dist-git import seems to work, but now the 
rpkg-copr fails..



[mockbuilder@copr03 python-blinker]$ fedpkg-copr -v --dist rhel7 srpm
/usr/lib/python2.7/site-packages/pyrpkg/cli.py:37: DeprecationWarning: --dist 
is deprecated and will be removed in future version. Use --release instead.
  'Use --release instead.', DeprecationWarning)
Creating repo object from /tmp/build_package_repo/python-blinker
Could not determine the remote name: 'git config --get branch.rhel7.remote' 
returned with exit code 1
Falling back to default remote name 'origin'
Could not execute srpm: Could not find the dist from branch name rhel7
Traceback (most recent call last):
  File "/bin/fedpkg-copr", line 193, in 
main()
  File "/bin/fedpkg-copr", line 183, in main
sys.exit(client.args.command())
  File "/usr/lib/python2.7/site-packages/pyrpkg/cli.py", line 1321, in srpm
self.cmd.srpm(hashtype=self.args.hash)
  File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 2402, in srpm
% (self.module_name, self.ver, self.rel))
  File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 870, in ver
self.load_nameverrel()
  File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 668, in 
load_nameverrel
cmd.extend(self.rpmdefines)
  File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 731, in 
rpmdefines
self.load_rpmdefines()
  File "/bin/fedpkg-copr", line 83, in load_rpmdefines
'%s' % self.branch_merge)
pyrpkg.errors.rpkgError: Could not find the dist from branch name rhel7


Any hints???




--- filters.py.old  2017-01-31 14:49:40.173894506 +0100
+++ filters.py  2017-01-31 14:43:21.575014808 +0100
@@ -51,6 +51,8 @@
 return "fc.{0}".format(os_version)
 elif os_name == "epel":
 return "el{0}".format(os_version)
+   elif os_name == "rhel":
+return "rhel{0}".format(os_version)
 return os_name


--- helpers.py.old  2017-01-31 14:51:04.863520441 +0100
+++ helpers.py  2017-01-31 14:24:19.095712364 +0100
@@ -230,6 +230,9 @@
 elif branch[:4] == "epel" or branch[:2] == "el":
 os = "epel"
 version = branch[-1:]
+elif branch[:4] == "rhel" or branch[:2] == "rh":
+os = "rhel"
+version = branch[-1:]
 elif branch[:6] == "custom":
 os = "custom"
     version = branch[-1:]




- Original meddelelse -
Fra: "Michal Novotny" <cl...@redhat.com>
Til: "copr-devel" <copr-devel@lists.fedorahosted.org>
Sendt: tirsdag, 31. januar 2017 14:06:41
Emne: Re: mockremote with RHEL??

Martin, I think you go in the right direction. If you follow 
/usr/share/copr/coprs_frontend/coprs/views/backend_ns/backend_general.py", line 
71 back to the cause, you will come to branch_to_os_version method that does 
support epel but not rhel. That might as well be the cause of the problem. M. 

On Tue, Jan 31, 2017 at 12:55 PM, Martin Juhl < m...@casalogic.dk > wrote: 


Hmmm 

After digging a bit, I think that problem is actually with the import to 
dist-git... Works fine with epel, but with RHEL it fails: 

==> httpd/error_log <== 
[Tue Jan 31 12:52:33.152277 2017] [:error] [pid 1029] 

 
[Tue Jan 31 12:52:33.152313 2017] [:error] [pid 1029] DEBUG in backend_general 
[/usr/share/copr/coprs_frontend/coprs/views/backend_ns/backend_general.py:68]: 
[Tue Jan 31 12:52:33.152316 2017] [:error] [pid 1029] {"pkg_version": 
"1.36-1.fc22", "git_hash": "3231f204b083b4532ee25757c45afe21fced9a75", 
"pkg_name": "copr-selinux", "task_id": "23-rhel7", "repo_name": 
"mj/Ting/copr-selinux"} 
[Tue Jan 31 12:52:33.152318 2017] [:error] [pid 1029] 

 
[Tue Jan 31 12:52:33.152944 2017] [:error] [pid 1029] 
DEBUG:coprs:{"pkg_version": "1.36-1.fc22", "git_hash": 
"3231f204b083b4532ee25757c45afe21fced9a75", "pkg_name": "copr-selinux", 
"task_id": "23-rhel7", "repo_name": "mj/Ting/copr-selinux"} 

==> copr-frontend/frontend.log <== 
2017-01-31 12:52:33,152 
[DEBUG][/usr/share/copr/coprs_frontend/coprs/views/backend_ns/backend_general.py:68|backend_general:dist_git_upload_completed]
 {"pkg_version": "1.36-1.fc22", "git_hash": 
"3231f204b083b4532ee25757c45afe21fced9a75", "pkg_name": "copr-selinux", 
"task_id": "23-rhel7", "repo_name": "mj/Ting/copr-selin

Re: mockremote with RHEL??

2017-01-31 Thread Pavel Raiskup
On Tuesday, January 31, 2017 11:22:18 AM CET Martin Juhl wrote:
> 
> > Add it with manage.py to copr db is one step, but you must make sure the
> > config exist on builders VMs. So put it in ansible playbook, which spawns
> > the builder. 
> 
> Sooo.. where exactly should I put it?? 
> 
> I'm using the /usr/share/doc/copr-backend-1.94/playbooks/spawn_local.yml 
> playbook... ???

Well, if your group...spawn_playbook option refers to this playbook (and
you haven't made a change to this file) it looks like it is enough to have
the rhel-7-x86.cfg installed on backend machine directly.

> > Ok. this is another issue. It seems that ansible is not able to ssh connect
> > to your localhost. Are you sure you have there ssh keys for copr user? 
> 
> It works with epel-7-x86_64.cfg??? so I guess it's because the vm is spawned 
> incorrectly??

If you use spawn_local, there's no special builder VM.  And it is really
suspicious that ssh works with epel-7 and not with rhel-7.  Haven't you
upgraded your copr-backend package in the meantime?  The latest release
brings different ssh-layer into backend code (not using ansible now but using
python-paramiko directly).  This probably requires you to specify the:

  [ssh]
  identity_file=/path/to/your/ssh_private_key

(in backend's config)

Pavel

> - Original meddelelse -
> Fra: "Miroslav Suchý" <msu...@redhat.com>
> Til: "copr-devel" <copr-devel@lists.fedorahosted.org>
> Sendt: tirsdag, 31. januar 2017 11:08:29
> Emne: Re: mockremote with RHEL??
> 
> Dne 24.1.2017 v 11:31 Martin Juhl napsal(a): 
> > Does anyone know howto use this with copr and mockremote??? 
> > 
> > Right now I have created a /etc/mock/rhel-7-x86_64.cfg, and added the 
> > profile with the manage.py script... 
> 
> Add it with manage.py to copr db is one step, but you must make sure the 
> config exist on builders VMs. So put it in 
> ansible playbook, which spawns the builder. 
> 
> 
> > [2017-01-24 09:56:59,846][ 
> > DEBUG][vmm.event_handler][event_handle.py:on_health_check_result:106] 
> > recording check fail: {u'vm_ip': u'127.0.0.1', u'vm_name': u'Copr builder 
> > 596711858', u'topic': u'health_check', u'result': u'failed', u'msg': u'VM 
> > is not responding to the testing playbook.Runner options: {\'remote_user\': 
> > \'mockbuilder\', \'timeout\': 5, \'pattern\': \'127.0.0.1\', \'forks\': 1, 
> > \'host_list\': \'127.0.0.1,\', \'transport\': u\'paramiko\'}Ansible raw 
> > response:\n{\'dark\': {\'127.0.0.1\': {\'msg\': "Failed to open session: 
> > (1, \'Administratively prohibited\')", \'failed\': True}}, \'contacted\': 
> > {}}'} 
> 
> Ok. this is another issue. It seems that ansible is not able to ssh connect to
> your localhost. Are you sure you have there ssh keys for copr user? 
> 
> 
> 

___
copr-devel mailing list -- copr-devel@lists.fedorahosted.org
To unsubscribe send an email to copr-devel-le...@lists.fedorahosted.org


Re: mockremote with RHEL??

2017-01-31 Thread Martin Juhl

> Add it with manage.py to copr db is one step, but you must make sure the 
> config exist on builders VMs. So put it in 
> ansible playbook, which spawns the builder. 

Sooo.. where exactly should I put it?? 

I'm using the /usr/share/doc/copr-backend-1.94/playbooks/spawn_local.yml 
playbook... ???

> Ok. this is another issue. It seems that ansible is not able to ssh connect 
> to your localhost. Are you sure you have 
> there ssh keys for copr user? 

It works with epel-7-x86_64.cfg??? so I guess it's because the vm is spawned 
incorrectly??


- Original meddelelse -
Fra: "Miroslav Suchý" <msu...@redhat.com>
Til: "copr-devel" <copr-devel@lists.fedorahosted.org>
Sendt: tirsdag, 31. januar 2017 11:08:29
Emne: Re: mockremote with RHEL??

Dne 24.1.2017 v 11:31 Martin Juhl napsal(a): 
> Does anyone know howto use this with copr and mockremote??? 
> 
> Right now I have created a /etc/mock/rhel-7-x86_64.cfg, and added the profile 
> with the manage.py script... 

Add it with manage.py to copr db is one step, but you must make sure the config 
exist on builders VMs. So put it in 
ansible playbook, which spawns the builder. 


> [2017-01-24 09:56:59,846][ 
> DEBUG][vmm.event_handler][event_handle.py:on_health_check_result:106] 
> recording check fail: {u'vm_ip': u'127.0.0.1', u'vm_name': u'Copr builder 
> 596711858', u'topic': u'health_check', u'result': u'failed', u'msg': u'VM is 
> not responding to the testing playbook.Runner options: {\'remote_user\': 
> \'mockbuilder\', \'timeout\': 5, \'pattern\': \'127.0.0.1\', \'forks\': 1, 
> \'host_list\': \'127.0.0.1,\', \'transport\': u\'paramiko\'}Ansible raw 
> response:\n{\'dark\': {\'127.0.0.1\': {\'msg\': "Failed to open session: (1, 
> \'Administratively prohibited\')", \'failed\': True}}, \'contacted\': {}}'} 

Ok. this is another issue. It seems that ansible is not able to ssh connect to 
your localhost. Are you sure you have 
there ssh keys for copr user? 


-- 
Miroslav Suchy, RHCA 
Red Hat, Senior Software Engineer, #brno, #devexp, #fedora-buildsys 
___ 
copr-devel mailing list -- copr-devel@lists.fedorahosted.org 
To unsubscribe send an email to copr-devel-le...@lists.fedorahosted.org 
___
copr-devel mailing list -- copr-devel@lists.fedorahosted.org
To unsubscribe send an email to copr-devel-le...@lists.fedorahosted.org


mockremote with RHEL??

2017-01-24 Thread Martin Juhl
Hi guys

I have standard mock building packages for RHEL with the following 
configuration:

---
config_opts['root'] = 'rhel-7-x86_64'
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
config_opts['chroot_setup_cmd'] = 'install bash bzip2 cpio diffutils gzip perl 
sed tar unzip which @development'
config_opts['dist'] = 'el7'
config_opts['releasever'] = '7Server'
config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
keepcache=1
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
# repos

[rhel-7-server-rpms]
metadata_expire = 86400
sslclientcert = /etc/pki/entitlement/9216879986979201201.pem
baseurl = 
https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/os
ui_repoid_vars = releasever basearch
sslverify = 1
name = Red Hat Enterprise Linux 7 Server (RPMs)
sslclientkey = /etc/pki/entitlement/9216879986979201201-key.pem
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
enabled = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
gpgcheck = 1

"""


Does anyone know howto use this with copr and mockremote???

Right now I have created a /etc/mock/rhel-7-x86_64.cfg, and added the profile 
with the manage.py script...

But it doesn't really spawn the process:

[2017-01-24 09:56:59,846][ 
DEBUG][vmm.event_handler][event_handle.py:on_health_check_result:106] recording 
check fail: {u'vm_ip': u'127.0.0.1', u'vm_name': u'Copr builder 596711858', 
u'topic': u'health_check', u'result': u'failed', u'msg': u'VM is not responding 
to the testing playbook.Runner options: {\'remote_user\': \'mockbuilder\', 
\'timeout\': 5, \'pattern\': \'127.0.0.1\', \'forks\': 1, \'host_list\': 
\'127.0.0.1,\', \'transport\': u\'paramiko\'}Ansible raw response:\n{\'dark\': 
{\'127.0.0.1\': {\'msg\': "Failed to open session: (1, \'Administratively 
prohibited\')", \'failed\': True}}, \'contacted\': {}}'}


Any ideas??

Regards

Martin
___
copr-devel mailing list -- copr-devel@lists.fedorahosted.org
To unsubscribe send an email to copr-devel-le...@lists.fedorahosted.org