Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed tests after last commit

  • Loading branch information...
commit a21fc5057ec74e612c0c830db077d89da7640bb9 1 parent 459e887
@pauloricardomg pauloricardomg authored
Showing with 565 additions and 55 deletions.
  1. +1 −1  service/service/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/cumulus.conf
  2. +20 −0 service/service/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/global-policies.conf
  3. +10 −0 service/service/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/network.conf
  4. +9 −0 service/service/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/other/main.conflocator.xml
  5. +23 −0 service/service/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/other/main.xml
  6. +108 −0 service/service/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/spotinstances.conf
  7. +1 −1  ...service/java/tests/suites/spotinstances/noresources/home/services/etc/nimbus/workspace-service/cumulus.conf
  8. +20 −0 ...java/tests/suites/spotinstances/noresources/home/services/etc/nimbus/workspace-service/global-policies.conf
  9. +10 −0 ...service/java/tests/suites/spotinstances/noresources/home/services/etc/nimbus/workspace-service/network.conf
  10. +1 −0  ...sts/suites/spotinstances/noresources/home/services/etc/nimbus/workspace-service/other/authz-callout-sql.xml
  11. +9 −0 ...ests/suites/spotinstances/noresources/home/services/etc/nimbus/workspace-service/other/main.conflocator.xml
  12. +25 −1 ...rvice/java/tests/suites/spotinstances/noresources/home/services/etc/nimbus/workspace-service/other/main.xml
  13. +108 −0 ...e/java/tests/suites/spotinstances/noresources/home/services/etc/nimbus/workspace-service/spotinstances.conf
  14. +1 −1  .../java/tests/suites/spotinstances/singleresourcepool/home/services/etc/nimbus/workspace-service/cumulus.conf
  15. +20 −0 ...sts/suites/spotinstances/singleresourcepool/home/services/etc/nimbus/workspace-service/global-policies.conf
  16. +10 −0 .../java/tests/suites/spotinstances/singleresourcepool/home/services/etc/nimbus/workspace-service/network.conf
  17. +1 −0  ...tes/spotinstances/singleresourcepool/home/services/etc/nimbus/workspace-service/other/authz-callout-sql.xml
  18. +9 −0 ...ites/spotinstances/singleresourcepool/home/services/etc/nimbus/workspace-service/other/main.conflocator.xml
  19. +25 −1 ...ava/tests/suites/spotinstances/singleresourcepool/home/services/etc/nimbus/workspace-service/other/main.xml
  20. +108 −0 ...tests/suites/spotinstances/singleresourcepool/home/services/etc/nimbus/workspace-service/spotinstances.conf
  21. +8 −7 ...s/suites/spotinstances/src/org/globus/workspace/testing/suites/spotinstances/SingleResourcePoolSISuite.java
  22. +14 −15 service/service/java/tests/unit/org/globus/workspace/spotinstances/MaximizeProfitPricingModelTest.java
  23. +22 −22 service/service/java/tests/unit/org/globus/workspace/spotinstances/MaximizeUtilizationPricingModelTest.java
  24. +2 −6 service/service/java/tests/unit/org/globus/workspace/spotinstances/PricingModelTestUtils.java
View
2  ...e/service/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/cumulus.conf
@@ -5,4 +5,4 @@ cumulus.authz.db=$NIMBUS_HOME/cumulus/etc/authz.db
cumulus.repo.dir=$NIMBUS_HOME/cumulus/posixdata
cumulus.host=
cumulus.repo.bucket=Repo
-cumulus.repo.prefix=VM
+cumulus.repo.prefix=VMS
View
20 ...e/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/global-policies.conf
@@ -67,3 +67,23 @@ termination.offset.seconds=600
# per-use if one justs wants to limit all static IP use
allow.static.addresses=false
+
+
+# POLICY: allow.other.schemes
+#
+# If 'true' this allows clients to use file URL schemes other than "cumulus://"
+# or file://" for images. It leaves it up to workspace-control or other special
+# mechanisms (like "allowed.http.hosts" configuration below) to decide on
+# the authorization question.
+
+allow.other.schemes=false
+
+
+# POLICY: allowed.http.hosts
+#
+# This is a list of hosts that the users are allowed to propagate images from
+# via http propagation. This should be a comma separated list.
+#
+# If http is desired, "allow.other.propagation.schemes" above must be enabled.
+
+allowed.http.hosts=
View
10 ...e/service/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/network.conf
@@ -17,5 +17,15 @@
# of 2, 6, A or E"
#
# Setting a too-long prefix will limit the amount of IPs you can support.
+#
+# MAC addresses can also be explictly assigned in the network-pool files.
+# Explicit MACs do not need to start with this prefix.
mac.prefix=A2:AA:BB
+
+# Network to choose netsample IP and MAC from. This is only generally used
+# when you are first installing Nimbus and attempting to get correct network
+# bridging working on your VMM. Specifying an invalid or empty network here
+# will result in the netsample file not being written.
+
+netsample.network=public
View
9 .../tests/suites/basic/home/services/etc/nimbus/workspace-service/other/main.conflocator.xml
@@ -64,6 +64,15 @@
value="$CUMULUS{" />
</bean>
+ <bean id="siSettings"
+ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+
+ <property name="location"
+ value="$NIMBUS_HOME/services/etc/nimbus/workspace-service/spotinstances.conf" />
+ <property name="placeholderPrefix"
+ value="$SI{" />
+ </bean>
+
<bean id="accountingSettings"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
View
23 ...service/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/other/main.xml
@@ -152,6 +152,8 @@
value="$GLOBAL{termination.offset.seconds}" />
<property name="defaultRunningTimeSeconds"
value="$GLOBAL{default.runtime.seconds}" />
+ <property name="allowedHttpHosts"
+ value="$GLOBAL{allowed.http.hosts}" />
<!-- Property values coming via common.conf -->
<property name="fake" value="$COMMON{fake.mode}" />
@@ -274,6 +276,13 @@
<property name="networksDir" value="$COMMON{conf.dir}/network-pools" />
<property name="macPrefix" value="$NETWORK{mac.prefix}" />
+ <property name="netSampleNetwork" value="$NETWORK{netsample.network}" />
+ <property name="netSampleResource"
+ value="$COMMON{persistence.dir}/control.netsample.txt" />
+ <property name="dhcpdEntriesResource"
+ value="$COMMON{persistence.dir}/dhcpd.entries" />
+ <property name="ipMacResource"
+ value="$COMMON{persistence.dir}/ip_macs.txt" />
</bean>
@@ -538,6 +547,9 @@
org.globus.workspace.spotinstances.* interfaces
=================================================================== -->
+ <bean id="nimbus-rm.spotinstances.pricingmodel"
+ class="$SI{si.pricingmodel}" />
+
<bean id="nimbus-rm.spotinstances.manager"
class="org.globus.workspace.spotinstances.SpotInstancesManagerImpl">
@@ -545,9 +557,20 @@
<constructor-arg ref="nimbus-rm.loglevels" />
<constructor-arg ref="nimbus-rm.home.instance"/>
<constructor-arg ref="nimbus-rm.home.group"/>
+ <constructor-arg value="$SI{si.basic.minprice}" />
+ <constructor-arg ref="nimbus-rm.spotinstances.pricingmodel" />
<!-- set after object creation time to avoid circular dep -->
<property name="creationManager" ref="nimbus-rm.creation" />
+
+ <!-- Property values coming via spotinstances.conf -->
+ <property name="minReservedMem"
+ value="$SI{si.policies.minreservedmem}" />
+ <property name="maxUtilization"
+ value="$SI{si.policies.maxutilization}" />
+ <property name="instanceMem"
+ value="$SI{si.basic.mem}" />
+
</bean>
View
108 ...ice/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/spotinstances.conf
@@ -0,0 +1,108 @@
+################################################################################
+#
+# This file is used for configuring Spot Instances within this site
+#
+################################################################################
+
+###########################
+# GENERAL CONFIGURATION:
+###########################
+
+# Indicates whether the Spot Instances feature
+# is enabled (true) or disabled (false) for this site
+
+si.enabled=true
+
+# A pricing model is invoked every time the Spot Instances
+# environment changes. This can happen in many situations:
+# when a request arrives, is canceled or terminated, when
+# the quantity of resources available for Spot Instances
+# increases or decreases, etc.
+#
+# Given the actual requests, the maximum quantity of VMs for
+# Spot Instances and the current spot price, a pricing model
+# defines the next spot price based on this variables.
+# Usually a spot price change causes requests to be allocated,
+# if their bid is above the spot price, or pre-empted, if their
+# bid is below the current spot price.
+#
+# This property defines which implementation of the
+# org.globus.workspace.spotinstances.PricingModel
+# interface should be used by the Spot Instances module
+# to set the spot price. This class will be constructed
+# by reflection, so it must be in the classpath of the
+# Nimbus executable.
+#
+# Currently there are two default implementations of that
+# interface, explained as follows:
+#
+# ** org.globus.workspace.spotinstances.MaximizeUtilizationPricingModel **
+#
+# This pricing model aims to satisfy the maximum number of requests, giving
+# priority to higher bid requests when there aren't available VMs to fulfill
+# all requests. Suitable for scientific clouds.
+#
+# ** org.globus.workspace.spotinstances.MaximizeProfitPricingModel **
+#
+# This pricing model aims to maximize the revenue of the cloud provider,
+# without necessarily increasing cloud utilization. Suitable for commercial
+# clouds.
+
+si.pricingmodel=org.globus.workspace.spotinstances.MaximizeUtilizationPricingModel
+
+####################################
+# BASIC SPOT INSTANCE CONFIGURATION:
+####################################
+
+# Defines the amount of memory (in MegaBytes) that
+# a Spot Instance of the basic type has
+
+si.basic.mem=128
+
+# Defines the minimum price (in allocation units) per minute
+# that a Spot Instance of the basic type can cost
+
+si.basic.minprice=0.1
+
+
+#############################
+# MEMORY MANAGEMENT POLICIES:
+#############################
+
+# The policies below define how the total resource pool memory is #
+# divided between ordinary Workspace Service requests #
+# (1st class requests) and Spot Instance requests (SI requests). #
+# #
+# It's important to note that these policies are preventive, in the #
+# sense that free space is reserved for future 1st class requests, #
+# but if the reserved space is still not sufficient to satisfy a #
+# 1st class request, SI requests will be pre-empted on-the-fly in #
+# order to free the needed amount of space (emergency pre-emption) #
+
+# This policy defines the minimum amount of free memory (in MegaBytes)
+# that should be reserved exclusively for 1st class requests, and thus
+# will not be allocated for SI requests.
+
+si.policies.minreservedmem=256
+
+# This policy defines the maximum utilization (in %) for
+# 1st class requests. When the utilization raises above that
+# value, Spot Instance requests are pre-empted (preventive pre-emption)
+# in order to decrease the utilization of 1st class requests.
+#
+# The Spot Instances module will reserve an amount of free
+# memory for 1st class requests in order to ensure that
+# the utilization of 1st class requests is equal or below
+# that value, unless there is no more available memory
+# to reserve.
+#
+# The amount of reserved memory for 1st class requests
+# is derived from this formula:
+#
+# * maxUtilization = usedMem / (usedMem + reservedMem)
+#
+# that, if reorganized becomes:
+#
+# * reservedMem = (1 - maxUtilization)*usedMem/maxUtilization
+
+si.policies.maxutilization=0.7
View
2  .../suites/spotinstances/noresources/home/services/etc/nimbus/workspace-service/cumulus.conf
@@ -5,4 +5,4 @@ cumulus.authz.db=$NIMBUS_HOME/cumulus/etc/authz.db
cumulus.repo.dir=$NIMBUS_HOME/cumulus/posixdata
cumulus.host=
cumulus.repo.bucket=Repo
-cumulus.repo.prefix=VM
+cumulus.repo.prefix=VMS
View
20 ...spotinstances/noresources/home/services/etc/nimbus/workspace-service/global-policies.conf
@@ -67,3 +67,23 @@ termination.offset.seconds=600
# per-use if one justs wants to limit all static IP use
allow.static.addresses=false
+
+
+# POLICY: allow.other.schemes
+#
+# If 'true' this allows clients to use file URL schemes other than "cumulus://"
+# or file://" for images. It leaves it up to workspace-control or other special
+# mechanisms (like "allowed.http.hosts" configuration below) to decide on
+# the authorization question.
+
+allow.other.schemes=false
+
+
+# POLICY: allowed.http.hosts
+#
+# This is a list of hosts that the users are allowed to propagate images from
+# via http propagation. This should be a comma separated list.
+#
+# If http is desired, "allow.other.propagation.schemes" above must be enabled.
+
+allowed.http.hosts=
View
10 .../suites/spotinstances/noresources/home/services/etc/nimbus/workspace-service/network.conf
@@ -17,5 +17,15 @@
# of 2, 6, A or E"
#
# Setting a too-long prefix will limit the amount of IPs you can support.
+#
+# MAC addresses can also be explictly assigned in the network-pool files.
+# Explicit MACs do not need to start with this prefix.
mac.prefix=A2:AA:BB
+
+# Network to choose netsample IP and MAC from. This is only generally used
+# when you are first installing Nimbus and attempting to get correct network
+# bridging working on your VMM. Specifying an invalid or empty network here
+# will result in the netsample file not being written.
+
+netsample.network=public
View
1  ...tances/noresources/home/services/etc/nimbus/workspace-service/other/authz-callout-sql.xml
@@ -33,6 +33,7 @@
class="org.globus.workspace.sqlauthz.AuthzDecisionLogic">
<constructor-arg ref="other.AuthzDataSource" />
+ <constructor-arg value="$GLOBAL{allow.other.schemes}" />
<property name="repoDir" value="$CUMULUS{cumulus.repo.dir}" />
<property name="repoHost" value="$SSH{service.sshd.contact.string}" />
View
9 ...stances/noresources/home/services/etc/nimbus/workspace-service/other/main.conflocator.xml
@@ -64,6 +64,15 @@
value="$CUMULUS{" />
</bean>
+ <bean id="siSettings"
+ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+
+ <property name="location"
+ value="$NIMBUS_HOME/services/etc/nimbus/workspace-service/spotinstances.conf" />
+ <property name="placeholderPrefix"
+ value="$SI{" />
+ </bean>
+
<bean id="accountingSettings"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
View
26 ...uites/spotinstances/noresources/home/services/etc/nimbus/workspace-service/other/main.xml
@@ -152,6 +152,8 @@
value="$GLOBAL{termination.offset.seconds}" />
<property name="defaultRunningTimeSeconds"
value="$GLOBAL{default.runtime.seconds}" />
+ <property name="allowedHttpHosts"
+ value="$GLOBAL{allowed.http.hosts}" />
<!-- Property values coming via common.conf -->
<property name="fake" value="$COMMON{fake.mode}" />
@@ -274,6 +276,13 @@
<property name="networksDir" value="$COMMON{conf.dir}/network-pools" />
<property name="macPrefix" value="$NETWORK{mac.prefix}" />
+ <property name="netSampleNetwork" value="$NETWORK{netsample.network}" />
+ <property name="netSampleResource"
+ value="$COMMON{persistence.dir}/control.netsample.txt" />
+ <property name="dhcpdEntriesResource"
+ value="$COMMON{persistence.dir}/dhcpd.entries" />
+ <property name="ipMacResource"
+ value="$COMMON{persistence.dir}/ip_macs.txt" />
</bean>
@@ -303,7 +312,8 @@
<!-- these modules can be null (InstanceResourceImpl) -->
<property name="accountingEventAdapter"
ref="nimbus-rm.accounting" />
- <property name="authzCallout"><null/></property>
+ <property name="authzCallout"
+ ref="nimbus-rm.service.binding.AuthorizationCallout" />
</bean>
<bean id="nimbus-rm.home.instance"
@@ -537,6 +547,9 @@
org.globus.workspace.spotinstances.* interfaces
=================================================================== -->
+ <bean id="nimbus-rm.spotinstances.pricingmodel"
+ class="$SI{si.pricingmodel}" />
+
<bean id="nimbus-rm.spotinstances.manager"
class="org.globus.workspace.spotinstances.SpotInstancesManagerImpl">
@@ -544,9 +557,20 @@
<constructor-arg ref="nimbus-rm.loglevels" />
<constructor-arg ref="nimbus-rm.home.instance"/>
<constructor-arg ref="nimbus-rm.home.group"/>
+ <constructor-arg value="$SI{si.basic.minprice}" />
+ <constructor-arg ref="nimbus-rm.spotinstances.pricingmodel" />
<!-- set after object creation time to avoid circular dep -->
<property name="creationManager" ref="nimbus-rm.creation" />
+
+ <!-- Property values coming via spotinstances.conf -->
+ <property name="minReservedMem"
+ value="$SI{si.policies.minreservedmem}" />
+ <property name="maxUtilization"
+ value="$SI{si.policies.maxutilization}" />
+ <property name="instanceMem"
+ value="$SI{si.basic.mem}" />
+
</bean>
View
108 ...s/spotinstances/noresources/home/services/etc/nimbus/workspace-service/spotinstances.conf
@@ -0,0 +1,108 @@
+################################################################################
+#
+# This file is used for configuring Spot Instances within this site
+#
+################################################################################
+
+###########################
+# GENERAL CONFIGURATION:
+###########################
+
+# Indicates whether the Spot Instances feature
+# is enabled (true) or disabled (false) for this site
+
+si.enabled=true
+
+# A pricing model is invoked every time the Spot Instances
+# environment changes. This can happen in many situations:
+# when a request arrives, is canceled or terminated, when
+# the quantity of resources available for Spot Instances
+# increases or decreases, etc.
+#
+# Given the actual requests, the maximum quantity of VMs for
+# Spot Instances and the current spot price, a pricing model
+# defines the next spot price based on this variables.
+# Usually a spot price change causes requests to be allocated,
+# if their bid is above the spot price, or pre-empted, if their
+# bid is below the current spot price.
+#
+# This property defines which implementation of the
+# org.globus.workspace.spotinstances.PricingModel
+# interface should be used by the Spot Instances module
+# to set the spot price. This class will be constructed
+# by reflection, so it must be in the classpath of the
+# Nimbus executable.
+#
+# Currently there are two default implementations of that
+# interface, explained as follows:
+#
+# ** org.globus.workspace.spotinstances.MaximizeUtilizationPricingModel **
+#
+# This pricing model aims to satisfy the maximum number of requests, giving
+# priority to higher bid requests when there aren't available VMs to fulfill
+# all requests. Suitable for scientific clouds.
+#
+# ** org.globus.workspace.spotinstances.MaximizeProfitPricingModel **
+#
+# This pricing model aims to maximize the revenue of the cloud provider,
+# without necessarily increasing cloud utilization. Suitable for commercial
+# clouds.
+
+si.pricingmodel=org.globus.workspace.spotinstances.MaximizeUtilizationPricingModel
+
+####################################
+# BASIC SPOT INSTANCE CONFIGURATION:
+####################################
+
+# Defines the amount of memory (in MegaBytes) that
+# a Spot Instance of the basic type has
+
+si.basic.mem=128
+
+# Defines the minimum price (in allocation units) per minute
+# that a Spot Instance of the basic type can cost
+
+si.basic.minprice=0.1
+
+
+#############################
+# MEMORY MANAGEMENT POLICIES:
+#############################
+
+# The policies below define how the total resource pool memory is #
+# divided between ordinary Workspace Service requests #
+# (1st class requests) and Spot Instance requests (SI requests). #
+# #
+# It's important to note that these policies are preventive, in the #
+# sense that free space is reserved for future 1st class requests, #
+# but if the reserved space is still not sufficient to satisfy a #
+# 1st class request, SI requests will be pre-empted on-the-fly in #
+# order to free the needed amount of space (emergency pre-emption) #
+
+# This policy defines the minimum amount of free memory (in MegaBytes)
+# that should be reserved exclusively for 1st class requests, and thus
+# will not be allocated for SI requests.
+
+si.policies.minreservedmem=256
+
+# This policy defines the maximum utilization (in %) for
+# 1st class requests. When the utilization raises above that
+# value, Spot Instance requests are pre-empted (preventive pre-emption)
+# in order to decrease the utilization of 1st class requests.
+#
+# The Spot Instances module will reserve an amount of free
+# memory for 1st class requests in order to ensure that
+# the utilization of 1st class requests is equal or below
+# that value, unless there is no more available memory
+# to reserve.
+#
+# The amount of reserved memory for 1st class requests
+# is derived from this formula:
+#
+# * maxUtilization = usedMem / (usedMem + reservedMem)
+#
+# that, if reorganized becomes:
+#
+# * reservedMem = (1 - maxUtilization)*usedMem/maxUtilization
+
+si.policies.maxutilization=0.7
View
2  .../spotinstances/singleresourcepool/home/services/etc/nimbus/workspace-service/cumulus.conf
@@ -5,4 +5,4 @@ cumulus.authz.db=$NIMBUS_HOME/cumulus/etc/authz.db
cumulus.repo.dir=$NIMBUS_HOME/cumulus/posixdata
cumulus.host=
cumulus.repo.bucket=Repo
-cumulus.repo.prefix=VM
+cumulus.repo.prefix=VMS
View
20 ...tances/singleresourcepool/home/services/etc/nimbus/workspace-service/global-policies.conf
@@ -67,3 +67,23 @@ termination.offset.seconds=600
# per-use if one justs wants to limit all static IP use
allow.static.addresses=false
+
+
+# POLICY: allow.other.schemes
+#
+# If 'true' this allows clients to use file URL schemes other than "cumulus://"
+# or file://" for images. It leaves it up to workspace-control or other special
+# mechanisms (like "allowed.http.hosts" configuration below) to decide on
+# the authorization question.
+
+allow.other.schemes=false
+
+
+# POLICY: allowed.http.hosts
+#
+# This is a list of hosts that the users are allowed to propagate images from
+# via http propagation. This should be a comma separated list.
+#
+# If http is desired, "allow.other.propagation.schemes" above must be enabled.
+
+allowed.http.hosts=
View
10 .../spotinstances/singleresourcepool/home/services/etc/nimbus/workspace-service/network.conf
@@ -17,5 +17,15 @@
# of 2, 6, A or E"
#
# Setting a too-long prefix will limit the amount of IPs you can support.
+#
+# MAC addresses can also be explictly assigned in the network-pool files.
+# Explicit MACs do not need to start with this prefix.
mac.prefix=A2:AA:BB
+
+# Network to choose netsample IP and MAC from. This is only generally used
+# when you are first installing Nimbus and attempting to get correct network
+# bridging working on your VMM. Specifying an invalid or empty network here
+# will result in the netsample file not being written.
+
+netsample.network=public
View
1  ...singleresourcepool/home/services/etc/nimbus/workspace-service/other/authz-callout-sql.xml
@@ -33,6 +33,7 @@
class="org.globus.workspace.sqlauthz.AuthzDecisionLogic">
<constructor-arg ref="other.AuthzDataSource" />
+ <constructor-arg value="$GLOBAL{allow.other.schemes}" />
<property name="repoDir" value="$CUMULUS{cumulus.repo.dir}" />
<property name="repoHost" value="$SSH{service.sshd.contact.string}" />
View
9 .../singleresourcepool/home/services/etc/nimbus/workspace-service/other/main.conflocator.xml
@@ -64,6 +64,15 @@
value="$CUMULUS{" />
</bean>
+ <bean id="siSettings"
+ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+
+ <property name="location"
+ value="$NIMBUS_HOME/services/etc/nimbus/workspace-service/spotinstances.conf" />
+ <property name="placeholderPrefix"
+ value="$SI{" />
+ </bean>
+
<bean id="accountingSettings"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
View
26 ...potinstances/singleresourcepool/home/services/etc/nimbus/workspace-service/other/main.xml
@@ -152,6 +152,8 @@
value="$GLOBAL{termination.offset.seconds}" />
<property name="defaultRunningTimeSeconds"
value="$GLOBAL{default.runtime.seconds}" />
+ <property name="allowedHttpHosts"
+ value="$GLOBAL{allowed.http.hosts}" />
<!-- Property values coming via common.conf -->
<property name="fake" value="$COMMON{fake.mode}" />
@@ -274,6 +276,13 @@
<property name="networksDir" value="$COMMON{conf.dir}/network-pools" />
<property name="macPrefix" value="$NETWORK{mac.prefix}" />
+ <property name="netSampleNetwork" value="$NETWORK{netsample.network}" />
+ <property name="netSampleResource"
+ value="$COMMON{persistence.dir}/control.netsample.txt" />
+ <property name="dhcpdEntriesResource"
+ value="$COMMON{persistence.dir}/dhcpd.entries" />
+ <property name="ipMacResource"
+ value="$COMMON{persistence.dir}/ip_macs.txt" />
</bean>
@@ -303,7 +312,8 @@
<!-- these modules can be null (InstanceResourceImpl) -->
<property name="accountingEventAdapter"
ref="nimbus-rm.accounting" />
- <property name="authzCallout"><null/></property>
+ <property name="authzCallout"
+ ref="nimbus-rm.service.binding.AuthorizationCallout" />
</bean>
<bean id="nimbus-rm.home.instance"
@@ -537,6 +547,9 @@
org.globus.workspace.spotinstances.* interfaces
=================================================================== -->
+ <bean id="nimbus-rm.spotinstances.pricingmodel"
+ class="$SI{si.pricingmodel}" />
+
<bean id="nimbus-rm.spotinstances.manager"
class="org.globus.workspace.spotinstances.SpotInstancesManagerImpl">
@@ -544,9 +557,20 @@
<constructor-arg ref="nimbus-rm.loglevels" />
<constructor-arg ref="nimbus-rm.home.instance"/>
<constructor-arg ref="nimbus-rm.home.group"/>
+ <constructor-arg value="$SI{si.basic.minprice}" />
+ <constructor-arg ref="nimbus-rm.spotinstances.pricingmodel" />
<!-- set after object creation time to avoid circular dep -->
<property name="creationManager" ref="nimbus-rm.creation" />
+
+ <!-- Property values coming via spotinstances.conf -->
+ <property name="minReservedMem"
+ value="$SI{si.policies.minreservedmem}" />
+ <property name="maxUtilization"
+ value="$SI{si.policies.maxutilization}" />
+ <property name="instanceMem"
+ value="$SI{si.basic.mem}" />
+
</bean>
View
108 ...nstances/singleresourcepool/home/services/etc/nimbus/workspace-service/spotinstances.conf
@@ -0,0 +1,108 @@
+################################################################################
+#
+# This file is used for configuring Spot Instances within this site
+#
+################################################################################
+
+###########################
+# GENERAL CONFIGURATION:
+###########################
+
+# Indicates whether the Spot Instances feature
+# is enabled (true) or disabled (false) for this site
+
+si.enabled=true
+
+# A pricing model is invoked every time the Spot Instances
+# environment changes. This can happen in many situations:
+# when a request arrives, is canceled or terminated, when
+# the quantity of resources available for Spot Instances
+# increases or decreases, etc.
+#
+# Given the actual requests, the maximum quantity of VMs for
+# Spot Instances and the current spot price, a pricing model
+# defines the next spot price based on this variables.
+# Usually a spot price change causes requests to be allocated,
+# if their bid is above the spot price, or pre-empted, if their
+# bid is below the current spot price.
+#
+# This property defines which implementation of the
+# org.globus.workspace.spotinstances.PricingModel
+# interface should be used by the Spot Instances module
+# to set the spot price. This class will be constructed
+# by reflection, so it must be in the classpath of the
+# Nimbus executable.
+#
+# Currently there are two default implementations of that
+# interface, explained as follows:
+#
+# ** org.globus.workspace.spotinstances.MaximizeUtilizationPricingModel **
+#
+# This pricing model aims to satisfy the maximum number of requests, giving
+# priority to higher bid requests when there aren't available VMs to fulfill
+# all requests. Suitable for scientific clouds.
+#
+# ** org.globus.workspace.spotinstances.MaximizeProfitPricingModel **
+#
+# This pricing model aims to maximize the revenue of the cloud provider,
+# without necessarily increasing cloud utilization. Suitable for commercial
+# clouds.
+
+si.pricingmodel=org.globus.workspace.spotinstances.MaximizeUtilizationPricingModel
+
+####################################
+# BASIC SPOT INSTANCE CONFIGURATION:
+####################################
+
+# Defines the amount of memory (in MegaBytes) that
+# a Spot Instance of the basic type has
+
+si.basic.mem=128
+
+# Defines the minimum price (in allocation units) per minute
+# that a Spot Instance of the basic type can cost
+
+si.basic.minprice=0.1
+
+
+#############################
+# MEMORY MANAGEMENT POLICIES:
+#############################
+
+# The policies below define how the total resource pool memory is #
+# divided between ordinary Workspace Service requests #
+# (1st class requests) and Spot Instance requests (SI requests). #
+# #
+# It's important to note that these policies are preventive, in the #
+# sense that free space is reserved for future 1st class requests, #
+# but if the reserved space is still not sufficient to satisfy a #
+# 1st class request, SI requests will be pre-empted on-the-fly in #
+# order to free the needed amount of space (emergency pre-emption) #
+
+# This policy defines the minimum amount of free memory (in MegaBytes)
+# that should be reserved exclusively for 1st class requests, and thus
+# will not be allocated for SI requests.
+
+si.policies.minreservedmem=256
+
+# This policy defines the maximum utilization (in %) for
+# 1st class requests. When the utilization raises above that
+# value, Spot Instance requests are pre-empted (preventive pre-emption)
+# in order to decrease the utilization of 1st class requests.
+#
+# The Spot Instances module will reserve an amount of free
+# memory for 1st class requests in order to ensure that
+# the utilization of 1st class requests is equal or below
+# that value, unless there is no more available memory
+# to reserve.
+#
+# The amount of reserved memory for 1st class requests
+# is derived from this formula:
+#
+# * maxUtilization = usedMem / (usedMem + reservedMem)
+#
+# that, if reorganized becomes:
+#
+# * reservedMem = (1 - maxUtilization)*usedMem/maxUtilization
+
+si.policies.maxutilization=0.7
View
15 ...nces/src/org/globus/workspace/testing/suites/spotinstances/SingleResourcePoolSISuite.java
@@ -19,7 +19,6 @@
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertTrue;
-import org.globus.workspace.spotinstances.PricingModelConstants;
import org.globus.workspace.spotinstances.SpotInstancesManagerImpl;
import org.globus.workspace.testing.NimbusTestBase;
import org.globus.workspace.testing.NimbusTestContextLoader;
@@ -48,6 +47,8 @@
private static final String SPOTINSTANCES_MANAGER_BEAN_NAME = "nimbus-rm.spotinstances.manager";
private static final int TASK_TIME = 10;
private static final int BUFFER = 10000;
+
+ private static final Double MINIMUM_PRICE = 0.1;
@AfterSuite(alwaysRun=true)
public void suiteTeardown() throws Exception {
@@ -117,7 +118,7 @@ public void singleRequest() throws Exception {
// Spot price: MINIUM_PRICE (since requestedVMs < availableVMs)
//New spot price is equal to minimum price (since there are still available resources)
- assertEquals(PricingModelConstants.MINIMUM_PRICE, rm.getSpotPrice());
+ assertEquals(MINIMUM_PRICE, rm.getSpotPrice());
SpotRequest[] spotRequestByCaller = rm.getSpotRequestByCaller(caller);
assertEquals(1, spotRequestByCaller.length);
@@ -253,7 +254,7 @@ public void multipleSIRequestsOnly() throws Exception {
// Spot price: MINIUM_PRICE (since requestedVMs < availableVMs)
//New spot price is equal to minimum price
- assertEquals(PricingModelConstants.MINIMUM_PRICE, rm.getSpotPrice());
+ assertEquals(MINIMUM_PRICE, rm.getSpotPrice());
//Check if all submitted requests are active
SpotRequest[] caller1Reqs = rm.getSpotRequestByCaller(caller1);
@@ -729,7 +730,7 @@ public void mixedSIandWSrequests() throws Exception {
assertEquals(4, getAvailableResources());
//New spot price is equal to minimum price
- assertEquals(PricingModelConstants.MINIMUM_PRICE, rm.getSpotPrice());
+ assertEquals(MINIMUM_PRICE, rm.getSpotPrice());
lowReq1SR = rm.getSpotRequest(lowReq1Id, siCaller);
assertEquals(SIRequestState.STATE_Closed, lowReq1SR.getState().getStateStr());
@@ -772,7 +773,7 @@ public void mixedSIandWSrequests() throws Exception {
assertEquals(4, getAvailableResources());
//New spot price is equal to minimum price
- assertEquals(PricingModelConstants.MINIMUM_PRICE, rm.getSpotPrice());
+ assertEquals(MINIMUM_PRICE, rm.getSpotPrice());
lowReq1SR = rm.getSpotRequest(lowReq1Id, siCaller);
assertEquals(SIRequestState.STATE_Closed, lowReq1SR.getState().getStateStr());
@@ -818,7 +819,7 @@ public void mixedSIandWSrequests() throws Exception {
assertEquals(4, getAvailableResources());
//New spot price is equal to minimum price
- assertEquals(PricingModelConstants.MINIMUM_PRICE, rm.getSpotPrice());
+ assertEquals(MINIMUM_PRICE, rm.getSpotPrice());
lowReq1SR = rm.getSpotRequest(lowReq1Id, siCaller);
assertEquals(SIRequestState.STATE_Closed, lowReq1SR.getState().getStateStr());
@@ -918,7 +919,7 @@ public void mixedSIandWSrequests() throws Exception {
assertEquals(4, getAvailableResources());
//New spot price is equal to minimum price
- assertEquals(PricingModelConstants.MINIMUM_PRICE, rm.getSpotPrice());
+ assertEquals(MINIMUM_PRICE, rm.getSpotPrice());
lowReq1SR = rm.getSpotRequest(lowReq1Id, siCaller);
assertEquals(SIRequestState.STATE_Closed, lowReq1SR.getState().getStateStr());
View
29 ...ce/java/tests/unit/org/globus/workspace/spotinstances/MaximizeProfitPricingModelTest.java
@@ -10,7 +10,6 @@
public class MaximizeProfitPricingModelTest {
private MaximizeProfitPricingModel pricingModel = new MaximizeProfitPricingModel();
-
@Test
public void testGetNextPriceNoDemand() {
@@ -18,17 +17,17 @@ public void testGetNextPriceNoDemand() {
LinkedList<SIRequest> requests = new LinkedList<SIRequest>();
Double nextPrice = pricingModel.getNextPrice(0, requests, null);
- assertEquals(PricingModelConstants.MINIMUM_PRICE, nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 0, requests));
+ assertEquals(pricingModel.getMinPrice(), nextPrice);
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 0, requests));
nextPrice = pricingModel.getNextPrice(5, requests, null);
- assertEquals(PricingModelConstants.MINIMUM_PRICE, nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 5, requests));
+ assertEquals(pricingModel.getMinPrice(), nextPrice);
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 5, requests));
nextPrice = pricingModel.getNextPrice(2500, requests, null);
- assertEquals(PricingModelConstants.MINIMUM_PRICE, nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 2500, requests));
+ assertEquals(pricingModel.getMinPrice(), nextPrice);
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 2500, requests));
}
@Test
@@ -40,7 +39,7 @@ public void testGetNextPriceNoOffer() {
Double nextPrice = pricingModel.getNextPrice(0, requests, null);
assertEquals(new Double(2.0+0.1), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 0, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 0, requests));
//case 2
requests = new LinkedList<SIRequest>();
@@ -50,7 +49,7 @@ public void testGetNextPriceNoOffer() {
nextPrice = pricingModel.getNextPrice(0, requests, null);
assertEquals(new Double(4.0+0.1), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 0, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 0, requests));
}
@Test
@@ -61,7 +60,7 @@ public void testGetNextPriceCase1() {
Double nextPrice = pricingModel.getNextPrice(5, requests, null);
assertEquals(new Double(2.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 5, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 5, requests));
}
@@ -73,7 +72,7 @@ public void testGetNextPriceCase2() {
Double nextPrice = pricingModel.getNextPrice(5, requests, null);
assertEquals(new Double(2.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 5, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 5, requests));
}
@Test
@@ -86,7 +85,7 @@ public void testGetNextPriceCase3() {
Double nextPrice = pricingModel.getNextPrice(5, requests, null);
assertEquals(new Double(2.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 5, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 5, requests));
}
@@ -100,7 +99,7 @@ public void testGetNextPriceCase4() {
Double nextPrice = pricingModel.getNextPrice(15, requests, null);
assertEquals(new Double(1.6), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 15, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 15, requests));
}
@Test
@@ -113,7 +112,7 @@ public void testGetNextPriceCase5() {
Double nextPrice = pricingModel.getNextPrice(15, requests, null);
assertEquals(new Double(1.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 15, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 15, requests));
}
/*
@@ -135,7 +134,7 @@ public void testGetNextPriceCase6() {
Double nextPrice = pricingModel.getNextPrice(200, requests, null);
assertEquals(new Double(200.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 200, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 200, requests));
}
}
View
44 ...va/tests/unit/org/globus/workspace/spotinstances/MaximizeUtilizationPricingModelTest.java
@@ -17,17 +17,17 @@ public void testGetNextPriceNoDemand() {
LinkedList<SIRequest> requests = new LinkedList<SIRequest>();
Double nextPrice = pricingModel.getNextPrice(0, requests, null);
- assertEquals(PricingModelConstants.MINIMUM_PRICE, nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 0, requests));
+ assertEquals(pricingModel.getMinPrice(), nextPrice);
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 0, requests));
nextPrice = pricingModel.getNextPrice(5, requests, null);
- assertEquals(PricingModelConstants.MINIMUM_PRICE, nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 5, requests));
+ assertEquals(pricingModel.getMinPrice(), nextPrice);
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 5, requests));
nextPrice = pricingModel.getNextPrice(2500, requests, null);
- assertEquals(PricingModelConstants.MINIMUM_PRICE, nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 2500, requests));
+ assertEquals(pricingModel.getMinPrice(), nextPrice);
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 2500, requests));
}
@Test
@@ -42,7 +42,7 @@ public void testGetNextPriceNoOffer() {
Double nextPrice = pricingModel.getNextPrice(0, requests, null);
assertEquals(new Double(2.0+0.1), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 0, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 0, requests));
//case 2
requests = new LinkedList<SIRequest>();
@@ -52,7 +52,7 @@ public void testGetNextPriceNoOffer() {
nextPrice = pricingModel.getNextPrice(0, requests, null);
assertEquals(new Double(4.0+0.1), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 0, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 0, requests));
}
@Test
@@ -65,8 +65,8 @@ public void testGetNextPriceCase1a() {
requests.add(new SIRequest("a", 2.0, 3));
Double nextPrice = pricingModel.getNextPrice(5, requests, null);
- assertEquals(new Double(PricingModelConstants.MINIMUM_PRICE), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 5, requests));
+ assertEquals(new Double(pricingModel.getMinPrice()), nextPrice);
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 5, requests));
}
@Test
@@ -80,7 +80,7 @@ public void testGetNextPriceCase1b() {
Double nextPrice = pricingModel.getNextPrice(5, requests, null);
assertEquals(new Double(2.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 5, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 5, requests));
}
@Test
@@ -94,7 +94,7 @@ public void testGetNextPriceCase2a() {
Double nextPrice = pricingModel.getNextPrice(5, requests, null);
assertEquals(new Double(2.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 5, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 5, requests));
}
@Test
@@ -108,7 +108,7 @@ public void testGetNextPriceCase2b() {
Double nextPrice = pricingModel.getNextPrice(5, requests, null);
assertEquals(new Double(2.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 5, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 5, requests));
}
@Test
@@ -123,7 +123,7 @@ public void testGetNextPriceCase3a() {
Double nextPrice = pricingModel.getNextPrice(5, requests, null);
assertEquals(new Double(2.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 5, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 5, requests));
}
@Test
@@ -138,7 +138,7 @@ public void testGetNextPriceCase3b() {
Double nextPrice = pricingModel.getNextPrice(5, requests, null);
assertEquals(new Double(2.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 5, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 5, requests));
}
@Test
@@ -153,7 +153,7 @@ public void testGetNextPriceCase4a() {
Double nextPrice = pricingModel.getNextPrice(15, requests, null);
assertEquals(new Double(1.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 15, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 15, requests));
}
@Test
@@ -168,7 +168,7 @@ public void testGetNextPriceCase4b() {
Double nextPrice = pricingModel.getNextPrice(15, requests, null);
assertEquals(new Double(1.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 15, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 15, requests));
}
@Test
@@ -183,7 +183,7 @@ public void testGetNextPriceCase5a() {
Double nextPrice = pricingModel.getNextPrice(15, requests, null);
assertEquals(new Double(1.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 15, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 15, requests));
}
@Test
@@ -198,7 +198,7 @@ public void testGetNextPriceCase5b() {
Double nextPrice = pricingModel.getNextPrice(15, requests, null);
assertEquals(new Double(1.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 15, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 15, requests));
}
@Test
@@ -214,8 +214,8 @@ public void testGetNextPriceCase6a() {
requests.add(new SIRequest("e", 4.0, 25));
Double nextPrice = pricingModel.getNextPrice(200, requests, null);
- assertEquals(new Double(PricingModelConstants.MINIMUM_PRICE), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 200, requests));
+ assertEquals(new Double(pricingModel.getMinPrice()), nextPrice);
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 200, requests));
}
@Test
@@ -232,7 +232,7 @@ public void testGetNextPriceCase6b() {
Double nextPrice = pricingModel.getNextPrice(200, requests, null);
assertEquals(new Double(1.0), nextPrice);
- assertTrue(PricingModelTestUtils.checkPricingModelConstraints(nextPrice, 200, requests));
+ assertTrue(PricingModelTestUtils.checkPricingModelConstraints(pricingModel.getMinPrice(), nextPrice, 200, requests));
}
}
View
8 ...ice/service/java/tests/unit/org/globus/workspace/spotinstances/PricingModelTestUtils.java
@@ -7,19 +7,15 @@
public class PricingModelTestUtils {
- public static boolean checkPricingModelConstraints(Double nextPrice, Integer totalReservedResources, Collection<SIRequest> requests){
+ public static boolean checkPricingModelConstraints(Double minPrice, Double nextPrice, Integer totalReservedResources, Collection<SIRequest> requests){
- if(!checkMinimumPriceCOnstant(nextPrice)){
+ if(nextPrice < minPrice){
return false;
}
return checkSpotInstancesConstraint(nextPrice, totalReservedResources, requests);
}
- private static boolean checkMinimumPriceCOnstant(Double nextPrice) {
- return nextPrice >= PricingModelConstants.MINIMUM_PRICE;
- }
-
private static boolean checkSpotInstancesConstraint(Double nextPrice,
Integer totalReservedResources, Collection<SIRequest> requests) {
Please sign in to comment.
Something went wrong with that request. Please try again.