Beispiel #1
0
 def configure(self, config_file):
     config_url = 'config:' + config_file
     cwd = os.getcwd()
     self.config = appconfig(config_url, 'MAGMaWeb', relative_to=cwd)
     engine = engine_from_config(self.config)
     init_user_db(engine)
     self.job_factory = make_job_factory(self.config)
Beispiel #2
0
 def configure(self, config_file):
     config_url = 'config:' + config_file
     cwd = os.getcwd()
     self.config = appconfig(config_url, 'MAGMaWeb', relative_to=cwd)
     engine = engine_from_config(self.config)
     init_user_db(engine)
     self.job_factory = make_job_factory(self.config)
Beispiel #3
0
 def __init__(self, job, request):
     """View callable with job and request as arguments"""
     self.job = job
     self.request = request
     self.job_factory = make_job_factory(request.registry.settings)
     self.restricted = self.request.registry.settings['restricted']
     self.ncpus = self.request.registry.settings['ncpus']
Beispiel #4
0
 def test_local(self):
     settings = {'jobfactory.root_dir': '/somedir',
                 'jobfactory.init_script': '. /somedir/env/bin/activate'
                 }
     factory = make_job_factory(settings)
     self.assertEqual(factory.root_dir, '/somedir')
     self.assertEqual(factory.init_script, '. /somedir/env/bin/activate')
     self.assertEqual(factory.tarball, None)
Beispiel #5
0
 def setUp(self):
     FunctionalTests.setUp(self)
     # Setup owner of job
     jf = make_job_factory(self.settings)
     with transaction.manager:
         user = User('bob', 'Bob Example', '*****@*****.**', 'mypassword')
         DBSession().add(user)
         self.job = jf.fromScratch('bob')
         self.jobid = self.job.id
Beispiel #6
0
 def setUp(self):
     FunctionalTests.setUp(self)
     # Setup owner of job
     jf = make_job_factory(self.settings)
     with transaction.manager:
         user = User(u"bob", u"Bob Example", u"*****@*****.**", "mypassword")
         DBSession().add(user)
         self.job = jf.fromScratch(u"bob")
         self.jobid = self.job.id
Beispiel #7
0
 def test_remote(self):
     settings = {'jobfactory.root_dir': '/somedir',
                 'jobfactory.init_script': 'tar -zxf Magma.tar.gz;',
                 'jobfactory.tarball': '/somepath/Magma.tar.gz'
                 }
     factory = make_job_factory(settings)
     self.assertEqual(factory.root_dir, '/somedir')
     self.assertEqual(factory.init_script, 'tar -zxf Magma.tar.gz;')
     self.assertEqual(factory.tarball, '/somepath/Magma.tar.gz')
Beispiel #8
0
 def __init__(self, request):
     super(JobIdFactory, self).__init__(request)
     from magmaweb.job import make_job_factory
     self.job_factory = make_job_factory(request.registry.settings)
Beispiel #9
0
 def __init__(self, request):
     super(JobIdFactory, self).__init__(request)
     from magmaweb.job import make_job_factory
     self.job_factory = make_job_factory(request.registry.settings)
Beispiel #10
0
 def __init__(self, request):
     self.request = request
     self.job_factory = make_job_factory(request.registry.settings)
Beispiel #11
0
    def test_minimal(self):
        factory = make_job_factory({'jobfactory.root_dir': '/somedir'})

        self.assertEqual(factory.root_dir, '/somedir')
        self.assertEqual(factory.init_script, '')
        self.assertEqual(factory.tarball, None)
Beispiel #12
0
 def test_norootdir(self):
     with self.assertRaises(TypeError):
         make_job_factory({})
Beispiel #13
0
 def __init__(self, request):
     self.request = request
     self.job_factory = make_job_factory(request.registry.settings)