2003-07-18 21:43:12 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
# Creates a new BOINC project.
|
|
|
|
|
2003-10-03 05:53:28 +00:00
|
|
|
import boinc_path_config
|
|
|
|
from Boinc.setup_project import *
|
|
|
|
from Boinc import database, db_mid, configxml, tools
|
|
|
|
import sys, os, getopt, re, socket
|
|
|
|
|
2004-12-06 22:41:19 +00:00
|
|
|
def getfqdn():
|
2003-10-03 05:53:28 +00:00
|
|
|
try:
|
2004-12-06 22:41:19 +00:00
|
|
|
return socket.getfqdn()
|
2003-10-03 05:53:28 +00:00
|
|
|
except:
|
|
|
|
return 'localhost'
|
|
|
|
|
|
|
|
def isurl(s):
|
|
|
|
return s.startswith('http://') or s.startswith('https://')
|
2003-07-18 21:43:12 +00:00
|
|
|
|
|
|
|
argv0 = sys.argv[0]
|
|
|
|
HOME = os.path.expanduser('~')
|
2003-07-18 22:41:11 +00:00
|
|
|
USER = os.environ['USER']
|
2004-12-06 22:41:19 +00:00
|
|
|
NODENAME = getfqdn()
|
2003-07-18 21:43:12 +00:00
|
|
|
|
|
|
|
HELP = """
|
2003-10-03 05:53:28 +00:00
|
|
|
syntax: %(argv0)s [options] project ['Project Long Name']
|
2003-07-18 21:43:12 +00:00
|
|
|
|
|
|
|
Creates a new project with given name with everything running on a single
|
|
|
|
server.
|
|
|
|
|
|
|
|
Misc options:
|
2003-07-18 23:20:46 +00:00
|
|
|
--no_query accept all directories without querying
|
|
|
|
--user_name default: $USER (%(USER)s)
|
|
|
|
--delete_prev_inst delete project-root first (from prev installation)
|
|
|
|
--drop_db_first drop database first (from prev installation)
|
2010-11-10 00:10:32 +00:00
|
|
|
--test_app install example application
|
2007-12-21 23:39:25 +00:00
|
|
|
--web_only install web files, no executables (for Bossa, Bolt)
|
2009-06-10 22:38:33 +00:00
|
|
|
--srcdir where to find the source files (default: current directory)
|
2003-07-18 21:43:12 +00:00
|
|
|
|
|
|
|
Dir-options:
|
2005-02-17 20:35:41 +00:00
|
|
|
--project_root default: HOME/projects/PROJECT
|
|
|
|
--key_dir default: PROJECT_ROOT/keys
|
2003-10-03 05:53:28 +00:00
|
|
|
--url_base default: http://$NODENAME/ (http://%(NODENAME)s/)
|
2003-07-18 21:43:12 +00:00
|
|
|
|
2003-07-18 23:20:46 +00:00
|
|
|
--html_user_url default: URL_BASE/PROJECT/
|
|
|
|
--html_ops_url default: URL_BASE/PROJECT_ops/
|
|
|
|
--cgi_url default: URL_BASE/PROJECT_cgi/
|
2003-07-18 21:43:12 +00:00
|
|
|
|
2003-10-03 05:53:28 +00:00
|
|
|
Other:
|
|
|
|
--db_name default: PROJECT
|
2005-01-17 00:21:19 +00:00
|
|
|
--db_user default: USER_NAME
|
|
|
|
--db_passwd default: None
|
2005-02-17 20:35:41 +00:00
|
|
|
--db_host default: None
|
2003-10-03 05:53:28 +00:00
|
|
|
|
2003-07-18 23:20:46 +00:00
|
|
|
Example command line:
|
2007-04-19 22:11:25 +00:00
|
|
|
./make_project --project_root $HOME/boinc/projects --url_base http://tah.org/ tah 'Test@home'
|
2003-07-18 21:43:12 +00:00
|
|
|
|
2007-04-19 22:11:25 +00:00
|
|
|
Then upload_dir = $HOME/boinc/projects/tah/upload
|
|
|
|
and cgi_url = http://tah.org/tah_cgi/
|
2003-07-18 21:43:12 +00:00
|
|
|
|
|
|
|
By default, directory options will be queried if they do not exist yet.
|
|
|
|
|
|
|
|
""" %locals()
|
|
|
|
|
2003-07-18 22:41:11 +00:00
|
|
|
def syntax_error(str):
|
|
|
|
raise SystemExit('%s; See "%s --help" for help\n' % (str,sys.argv[0]))
|
2003-07-18 21:43:12 +00:00
|
|
|
|
|
|
|
def usage():
|
|
|
|
print HELP
|
|
|
|
raise SystemExit
|
|
|
|
|
|
|
|
try:
|
|
|
|
opts, args = getopt.getopt(sys.argv[1:],
|
2005-02-17 20:35:41 +00:00
|
|
|
'hv', [
|
|
|
|
'help',
|
|
|
|
'verbose=',
|
|
|
|
'no_query',
|
2007-04-23 16:14:47 +00:00
|
|
|
'test_app',
|
2007-12-21 23:39:25 +00:00
|
|
|
'web_only',
|
2009-06-10 22:38:33 +00:00
|
|
|
'srcdir=',
|
2005-02-17 20:35:41 +00:00
|
|
|
'user_name=',
|
|
|
|
'drop_db_first',
|
|
|
|
'delete_prev_inst',
|
|
|
|
'base=',
|
|
|
|
'key_dir=',
|
|
|
|
'project_root=',
|
|
|
|
'url_base=',
|
|
|
|
'html_user_url=',
|
|
|
|
'html_ops_url=',
|
|
|
|
'cgi_url=',
|
|
|
|
'db_name=',
|
|
|
|
'db_user=',
|
|
|
|
'db_passwd=',
|
|
|
|
'db_host=',
|
|
|
|
]
|
|
|
|
)
|
2003-07-18 22:41:11 +00:00
|
|
|
except getopt.GetoptError, e:
|
|
|
|
syntax_error(e)
|
2003-07-18 21:43:12 +00:00
|
|
|
|
|
|
|
options.url_base = None
|
2003-07-18 22:41:11 +00:00
|
|
|
options.no_query = False
|
2007-04-23 16:14:47 +00:00
|
|
|
options.test_app = False
|
2007-12-21 23:39:25 +00:00
|
|
|
options.web_only = False
|
2003-07-18 23:20:46 +00:00
|
|
|
options.delete_prev_inst = False
|
2009-06-10 22:38:33 +00:00
|
|
|
options.srcdir = None
|
2003-07-18 21:43:12 +00:00
|
|
|
|
|
|
|
for o,a in opts:
|
|
|
|
if o == '-h' or o == '--help': usage()
|
2003-10-03 05:53:28 +00:00
|
|
|
elif o == '-v': options.echo_verbose = 2
|
2003-07-18 22:41:11 +00:00
|
|
|
elif o == '--verbose': options.echo_verbose = int(a)
|
|
|
|
elif o == '--no_query': options.no_query = True
|
2007-04-23 16:14:47 +00:00
|
|
|
elif o == '--test_app': options.test_app = True
|
2007-12-21 23:39:25 +00:00
|
|
|
elif o == '--web_only': options.web_only = True
|
2009-06-10 22:38:33 +00:00
|
|
|
elif o == '--srcdir': options.srcdir = a
|
2003-07-18 22:41:11 +00:00
|
|
|
elif o == '--user_name': options.user_name = a
|
2003-07-18 23:20:46 +00:00
|
|
|
elif o == '--drop_db_first': options.drop_db_first = True
|
|
|
|
elif o == '--delete_prev_inst': options.delete_prev_inst = True
|
2003-07-18 22:41:11 +00:00
|
|
|
elif o == '--key_dir': options.key_dir = a
|
|
|
|
elif o == '--project_root': options.project_root = a
|
|
|
|
elif o == '--url_base': options.url_base = a
|
|
|
|
elif o == '--html_user_url': options.html_user_url = a
|
|
|
|
elif o == '--html_ops_url': options.html_ops_url = a
|
|
|
|
elif o == '--cgi_url': options.cgi_url = a
|
2003-10-03 05:53:28 +00:00
|
|
|
elif o == '--db_name': options.db_name = a
|
2005-01-17 00:21:19 +00:00
|
|
|
elif o == '--db_user': options.db_user = a
|
|
|
|
elif o == '--db_passwd': options.db_passwd = a
|
2005-02-17 20:35:41 +00:00
|
|
|
elif o == '--db_host': options.db_host = a
|
2003-07-18 21:43:12 +00:00
|
|
|
else:
|
2003-07-18 22:41:11 +00:00
|
|
|
raise SystemExit('internal error o=%s'%o)
|
2003-07-18 21:43:12 +00:00
|
|
|
|
2003-10-03 05:53:28 +00:00
|
|
|
if len(args) == 2:
|
|
|
|
(project_shortname, project_longname) = args
|
|
|
|
elif len(args) == 1:
|
2004-02-15 19:22:01 +00:00
|
|
|
(project_shortname, project_longname) = args[0], args[0]
|
2003-10-03 05:53:28 +00:00
|
|
|
else:
|
|
|
|
syntax_error('Need one or two arguments')
|
2003-07-18 21:43:12 +00:00
|
|
|
|
2009-06-10 22:38:33 +00:00
|
|
|
if not options.srcdir:
|
|
|
|
for dir in ('.', '..'):
|
|
|
|
if os.path.exists(os.path.join(dir, 'html', 'project.sample', 'project.inc')):
|
|
|
|
options.srcdir = dir
|
|
|
|
if not options.srcdir:
|
|
|
|
syntax_error('Not running in the source directory and --srcdir was not specified')
|
|
|
|
|
2003-07-18 23:20:46 +00:00
|
|
|
opt_repls = {'PROJECT':project_shortname,
|
|
|
|
'PROJECT_ops':project_shortname+'_ops',
|
2003-10-03 05:53:28 +00:00
|
|
|
'PROJECT_cgi':project_shortname+'_cgi'}
|
|
|
|
def delete_slash(str):
|
|
|
|
return os.path.join(str,'')[:-1]
|
2003-07-18 22:41:11 +00:00
|
|
|
def add_slash(str, action=True):
|
|
|
|
if action:
|
|
|
|
return os.path.join(str,'')
|
|
|
|
else:
|
|
|
|
return str
|
2003-10-03 05:53:28 +00:00
|
|
|
def replopt(str):
|
|
|
|
for key in opt_repls:
|
|
|
|
str = str.replace(key, delete_slash(opt_repls[key]))
|
|
|
|
return str
|
2005-02-17 20:35:41 +00:00
|
|
|
|
2003-07-18 22:41:11 +00:00
|
|
|
def defopt(name, v, isdir=True):
|
|
|
|
options.__dict__[name] = opt_repls[name.upper()] = add_slash(replopt(options.__dict__.get(name) or v), isdir)
|
|
|
|
|
2003-10-03 05:53:28 +00:00
|
|
|
defopt('url_base' , 'http://%s/'%NODENAME)
|
|
|
|
|
|
|
|
if not isurl(options.url_base):
|
|
|
|
syntax_error('url_base needs to be an URL')
|
|
|
|
|
|
|
|
defopt('html_user_url' , 'URL_BASE/PROJECT')
|
|
|
|
defopt('html_ops_url' , 'URL_BASE/PROJECT_ops')
|
|
|
|
defopt('cgi_url' , 'URL_BASE/PROJECT_cgi')
|
|
|
|
|
|
|
|
defopt('user_name' , USER, isdir=False)
|
2005-03-11 23:13:27 +00:00
|
|
|
defopt('project_root' , HOME+'/projects/PROJECT')
|
2006-03-24 06:54:49 +00:00
|
|
|
defopt('key_dir' , options.project_root+'keys')
|
2003-07-18 22:41:11 +00:00
|
|
|
|
2003-10-03 05:53:28 +00:00
|
|
|
defopt('db_name' , 'PROJECT', isdir=False)
|
2005-01-17 00:21:19 +00:00
|
|
|
defopt('db_user' , 'USER_NAME', isdir=False)
|
|
|
|
defopt('db_passwd' , '', isdir=False)
|
2005-03-11 23:13:27 +00:00
|
|
|
defopt('db_host' , '', isdir=False)
|
2003-07-18 22:41:11 +00:00
|
|
|
|
|
|
|
print "Creating project '%s' (short name '%s'):" %(project_longname, project_shortname)
|
2005-02-17 20:35:41 +00:00
|
|
|
for k in [
|
|
|
|
'project_root',
|
|
|
|
'url_base',
|
|
|
|
'html_user_url',
|
|
|
|
'html_ops_url',
|
|
|
|
'cgi_url',
|
2006-03-24 06:54:49 +00:00
|
|
|
'key_dir',
|
2005-02-17 20:35:41 +00:00
|
|
|
'db_name',
|
|
|
|
'db_host',
|
|
|
|
]:
|
2003-07-18 22:41:11 +00:00
|
|
|
print k.upper().rjust(15), "=", options.__dict__[k]
|
|
|
|
|
|
|
|
project_root_parent = os.path.realpath(os.path.join(options.project_root,'..'))
|
|
|
|
if not os.path.exists(project_root_parent):
|
|
|
|
os.makedirs(project_root_parent)
|
|
|
|
|
2003-07-18 23:20:46 +00:00
|
|
|
if os.path.exists(options.project_root):
|
|
|
|
if options.delete_prev_inst:
|
|
|
|
if not options.no_query:
|
|
|
|
if not query_noyes('Delete %s?'%options.project_root):
|
|
|
|
raise SystemExit('Aborted')
|
2003-10-03 05:53:28 +00:00
|
|
|
print "Deleting", options.project_root
|
2003-07-18 23:20:46 +00:00
|
|
|
rmtree(options.project_root)
|
|
|
|
else:
|
|
|
|
raise SystemExit('Project root already exists! Specify --delete_prev_inst --drop_db_first to clobber')
|
|
|
|
|
2003-07-18 22:41:11 +00:00
|
|
|
if not options.no_query:
|
|
|
|
if not query_yesno("Continue?"):
|
|
|
|
raise SystemExit('Aborted')
|
|
|
|
|
|
|
|
options.install_method = 'copy'
|
|
|
|
init()
|
2005-02-17 20:35:41 +00:00
|
|
|
project = Project(
|
|
|
|
project_shortname,
|
|
|
|
project_longname,
|
|
|
|
project_dir = options.project_root,
|
|
|
|
master_url = options.html_user_url,
|
|
|
|
cgi_url = options.cgi_url,
|
|
|
|
key_dir = options.key_dir,
|
|
|
|
db_name = options.db_name,
|
2007-12-21 23:39:25 +00:00
|
|
|
web_only = options.web_only,
|
2007-04-23 16:14:47 +00:00
|
|
|
production = True
|
2005-02-17 20:35:41 +00:00
|
|
|
)
|
2003-07-18 23:20:46 +00:00
|
|
|
|
2003-07-18 22:41:11 +00:00
|
|
|
project.install_project()
|
2007-04-19 22:11:25 +00:00
|
|
|
proot = delete_slash(options.project_root)
|
2003-07-18 22:41:11 +00:00
|
|
|
|
2007-04-19 22:11:25 +00:00
|
|
|
# set up default daemons
|
2004-08-26 18:02:37 +00:00
|
|
|
project.sched_install('feeder')
|
|
|
|
project.sched_install('transitioner')
|
|
|
|
project.sched_install('file_deleter')
|
2007-04-23 16:14:47 +00:00
|
|
|
if options.test_app:
|
2007-04-19 22:11:25 +00:00
|
|
|
project.config.daemons.make_node_and_append("daemon").cmd = 'sample_work_generator -d 3'
|
2010-11-10 00:10:32 +00:00
|
|
|
project.config.daemons.make_node_and_append("daemon").cmd = 'sample_bitwise_validator -d 3 --app example_app'
|
|
|
|
project.config.daemons.make_node_and_append("daemon").cmd = 'sample_assimilator -d 3 --app example_app'
|
2007-04-20 17:14:08 +00:00
|
|
|
|
|
|
|
# set up default tasks
|
|
|
|
|
|
|
|
t = project.config.tasks.make_node_and_append("task")
|
|
|
|
t.period = '24 hours'
|
|
|
|
t.output = 'db_dump.out'
|
2010-11-10 00:10:32 +00:00
|
|
|
t.cmd = 'db_dump -d 2 --dump_spec ../db_dump_spec.xml'
|
2008-01-04 22:59:21 +00:00
|
|
|
t.disabled = 1
|
2007-04-20 17:14:08 +00:00
|
|
|
|
|
|
|
t = project.config.tasks.make_node_and_append("task")
|
|
|
|
t.period = '1 days'
|
|
|
|
t.output = 'update_uotd.out'
|
2008-01-03 17:24:28 +00:00
|
|
|
t.cmd = 'run_in_ops ./update_uotd.php'
|
2008-01-04 22:59:21 +00:00
|
|
|
t.disabled = 1
|
2007-04-20 17:14:08 +00:00
|
|
|
|
|
|
|
t = project.config.tasks.make_node_and_append("task")
|
|
|
|
t.period = '1 hour'
|
|
|
|
t.output = 'update_forum_activities.out'
|
2008-01-03 17:24:28 +00:00
|
|
|
t.cmd = 'run_in_ops ./update_forum_activities.php'
|
2008-01-04 22:59:21 +00:00
|
|
|
t.disabled = 1
|
2007-04-20 17:14:08 +00:00
|
|
|
|
|
|
|
t = project.config.tasks.make_node_and_append("task")
|
|
|
|
t.period = '7 days'
|
|
|
|
t.output = 'update_stats.out'
|
2010-11-10 00:10:32 +00:00
|
|
|
t.cmd = 'update_stats --update_users --update_teams --update_hosts'
|
2008-01-04 22:59:21 +00:00
|
|
|
t.disabled = 1
|
2007-04-20 17:14:08 +00:00
|
|
|
|
|
|
|
t = project.config.tasks.make_node_and_append("task")
|
|
|
|
t.period = '24 hours'
|
|
|
|
t.output = 'update_profile_pages.out'
|
2008-01-03 17:24:28 +00:00
|
|
|
t.cmd = 'run_in_ops ./update_profile_pages.php'
|
2008-01-04 22:59:21 +00:00
|
|
|
t.disabled = 1
|
2007-04-20 17:14:08 +00:00
|
|
|
|
2007-07-27 18:30:10 +00:00
|
|
|
t = project.config.tasks.make_node_and_append("task")
|
|
|
|
t.period = '24 hours'
|
|
|
|
t.output = 'team_import.out'
|
2008-01-03 17:24:28 +00:00
|
|
|
t.cmd = 'run_in_ops ./team_import.php'
|
2008-01-04 22:59:21 +00:00
|
|
|
t.disabled = 1
|
2007-07-27 18:30:10 +00:00
|
|
|
|
2007-12-30 22:02:16 +00:00
|
|
|
t = project.config.tasks.make_node_and_append("task")
|
|
|
|
t.period = '24 hours'
|
|
|
|
t.output = 'notify.out'
|
2008-01-03 17:24:28 +00:00
|
|
|
t.cmd = 'run_in_ops ./notify.php'
|
2008-01-04 22:59:21 +00:00
|
|
|
t.disabled = 1
|
2007-12-30 22:02:16 +00:00
|
|
|
|
2007-04-20 17:14:08 +00:00
|
|
|
project.config.write()
|
2004-08-26 18:02:37 +00:00
|
|
|
|
2007-05-01 21:21:13 +00:00
|
|
|
svn_version_file = proot+'/local.revision'
|
|
|
|
try:
|
2009-06-10 22:38:33 +00:00
|
|
|
cmd = '/bin/sh -c \'/usr/bin/svnversion ' + options.srcdir + '\' > '+svn_version_file
|
|
|
|
os.system(cmd)
|
2007-05-01 21:21:13 +00:00
|
|
|
except:
|
|
|
|
print '''Couldn't find svnversion'''
|
|
|
|
|
2009-03-24 21:24:57 +00:00
|
|
|
try:
|
2009-06-10 22:38:33 +00:00
|
|
|
cmd = '/bin/sh -c \'/usr/bin/svnversion ' + options.srcdir + '\' > '+proot+'/db_revision'
|
|
|
|
os.system(cmd)
|
2009-03-24 21:24:57 +00:00
|
|
|
except:
|
|
|
|
print '''Couldn't find svnversion'''
|
|
|
|
|
|
|
|
try:
|
2009-06-11 17:25:01 +00:00
|
|
|
os.system('cd '+proot+'/html/ops; ./update_translations.php -d 1')
|
2009-03-24 21:24:57 +00:00
|
|
|
except:
|
|
|
|
print '''Couldn't install translation files'''
|
|
|
|
|
2004-08-26 18:02:37 +00:00
|
|
|
print '''Done installing default daemons.'''
|
2003-07-18 23:20:46 +00:00
|
|
|
|
2007-04-19 22:11:25 +00:00
|
|
|
# copy the test app if needed
|
2007-04-23 16:14:47 +00:00
|
|
|
if options.test_app:
|
2010-11-10 00:10:32 +00:00
|
|
|
app_dir = proot+'/apps/example_app/'
|
|
|
|
os.mkdir(app_dir)
|
|
|
|
os.system('cp -r ../samples/example_app/bin/* ' + app_dir);
|
|
|
|
shutil.copy('example_app_in.xml', proot+'/templates/')
|
|
|
|
shutil.copy('example_app_out.xml', proot+'/templates/')
|
2007-04-23 16:14:47 +00:00
|
|
|
shutil.copy('../tools/create_work_example', proot+'/bin/')
|
2007-04-19 22:11:25 +00:00
|
|
|
|
2005-02-17 20:35:41 +00:00
|
|
|
httpd_conf_template_filename = os.path.join(
|
|
|
|
options.project_root,
|
|
|
|
project_shortname+'.httpd.conf'
|
|
|
|
)
|
2003-10-03 05:53:28 +00:00
|
|
|
|
|
|
|
print >>open(httpd_conf_template_filename,'w'), '''
|
2003-07-18 23:20:46 +00:00
|
|
|
|
2003-10-03 05:53:28 +00:00
|
|
|
## Settings for BOINC project %(project_longname)s
|
|
|
|
|
2004-02-04 01:11:12 +00:00
|
|
|
Alias /%(project_shortname)s %(proot)s/html/user
|
|
|
|
Alias /%(project_shortname)s_ops %(proot)s/html/ops
|
2003-10-03 05:53:28 +00:00
|
|
|
ScriptAlias /%(project_shortname)s_cgi %(proot)s/cgi-bin
|
2003-07-18 22:41:11 +00:00
|
|
|
|
|
|
|
# Note: projects/*/keys/ should NOT be readable!
|
|
|
|
|
2004-02-04 01:11:12 +00:00
|
|
|
<Directory "%(proot)s/html">
|
2003-07-18 23:20:46 +00:00
|
|
|
Options Indexes FollowSymlinks MultiViews
|
2003-07-18 22:41:11 +00:00
|
|
|
AllowOverride AuthConfig
|
|
|
|
Order allow,deny
|
|
|
|
Allow from all
|
|
|
|
</Directory>
|
2003-07-18 21:43:12 +00:00
|
|
|
|
2003-07-18 23:20:46 +00:00
|
|
|
<Directory "%(proot)s/cgi-bin">
|
|
|
|
Options ExecCGI
|
2006-03-24 06:54:49 +00:00
|
|
|
AllowOverride AuthConfig
|
2003-07-18 23:20:46 +00:00
|
|
|
Order allow,deny
|
|
|
|
Allow from all
|
|
|
|
</Directory>
|
2003-10-03 05:53:28 +00:00
|
|
|
''' %locals()
|
2003-07-18 21:43:12 +00:00
|
|
|
|
2009-09-08 04:55:48 +00:00
|
|
|
htaccess_filename = options.project_root+'/html/ops/.htaccess'
|
|
|
|
htpasswd_filename = options.project_root+'/html/ops/.htpasswd'
|
|
|
|
|
|
|
|
print >>open(htaccess_filename, 'w'), '''
|
|
|
|
AuthName "%(project_shortname)s"
|
|
|
|
AuthType Basic
|
|
|
|
AuthUserFile %(htpasswd_filename)s
|
|
|
|
require valid-user
|
|
|
|
'''%locals()
|
|
|
|
|
2007-04-25 20:38:01 +00:00
|
|
|
cronjob_filename = os.path.join(
|
|
|
|
options.project_root,
|
|
|
|
project_shortname+'.cronjob'
|
|
|
|
)
|
|
|
|
print >>open(cronjob_filename,'w'), '''
|
|
|
|
0,5,10,15,20,25,30,35,40,45,50,55 * * * * %(proot)s/bin/start --cron
|
2008-06-04 23:27:01 +00:00
|
|
|
'''%locals()
|
2007-04-25 20:38:01 +00:00
|
|
|
|
2008-06-04 23:27:01 +00:00
|
|
|
readme_filename = os.path.join(
|
|
|
|
options.project_root,
|
|
|
|
project_shortname+'.readme'
|
|
|
|
)
|
2003-07-18 21:43:12 +00:00
|
|
|
|
2008-06-04 23:27:01 +00:00
|
|
|
test_app_msg = ''
|
|
|
|
if options.test_app:
|
|
|
|
test_app_msg = '''
|
2009-02-18 16:21:30 +00:00
|
|
|
- The project is configured with a test application.
|
|
|
|
To install this application (recommended) run:
|
2008-06-04 23:27:01 +00:00
|
|
|
cd %(proot)s
|
|
|
|
bin/update_versions
|
|
|
|
'''%locals()
|
|
|
|
|
2009-09-08 04:55:48 +00:00
|
|
|
html_user_url = options.html_user_url
|
|
|
|
html_ops_url = options.html_ops_url
|
|
|
|
|
2010-02-21 04:45:52 +00:00
|
|
|
print >>open(readme_filename,'w'), '''Steps to complete installation:
|
2003-10-03 05:53:28 +00:00
|
|
|
|
2009-02-18 16:21:30 +00:00
|
|
|
- Change Apache configuration (as root):
|
2003-10-03 05:53:28 +00:00
|
|
|
|
2008-06-05 18:36:31 +00:00
|
|
|
cat %(httpd_conf_template_filename)s >> /etc/apache/httpd.conf
|
2003-10-03 05:53:28 +00:00
|
|
|
|
2010-02-26 00:30:09 +00:00
|
|
|
(path to httpd.conf varies; try /etc/httpd/ or /etc/apache2)
|
2008-06-05 18:36:31 +00:00
|
|
|
Then restart the web server:
|
|
|
|
|
|
|
|
/usr/sbin/apache2ctl restart
|
|
|
|
(or /usr/sbin/apachectl restart)
|
2003-07-18 23:20:46 +00:00
|
|
|
|
2009-02-18 16:21:30 +00:00
|
|
|
- Add to crontab (as %(USER)s)
|
2003-10-03 05:53:28 +00:00
|
|
|
|
2010-02-21 04:45:52 +00:00
|
|
|
crontab -e
|
2003-07-18 21:43:12 +00:00
|
|
|
|
2010-02-21 04:45:52 +00:00
|
|
|
and add the line:
|
|
|
|
|
|
|
|
0,5,10,15,20,25,30,35,40,45,50,55 * * * * %(proot)s/bin/start --cron
|
2003-07-18 23:20:46 +00:00
|
|
|
|
2009-02-18 16:21:30 +00:00
|
|
|
- In the project home directory (%(proot)s) run
|
2010-02-21 04:45:52 +00:00
|
|
|
|
2008-07-01 23:40:46 +00:00
|
|
|
bin/xadd
|
2010-02-21 04:45:52 +00:00
|
|
|
%(test_app_msg)s
|
|
|
|
- Add a .htpasswd file in the project's html/ops directory:
|
|
|
|
(You'll need this to access the project's Administrative page)
|
|
|
|
|
|
|
|
htpasswd -c .htpasswd username
|
|
|
|
|
|
|
|
----------------------------
|
2008-07-01 23:40:46 +00:00
|
|
|
|
2007-04-19 22:11:25 +00:00
|
|
|
To start, show status, and stop the project, run:
|
|
|
|
bin/start
|
|
|
|
bin/status
|
|
|
|
bin/stop
|
2003-10-03 05:53:28 +00:00
|
|
|
|
2007-04-19 22:11:25 +00:00
|
|
|
The project's URLs are:
|
|
|
|
Home page (and master URL): %(html_user_url)s
|
|
|
|
Administrative page: %(html_ops_url)s
|
2004-08-26 18:02:37 +00:00
|
|
|
|
2007-04-19 22:11:25 +00:00
|
|
|
----------------------------
|
2004-08-26 18:02:37 +00:00
|
|
|
|
2007-04-19 22:11:25 +00:00
|
|
|
To use this project for your own computations, you'll need to
|
|
|
|
- Port your application(s) and add them
|
|
|
|
- Develop programs to submit and handle jobs
|
2004-02-15 18:34:10 +00:00
|
|
|
See the online documentation at http://boinc.berkeley.edu/
|
2003-07-18 23:20:46 +00:00
|
|
|
|
2003-10-03 05:53:28 +00:00
|
|
|
'''%locals()
|
2008-06-04 23:27:01 +00:00
|
|
|
|
|
|
|
print '''
|
2009-04-06 18:27:02 +00:00
|
|
|
Done creating project. Please view
|
2008-06-04 23:27:01 +00:00
|
|
|
%(readme_filename)s
|
|
|
|
for important additional instructions.
|
|
|
|
'''%locals()
|