Skip to content

Commit e257423

Browse files
authored
Merge bcf8d2f into 5529cc4
2 parents 5529cc4 + bcf8d2f commit e257423

File tree

11 files changed

+130
-137
lines changed

11 files changed

+130
-137
lines changed

.github/workflows/2-system.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ on:
2929
env:
3030
# openwhisk env
3131
TEST_SUITE: System
32-
ANSIBLE_CMD: "ansible-playbook -i environments/local -e docker_image_prefix=testing"
32+
ANSIBLE_CMD: "ansible-playbook -i environments/local -e docker_image_prefix=testing -e container_pool_akka_client=false"
3333
GRADLE_PROJS_SKIP: ""
3434

3535
## secrets

.github/workflows/4-standalone.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ jobs:
6565
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
6666
- name: Check free space
6767
run: df -h
68+
- name: Disable the scheduler
69+
run: "./tools/github/disable-scheduler.sh"
6870
- id: tests
6971
name: Run Tests
7072
run: "./tools/github/run${{ env.TEST_SUITE }}Tests.sh"

ansible/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,13 @@ Set the value of pause-grace to 10s by default
195195
.
196196
```
197197

198-
#### Enable the scheduler
199-
- Make sure you enable the scheduler by configuring `scheduler_enable`.
198+
#### Disable the scheduler
199+
- You can disable the scheduler by configuring `scheduler_enable`.
200+
- The scheduler is enabled by default.
200201

201202
**ansible/environments/local/group_vars/all**
202203
```yaml
203-
scheduler_enable: true
204+
scheduler_enable: false
204205
```
205206
206207
#### [Optional] Enable ElasticSearch Activation Store

ansible/group_vars/all

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ durationChecker:
498498
spi: "{{ duration_checker_spi | default('') }}"
499499
timeWindow: "{{ duration_checker_time_window | default('1 d') }}"
500500

501-
enable_scheduler: "{{ scheduler_enable | default(false) }}"
501+
enable_scheduler: "{{ scheduler_enable | default(true) }}"
502502

503503
scheduler:
504504
protocol: "{{ scheduler_protocol | default('http') }}"

common/scala/src/main/resources/reference.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ whisk.spi {
2323
MessagingProvider = org.apache.openwhisk.connector.kafka.KafkaMessagingProvider
2424
ContainerFactoryProvider = org.apache.openwhisk.core.containerpool.docker.DockerContainerFactoryProvider
2525
LogStoreProvider = org.apache.openwhisk.core.containerpool.logging.DockerToActivationLogStoreProvider
26-
LoadBalancerProvider = org.apache.openwhisk.core.loadBalancer.ShardingContainerPoolBalancer
27-
EntitlementSpiProvider = org.apache.openwhisk.core.entitlement.LocalEntitlementProvider
26+
LoadBalancerProvider = org.apache.openwhisk.core.loadBalancer.FPCPoolBalancer
27+
EntitlementSpiProvider = org.apache.openwhisk.core.entitlement.FPCEntitlementProvider
2828
AuthenticationDirectiveProvider = org.apache.openwhisk.core.controller.BasicAuthenticationDirective
29-
InvokerProvider = org.apache.openwhisk.core.invoker.InvokerReactive
30-
InvokerServerProvider = org.apache.openwhisk.core.invoker.DefaultInvokerServer
31-
DurationCheckerProvider = org.apache.openwhisk.core.scheduler.queue.NoopDurationCheckerProvider
29+
InvokerProvider = org.apache.openwhisk.core.invoker.FPCInvokerReactive
30+
InvokerServerProvider = org.apache.openwhisk.core.invoker.FPCInvokerServer
31+
DurationCheckerProvider = org.apache.openwhisk.core.scheduler.queue.ElasticSearchDurationCheckerProvider
3232
}
3333

3434
dispatchers {

core/controller/src/main/resources/reference.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ whisk {
3131
timeout-addon = 1m
3232

3333
fpc {
34-
use-per-min-throttles = false
34+
use-per-min-throttles = true
3535
}
3636
}
3737
controller {

tests/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def systemIncludes = [
5858
"org/apache/openwhisk/core/apigw/actions/test/**",
5959
"org/apache/openwhisk/core/database/test/*CacheConcurrencyTests*",
6060
"org/apache/openwhisk/core/controller/test/*ControllerApiTests*",
61+
"org/apache/openwhisk/core/scheduler/queue/test/ElasticSearchDurationCheck*",
6162
"apigw/healthtests/**",
6263
"ha/**",
6364
"services/**",
@@ -78,7 +79,7 @@ ext.testSets = [
7879
"org/apache/openwhisk/core/limits/**",
7980
"org/apache/openwhisk/core/scheduler/**",
8081
"org/apache/openwhisk/core/invoker/test/*InvokerBootUpTests*",
81-
"org/apache/openwhisk/core/loadBalancer/test/*FPCPoolBalancerTests*",
82+
"org/apache/openwhisk/core/scheduler/queue/test/ElasticSearchDurationCheck*",
8283
"org/apache/openwhisk/common/etcd/**",
8384
"**/*CacheConcurrencyTests*",
8485
"**/*ControllerApiTests*",
@@ -89,6 +90,7 @@ ext.testSets = [
8990
"REQUIRE_SYSTEM" : [
9091
"includes" : systemIncludes,
9192
"excludes": [
93+
"org/apache/openwhisk/core/loadBalancer/test/*FPCPoolBalancerTests*",
9294
"system/basic/WskMultiRuntimeTests*",
9395
'invokerShoot/**'
9496
]
@@ -99,7 +101,6 @@ ext.testSets = [
99101
"org/apache/openwhisk/core/containerpool/v2/test/**",
100102
"org/apache/openwhisk/core/scheduler/**",
101103
"org/apache/openwhisk/core/invoker/test/*InvokerBootUpTests*",
102-
"org/apache/openwhisk/core/loadBalancer/test/*FPCPoolBalancerTests*",
103104
"org/apache/openwhisk/core/service/**",
104105
]
105106
],

tests/src/test/scala/limits/ThrottleTests.scala

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -229,68 +229,6 @@ class ThrottleTests
229229
settleThrottles(alreadyWaited)
230230
}
231231
}
232-
233-
it should "throttle 'concurrent' activations of one action" in withAssetCleaner(wskprops) { (wp, assetHelper) =>
234-
val name = "checkConcurrentActionThrottle"
235-
assetHelper.withCleaner(wsk.action, name) {
236-
val timeoutAction = Some(TestUtils.getTestActionFilename("sleep.js"))
237-
(action, _) =>
238-
action.create(name, timeoutAction)
239-
}
240-
241-
// The sleep is necessary as the load balancer currently has a latency before recognizing concurrency.
242-
val sleep = 15.seconds
243-
// Adding a bit of overcommit since some loadbalancers rely on some overcommit. This won't hurt those who don't
244-
// since all activations are taken into account to check for throttled invokes below.
245-
val slowInvokes = (maximumConcurrentInvokes * 1.2).toInt
246-
val fastInvokes = 4
247-
val fastInvokeDuration = 4.seconds
248-
val slowInvokeDuration = sleep + fastInvokeDuration
249-
250-
// These invokes will stay active long enough that all are issued and load balancer has recognized concurrency.
251-
val startSlowInvokes = Instant.now
252-
val slowResults = untilThrottled(slowInvokes) { () =>
253-
wsk.action.invoke(
254-
name,
255-
Map("sleepTimeInMs" -> slowInvokeDuration.toMillis.toJson),
256-
expectedExitCode = DONTCARE_EXIT)
257-
}
258-
val afterSlowInvokes = Instant.now
259-
val slowIssueDuration = durationBetween(startSlowInvokes, afterSlowInvokes)
260-
println(
261-
s"$slowInvokes slow invokes (dur = ${slowInvokeDuration.toSeconds} sec) took ${slowIssueDuration.toSeconds} seconds to issue")
262-
263-
// Sleep to let the background thread get the newest values (refreshes every 2 seconds)
264-
println(s"Sleeping for ${sleep.toSeconds} sec")
265-
Thread.sleep(sleep.toMillis)
266-
267-
// These fast invokes will trigger the concurrency-based throttling.
268-
val startFastInvokes = Instant.now
269-
val fastResults = untilThrottled(fastInvokes) { () =>
270-
wsk.action.invoke(
271-
name,
272-
Map("sleepTimeInMs" -> fastInvokeDuration.toMillis.toJson),
273-
expectedExitCode = DONTCARE_EXIT)
274-
}
275-
val afterFastInvokes = Instant.now
276-
val fastIssueDuration = durationBetween(afterFastInvokes, startFastInvokes)
277-
println(
278-
s"$fastInvokes fast invokes (dur = ${fastInvokeDuration.toSeconds} sec) took ${fastIssueDuration.toSeconds} seconds to issue")
279-
280-
val combinedResults = slowResults ++ fastResults
281-
try {
282-
val throttledCount = throttledActivations(combinedResults, tooManyConcurrentRequests(0, 0))
283-
throttledCount should be > 0
284-
} finally {
285-
val alreadyWaited = durationBetween(afterSlowInvokes, Instant.now)
286-
settleThrottles(alreadyWaited)
287-
println("clearing activations")
288-
}
289-
// wait for the activations last, giving the activations time to complete and
290-
// may avoid unnecessarily polling; if these fail, the throttle may not be settled
291-
println("waiting for activations to complete")
292-
waitForActivations(combinedResults)
293-
}
294232
}
295233

296234
@RunWith(classOf[JUnitRunner])
@@ -458,19 +396,6 @@ class NamespaceSpecificThrottleTests
458396
}, 2, Some(1.second))
459397
}
460398

461-
it should "respect overridden concurrent throttle of 0" in withAssetCleaner(zeroConcProps) { (wp, assetHelper) =>
462-
implicit val props = wp
463-
val actionName = "zeroConcurrentAction"
464-
465-
assetHelper.withCleaner(wsk.action, actionName) { (action, _) =>
466-
action.create(actionName, defaultAction)
467-
}
468-
469-
wsk.action.invoke(actionName, expectedExitCode = TooManyRequests.intValue).stderr should {
470-
include(prefix(tooManyConcurrentRequests(0, 0))) and include("allowed: 0")
471-
}
472-
}
473-
474399
it should "not store an activation if disabled for this namespace" in withAssetCleaner(activationDisabled) {
475400
(wp, assetHelper) =>
476401
implicit val props = wp

tests/src/test/scala/org/apache/openwhisk/core/controller/test/FPCEntitlementTests.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class FPCEntitlementProviderTests extends ControllerTestCommon with ScalaFutures
3737
val someUser = WhiskAuthHelpers.newIdentity()
3838
val action = FullyQualifiedEntityName(EntityPath("testns"), EntityName("action"))
3939
val loadBalancer = mock[LoadBalancer]
40+
(loadBalancer.clusterSize _).expects().returning(1).anyNumberOfTimes()
4041
(loadBalancer
4142
.checkThrottle(_: EntityPath, _: String))
4243
.expects(someUser.namespace.name.toPath, action.fullPath.asString)

tests/src/test/scala/org/apache/openwhisk/core/limits/ConcurrencyTests.scala

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -101,55 +101,6 @@ class ConcurrencyTests extends TestHelpers with WskTestHelpers with WskActorSyst
101101
}
102102
}
103103

104-
//This tests generates the same load against the same action as previous test, BUT with concurrency set to 1
105-
it should "execute activations sequentially when concurrency = 1 " in withAssetCleaner(wskprops) {
106-
assume(Option(WhiskProperties.getProperty("whisk.action.concurrency", "False")).exists(_.toBoolean))
107-
108-
(wp, assetHelper) =>
109-
val name = "TestNonConcurrentAction"
110-
assetHelper.withCleaner(wsk.action, name, confirmDelete = true) {
111-
val actionName = TestUtils.getTestActionFilename("concurrent.js")
112-
(action, _) =>
113-
//disable log collection since concurrent activation requires specialized log processing
114-
// (at action runtime and using specialized LogStore)
115-
action.create(name, Some(actionName), logsize = Some(0.bytes), concurrency = Some(1))
116-
}
117-
//warm the container (concurrent activations with no warmed container, will cause multiple containers to be used - so we force one to warm up)
118-
val run = wsk.action.invoke(name, Map("warm" -> 1.toJson), blocking = true)
119-
withActivation(wsk.activation, run) { response =>
120-
val logs = response.logs.get
121-
withClue(logs) { logs.size shouldBe 0 }
122-
123-
response.response.status shouldBe "success"
124-
response.response.result shouldBe Some(JsObject("warm" -> 1.toJson))
125-
}
126-
127-
//read configs to determine max concurrency support - currently based on single invoker and invokerUserMemory config
128-
val busyThreshold =
129-
(loadConfigOrThrow[ContainerPoolConfig](ConfigKeys.containerPool).userMemory / MemoryLimit.STD_MEMORY).toInt
130-
131-
//run maximum allowed concurrent actions via Futures
132-
val requestCount = busyThreshold
133-
println(s"executing $requestCount activations")
134-
val runs = (1 to requestCount).map { _ =>
135-
Future {
136-
//expect only 1 activation concurrently (within the 1 second timeout implemented in concurrent.js)
137-
wsk.action.invoke(name, Map("requestCount" -> 1.toJson), blocking = true)
138-
}
139-
}
140-
141-
//none of the actions will complete till the requestCount is reached
142-
Await.result(Future.sequence(runs), 50.seconds).foreach { run =>
143-
withActivation(wsk.activation, run) { response =>
144-
val logs = response.logs.get
145-
withClue(logs) { logs.size shouldBe 0 }
146-
response.response.status shouldBe "success"
147-
//expect only 1 activation concurrently
148-
response.response.result shouldBe Some(JsObject("msg" -> s"Received 1 activations.".toJson))
149-
}
150-
}
151-
}
152-
153104
it should "allow concurrent activations to gracefully complete when one fails" in withAssetCleaner(wskprops) {
154105
assume(Option(WhiskProperties.getProperty("whisk.action.concurrency", "False")).exists(_.toBoolean))
155106
(wp, assetHelper) =>

0 commit comments

Comments
 (0)