[Avocado-devel] Avocado 0.31.0 multi user problems
Lukáš Doktor
ldoktor at redhat.com
Tue Jan 19 16:44:58 UTC 2016
Dne 19.1.2016 v 16:55 Olav Philipp Henschel napsal(a):
> Hi Lukáš,
>
> I've been able to fix my installation. The problem was with the usage of
> sudo.
> I've deleted the mentioned files, installed avocado and avocado-vt with
> my user powerkvm with the command "sudo python setup.py --prefix=..."
> and the references to .conf files were correctly updated.
> Unfortunately, if I want to execute avocado from the home of my other
> user (olavph), I have to repeat the same procedure: clean files, install
> avocado and avocado-vt. This also prevents me from executing avocado
> from both users at the same time, something that I used to do in Avocado
> 0.30.
> Do you see any solutions to that? Having multiple avocado installations
> and being able to run them with sudo, because of the libvirt requirement.
>
> PS: the "make rpm" command did not work for me, but I don't see that as
> a priority.
>
Well I'm not really sure what do you do. I assume you have 2 different
avocado versions for "olavph" and "powerkvm" users. And if I understand
it correctly, you use booth with and without sudo. That's tricky... :D
For 2 users, it's simple, you use `python setup.py develop --user`
executed each from different location results in isolated 2 versions. If
that suffices to you, then great.
Even when only one user needs to use sudo, then it's simple a matter of
running `python setup.py develop --user` and voila it works.
When you use sudo from booth accounts, then you're screwed, because they
booth use the same locations to store egg links (and resources). I see 2
possible ways:
1. Simply execute sudo python develop --user before you execute avocado
(once per user switch)
2. Install it in different prefix and use PATH to pick the correct one
3. Use chroot
I don't know if 2 or 3 works (I don't want to spend afternoon on this),
but 1 works. And actually I wanted to push changes to Makefile to
replace `link` and `clean` with `develop` and `clean`, which would
execute `python develop --user` in all sub-repos. That should actually
simplify things for you as the only thing you'd have to do is `sudo make
develop` before you start using it under the second user.
I hope it helped, I'll work on the "Makefile" adjustment, which should
simplify the switching.
Lukáš
> On 19-01-2016 13:19, Lukáš Doktor wrote:
>> Hello Olav,
>>
>> please find some answers (or thought) inside...
>>
>> Dne 8.1.2016 v 17:38 Cleber Rosa napsal(a):
>>>
>>>
>>> ----- Original Message -----
>>>> From: "Olav Philipp Henschel" <olavph at linux.vnet.ibm.com>
>>>> To: avocado-devel at redhat.com
>>>> Sent: Friday, January 8, 2016 2:09:02 PM
>>>> Subject: Re: [Avocado-devel] Avocado 0.31.0 multi user problems
>>>>
>>>> Thanks Cleber,
>>>>
>>>> I've been able to locate and delete all the files you mentioned.
>>
>> It's hard to spot them all. What I'd recommend is to do `python
>> setup.py uninstall`. Actually to be sure, I'd get the other user, then
>> run `install`, `install --user` and then `uninstall` and `uninstall
>> --user`.
>>
>>>>
>>>> Then I proceeded to "make rpm", but it exits with an error:
>>>> Error: No Package found for aexpect
>>>> Even though it is already install by pip.
>>>>
>>>> I proceeded anyway with "python setup.py develop --user". I don't need
>>>> to use a path that all users can access yet.
>>>> I did the same for avocado-vt.
>>>>
>>>
>>> The solution to this is documented on the Makefile (repos just updated):
>> Yes, but some packages from EPEL are required. The problem is, that
>> EPEL is not supported for ppc64le and aarch64. We discussed this
>> recently and we'll try to create "unsafe" repo for these architectures
>> for users, who don't want to build their packages. The problem is we
>> don't have resources to keep it up-to-date, so some security updates
>> might not be there.
>>
>> Anyway it's hard call, you can download the srpms and build it
>> yourself, or you can wait for us to build (maybe outdated) versions,
>> or you can use `rpm -ivh --nodeps` to force install it as you already
>> have it installed from pip.
>>
>>>
>>> #
>>> # NOTE: to build Avocado RPM packages extra deps not present out of
>>> the box
>>> # are necessary. These packages are currently hosted at:
>>> #
>>> # https://repos-avocadoproject.rhcloud.com/static/avocado-fedora.repo
>>> # or
>>> # https://repos-avocadoproject.rhcloud.com/static/avocado-el.repo
>>> #
>>> # Since the RPM build steps are based on mock, edit your chroot config
>>> # file (/etc/mock/<your-config>.cnf) and add the COPR repo
>>> configuration there.
>>> #
>>>
>>> It's something hard to automate, but yes, it should probably also
>>> be documented elsewhere.
>>>
>>>>
>>>> Avocado is still getting .conf files from my other user, however
>>>> (powerkvm). I've tried with the absolute paths with the same results.
>>>> The paths that it shows for the subcommand "config" and "vt-bootstrap"
>>>> differ:
>>>>
>>>> $ sudo ~/.local/bin/avocado --config
>>>> /home/olavph/ibm-kvm-tests/avocado/etc/avocado/conf.d/pkvm.conf config
>>>> [sudo] password for olavph:
>>>> Config files read (in order):
>>>> /home/powerkvm/ibm-kvm-tests/avocado/etc/avocado/avocado.conf
>>>> /home/powerkvm/ibm-kvm-tests/avocado/etc/avocado/conf.d/gdb.conf
>>>> /home/powerkvm/ibm-kvm-tests/avocado/etc/avocado/conf.d/pkvm.conf
>>>> /home/olavph/ibm-kvm-tests/avocado/etc/avocado/conf.d/pkvm.conf
>>>>
>>>> Section.Key Value
>>>> datadir.paths.base_dir /home/olavph/avocado
>>>> datadir.paths.test_dir /home/olavph/avocado/tests
>>>> datadir.paths.data_dir /home/olavph/avocado/data
>>>> datadir.paths.logs_dir /home/olavph/avocado/job-results
>>>> ...
>>>>
>>>> $ sudo ~/.local/bin/avocado --config
>>>> /home/olavph/ibm-kvm-tests/avocado/etc/avocado/conf.d/pkvm.conf
>>>> vt-bootstrap --vt-type libvirt --vt-guest-os PowerKVM --y
>>>> es-to-all
>>>> ...
>>>> 10:44:58 INFO | 4 - Verifying directories
>>>> 10:44:58 DEBUG| Dir /var/avocado/data/avocado-vt/images exists, not
>>>> creating
>>>> 10:44:58 DEBUG| Dir /var/avocado/data/avocado-vt/isos exists, not
>>>> creating
>>>> 10:44:58 DEBUG| Dir /var/avocado/data/avocado-vt/steps_data exists, not
>>>> creating
>>>> 10:44:58 DEBUG| Dir /var/avocado/data/avocado-vt/gpg exists, not
>>>> creating
>>>> ...
>>>>
>>>>
>>>> Any other hints?
>>>
>>> I'll try to reproduce your setup and hopefully come with hints and/or
>>> fixes.
>>>
>>>>
>>>> Olav
>>>>
>>>>
>>>> On 07-01-2016 19:15, Cleber Rosa wrote:
>>>>>
>>>>> ----- Original Message -----
>>>>>> From: "Olav Philipp Henschel" <olavph at linux.vnet.ibm.com>
>>>>>> To: avocado-devel at redhat.com
>>>>>> Sent: Thursday, January 7, 2016 4:43:27 PM
>>>>>> Subject: [Avocado-devel] Avocado 0.31.0 multi user problems
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I've updated avocado to version 0.31.0 and got it to work using
>>>>>> "python
>>>>>> setup.py develop". Everything worked fine until I tried to run it
>>>>>> from
>>>>>> another user (with another local git clone).
>>>>> That may be expected. Setuptools "develop" will create a link file
>>>>> (not a
>>>>> POSIX symlink or hardlink) that points to the original location.
>>>>> The second
>>>>> user may not have permission to access those.
>>>>>
>>>>>> I've ran "python setup.py develop" from that user too to try to
>>>>>> overwrite whatever configurations were made. It keeps using the files
>>>>>> from the first user avocado-vt plugin folder however, getting its
>>>>>> tests
>>>>>> provider and custom .cfgs.
>>>>>> At some point I've ran "python setup.py install", so I'm not sure
>>>>>> which
>>>>>> command made this mess.
>>>>>> I've also tried using "python setup.py install" and "python setup.py
>>>>>> develop --user" from the second user.
>>>>>>
>>>>> Given the different commands ran as different users, it's pretty hard
>>>>> to give any thoughts about your current installation state.
>>>>>
>>>>>> Is there any way I can make a clean install? Which folders does the
>>>>>> setup.py write to?
>>>>> It depends on how you ran it. What I'd recommend is:
>>>>>
>>>>> 1) Look for egg link files (avocado*.egg-link), and then look at
>>>>> their
>>>>> contents to check where they point to
>>>>> 2) At the link targets, (the locations given in the .egg-link
>>>>> files)
>>>>> check if they have avocado*.egg-info directories
>>>>> 3) Look for the "avocado" script in your system.
>>>>>
>>>>> Cleaning all of those, and then starting fresh, should give you pretty
>>>>> good confidence about where you're running Avocado from.
>>>>>
>>>>> Now, for some advice on how to install Avocado:
>>>>>
>>>>> 1) Even if you're tracking Avocado from master (or your local
>>>>> branch)
>>>>> you could depend on RPM packages (if your system supports
>>>>> it). The
>>>>> `make rpm` command should give you pretty reliable versions.
>>>>> And,
>>>>> because of the packaging system itself, you don't have to go
>>>>> looking
>>>>> for scattered files if you want to remove it.
>>>>>
>>>>> 2) If you want to run directly from git, I'd recommend using:
>>>>>
>>>>> $ python setup.py develop
>>>>> --prefix=/path/that/all/users/can/access
>>>>>
>>>>> Setuptools itself will tell you that the given prefix must be
>>>>> on the
>>>>> Python search path for your users.
>>>>>
>>>>> I hope that helps.
>>>>>
>>>>>>
>>>>>> Regards,
>>>>>> Olav P. Henschel
>>>>>>
>>>>>> _______________________________________________
>>>>>> Avocado-devel mailing list
>>>>>> Avocado-devel at redhat.com
>>>>>> https://www.redhat.com/mailman/listinfo/avocado-devel
>>>>>>
>>>>> _______________________________________________
>>>>> Avocado-devel mailing list
>>>>> Avocado-devel at redhat.com
>>>>> https://www.redhat.com/mailman/listinfo/avocado-devel
>>>>>
>>>>
>>>> _______________________________________________
>>>> Avocado-devel mailing list
>>>> Avocado-devel at redhat.com
>>>> https://www.redhat.com/mailman/listinfo/avocado-devel
>>>>
>>>
>>> _______________________________________________
>>> Avocado-devel mailing list
>>> Avocado-devel at redhat.com
>>> https://www.redhat.com/mailman/listinfo/avocado-devel
>>>
>>
>> _______________________________________________
>> Avocado-devel mailing list
>> Avocado-devel at redhat.com
>> https://www.redhat.com/mailman/listinfo/avocado-devel
>>
>
> _______________________________________________
> Avocado-devel mailing list
> Avocado-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/avocado-devel
More information about the Avocado-devel
mailing list