1 : |
agomez |
10 |
#
|
2 : |
|
|
# BonFIRE Virtual Clusters on Federated Clouds Demonstration Kit
|
3 : |
|
|
#
|
4 : |
|
|
# Copyright (c) Fundacion Centro Tecnologico de Supercomputacion de Galicia 2012
|
5 : |
|
|
#
|
6 : |
|
|
# License GPL Version 3
|
7 : |
|
|
#
|
8 : |
|
|
# The research leading to these results has received funding from
|
9 : |
|
|
# the European Community's Seventh Framework Programme (FP7/2007-2013)
|
10 : |
|
|
# under agreement number 257386
|
11 : |
|
|
#
|
12 : |
|
|
# This software is provided with ABSOLUTELY NO WARRANTY
|
13 : |
|
|
#
|
14 : |
|
|
'''
|
15 : |
|
|
Created on 02/02/2012
|
16 : |
|
|
|
17 : |
|
|
@author: R.Valin
|
18 : |
|
|
'''
|
19 : |
|
|
|
20 : |
|
|
#import simplejson
|
21 : |
|
|
#import sub_pycurl
|
22 : |
|
|
|
23 : |
|
|
|
24 : |
|
|
def json_exp(locations, duration):
|
25 : |
|
|
"""Indicamos la lista de sites a los que queremos enviar, la duracion de los experimentos
|
26 : |
|
|
y nos devuelve una lista de strings con los json de los experimentos para todos
|
27 : |
|
|
los posibles recursos de ese site"""
|
28 : |
|
|
|
29 : |
|
|
exp_name = 'Cesgabfmedidas'
|
30 : |
|
|
compute = 'Cesgatest'
|
31 : |
|
|
#duration= 120
|
32 : |
|
|
exp = dict()
|
33 : |
|
|
#locations=['be-ibbt','fr-inria','uk-hplabs','uk-uedin']
|
34 : |
|
|
|
35 : |
|
|
#Disponibles
|
36 : |
|
|
#storage=['BonFIRE Debian Squeeze 2G v3','BonFIRE SAP Debian Squeeze v2','BonFIRE Zabbix Aggregator v5','BonFIRE Debian Squeeze v3','BonFIRE Debian Squeeze 10G v3']
|
37 : |
|
|
#networks=['BonFIRE WAN','BonFIRE OnDemand WAN','Public IPv4 (EXPERIMENTAL)']
|
38 : |
|
|
#instance=['lite','small','medium','large','Large-EN',"Large+",'xlarge']
|
39 : |
|
|
|
40 : |
|
|
instance_ibbt = ['Large-EN']
|
41 : |
|
|
#instance_inria = ['lite', 'small', 'medium']
|
42 : |
|
|
instance_inria = ['medium']
|
43 : |
|
|
instance_hp = ['Large+']
|
44 : |
|
|
#instance_uedin = ['lite', 'small', 'medium', 'large', 'xlarge']
|
45 : |
|
|
instance_uedin = ['large']
|
46 : |
|
|
|
47 : |
|
|
storage_ibbt = ['BonFIRE Debian Squeeze 2G v3']
|
48 : |
|
|
storage_inria = ['BonFIRE Debian Squeeze 2G v3', 'BonFIRE Zabbix Aggregator v5', 'BonFIRE Debian Squeeze v3', 'BonFIRE Debian Squeeze 10G v3']
|
49 : |
|
|
#storage_inria = ['BonFIRE Debian Squeeze v3']
|
50 : |
|
|
storage_hp = ['BonFIRE SAP Debian Squeeze v2', 'BonFIRE Debian Squeeze 10G']
|
51 : |
|
|
storage_uedin = ['BonFIRE Debian Squeeze v3']
|
52 : |
|
|
#storage_uedin = ['BonFIRE Debian Squeeze v3', 'BonFIRE Debian Squeeze 2G v3', 'BonFIRE Debian Squeeze 10G v3', 'BonFIRE Zabbix Aggregator v5']
|
53 : |
|
|
#storage_uedin = ['BonFIRE Debian Squeeze 2G v3', 'BonFIRE Zabbix Aggregator v5', 'BonFIRE Debian Squeeze v3', 'BonFIRE Debian Squeeze 10G v3']
|
54 : |
|
|
#storage_uedin = ['BonFIRE Debian Squeeze 2G v3', 'BonFIRE Zabbix Aggregator v5']
|
55 : |
|
|
|
56 : |
|
|
exp['be-ibbt'] = [instance_ibbt, storage_ibbt]
|
57 : |
|
|
exp['fr-inria'] = [instance_inria, storage_inria]
|
58 : |
|
|
exp['uk-hplabs'] = [instance_hp, storage_hp]
|
59 : |
|
|
exp['uk-epcc'] = [instance_uedin, storage_uedin]
|
60 : |
|
|
|
61 : |
|
|
exp_def = []
|
62 : |
|
|
info_instance=dict()
|
63 : |
|
|
info_storage=dict()
|
64 : |
|
|
info_location=dict()
|
65 : |
|
|
for i in locations:
|
66 : |
|
|
for j in exp[i][0]:
|
67 : |
|
|
for k in exp[i][1]:
|
68 : |
|
|
exp_json = {'description': exp_name,
|
69 : |
|
|
'duration': 120,
|
70 : |
|
|
'name': exp_name,
|
71 : |
|
|
'resources': [{'compute': {'name': compute,
|
72 : |
|
|
'description': compute,
|
73 : |
|
|
'instanceType': j,
|
74 : |
|
|
'locations': [i],
|
75 : |
|
|
'resources':[{'storage':'@' + k}, {'network':'@BonFIRE WAN'}]}}]}
|
76 : |
|
|
exp_def.append(exp_json)
|
77 : |
|
|
info_instance[str(exp_json)]=j
|
78 : |
|
|
info_storage[str(exp_json)]='@' + k
|
79 : |
|
|
info_location[str(exp_json)]=i
|
80 : |
|
|
|
81 : |
|
|
return (exp_def,info_instance,info_storage,info_location)
|
82 : |
|
|
|
83 : |
|
|
#locations=['fr-inria']
|
84 : |
|
|
#duration=120
|
85 : |
|
|
#print(json_exp(locations,duration)[0])
|
86 : |
|
|
#print(simplejson.dumps(json_exp(locations,duration)[0]))
|
87 : |
|
|
|
88 : |
|
|
|
89 : |
|
|
|
90 : |
|
|
|
91 : |
|
|
#for i in exp_def:
|
92 : |
|
|
# print i
|
93 : |
|
|
|
94 : |
|
|
#exp={'description': 'Experiment description',
|
95 : |
|
|
# 'duration': 120,
|
96 : |
|
|
# 'name': 'My Experiment',
|
97 : |
|
|
# 'resources': [{'compute': {'name': 'JSON-COMPUTE-TEST',
|
98 : |
|
|
# 'description': 'A description of the compute.',
|
99 : |
|
|
# 'instanceType': 'small',
|
100 : |
|
|
# 'locations': ['fr-inria'],
|
101 : |
|
|
# 'resources':[{'storage': '@BonFIRE Debian Squeeze v3'},{'network':'@BonFIRE WAN'}]}}]}
|
102 : |
|
|
|
103 : |
|
|
|
104 : |
|
|
|
105 : |
|
|
|
106 : |
|
|
|