Skip to content

Commit dee13de

Browse files
committed
Merge pull request #253 from fogbow/develop
Fixing link output format to be understandable by rocci client
2 parents 0d20708 + f8db7f8 commit dee13de

File tree

160 files changed

+12324
-6064
lines changed

Some content is hidden

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

160 files changed

+12324
-6064
lines changed

bin/fogbow-create-reverse-tunnel

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,16 @@ autossh() {
1919
continue
2020
fi
2121
echo "Starting tunnel in port \$REMOTE_PORT"
22-
echo "Command: ssh $SSH_OPTIONS -N -R 0.0.0.0:\$REMOTE_PORT:localhost:22 #TOKEN_ID#@#TOKEN_HOST# -p #TOKEN_HOST_SSH_PORT#"
23-
ssh $SSH_OPTIONS -N -R 0.0.0.0:\$REMOTE_PORT:localhost:22 #TOKEN_ID#@#TOKEN_HOST# -p #TOKEN_HOST_SSH_PORT#
22+
23+
OLD_IFS=\$IFS # save internal field separator
24+
IFS=":" # set it to ':'
25+
set -- \$REMOTE_PORT # make the result positional parameters
26+
IFS=\$OLD_IFS # restore IFS
27+
PORT=\$1
28+
SSH_SERVER_PORT=\$2
29+
30+
echo "Command: ssh $SSH_OPTIONS -N -R 0.0.0.0:\$PORT:localhost:22 #TOKEN_ID#@#TOKEN_HOST# -p \$SSH_SERVER_PORT"
31+
ssh $SSH_OPTIONS -N -R 0.0.0.0:\$PORT:localhost:22 #TOKEN_ID#@#TOKEN_HOST# -p \$SSH_SERVER_PORT
2432
sleep 5
2533
done
2634
}
@@ -30,7 +38,19 @@ chmod +x /bin/fogbow-autossh
3038
setsid /bin/fogbow-autossh
3139
cat > /bin/create-fogbow-tunnel << EOL
3240
#!/bin/sh
33-
REMOTE_PORT=\$(curl -X POST #TOKEN_HOST#:#TOKEN_HOST_HTTP_PORT#/token/#TOKEN_ID#-\${1})
34-
ssh $SSH_OPTIONS -f -N -R 0.0.0.0:\$REMOTE_PORT:localhost:\${2} #TOKEN_ID#-\${1}@#TOKEN_HOST# -p #TOKEN_HOST_SSH_PORT#
41+
TOKEN_VAR=\$1
42+
LOCAL_PORT=\$2
43+
echo "Requesting port curl -X POST #TOKEN_HOST#:#TOKEN_HOST_HTTP_PORT#/token/#TOKEN_ID#-\$TOKEN_VAR"
44+
REMOTE_PORT=\$(curl -X POST #TOKEN_HOST#:#TOKEN_HOST_HTTP_PORT#/token/#TOKEN_ID#-\$TOKEN_VAR)
45+
OLD_IFS=\$IFS # save internal field separator
46+
IFS=":" # set it to ':'
47+
set -- \$REMOTE_PORT # make the result positional parameters
48+
IFS=\$OLD_IFS # restore IFS
49+
PORT=\$1
50+
SSH_SERVER_PORT=\$2
51+
echo "Recives PORT:\$PORT and SSH SERVER PORT: \$SSH_SERVER_PORT"
52+
echo "Command: ssh $SSH_OPTIONS -f -N -R 0.0.0.0:\$PORT:localhost:\$LOCAL_PORT #TOKEN_ID#-\$TOKEN_VAR@#TOKEN_HOST# -p \$SSH_SERVER_PORT"
53+
54+
ssh $SSH_OPTIONS -f -N -R 0.0.0.0:\$PORT:localhost:\$LOCAL_PORT #TOKEN_ID#-\$TOKEN_VAR@#TOKEN_HOST# -p \$SSH_SERVER_PORT
3555
EOL
3656
chmod +x /bin/create-fogbow-tunnel

manager.conf.example

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@ order_bd_updater_period=30000
1515
# flavor_fogbow_medium={mem=1024, cpu=2}
1616
# flavor_fogbow_large={mem=2048, cpu=4}
1717

18+
## Storage Plugin (Openstack)
19+
storage_class=org.fogbowcloud.manager.core.plugins.storage.openstack.OpenStackV2StoragePlugin
20+
storage_v2_url=http://localhost:8776
21+
22+
## Storage Plugin (OpenNebula)
23+
# storage_class=org.fogbowcloud.manager.core.plugins.storage.opennebula.OpenNebulaStoragePlugin
24+
## Default device prefix to use when attaching volumes, values: hd (IDE), sd (SCSI), vd (KVM), vxd (XEN)
25+
# storage_one_datastore_default_device_prefix=vd
26+
27+
## Storage Plugin (CloudStack)
28+
# storage_class=org.fogbowcloud.manager.core.plugins.storage.cloudstack.CloudStackStoragePlugin
29+
30+
## Storage Plugin (NoCloud)
31+
# storage_class=org.fogbowcloud.manager.core.plugins.storage.nocloud.NoCloudStoragePlugin
32+
1833
## Compute Plugin (Openstack)
1934
compute_class=org.fogbowcloud.manager.core.plugins.compute.openstack.OpenStackNovaV2ComputePlugin
2035
compute_novav2_url=http://localhost:8774
@@ -202,6 +217,7 @@ token_host_http_port=2223
202217
token_host_port=2222
203218

204219
my_ip=127.0.0.1
220+
#admin_users=user1;user2
205221

206222
## Accounting Plugin
207223
accounting_class=org.fogbowcloud.manager.core.plugins.accounting.FCUAccountingPlugin
@@ -227,10 +243,10 @@ benchmarking_class=org.fogbowcloud.manager.core.plugins.benchmarking.VanillaBenc
227243
public_key; scheme="http://schemas.openstack.org/instance/credentials#"; class="mixin";
228244
org.openstack.credentials.publickey.data
229245

230-
# Request public key properties
246+
# Order public key properties
231247
occi_extra_resource_fogbow_public_key=public_key
232248
occi_extra_resource_org.fogbowcloud.credentials.publickey.data=org.openstack.credentials.publickey.data
233249

234-
# Request userdata properties
250+
# Order userdata properties
235251
occi_extra_resource_fogbow_userdata=user_data
236252
occi_extra_resource_org.fogbowcloud.request.extra-user-data=org.openstack.compute.user_data

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.fogbowcloud.manager.core.plugins.IdentityPlugin;
1818
import org.fogbowcloud.manager.core.plugins.ImageStoragePlugin;
1919
import org.fogbowcloud.manager.core.plugins.PrioritizationPlugin;
20+
import org.fogbowcloud.manager.core.plugins.StoragePlugin;
2021
import org.fogbowcloud.manager.core.plugins.accounting.FCUAccountingPlugin;
2122
import org.fogbowcloud.manager.core.plugins.benchmarking.VanillaBenchmarkingPlugin;
2223
import org.fogbowcloud.manager.core.plugins.imagestorage.http.HTTPDownloadImageStoragePlugin;
@@ -144,6 +145,15 @@ public static void main(String[] args) throws Exception {
144145
LOGGER.warn("Federation user crendetail plugin not specified in properties. Using the default one.", e);
145146
}
146147

148+
StoragePlugin storagePlugin = null;
149+
try {
150+
storagePlugin = (StoragePlugin) createInstance(
151+
ConfigurationConstants.STORAGE_CLASS_KEY, properties);
152+
} catch (Exception e) {
153+
LOGGER.warn("Storage Plugin not especified in the properties.", e);
154+
System.exit(EXIT_ERROR_CODE);
155+
}
156+
147157
String occiExtraResourcesPath = properties
148158
.getProperty(ConfigurationConstants.OCCI_EXTRA_RESOURCES_KEY_PATH);
149159
if (occiExtraResourcesPath != null && !occiExtraResourcesPath.isEmpty()) {
@@ -169,6 +179,7 @@ public static void main(String[] args) throws Exception {
169179
facade.setMemberPickerPlugin(memberPickerPlugin);
170180
facade.setPrioritizationPlugin(prioritizationPlugin);
171181
facade.setLocalCredentailsPlugin(mapperPlugin);
182+
facade.setStoragePlugin(storagePlugin);
172183

173184
String xmppHost = properties.getProperty(ConfigurationConstants.XMPP_HOST_KEY);
174185
String xmppJid = properties.getProperty(ConfigurationConstants.XMPP_JID_KEY);

src/main/java/org/fogbowcloud/manager/core/AsynchronousRequestCallback.java renamed to src/main/java/org/fogbowcloud/manager/core/AsynchronousOrderCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.fogbowcloud.manager.core;
22

3-
public interface AsynchronousRequestCallback {
3+
public interface AsynchronousOrderCallback {
44

55
public void success(String instanceId);
66

src/main/java/org/fogbowcloud/manager/core/ConfigurationConstants.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class ConfigurationConstants {
2020
public static final String IDENTITY_CLASS_KEY = "identity_class";
2121
public static final String MEMBER_VALIDATOR_CLASS_KEY = "member_validator_class";
2222
public static final String LOCAL_CREDENTIALS_CLASS_KEY = "federation_user_credentail_class";
23+
public static final String STORAGE_CLASS_KEY = "storage_class";
2324

2425
// prefixs
2526
public static final String LOCAL_PREFIX = "local_";
@@ -32,10 +33,10 @@ public class ConfigurationConstants {
3233
public static final String SCHEDULER_PERIOD_KEY = "scheduler_period";
3334
public static final String INSTANCE_MONITORING_PERIOD_KEY = "instance_monitoring_period";
3435
public static final String TOKEN_UPDATE_PERIOD_KEY = "token_update_period";
35-
public static final String SERVED_REQUEST_MONITORING_PERIOD_KEY = "served_request_monitoring_period";
36+
public static final String SERVED_ORDER_MONITORING_PERIOD_KEY = "served_request_monitoring_period";
3637
public static final String GARBAGE_COLLECTOR_PERIOD_KEY = "garbage_collector_period";
3738
public static final String ACCOUNTING_UPDATE_PERIOD_KEY = "accounting_update_period";
38-
public static final String ASYNC_REQUEST_WAITING_INTERVAL_KEY = "async_request_waiting_interval";
39+
public static final String ASYNC_ORDER_WAITING_INTERVAL_KEY = "async_request_waiting_interval";
3940

4041
// token host
4142
public static final String TOKEN_HOST_PRIVATE_ADDRESS_KEY = "token_host_private_address";
@@ -50,6 +51,7 @@ public class ConfigurationConstants {
5051

5152
public static final String HTTP_PORT_KEY = "http_port";
5253

54+
public static final String ADMIN_USERS = "admin_users";
5355
public static final String PROP_MAX_WHOISALIVE_MANAGER_COUNT = "max_whoisalive_manager_count";
5456

5557
// OCCI extra resource

0 commit comments

Comments
 (0)