Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 327165 - Few packages for soc.dev.gentoo.org (PostgreSQL, SQLAlchemy, etc)
Summary: Few packages for soc.dev.gentoo.org (PostgreSQL, SQLAlchemy, etc)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Infrastructure
Classification: Unclassified
Component: Dev box issues (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Infrastructure
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-06 14:24 UTC by Priit Laes (IRC: plaes)
Modified: 2010-09-20 23:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Priit Laes (IRC: plaes) 2010-07-06 14:24:23 UTC
I have few requests regarding to soc.dev.gentoo.org (username: plaes).

Possibility to run a WSGI app with apache (www-apps/mod_wsgi + few lines of conf):
[snip]
# Dunno about these (xxx, yyy, zzz) below:
#        WSGIDaemonProcess xxx user=yyy group=zzz threads=5
        WSGIScriptAlias /grumpy /home/plaes/virtualenv/grumpy.wsgi
[/snip]

PostgreSQL database:
Latest stable version is ok, need user with r/w capabilities to db.

And also following extra python packages:
dev-python/virtualenv, dev-python/sqlalchemy[postgres], dev-python/flask
Comment 1 Priit Laes (IRC: plaes) 2010-07-09 17:36:45 UTC
Also, 'cron' support would be nice to have ;)

Updating list of packages:
dev-python/virtualenv, dev-python/sqlalchemy[postgres], dev-python/flask, dev-python/lxml
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-07-12 14:19:07 UTC
(In reply to comment #1)

> Updating list of packages:
> dev-python/virtualenv, dev-python/sqlalchemy[postgres], dev-python/flask,
> dev-python/lxml

These will be installed during the next cfengine pass, in about ~30 minutes.
Comment 3 Mike Doty (RETIRED) gentoo-dev 2010-07-13 01:03:41 UTC
(In reply to comment #0)
> I have few requests regarding to soc.dev.gentoo.org (username: plaes).
> 
> Possibility to run a WSGI app with apache (www-apps/mod_wsgi + few lines of
> conf):
> [snip]
> # Dunno about these (xxx, yyy, zzz) below:
> #        WSGIDaemonProcess xxx user=yyy group=zzz threads=5
>         WSGIScriptAlias /grumpy /home/plaes/virtualenv/grumpy.wsgi
> [/snip]

Can we get around the WSGI requirement for now?  Something along the lines of http://foo.gentoo.org/~plaes/foo/foo.py
Comment 4 Priit Laes (IRC: plaes) 2010-07-13 05:42:39 UTC
(In reply to comment #3)
> (In reply to comment #0)
> Can we get around the WSGI requirement for now?  Something along the lines of
> http://foo.gentoo.org/~plaes/foo/foo.py

You mean running it as CGI script?
I don't think it's possible as Flask is WSGI-based framework and I am using that as a core of my app. Besides WSGI has become standard way of running web apps :(.

But following configuration should be enough to run it (in web server privileges):
[snip]
<IfDefine WSGI>
  # Needed for application side HTTP authentication checks
  WSGIPassAuthorization On
  WSGIScriptAlias /grumpy /home/plaes/env/grumpy.wsgi
</IfDefine>
[/snip]
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-07-13 17:34:13 UTC
Ok, updated status since it seems our TZs are too far apart to communicate on IRC.. :) 

Done:
- All requested packages are installed.
- Added to cron group.

TODO:
- Long term, you need to give us a file to plop into cron.d as your user won't have a local login to the future host that is hosting the service.
- Set up pgdb, etc.
- Add WSGI directive. I didn't see the file: "home/plaes/env/grumpy.wsgi" so I stopped pursuing this at the moment.
Comment 6 Priit Laes (IRC: plaes) 2010-07-13 17:54:01 UTC
(In reply to comment #5)
> Ok, updated status since it seems our TZs are too far apart to communicate on
> IRC.. :) 

> TODO:
> - Long term, you need to give us a file to plop into cron.d as your user won't
> have a local login to the future host that is hosting the service.
> - Set up pgdb, etc.
> - Add WSGI directive. I didn't see the file: "home/plaes/env/grumpy.wsgi" so I
> stopped pursuing this at the moment.

As pointed out on IRC, it's actually possible to run Flask using cgi, so I need +ExecCGI for my public_html
Comment 7 Priit Laes (IRC: plaes) 2010-07-15 13:12:48 UTC
Ok, I have most of the packages I needed, but now, when trying to set up virtualenv environment in my homedir I get following traceback:
[snip]
plaes@vulture ~ $ virtualenv testdir
New python executable in testdir/bin/python2.6
Also creating executable in testdir/bin/python
Traceback (most recent call last):
  File "/usr/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.4.9', 'console_scripts', 'virtualenv')()
  File "/usr/lib64/python2.6/site-packages/virtualenv.py", line 526, in main
    use_distribute=options.use_distribute)
  File "/usr/lib64/python2.6/site-packages/virtualenv.py", line 609, in create_environment
    site_packages=site_packages, clear=clear))
  File "/usr/lib64/python2.6/site-packages/virtualenv.py", line 834, in install_python
    stdout=subprocess.PIPE)
  File "/usr/lib64/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.6/subprocess.py", line 1132, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied
[/snip]


And I'm still missing database :(
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-07-15 14:13:41 UTC
Database details in vulture:/home/plaes/pgsql-grumpy-passwords.txt

1. The grumpy_admin user must be used to create the tables, but must NOT be used in the application. (This is a protection against an SQL injection with DROP TABLE).
2. After the tables are created, we might need to adjust some of the perms for the grumpy_rw user.
3. grumpy_ro user in case you need it.
4. The passwords and usernames should NEVER be committed to any repository, they would usually be injected on deployment.

The postgres user accounts WILL expire on 2010/Oct/01, after the end of the SoC.
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-07-15 14:15:59 UTC
(In reply to comment #7)
> Ok, I have most of the packages I needed, but now, when trying to set up
> virtualenv environment in my homedir I get following traceback:
> [snip]
> plaes@vulture ~ $ virtualenv testdir
> New python executable in testdir/bin/python2.6
> Also creating executable in testdir/bin/python
> Traceback (most recent call last):
>   File "/usr/bin/virtualenv", line 9, in <module>
>     load_entry_point('virtualenv==1.4.9', 'console_scripts', 'virtualenv')()
>   File "/usr/lib64/python2.6/site-packages/virtualenv.py", line 526, in main
>     use_distribute=options.use_distribute)
>   File "/usr/lib64/python2.6/site-packages/virtualenv.py", line 609, in
> create_environment
>     site_packages=site_packages, clear=clear))
>   File "/usr/lib64/python2.6/site-packages/virtualenv.py", line 834, in
> install_python
>     stdout=subprocess.PIPE)
>   File "/usr/lib64/python2.6/subprocess.py", line 623, in __init__
>     errread, errwrite)
>   File "/usr/lib64/python2.6/subprocess.py", line 1132, in _execute_child
>     raise child_exception
> OSError: [Errno 13] Permission denied
> [/snip]
/home is noexec for security. Do not attempt to run direct code on it.
If "foo" starts with "#!/bin/sh", then run it as "/bin/sh foo". (Similar for Python).

> And I'm still missing database :(
See previous comment.
Comment 10 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-08-03 22:32:07 UTC
Shall we close this bug? Two weeks with no comment now.
Comment 11 Mart Raudsepp gentoo-dev 2010-08-03 22:56:05 UTC
I think Priit was waiting for a new release of one of the packages, and by now we have new package requirements, such as dev-python/flask-openid.
I don't particularly care if we request these in a new bug, or if Priit notes them here tomorrow, when he has woken up.

Currently there is a deployment of the project on one of his own servers, but there is probably some value in getting it work on gentoo infra alongside other such GSoC projects, as the end goal is to have production versions on gentoo infra with our developers making use of the service.
Comment 12 Priit Laes (IRC: plaes) 2010-08-04 05:58:44 UTC
Yeah, I'm missing following packages:

dev-python/flask-sqlalchemy and dev-python/flask-openid
Comment 13 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-08-29 19:28:02 UTC
packages set to be installed via cfengine.
anything else?
Comment 14 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-09-20 23:49:01 UTC
(In reply to comment #13)
> packages set to be installed via cfengine.
> anything else?
> 

closing bug.