Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit f66d2320 authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

Merge branch 'v1.0' into v1.1

parents fb3216f7 68dd4db7
......@@ -30,6 +30,8 @@ def check_access(auth_type, access_level):
raise cherrypy.HTTPError(400, 'Bad Request')
dic = get_credentials(access_level)
if len(dic)==0:
return False
if auth_type == 'ACL':
#Check that otherwise authenticated user has the required
......@@ -71,8 +73,11 @@ def get_credentials(access_level=1):
else:
conn.text_factory=str
with conn:
l = conn.execute('select user, passwd from users where access_level >= ?',(access_level,)).fetchall()
dic = dict(l)
try:
l = conn.execute('select user, passwd from users where access_level >= ?',(access_level,)).fetchall()
dic = dict(l)
except:
dic = dict([])
conn.close()
return dic
......
......@@ -94,7 +94,7 @@ class Repository:
## code
fn = self._match_fn (fns, s)
source = self.get_code_source(fn)
self._code[s] = compile(source, fn, "exec")
self._code[s] = (source, fn)#compile(source, fn, "exec")
self._all_string[s] =source
## hooks
......@@ -108,7 +108,7 @@ class Repository:
logger.warning(repr(e))
source=""
fn=""
self._hook[s][h] = compile(source, fn, "exec")
self._hook[s][h] = (source, fn)#compile(source, fn, "exec")
self._all_string[s] +=source
## deps
......
......@@ -213,17 +213,20 @@ class Scheduler():
if not path.exists(d):
os.mkdir(d)
r = self.pipe.repository
f = r.get_code_string(seg).co_filename
f = r.get_code_string(seg)
if f:
dest = d+'/'+os.path.basename(f)
os.system("cp %s %s"%(f, dest))
dest = d+'/'+os.path.basename(f[1])
fid = open(dest, "w")
fid.write(f[0])
fid.close()
lst_hook = r.get_hook_list(seg)
for h in lst_hook:
f = r.get_hook_string(seg, h).co_filename
f = r.get_hook_string(seg, h)
if f:
dest = d+'/'+os.path.basename(f)
os.system("cp %s %s"%(f, dest))
dest = d+'/'+os.path.basename(f[1])
fid = open(dest, "w")
fid.write(f[0])
fid.close()
parents = self.pipe.get_parents(seg) ## parents segments
d = self.tracker.get_done(seg) ## done tasks
......
......@@ -237,17 +237,23 @@ class Web:
"""
conn = sqlite3.connect(self.db_file,check_same_thread=True)
conn.text_factory=str
html = html_tmp
html += '<a class="icon home" href="/%s/"><small>Home</small></a>'%(self.name)
html += '<h1>Pipelines in %s </h1>'%self.name
# get all instances
with conn:
l = conn.execute('select seg, curr_dir, seg_id, param from segments order by curr_dir').fetchall()
tcounts = conn.execute('select seg_id, status, count() from tasks group by seg_id, status order by seg_id').fetchall()
sindex = [e[0] for e in tcounts]
index = [[] for i in range(max(sindex)+1)]
for i, s in enumerate(sindex): index[s].append(i)
html = html_tmp
html += '<a class="icon home" href="/%s/"><small>Home</small></a>'%(self.name)
html += '<h1>Pipelines in %s </h1>'%self.name
try:
sindex = [e[0] for e in tcounts]
index = [[] for i in range(max(sindex)+1)]
for i, s in enumerate(sindex): index[s].append(i)
except ValueError:
html += 'No computed pipeline !</div></body></html>'
return html
## Filter fieldset
html += '<fieldset id="filters"><legend><span class="text">Filters</span></legend>'
......@@ -286,6 +292,7 @@ class Web:
log_dir = l[0][1].split("_")[0]
seg_1 = log_dir.split("/")[-1]
log_dir = log_dir[0:len(log_dir)-len(seg_1)]+ "log"
## Buttons
html += '<tr></tr>'
......
......@@ -163,7 +163,7 @@ class Worker(object):
env: environment object.
"""
try:
exec (code, glo)
exec (compile(code[0], code[1], "exec"), glo)
# We do not want to prevent Abortion
except AbortError, e:
raise e
......@@ -249,7 +249,7 @@ class InteractiveWorker(Worker):
Main difference is that exception occuring in the segment code
are not caught.
"""
exec(code, glo)
exec(compile(code[0], code[1], "exec"), glo)
self.task.status = "done"
def terminate(self):
......
......@@ -3,8 +3,9 @@
Generate a cmb map from lambda-CDM power spectrum.
"""
import healpy as hp
import pylab as pl
import healpy as hp
### Define some global parameters
lst_par = ['lmax', 'nside', 'cmb_unit', 'sim_id', 'input_cl']
......
......@@ -3,9 +3,8 @@
Compute coupling matrix from hitcount map.
Compute noise power.
"""
import healpy as hp
import pylab as pl
import healpy as hp
import numpy as npy
import spherelib as sp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment