Skip to content

Commit 7ade54b

Browse files
committed
Merge pull request #234 from fogbow/develop
Merge pull request #233 from fogbow/discontinuingLocalToken
2 parents e21b5ca + 5eadb10 commit 7ade54b

File tree

87 files changed

+5347
-1696
lines changed

Some content is hidden

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

87 files changed

+5347
-1696
lines changed

manager.conf.example

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

9+
## Order database
10+
order_datastore_url=jdbc:h2:/home/chicog/Backup/dbmanager
11+
order_bd_updater_period=30000
12+
913
## Static mapping from flavors to requirements (Optional)
1014
# flavor_fogbow_small={mem=512, cpu=1}
1115
# flavor_fogbow_medium={mem=1024, cpu=2}
@@ -117,19 +121,9 @@ nof_prioritize_local=true
117121
## If you are using NoFMemberPicker or NoFPrioritizationPlugin classes
118122
nof_trustworthy=false
119123

120-
## Local identity (CloudStack Identity Plugin)
121-
local_identity_class=org.fogbowcloud.manager.core.plugins.identity.cloudstack.cloudStackIdentityPlugin
122-
local_identity_url=http://localhost:8080/client/api
123-
local_proxy_account_user_name=fogbow
124-
local_proxy_account_password=fogbow
125-
local_proxy_account_domain=root
126-
127124
## Local identity (Keystone Identity Plugin)
128125
local_identity_class=org.fogbowcloud.manager.core.plugins.identity.openstack.KeystoneIdentityPlugin
129126
local_identity_url=http://localhost:5000
130-
local_proxy_account_user_name=fogbow
131-
local_proxy_account_password=fogbow
132-
local_proxy_account_tenant_name=demo
133127

134128
## Local Identity (X509 Identity Plugin)
135129
# local_identity_class=org.fogbowcloud.manager.core.plugins.x509.X509IdentityPlugin
@@ -142,12 +136,35 @@ local_proxy_account_tenant_name=demo
142136
## Local Identity (Cloudstack Identity Plugin)
143137
# local_identity_class=org.fogbowcloud.manager.core.plugins.identity.cloudstack.CloudStackIdentityPlugin
144138
# local_identity_url=http://127.0.0.1:8080/client/api/
145-
# local_proxy_account_api_key=user_api_key
146-
# local_proxy_account_secret_key=user_secret_key
147139

148-
## Local Identity (EC2)
149-
# local_proxy_account_ec2_access_key=AKIALSKQLKFD7AHQLKEUO
150-
# local_proxy_account_ec2_secret_key=Iuaooiad&891/2309asd0123+akplkdh
140+
## Local Credentials
141+
federation_user_credentail_class=org.fogbowcloud.manager.core.plugins.localcredentails.SingleLocalCrendentialsPlugin
142+
# federation_user_credentail_class=org.fogbowcloud.manager.core.plugins.localcredentails.MemberBasedLocalCrendetialsPlugin
143+
# federation_user_credentail_class=org.fogbowcloud.manager.core.plugins.localcredentails.VOBasedLocalCrendentialsPlugin
144+
145+
## Mandatory for Local Credentails
146+
147+
# Local credentials for openstack
148+
local_credential_defaults_username=fogbow
149+
local_credential_defaults_password=fogbow
150+
local_credential_defaults_tenantName=fogbow
151+
152+
# Local credentials for opennebula
153+
# local_credential_defaults_username=fogbow
154+
# local_credential_defaults_password=fogbowpass
155+
156+
## Local credentials for (EC2)
157+
# local_credential_defaults_accessKey=AKIALSKQLKFD7AHQLKEUO
158+
# local_credential_defaults_secretKey=Iuaooiad&891/2309asd0123+akplkdh
159+
160+
## Local credentials for Cloudstack
161+
# local_credential_defaults_apiKey=user_api_key
162+
# local_credential_defaults_secret_key=user_secret_key
163+
164+
## Optional for Local Credentails
165+
# local_credential_other_username=
166+
# local_credential_other_password=
167+
# local_credential_other_tenantName=
151168

152169
## Authorization Plugin
153170
federation_authorization_class=org.fogbowcloud.manager.core.plugins.authorization.AllowAllAuthorizationPlugin
@@ -168,9 +185,9 @@ federation_identity_url=http://localhost:5000
168185

169186
## Identity (Azure)
170187
# federation_identity_class=org.fogbowcloud.manager.core.plugins.identity.azure.AzureIdentityPlugin
171-
# proxy_account_subscription_id=subscription_id
172-
# proxy_account_keystore_path=/etc/keystore/azure
173-
# proxy_account_keystore_password=test123
188+
# local_credential_defaults_subscription_id=subscription_id
189+
# local_credential_defaults_keystore_path=/etc/keystore/azure
190+
# local_credential_defaults_keystore_password=test123
174191

175192
## Member Validator
176193
member_validator_class=org.fogbowcloud.manager.core.plugins.memberauthorization.DefaultMemberAuthorizationPlugin
@@ -198,3 +215,19 @@ ssh_public_key=/etc/fogbow-manager/ssh/id_rsa.pub
198215

199216
## Benchmarking (Vanilla Benchmarking Plugin)
200217
# benchmarking_class=org.fogbowcloud.manager.core.plugins.benchmarking.VanillaBenchmarkingPlugin
218+
219+
220+
## OCCI extra resources
221+
#occi_extra_resource_file_path=
222+
223+
224+
public_key; scheme="http://schemas.openstack.org/instance/credentials#"; class="mixin";
225+
org.openstack.credentials.publickey.data
226+
227+
# Request public key properties
228+
occi_extra_resource_fogbow_public_key=public_key
229+
occi_extra_resource_org.fogbowcloud.credentials.publickey.data=org.openstack.credentials.publickey.data
230+
231+
# Request userdata properties
232+
occi_extra_resource_fogbow_userdata=user_data
233+
occi_extra_resource_org.fogbowcloud.request.extra-user-data=org.openstack.compute.user_data

pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,16 @@
250250
<artifactId>azure-management</artifactId>
251251
<version>0.8.0</version>
252252
</dependency>
253-
<dependency>
253+
<dependency>
254254
<groupId>org.opensaml</groupId>
255255
<artifactId>opensaml</artifactId>
256256
<version>2.6.4</version>
257+
<exclusions>
258+
<exclusion>
259+
<groupId>org.bouncycastle</groupId>
260+
<artifactId>bcprov-jdk15on</artifactId>
261+
</exclusion>
262+
</exclusions>
257263
</dependency>
258264
</dependencies>
259265

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
import org.fogbowcloud.manager.core.plugins.ComputePlugin;
1414
import org.fogbowcloud.manager.core.plugins.FederationMemberAuthorizationPlugin;
1515
import org.fogbowcloud.manager.core.plugins.FederationMemberPickerPlugin;
16+
import org.fogbowcloud.manager.core.plugins.LocalCredentialsPlugin;
1617
import org.fogbowcloud.manager.core.plugins.IdentityPlugin;
1718
import org.fogbowcloud.manager.core.plugins.ImageStoragePlugin;
1819
import org.fogbowcloud.manager.core.plugins.PrioritizationPlugin;
1920
import org.fogbowcloud.manager.core.plugins.accounting.FCUAccountingPlugin;
2021
import org.fogbowcloud.manager.core.plugins.benchmarking.VanillaBenchmarkingPlugin;
2122
import org.fogbowcloud.manager.core.plugins.imagestorage.http.HTTPDownloadImageStoragePlugin;
23+
import org.fogbowcloud.manager.core.plugins.localcredentails.SingleLocalCrendentialsPlugin;
2224
import org.fogbowcloud.manager.core.plugins.memberauthorization.DefaultMemberAuthorizationPlugin;
2325
import org.fogbowcloud.manager.core.plugins.memberpicker.RoundRobinMemberPickerPlugin;
2426
import org.fogbowcloud.manager.core.plugins.prioritization.TwoFoldPrioritizationPlugin;
@@ -133,6 +135,25 @@ public static void main(String[] args) throws Exception {
133135
LOGGER.warn("Member picker plugin not specified in properties. Using the default one.", e);
134136
}
135137

138+
LocalCredentialsPlugin localCredentialsPlugin = null;
139+
try {
140+
localCredentialsPlugin = (LocalCredentialsPlugin) createInstance(
141+
ConfigurationConstants.LOCAL_CREDENTIALS_CLASS_KEY, properties);
142+
} catch (Exception e) {
143+
localCredentialsPlugin = new SingleLocalCrendentialsPlugin(properties);
144+
LOGGER.warn("Federation user crendetail plugin not specified in properties. Using the default one.", e);
145+
}
146+
147+
String occiExtraResourcesPath = properties
148+
.getProperty(ConfigurationConstants.OCCI_EXTRA_RESOURCES_KEY_PATH);
149+
if (occiExtraResourcesPath != null && !occiExtraResourcesPath.isEmpty()) {
150+
if (properties.getProperty(ConfigurationConstants.INSTANCE_DATA_STORE_URL) == null) {
151+
LOGGER.error("If OCCI extra resources was set for supporting post-compute, you must also set instance datastore property ("
152+
+ ConfigurationConstants.INSTANCE_DATA_STORE_URL + ").");
153+
System.exit(EXIT_ERROR_CODE);
154+
}
155+
}
156+
136157
PrioritizationPlugin prioritizationPlugin = new TwoFoldPrioritizationPlugin(properties,
137158
accountingPlugin);
138159

@@ -147,6 +168,7 @@ public static void main(String[] args) throws Exception {
147168
facade.setAccountingPlugin(accountingPlugin);
148169
facade.setMemberPickerPlugin(memberPickerPlugin);
149170
facade.setPrioritizationPlugin(prioritizationPlugin);
171+
facade.setFederationUserCredentailsPlugin(localCredentialsPlugin);
150172

151173
String xmppHost = properties.getProperty(ConfigurationConstants.XMPP_HOST_KEY);
152174
String xmppJid = properties.getProperty(ConfigurationConstants.XMPP_JID_KEY);

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ public class ConfigurationConstants {
1919
public static final String MEMBER_PICKER_PLUGIN_CLASS_KEY = "member_picker_class";
2020
public static final String IDENTITY_CLASS_KEY = "identity_class";
2121
public static final String MEMBER_VALIDATOR_CLASS_KEY = "member_validator_class";
22+
public static final String LOCAL_CREDENTIALS_CLASS_KEY = "federation_user_credentail_class";
2223

2324
// prefixs
2425
public static final String LOCAL_PREFIX = "local_";
2526
public static final String FEDERATION_PREFIX = "federation_";
2627
public static final String PREFIX_FLAVORS = "flavor_";
28+
public static final String OCCI_EXTRA_RESOURCES_PREFIX = "occi_extra_resource_";
2729

2830
// periods
31+
public static final String ORDER_BD_UPDATER_PERIOD_KEY = "order_bd_updater_period";
2932
public static final String SCHEDULER_PERIOD_KEY = "scheduler_period";
3033
public static final String INSTANCE_MONITORING_PERIOD_KEY = "instance_monitoring_period";
3134
public static final String TOKEN_UPDATE_PERIOD_KEY = "token_update_period";
@@ -48,4 +51,10 @@ public class ConfigurationConstants {
4851
public static final String HTTP_PORT_KEY = "http_port";
4952

5053
public static final String PROP_MAX_WHOISALIVE_MANAGER_COUNT = "max_whoisalive_manager_count";
54+
55+
// OCCI extra resource
56+
public static final String OCCI_EXTRA_RESOURCES_KEY_PATH = "occi_extra_resource_file_path";
57+
58+
// Instance Data Store
59+
public static final String INSTANCE_DATA_STORE_URL = "instance_datastore_url";
5160
}

0 commit comments

Comments
 (0)