Skip to content

Commit 8526706

Browse files
committed
Merge pull request #195 from fogbow/develop
Fixing garbageCollector. Refactoring execBenchmark.
2 parents d0b6a01 + a801b96 commit 8526706

File tree

130 files changed

+2862
-1875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+2862
-1875
lines changed

bin/fogbow-create-reverse-tunnel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ autossh &
2323
EOL
2424
chmod +x /bin/fogbow-autossh
2525
setsid /bin/fogbow-autossh
26+
cat > /bin/create-fogbow-tunnel << EOL
27+
#!/bin/sh
28+
REMOTE_PORT=\$(curl -X POST #TOKEN_HOST#:#TOKEN_HOST_HTTP_PORT#/token/#TOKEN_ID#-\${1})
29+
ssh $SSH_OPTIONS -f -N -R 0.0.0.0:\$REMOTE_PORT:localhost:\${2} #TOKEN_ID#-\${1}@#TOKEN_HOST# -p #TOKEN_HOST_SSH_PORT#
30+
EOL
31+
chmod +x /bin/create-fogbow-tunnel

examples/lvl-user-data.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
create-fogbow-tunnel http 80
3+
sed -i 's/include \/etc\/nginx\/naxsi/#include \/etc\/nginx/g' /etc/nginx/sites-enabled/default
4+
service nginx restart

manager.conf.example

Lines changed: 116 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -6,132 +6,145 @@ xmpp_port=5347
66
rendezvous_jid=rendezvous.test.com
77
greensitter_jid=greensitter.test.com
88

9-
# That flavor specification will be transformed into requirements.
10-
flavor_fogbow_small={mem=512, cpu=1}
11-
flavor_fogbow_medium={mem=1024, cpu=2}
12-
flavor_fogbow_large={mem=2048, cpu=4}
13-
14-
# Compute Opennebula
15-
compute_class=org.fogbowcloud.manager.core.plugins.opennebula.OpenNebulaComputePlugin
16-
compute_one_url=http://localhost:2633/RPC2
17-
compute_one_network_id=1
18-
19-
# Setting used to find the correct flavor according to informed templates.
20-
# types :all or specific templates(template1,template2)
21-
compute_one_templates=all
22-
23-
# Settings used by ONE compute plugin to register new images in the cloud
24-
# ID of datastore to register the image
25-
compute_one_datastore_id=1
26-
# To register a new image, the image file needs to be in the some machine where ONE is running
27-
# If the fogbow manager is running in a different machine, set the SSH properties to transfer the image
28-
# Or if the fogbow manager is in the same machine, leave it blank
29-
compute_one_ssh_host=127.0.0.1
30-
compute_one_ssh_port=22
31-
compute_one_ssh_username=fogbow
32-
# The SSH try to access using private key, set the path to ssh id_rsa file
33-
compute_one_ssh_key_file=/home/fogbow/.ssh/id_rsa
34-
# Set the directory to copy images in remote host
35-
compute_one_ssh_target_temp_folder=/tmp/images
36-
37-
# Compute Openstack OCCI
38-
compute_class=org.fogbowcloud.manager.core.plugins.openstack.OpenStackOCCIComputePlugin
39-
compute_openstack_v2api_url=http://localhost:8182
40-
compute_occi_url=http://localhost:8182
41-
compute_occi_os_scheme=http://schemas.openstack.org/template/os#
42-
compute_occi_instance_scheme=http://schemas.openstack.org/compute/instance#
43-
compute_occi_resource_scheme=http://schemas.openstack.org/template/resource#
44-
compute_occi_network_id=ea51ed0c-0e8a-448d-8202-c79777109ffe
45-
46-
# Compute Opennebula OCCI
47-
compute_class=org.fogbowcloud.manager.core.plugins.opennebula.OpenNebulaOCCIComputePlugin
48-
compute_one_url=http://localhost:2633/RPC2
49-
compute_occi_url=http://localhost:3000
50-
compute_occi_template_scheme=http://occi.localhost/occi/infrastructure/os_tpl#
51-
compute_occi_resource_scheme=http://schema.fedcloud.egi.eu/occi/infrastructure/resource_tpl#
52-
compute_occi_flavors_small={cpu=1,mem=512}
53-
compute_occi_flavors_medium={cpu=2,mem=1024}
54-
compute_occi_flavors_large={cpu=4,mem=2048}
55-
56-
# If you are using the EgiImageStoragePlugin
57-
image_storage_class=org.fogbowcloud.manager.core.plugins.imagestorage.egi.EgiImageStoragePlugin
58-
image_storage_egi_base_url=http://lsd.ufcg.edu.br/~user/vm/
59-
image_storage_egi_tmp_storage=/tmp/
60-
61-
# If you are using the EgiApplianceImageStoragePlugin
62-
image_storage_class=org.fogbowcloud.manager.core.plugins.imagestorage.appliance.EgiApplianceImageStoragePlugin
63-
image_storage_appliance_base_url=http://appliance-repo.egi.eu/images
64-
image_storage_appliance_tmp_storage=/tmp/
65-
66-
# If you are using the VMCatcherStoragePlugin
67-
image_storage_class=org.fogbowcloud.manager.core.plugins.imagestorage.vmcatcher.VMCatcherStoragePlugin
68-
image_storage_vmcatcher_glancepush_vmcmapping_file=/etc/vmcatcher/vmcmapping
69-
image_storage_vmcatcher_push_method=glancepush
70-
image_storage_vmcatcher_push_method=cesga
71-
72-
# Applies to all image storage plugins
9+
## Static mapping from flavors to requirements (Optional)
10+
# flavor_fogbow_small={mem=512, cpu=1}
11+
# flavor_fogbow_medium={mem=1024, cpu=2}
12+
# flavor_fogbow_large={mem=2048, cpu=4}
13+
14+
## Compute Plugin (Openstack)
15+
compute_class=org.fogbowcloud.manager.core.plugins.compute.openstack.OpenStackNovaV2ComputePlugin
16+
compute_novav2_url=http://localhost:8774
17+
compute_glancev2_url=http://localhost:9292
18+
compute_glancev2_image_visibility=private
19+
compute_novav2_network_id=ea51ed0c-0e8a-448d-8202-c79777109ffe
20+
21+
## Compute Plugin (Opennebula)
22+
# compute_class=org.fogbowcloud.manager.core.plugins.compute.opennebula.OpenNebulaComputePlugin
23+
# compute_one_url=http://localhost:2633/RPC2
24+
# compute_one_network_id=1
25+
# compute_one_templates=all
26+
# compute_one_datastore_id=1
27+
# compute_one_ssh_host=127.0.0.1
28+
# compute_one_ssh_port=22
29+
# compute_one_ssh_username=fogbow
30+
# compute_one_ssh_key_file=/home/fogbow/.ssh/id_rsa
31+
# compute_one_ssh_target_temp_folder=/tmp/images
32+
33+
## Compute Plugin (Openstack OCCI)
34+
# compute_class=org.fogbowcloud.manager.core.plugins.compute.openstack.OpenStackOCCIComputePlugin
35+
# compute_openstack_v2api_url=http://localhost:8182
36+
# compute_occi_url=http://localhost:8182
37+
# compute_occi_os_scheme=http://schemas.openstack.org/template/os#
38+
# compute_occi_instance_scheme=http://schemas.openstack.org/compute/instance#
39+
# compute_occi_resource_scheme=http://schemas.openstack.org/template/resource#
40+
# compute_occi_network_id=ea51ed0c-0e8a-448d-8202-c79777109ffe
41+
42+
## Compute Plugin (Opennebula OCCI)
43+
# compute_class=org.fogbowcloud.manager.core.plugins.compute.opennebula.OpenNebulaOCCIComputePlugin
44+
# compute_one_url=http://localhost:2633/RPC2
45+
# compute_occi_url=http://localhost:3000
46+
# compute_occi_template_scheme=http://occi.localhost/occi/infrastructure/os_tpl#
47+
# compute_occi_resource_scheme=http://schema.fedcloud.egi.eu/occi/infrastructure/resource_tpl#
48+
# compute_occi_flavors_small={cpu=1,mem=512}
49+
# compute_occi_flavors_medium={cpu=2,mem=1024}
50+
# compute_occi_flavors_large={cpu=4,mem=2048}
51+
52+
## Image Storage Plugin (HTTPDownload)
53+
image_storage_class=org.fogbowcloud.manager.core.plugins.imagestorage.http.HTTPDownloadImageStoragePlugin
54+
image_storage_http_base_url=http://appliance-repo.egi.eu/images
55+
image_storage_http_tmp_storage=/tmp/
56+
57+
## Image Storage Plugin (VMCatcher)
58+
# image_storage_class=org.fogbowcloud.manager.core.plugins.imagestorage.vmcatcher.VMCatcherStoragePlugin
59+
# image_storage_vmcatcher_use_sudo=false
60+
# image_storage_vmcatcher_env_VMCATCHER_RDBMS="sqlite:////var/lib/vmcatcher/vmcatcher.db"
61+
# image_storage_vmcatcher_env_VMCATCHER_CACHE_DIR_CACHE="/var/lib/vmcatcher/cache"
62+
# image_storage_vmcatcher_env_VMCATCHER_CACHE_DIR_DOWNLOAD="/var/lib/vmcatcher/cache/partial"
63+
# image_storage_vmcatcher_env_VMCATCHER_CACHE_DIR_EXPIRE="/var/lib/vmcatcher/cache/expired"
64+
## glancepush specific
65+
# image_storage_vmcatcher_push_method=glancepush
66+
# image_storage_vmcatcher_glancepush_vmcmapping_file=/etc/vmcatcher/vmcmapping
67+
# image_storage_vmcatcher_env_VMCATCHER_CACHE_EVENT="python /var/lib/vmcatcher/gpvcmupdate.py"
68+
## one specific
69+
# image_storage_vmcatcher_push_method=cesga
70+
# image_storage_vmcatcher_env_VMCATCHER_CACHE_EVENT="python /var/lib/vmcatcher/vmcatcher_eventHndl_ON"
71+
# image_storage_vmcatcher_env_ONE_AUTH="/etc/vmcatcher/one_auth"
72+
73+
## Static mapping between local image ids and image names
74+
## Applies to all image storage plugins
7375
image_storage_static_fogbow-linux-x86=55d938ef-57d1-44ea-8155-6036d170780a
7476
image_storage_static_fogbow-ubuntu-1204=81765250-a4e4-440d-a215-43c9c0849120
7577

76-
member_picker_class=org.fogbowcloud.manager.core.RoundRobinMemberPicker
77-
#If you are using NoFMemberPicker or NoFPrioritizationPlugin classes
78-
nof_trustworthy=false
79-
nof_prioritize_local=true
78+
## Member Picker Plugin (Round Robin)
79+
member_picker_class=org.fogbowcloud.manager.core.plugins.memberpicker.RoundRobinMemberPickerPlugin
8080

81-
local_prioritization_plugin_class=org.fogbowcloud.manager.core.plugins.prioritization.FCFSPrioritizationPlugin
81+
## Member Picker Plugin (Nof Member Picker)
82+
# member_picker_class=org.fogbowcloud.manager.core.plugins.memberpicker.NoFMemberPickerPlugin
83+
84+
## Local Prioritization Plugin
85+
local_prioritization_plugin_class=org.fogbowcloud.manager.core.plugins.prioritization.fcfs.FCFSPrioritizationPlugin
86+
## Remote Prioritization Plugin
8287
remote_prioritization_plugin_class=org.fogbowcloud.manager.core.plugins.prioritization.nof.NoFPrioritizationPlugin
88+
nof_prioritize_local=true
8389

84-
# Compute Openstack
85-
compute_class=org.fogbowcloud.manager.core.plugins.openstack.OpenStackNovaV2ComputePlugin
86-
compute_novav2_url=http://localhost:8774
87-
compute_glancev2_url=http://localhost:9292
88-
compute_novav2_network_id=ea51ed0c-0e8a-448d-8202-c79777109ffe
90+
## If you are using NoFMemberPicker or NoFPrioritizationPlugin classes
91+
nof_trustworthy=false
8992

90-
# Local identity
91-
local_identity_class=org.fogbowcloud.manager.core.plugins.openstack.KeystoneIdentityPlugin
93+
## Local identity (Keystone Identity Plugin)
94+
local_identity_class=org.fogbowcloud.manager.core.plugins.identity.openstack.KeystoneIdentityPlugin
9295
local_identity_url=http://localhost:5000
93-
94-
# Federation identity
95-
federation_authorization_class=org.fogbowcloud.manager.core.plugins.common.AllowAllAuthorizationPlugin
96-
federation_identity_class=org.fogbowcloud.manager.core.plugins.openstack.KeystoneIdentityPlugin
97-
federation_identity_url=http://localhost:5000
98-
9996
local_proxy_account_user_name=fogbow
10097
local_proxy_account_password=fogbow
10198
local_proxy_account_tenant_name=demo
10299

103-
member_validator=org.fogbowcloud.manager.core.DefaultMemberValidator
104-
member_validator_ca_dir=
100+
## Local Identity (X509 Identity Plugin)
101+
# local_identity_class=org.fogbowcloud.manager.core.plugins.x509.X509IdentityPlugin
102+
# x509_ca_dir_path=/path/to/ca/directory
105103

106-
cert_path=
104+
## Local Identity (Opennebula Identity Plugin)
105+
# local_identity_class=org.fogbowcloud.manager.core.plugins.opennebula.OpenNebulaIdentityPlugin
106+
# local_identity_url=http://localhost:2633/RPC2
107107

108-
scheduler_period=30000
109-
token_update_period=300000
110-
instance_monitoring_period=120000
111-
served_request_monitoring_period=120000
112-
garbage_collector_period=240000
113-
asyn_request_waiting_interval=300000
108+
## Authorizatio Plugin
109+
federation_authorization_class=org.fogbowcloud.manager.core.plugins.authorization.AllowAllAuthorizationPlugin
114110

115-
ssh_tunnel_public_host=150.165.80.1
116-
ssh_tunnel_private_host=10.0.0.1
117-
ssh_tunnel_host_http_port=2223
118-
ssh_tunnel_host_port=2222
111+
## Federation identity (Keystone Identity Plugin)
112+
federation_identity_class=org.fogbowcloud.manager.core.plugins.identity.openstack.KeystoneIdentityPlugin
113+
federation_identity_url=http://localhost:5000
119114

120-
my_ip=127.0.0.1
115+
## Federation Identity (Opennebula Identity Plugin)
116+
# federation_identity_class=org.fogbowcloud.manager.core.plugins.opennebula.OpenNebulaIdentityPlugin
117+
# federation_identity_url=http://localhost:2633/RPC2
121118

122-
http_port=8182
119+
## Federation Identity (VOMS Identity PLugin)
120+
# federation_identity_class=org.fogbowcloud.manager.core.plugins.identity.voms.VomsIdentityPlugin
121+
# path_vomses=/etc/vomses
122+
# path_trust_anchors=/etc/grid-security/certificates
123+
# path_vomsdir=/etc/grid-security/vomsdir
123124

124-
max_whoisalive_manager_count=100
125+
## Member Validator
126+
member_validator_class=org.fogbowcloud.manager.core.plugins.memberauthorization.DefaultMemberAuthorizationPlugin
127+
member_validator_ca_dir=
128+
129+
token_host_public_address=150.165.80.1
130+
token_host_private_address=10.0.0.1
131+
token_host_http_port=2223
132+
token_host_port=2222
133+
134+
my_ip=127.0.0.1
125135

136+
## Accounting Plugin
126137
accounting_class=org.fogbowcloud.manager.core.plugins.accounting.FCUAccountingPlugin
127138
accounting_update_period=300000
128139
accounting_datastore_url=jdbc:h2:/tmp/usage
129140

130-
# SSH Benchmarking plugin
141+
## Benchmarking (SSH Benchmarking plugin)
131142
benchmarking_class=org.fogbowcloud.manager.core.plugins.benchmarking.SSHBenchmarkingPlugin
132-
# Benchmarking script to use with SSH Benchmarking plugin
143+
## Benchmarking script to use with SSH Benchmarking plugin
133144
ssh_benchmarking_script_url=http://downloads.fogbowcloud.org/benchmark/script_ssh_benchmarking.sh
134-
135-
# Manager public and private keys
145+
## Manager public and private keys
136146
ssh_private_key=/etc/fogbow-manager/ssh/id_rsa
137-
ssh_public_key=/etc/fogbow-manager/ssh/id_rsa.pub
147+
ssh_public_key=/etc/fogbow-manager/ssh/id_rsa.pub
148+
149+
## Benchmarking (Vanilla Benchmarking Plugin)
150+
# benchmarking_class=org.fogbowcloud.manager.core.plugins.benchmarking.VanillaBenchmarkingPlugin

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@
166166
<version>2.2.0</version>
167167
</dependency>
168168
<dependency>
169-
<groupId>org.apache.httpcomponents</groupId>
170-
<artifactId>httpclient</artifactId>
171-
<version>4.0-alpha4</version>
172-
</dependency>
169+
<groupId>org.apache.httpcomponents</groupId>
170+
<artifactId>httpclient</artifactId>
171+
<version>4.4</version>
172+
</dependency>
173173
<dependency>
174174
<groupId>org.json</groupId>
175175
<artifactId>json</artifactId>

src/main/java/org/fogbowcloud/manager/Main.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@
66
import org.apache.log4j.ConsoleAppender;
77
import org.apache.log4j.Logger;
88
import org.fogbowcloud.manager.core.ConfigurationConstants;
9-
import org.fogbowcloud.manager.core.DefaultMemberValidator;
10-
import org.fogbowcloud.manager.core.FederationMemberPicker;
11-
import org.fogbowcloud.manager.core.FederationMemberValidator;
129
import org.fogbowcloud.manager.core.ManagerController;
13-
import org.fogbowcloud.manager.core.RoundRobinMemberPicker;
1410
import org.fogbowcloud.manager.core.plugins.AccountingPlugin;
1511
import org.fogbowcloud.manager.core.plugins.AuthorizationPlugin;
1612
import org.fogbowcloud.manager.core.plugins.BenchmarkingPlugin;
1713
import org.fogbowcloud.manager.core.plugins.ComputePlugin;
14+
import org.fogbowcloud.manager.core.plugins.FederationMemberAuthorizationPlugin;
15+
import org.fogbowcloud.manager.core.plugins.FederationMemberPickerPlugin;
1816
import org.fogbowcloud.manager.core.plugins.IdentityPlugin;
1917
import org.fogbowcloud.manager.core.plugins.ImageStoragePlugin;
2018
import org.fogbowcloud.manager.core.plugins.PrioritizationPlugin;
2119
import org.fogbowcloud.manager.core.plugins.accounting.FCUAccountingPlugin;
2220
import org.fogbowcloud.manager.core.plugins.benchmarking.VanillaBenchmarkingPlugin;
23-
import org.fogbowcloud.manager.core.plugins.imagestorage.egi.EgiImageStoragePlugin;
21+
import org.fogbowcloud.manager.core.plugins.imagestorage.http.HTTPDownloadImageStoragePlugin;
22+
import org.fogbowcloud.manager.core.plugins.memberauthorization.DefaultMemberAuthorizationPlugin;
23+
import org.fogbowcloud.manager.core.plugins.memberpicker.RoundRobinMemberPickerPlugin;
2424
import org.fogbowcloud.manager.core.plugins.prioritization.TwoFoldPrioritizationPlugin;
2525
import org.fogbowcloud.manager.occi.OCCIApplication;
26-
import org.fogbowcloud.manager.occi.core.ResourceRepository;
26+
import org.fogbowcloud.manager.occi.model.ResourceRepository;
2727
import org.fogbowcloud.manager.xmpp.ManagerXmppComponent;
2828
import org.restlet.Component;
2929
import org.restlet.data.Protocol;
@@ -35,6 +35,7 @@ public class Main {
3535

3636
private static final Logger LOGGER = Logger.getLogger(Main.class);
3737
private static final int EXIT_ERROR_CODE = 128;
38+
private static final int DEFAULT_HTTP_PORT = 8182;
3839

3940
public static void main(String[] args) throws Exception {
4041
configureLog4j();
@@ -80,10 +81,10 @@ public static void main(String[] args) throws Exception {
8081
System.exit(EXIT_ERROR_CODE);
8182
}
8283

83-
FederationMemberValidator validator = new DefaultMemberValidator(properties);
84+
FederationMemberAuthorizationPlugin validator = new DefaultMemberAuthorizationPlugin(properties);
8485
try {
85-
validator = (FederationMemberValidator) createInstance(
86-
ConfigurationConstants.MEMBER_VALIDATOR_KEY, properties);
86+
validator = (FederationMemberAuthorizationPlugin) createInstance(
87+
ConfigurationConstants.MEMBER_VALIDATOR_CLASS_KEY, properties);
8788
} catch (Exception e) {
8889
LOGGER.warn("Member Validator not especified in the properties.");
8990
System.exit(EXIT_ERROR_CODE);
@@ -100,7 +101,7 @@ public static void main(String[] args) throws Exception {
100101
imageStoragePlugin = (ImageStoragePlugin) createInstanceWithComputePlugin(
101102
ConfigurationConstants.IMAGE_STORAGE_PLUGIN_CLASS, properties, computePlugin);
102103
} catch (Exception e) {
103-
imageStoragePlugin = new EgiImageStoragePlugin(properties, computePlugin);
104+
imageStoragePlugin = new HTTPDownloadImageStoragePlugin(properties, computePlugin);
104105
LOGGER.warn("Image Storage plugin not specified in properties. Using the default one.", e);
105106
}
106107

@@ -122,13 +123,13 @@ public static void main(String[] args) throws Exception {
122123
LOGGER.warn("Accounting plugin not specified in properties. Using the default one.", e);
123124
}
124125

125-
FederationMemberPicker memberPickerPlugin = null;
126+
FederationMemberPickerPlugin memberPickerPlugin = null;
126127
try {
127-
memberPickerPlugin = (FederationMemberPicker) createInstanceWithAccoutingPlugin(
128+
memberPickerPlugin = (FederationMemberPickerPlugin) createInstanceWithAccoutingPlugin(
128129
ConfigurationConstants.MEMBER_PICKER_PLUGIN_CLASS_KEY, properties,
129130
accountingPlugin);
130131
} catch (Exception e) {
131-
memberPickerPlugin = new RoundRobinMemberPicker(properties, accountingPlugin);
132+
memberPickerPlugin = new RoundRobinMemberPickerPlugin(properties, accountingPlugin);
132133
LOGGER.warn("Member picker plugin not specified in properties. Using the default one.", e);
133134
}
134135

@@ -171,8 +172,8 @@ public static void main(String[] args) throws Exception {
171172

172173
try {
173174
Component http = new Component();
174-
http.getServers().add(Protocol.HTTP,
175-
Integer.parseInt(properties.getProperty(ConfigurationConstants.HTTP_PORT_KEY)));
175+
String httpPort = properties.getProperty(ConfigurationConstants.HTTP_PORT_KEY);
176+
http.getServers().add(Protocol.HTTP, httpPort == null ? DEFAULT_HTTP_PORT : Integer.parseInt(httpPort));
176177
http.getDefaultHost().attach(application);
177178
http.start();
178179
} catch (Exception e) {

0 commit comments

Comments
 (0)