Log In | Get Help   
Home My Page Projects Code Snippets Project Openings BonFIRE VCOC Demonstration Kit
Summary Activity SCM Files Wiki
[bonfiredemokit] Annotation of /ea/experiment_type.py
[bonfiredemokit] / ea / experiment_type.py Repository:
ViewVC logotype

Annotation of /ea/experiment_type.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download) (as text)

1 : agomez 1 '''
2 :     Created on 02/02/2012
3 :    
4 :     @author: R.Valin
5 :     '''
6 :    
7 :     #import simplejson
8 :     #import sub_pycurl
9 :    
10 :    
11 :     def json_exp(locations, duration):
12 :     """Indicamos la lista de sites a los que queremos enviar, la duracion de los experimentos
13 :     y nos devuelve una lista de strings con los json de los experimentos para todos
14 :     los posibles recursos de ese site"""
15 :    
16 :     exp_name = 'Cesgabfmedidas'
17 :     compute = 'Cesgatest'
18 :     #duration= 120
19 :     exp = dict()
20 :     #locations=['be-ibbt','fr-inria','uk-hplabs','uk-uedin']
21 :    
22 :     #Disponibles
23 :     #storage=['BonFIRE Debian Squeeze 2G v3','BonFIRE SAP Debian Squeeze v2','BonFIRE Zabbix Aggregator v5','BonFIRE Debian Squeeze v3','BonFIRE Debian Squeeze 10G v3']
24 :     #networks=['BonFIRE WAN','BonFIRE OnDemand WAN','Public IPv4 (EXPERIMENTAL)']
25 :     #instance=['lite','small','medium','large','Large-EN',"Large+",'xlarge']
26 :    
27 :     instance_ibbt = ['Large-EN']
28 :     #instance_inria = ['lite', 'small', 'medium']
29 :     instance_inria = ['medium']
30 :     instance_hp = ['Large+']
31 :     #instance_uedin = ['lite', 'small', 'medium', 'large', 'xlarge']
32 :     instance_uedin = ['large']
33 :    
34 :     storage_ibbt = ['BonFIRE Debian Squeeze 2G v3']
35 :     storage_inria = ['BonFIRE Debian Squeeze 2G v3', 'BonFIRE Zabbix Aggregator v5', 'BonFIRE Debian Squeeze v3', 'BonFIRE Debian Squeeze 10G v3']
36 :     #storage_inria = ['BonFIRE Debian Squeeze v3']
37 :     storage_hp = ['BonFIRE SAP Debian Squeeze v2', 'BonFIRE Debian Squeeze 10G']
38 :     storage_uedin = ['BonFIRE Debian Squeeze v3']
39 :     #storage_uedin = ['BonFIRE Debian Squeeze v3', 'BonFIRE Debian Squeeze 2G v3', 'BonFIRE Debian Squeeze 10G v3', 'BonFIRE Zabbix Aggregator v5']
40 :     #storage_uedin = ['BonFIRE Debian Squeeze 2G v3', 'BonFIRE Zabbix Aggregator v5', 'BonFIRE Debian Squeeze v3', 'BonFIRE Debian Squeeze 10G v3']
41 :     #storage_uedin = ['BonFIRE Debian Squeeze 2G v3', 'BonFIRE Zabbix Aggregator v5']
42 :    
43 :     exp['be-ibbt'] = [instance_ibbt, storage_ibbt]
44 :     exp['fr-inria'] = [instance_inria, storage_inria]
45 :     exp['uk-hplabs'] = [instance_hp, storage_hp]
46 :     exp['uk-epcc'] = [instance_uedin, storage_uedin]
47 :    
48 :     exp_def = []
49 :     info_instance=dict()
50 :     info_storage=dict()
51 :     info_location=dict()
52 :     for i in locations:
53 :     for j in exp[i][0]:
54 :     for k in exp[i][1]:
55 :     exp_json = {'description': exp_name,
56 :     'duration': 120,
57 :     'name': exp_name,
58 :     'resources': [{'compute': {'name': compute,
59 :     'description': compute,
60 :     'instanceType': j,
61 :     'locations': [i],
62 :     'resources':[{'storage':'@' + k}, {'network':'@BonFIRE WAN'}]}}]}
63 :     exp_def.append(exp_json)
64 :     info_instance[str(exp_json)]=j
65 :     info_storage[str(exp_json)]='@' + k
66 :     info_location[str(exp_json)]=i
67 :    
68 :     return (exp_def,info_instance,info_storage,info_location)
69 :    
70 :     #locations=['fr-inria']
71 :     #duration=120
72 :     #print(json_exp(locations,duration)[0])
73 :     #print(simplejson.dumps(json_exp(locations,duration)[0]))
74 :    
75 :    
76 :    
77 :    
78 :     #for i in exp_def:
79 :     # print i
80 :    
81 :     #exp={'description': 'Experiment description',
82 :     # 'duration': 120,
83 :     # 'name': 'My Experiment',
84 :     # 'resources': [{'compute': {'name': 'JSON-COMPUTE-TEST',
85 :     # 'description': 'A description of the compute.',
86 :     # 'instanceType': 'small',
87 :     # 'locations': ['fr-inria'],
88 :     # 'resources':[{'storage': '@BonFIRE Debian Squeeze v3'},{'network':'@BonFIRE WAN'}]}}]}
89 :    
90 :    
91 :    
92 :    
93 :    

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge