rapid 'poweruser' interface

rapid 'poweruser' interface

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

rapid 'poweruser' interface

Post by Tobi »

May as well announce rapid: A set of two small tools (commandline and gui) to operate on your local rapid repository.

The commandline tool is mostly meant for power users as simply installing a package can also be done the GUI way. The GUI currently only allows installing single packages.

Anyway, the rapid commandline tool allows you to pin/unpin tags, install/uninstall packages, collect garbage, and rapidly create a .sdd from a .sdp package with a single command. (the latter is useful for engine development ;-))

It can be installed using:

Code: Select all

easy_install rapid-spring
Then view the possible commands by running:

Code: Select all

rapid
Or, for the GUI:

Code: Select all

rapid-gui
Thanks go to koshi for figuring how to package python stuff and for creating rapid-gui.

If you have any suggestions, find any bugs, have some patches (code is on github), etc., just post here or speak to me in Lobby.
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: rapid 'poweruser' interface

Post by SirMaverick »

Nice tool.

Edit: this is solved (setup problem).
There is a bug in install/uninstall:

Code: Select all

$ rapid list-installed-packages | grep XTA
  XTA 9.6                                  (xta:version:9.6, xta:latest)
$ rapid install "XTA 9.5"
Already installed: XTA 9.6
$ rapid uninstall "XTA 9.5"
Not pinned: xta:version:9.6
Unpinning: xta:latest
Uninstalling: XTA 9.6
$ rapid list-installed-packages | grep XTA

$ rapid list-tags | grep 7613
  ca:stable                                (Complete Annihilation stable-7613)
  ca-1faction:stable                       (Complete Annihilation 1 faction stable-7613)
  ca:stable                                (Complete Annihilation stable-7613)
  ca-1faction:stable                       (Complete Annihilation 1 faction stable-7613)
  ca:revision:7613                         (Complete Annihilation stable-7613)
  ca-1faction:revision:7613                (Complete Annihilation 1 faction stable-7613)
$ rapid install "Complete Annihilation stable-7613"
100 or more matching names found, please narrow your search.
$ rapid install "ca:revision:7613"
No names matching ca:revision:7613 found.
It only matches against the part until first space? And only full names?

Pinning a specific version works, e.g.

Code: Select all

rapid pin ca:revision:7613
Using latest from git, atm 8d7b06e3703f075c83610137945f26d12a67ee53
Last edited by SirMaverick on 29 Mar 2010, 20:45, edited 1 time in total.
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: rapid 'poweruser' interface

Post by SirMaverick »

Other problem: I used SD before and had over time more than 1000 packages installed. I ran "rapid collect-pool". It ran for 10-15 minutes (runtime is lesser issue) and used up to 1.3GB ram.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: rapid 'poweruser' interface

Post by aegis »

okay, it appears to be writing pool to files... so what's the memory hog?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: rapid 'poweruser' interface

Post by Tobi »

Thanks for the feedback.

SirMavericks install/uninstall issue has been narrowed down to his own wrapper shell script ($@ instead of "$@").

The memory hog when using collect-pool when lots of packages are installed may be because it loads for each package the list of files in memory and keeps this list cached in memory. If each such list is 300kb (rough estimate based on 50-200kb gzipped raw data) then 1000 packages would be 300M already. Apparently the python representation is quite somewhat less compact :-)

EDIT: memory issue should be resolved (reduced usage by 95%)
(yay Flyweight pattern)
admorgan
Posts: 3
Joined: 16 Aug 2010, 05:28

Re: rapid 'poweruser' interface

Post by admorgan »

When trying to use rapid I get the following error on Gentoo Linux with rapid-spring installed from easy_install

admorgan@alexandria ~ $ rapid-gui
Traceback (most recent call last):
File "/usr/bin/rapid-gui", line 5, in <module>
pkg_resources.run_script('rapid-spring==0.3.0', 'rapid-gui')
File "/usr/lib64/python2.6/site-packages/pkg_resources.py", line 468, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib64/python2.6/site-packages/pkg_resources.py", line 1201, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/EGG-INFO/scripts/rapid-gui", line 15, in <module>
window = RapidGUI()
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/gui.py", line 124, in __init__
self.mainWidget = MainRapidWidget(self)
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/gui.py", line 109, in __init__
self.availableWidget = AvailableRapidListWidget(self)
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/gui.py", line 95, in __init__
self.sourceModel.reload()
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/models.py", line 29, in reload
self.reloadData( lambda p: not p.installed )
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/models.py", line 18, in reloadData
for p in filter( dataFunction, main.rapid.packages ):
AttributeError: 'module' object has no attribute 'packages'
User avatar
jandd
Posts: 17
Joined: 05 Jan 2010, 13:30

Re: rapid 'poweruser' interface

Post by jandd »

admorgan wrote:When trying to use rapid I get the following error on Gentoo Linux with rapid-spring installed from easy_install

admorgan@alexandria ~ $ rapid-gui
Traceback (most recent call last):
File "/usr/bin/rapid-gui", line 5, in <module>
pkg_resources.run_script('rapid-spring==0.3.0', 'rapid-gui')
File "/usr/lib64/python2.6/site-packages/pkg_resources.py", line 468, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib64/python2.6/site-packages/pkg_resources.py", line 1201, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/EGG-INFO/scripts/rapid-gui", line 15, in <module>
window = RapidGUI()
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/gui.py", line 124, in __init__
self.mainWidget = MainRapidWidget(self)
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/gui.py", line 109, in __init__
self.availableWidget = AvailableRapidListWidget(self)
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/gui.py", line 95, in __init__
self.sourceModel.reload()
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/models.py", line 29, in reload
self.reloadData( lambda p: not p.installed )
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/models.py", line 18, in reloadData
for p in filter( dataFunction, main.rapid.packages ):
AttributeError: 'module' object has no attribute 'packages'
same error on Debian Squeeze (easy_install and built from source). Filed as http://github.com/tvo/rapid/issues#issue/3
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: rapid 'poweruser' interface

Post by koshi »

User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Re: rapid 'poweruser' interface

Post by Dragon45 »

argh why easy_install!?? neds moar pip... easy_install -> deviltool
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: rapid 'poweruser' interface

Post by lurker »

Shouldn't it install the bitarray dependency by itself?





When it asks me if I meant:
1. ba:latest
2. specialba:latest

Can the correct number to enter to get ba:latest not be 0?
admorgan
Posts: 3
Joined: 16 Aug 2010, 05:28

Re: rapid 'poweruser' interface

Post by admorgan »

I re-installed with pip instead of easy_install and now it works
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: rapid 'poweruser' interface

Post by Tobi »

Dragon45 wrote:argh why easy_install!?? neds moar pip... easy_install -> deviltool
Is pip some kind of official replacement for easy_install? Any references? I don't seem to find much docs yet that use pip, apart from the pip docs themselves. (which obviously argue pro pip)
lurker wrote:When it asks me if I meant:
1. ba:latest
2. specialba:latest

Can the correct number to enter to get ba:latest not be 0?
Noted.



To all: if there are issues with rapid the preferred form of reporting them is on the issue tracker at github.
admorgan
Posts: 3
Joined: 16 Aug 2010, 05:28

Re: rapid 'poweruser' interface

Post by admorgan »

According to http://pypi.python.org/pypi/pip and the python irc channel pip is the upcoming replacement to easy_install. The nice thing about pip is that it already works with everything that is easy_install compatible and in this case even made it work (although I can't explain that one).
Tobi wrote:
Dragon45 wrote:argh why easy_install!?? neds moar pip... easy_install -> deviltool
Is pip some kind of official replacement for easy_install? Any references? I don't seem to find much docs yet that use pip, apart from the pip docs themselves. (which obviously argue pro pip)
lurker wrote:When it asks me if I meant:
1. ba:latest
2. specialba:latest

Can the correct number to enter to get ba:latest not be 0?
Noted.



To all: if there are issues with rapid the preferred form of reporting them is on the issue tracker at github.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: rapid 'poweruser' interface

Post by Tobi »

Ok, thanks. Guess it doesn't hurt to switch the docs to pip anyway.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: rapid 'poweruser' interface

Post by Tobi »

Instead of doing that I fixed most open bugs / implemented the feature requests and made a new release.

Here's the git shortlog:
hide main function a bit better, and explain it
don't choke on multiple packages with same name, but different hex or dependencies
fix off-by-one error when user was asked to choose from a list
added -y/--yes option to skip confirmations
pin, unpin, install and uninstall now support arbitrary amount of arguments
sort packages and tags in list-[installed-]packages and list-[pinned-]tags
refactor: promote select to TUI
add -r/--regex option to use regex instead of substring matches
sync readme and usage, added options to readme
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: rapid 'poweruser' interface

Post by hoijui »

woo hoo! :D
nice nice!
looks like rapid is the most mature project in the spring community now. leaves little to be desired.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: rapid 'poweruser' interface

Post by Tobi »

I tried both pip and easy_install and noticed that neither installs dependencies of rapid. The dependency is defined like this in setup.py, in the call to distutils.core.setup:

Code: Select all

    requires=['bitarray'],
If anyone has any clue what causes this I would appreciate it if you could put it here :-)

EDIT: solved in 0.4.1, programs that read setup.py are pretty inconsistent with each other...
jeykey
Posts: 136
Joined: 28 May 2009, 16:24

Re: rapid 'poweruser' interface

Post by jeykey »

rapid pin ct:test
Traceback (most recent call last):
File "/usr/local/bin/rapid", line 5, in <module>
pkg_resources.run_script('rapid-spring==0.2.0', 'rapid')
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 467, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1200, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.6/dist-packages/rapid_spring-0.2.0-py2.6.egg/EGG-INFO/scripts/rapid", line 6, in <module>
from rapid.main import *
File "/usr/local/lib/python2.6/dist-packages/rapid_spring-0.2.0-py2.6.egg/rapid/main.py", line 41, in <module>
rapid = rapid.Rapid()
File "/usr/local/lib/python2.6/dist-packages/rapid_spring-0.2.0-py2.6.egg/rapid/rapid.py", line 297, in __init__
mkdir(spring_dir)
File "/usr/local/lib/python2.6/dist-packages/rapid_spring-0.2.0-py2.6.egg/rapid/rapid.py", line 42, in mkdir
os.mkdir(path)
OSError: [Errno 17] File exists: '/home/jeykey/.spring'


If Spring directory is a dead link, rapid crashes... I know this is a minor bug, but I wanted to share it anyway ;)

regards, jeykey
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: rapid 'poweruser' interface

Post by Tobi »

luckywaldo7
Posts: 1397
Joined: 17 Sep 2008, 04:36

Re: rapid 'poweruser' interface

Post by luckywaldo7 »

A new Zero-K player has trouble getting rapid to work:

http://pastebin.com/CX84eBn2
Post Reply

Return to “Linux”

cron