Skip to content

Commit

Permalink
Merge pull request #253 from fogbow/develop
Browse files Browse the repository at this point in the history
Fixing link output format to be understandable by rocci client
  • Loading branch information
giovannifs committed Mar 21, 2016
2 parents 0d20708 + f8db7f8 commit dee13de
Show file tree
Hide file tree
Showing 160 changed files with 12,324 additions and 6,064 deletions.
28 changes: 24 additions & 4 deletions bin/fogbow-create-reverse-tunnel
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@ autossh() {
continue
fi
echo "Starting tunnel in port \$REMOTE_PORT"
echo "Command: ssh $SSH_OPTIONS -N -R 0.0.0.0:\$REMOTE_PORT:localhost:22 #TOKEN_ID#@#TOKEN_HOST# -p #TOKEN_HOST_SSH_PORT#"
ssh $SSH_OPTIONS -N -R 0.0.0.0:\$REMOTE_PORT:localhost:22 #TOKEN_ID#@#TOKEN_HOST# -p #TOKEN_HOST_SSH_PORT#
OLD_IFS=\$IFS # save internal field separator
IFS=":" # set it to ':'
set -- \$REMOTE_PORT # make the result positional parameters
IFS=\$OLD_IFS # restore IFS
PORT=\$1
SSH_SERVER_PORT=\$2
echo "Command: ssh $SSH_OPTIONS -N -R 0.0.0.0:\$PORT:localhost:22 #TOKEN_ID#@#TOKEN_HOST# -p \$SSH_SERVER_PORT"
ssh $SSH_OPTIONS -N -R 0.0.0.0:\$PORT:localhost:22 #TOKEN_ID#@#TOKEN_HOST# -p \$SSH_SERVER_PORT
sleep 5
done
}
Expand All @@ -30,7 +38,19 @@ chmod +x /bin/fogbow-autossh
setsid /bin/fogbow-autossh
cat > /bin/create-fogbow-tunnel << EOL
#!/bin/sh
REMOTE_PORT=\$(curl -X POST #TOKEN_HOST#:#TOKEN_HOST_HTTP_PORT#/token/#TOKEN_ID#-\${1})
ssh $SSH_OPTIONS -f -N -R 0.0.0.0:\$REMOTE_PORT:localhost:\${2} #TOKEN_ID#-\${1}@#TOKEN_HOST# -p #TOKEN_HOST_SSH_PORT#
TOKEN_VAR=\$1
LOCAL_PORT=\$2
echo "Requesting port curl -X POST #TOKEN_HOST#:#TOKEN_HOST_HTTP_PORT#/token/#TOKEN_ID#-\$TOKEN_VAR"
REMOTE_PORT=\$(curl -X POST #TOKEN_HOST#:#TOKEN_HOST_HTTP_PORT#/token/#TOKEN_ID#-\$TOKEN_VAR)
OLD_IFS=\$IFS # save internal field separator
IFS=":" # set it to ':'
set -- \$REMOTE_PORT # make the result positional parameters
IFS=\$OLD_IFS # restore IFS
PORT=\$1
SSH_SERVER_PORT=\$2
echo "Recives PORT:\$PORT and SSH SERVER PORT: \$SSH_SERVER_PORT"
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"
ssh $SSH_OPTIONS -f -N -R 0.0.0.0:\$PORT:localhost:\$LOCAL_PORT #TOKEN_ID#-\$TOKEN_VAR@#TOKEN_HOST# -p \$SSH_SERVER_PORT
EOL
chmod +x /bin/create-fogbow-tunnel
20 changes: 18 additions & 2 deletions manager.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ order_bd_updater_period=30000
# flavor_fogbow_medium={mem=1024, cpu=2}
# flavor_fogbow_large={mem=2048, cpu=4}

## Storage Plugin (Openstack)
storage_class=org.fogbowcloud.manager.core.plugins.storage.openstack.OpenStackV2StoragePlugin
storage_v2_url=http://localhost:8776

## Storage Plugin (OpenNebula)
# storage_class=org.fogbowcloud.manager.core.plugins.storage.opennebula.OpenNebulaStoragePlugin
## Default device prefix to use when attaching volumes, values: hd (IDE), sd (SCSI), vd (KVM), vxd (XEN)
# storage_one_datastore_default_device_prefix=vd

## Storage Plugin (CloudStack)
# storage_class=org.fogbowcloud.manager.core.plugins.storage.cloudstack.CloudStackStoragePlugin

## Storage Plugin (NoCloud)
# storage_class=org.fogbowcloud.manager.core.plugins.storage.nocloud.NoCloudStoragePlugin

## Compute Plugin (Openstack)
compute_class=org.fogbowcloud.manager.core.plugins.compute.openstack.OpenStackNovaV2ComputePlugin
compute_novav2_url=http://localhost:8774
Expand Down Expand Up @@ -202,6 +217,7 @@ token_host_http_port=2223
token_host_port=2222

my_ip=127.0.0.1
#admin_users=user1;user2

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

# Request public key properties
# Order public key properties
occi_extra_resource_fogbow_public_key=public_key
occi_extra_resource_org.fogbowcloud.credentials.publickey.data=org.openstack.credentials.publickey.data

# Request userdata properties
# Order userdata properties
occi_extra_resource_fogbow_userdata=user_data
occi_extra_resource_org.fogbowcloud.request.extra-user-data=org.openstack.compute.user_data
11 changes: 11 additions & 0 deletions src/main/java/org/fogbowcloud/manager/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.fogbowcloud.manager.core.plugins.IdentityPlugin;
import org.fogbowcloud.manager.core.plugins.ImageStoragePlugin;
import org.fogbowcloud.manager.core.plugins.PrioritizationPlugin;
import org.fogbowcloud.manager.core.plugins.StoragePlugin;
import org.fogbowcloud.manager.core.plugins.accounting.FCUAccountingPlugin;
import org.fogbowcloud.manager.core.plugins.benchmarking.VanillaBenchmarkingPlugin;
import org.fogbowcloud.manager.core.plugins.imagestorage.http.HTTPDownloadImageStoragePlugin;
Expand Down Expand Up @@ -144,6 +145,15 @@ public static void main(String[] args) throws Exception {
LOGGER.warn("Federation user crendetail plugin not specified in properties. Using the default one.", e);
}

StoragePlugin storagePlugin = null;
try {
storagePlugin = (StoragePlugin) createInstance(
ConfigurationConstants.STORAGE_CLASS_KEY, properties);
} catch (Exception e) {
LOGGER.warn("Storage Plugin not especified in the properties.", e);
System.exit(EXIT_ERROR_CODE);
}

String occiExtraResourcesPath = properties
.getProperty(ConfigurationConstants.OCCI_EXTRA_RESOURCES_KEY_PATH);
if (occiExtraResourcesPath != null && !occiExtraResourcesPath.isEmpty()) {
Expand All @@ -169,6 +179,7 @@ public static void main(String[] args) throws Exception {
facade.setMemberPickerPlugin(memberPickerPlugin);
facade.setPrioritizationPlugin(prioritizationPlugin);
facade.setLocalCredentailsPlugin(mapperPlugin);
facade.setStoragePlugin(storagePlugin);

String xmppHost = properties.getProperty(ConfigurationConstants.XMPP_HOST_KEY);
String xmppJid = properties.getProperty(ConfigurationConstants.XMPP_JID_KEY);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.fogbowcloud.manager.core;

public interface AsynchronousRequestCallback {
public interface AsynchronousOrderCallback {

public void success(String instanceId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class ConfigurationConstants {
public static final String IDENTITY_CLASS_KEY = "identity_class";
public static final String MEMBER_VALIDATOR_CLASS_KEY = "member_validator_class";
public static final String LOCAL_CREDENTIALS_CLASS_KEY = "federation_user_credentail_class";
public static final String STORAGE_CLASS_KEY = "storage_class";

// prefixs
public static final String LOCAL_PREFIX = "local_";
Expand All @@ -32,10 +33,10 @@ public class ConfigurationConstants {
public static final String SCHEDULER_PERIOD_KEY = "scheduler_period";
public static final String INSTANCE_MONITORING_PERIOD_KEY = "instance_monitoring_period";
public static final String TOKEN_UPDATE_PERIOD_KEY = "token_update_period";
public static final String SERVED_REQUEST_MONITORING_PERIOD_KEY = "served_request_monitoring_period";
public static final String SERVED_ORDER_MONITORING_PERIOD_KEY = "served_request_monitoring_period";
public static final String GARBAGE_COLLECTOR_PERIOD_KEY = "garbage_collector_period";
public static final String ACCOUNTING_UPDATE_PERIOD_KEY = "accounting_update_period";
public static final String ASYNC_REQUEST_WAITING_INTERVAL_KEY = "async_request_waiting_interval";
public static final String ASYNC_ORDER_WAITING_INTERVAL_KEY = "async_request_waiting_interval";

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

public static final String HTTP_PORT_KEY = "http_port";

public static final String ADMIN_USERS = "admin_users";
public static final String PROP_MAX_WHOISALIVE_MANAGER_COUNT = "max_whoisalive_manager_count";

// OCCI extra resource
Expand Down
Loading

0 comments on commit dee13de

Please sign in to comment.