diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-04 10:04:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-04 10:04:50 +0200 |
| commit | 92cc0908b7ad6c94b08e6016f8815ab07cd1714d (patch) | |
| tree | b5edaff69212986265f9edc620e40bb8695f11eb /opendc-faas/opendc-faas-workload/src/test/kotlin | |
| parent | 2d2a3854d355bd4b074ef651f291d34081e70d96 (diff) | |
| parent | bd476d11ab24fe745bb54e97a11133706bb96cb1 (diff) | |
merge: Add provisioning tool for experiments (#104)
This pull request implements a new tool to help provision and manage the
experimental environment.
## Implementation Notes :hammer_and_pick:
* Add service registry for cloud services
* Add provisioning tool for experiments
* Add provisioning step for workflow service
* Add provisioners for FaaS service
* Use experiment base for Capelin experiments
* Use experiment base for web runner
* Integrate compute workload classes
* Remove Topology interface
## Breaking API Changes :warning:
* Removal of the `opendc-compute-workload`, `opendc-faas-workload`,
and `opendc-workflow-workload` modules. These are now located
inside `opendc-experiments`
* Removal of `ComputeServiceHelper`. Use `Provisioner` to provision
a `ComputeService`.
Diffstat (limited to 'opendc-faas/opendc-faas-workload/src/test/kotlin')
2 files changed, 0 insertions, 129 deletions
diff --git a/opendc-faas/opendc-faas-workload/src/test/kotlin/org/opendc/faas/workload/FaaSServiceHelperTest.kt b/opendc-faas/opendc-faas-workload/src/test/kotlin/org/opendc/faas/workload/FaaSServiceHelperTest.kt deleted file mode 100644 index dbe024c0..00000000 --- a/opendc-faas/opendc-faas-workload/src/test/kotlin/org/opendc/faas/workload/FaaSServiceHelperTest.kt +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2022 AtLarge Research - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package org.opendc.faas.workload - -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertAll -import org.opendc.faas.service.autoscaler.FunctionTerminationPolicyFixed -import org.opendc.faas.service.router.RandomRoutingPolicy -import org.opendc.faas.simulator.delay.ColdStartModel -import org.opendc.simulator.compute.model.MachineModel -import org.opendc.simulator.compute.model.MemoryUnit -import org.opendc.simulator.compute.model.ProcessingNode -import org.opendc.simulator.compute.model.ProcessingUnit -import org.opendc.simulator.core.runBlockingSimulation -import java.io.File -import java.time.Duration - -/** - * Integration test suite for the [FaaSServiceHelper] class. - */ -class FaaSServiceHelperTest { - /** - * Smoke test that simulates a small trace. - */ - @Test - fun testSmoke() = runBlockingSimulation { - val trace = ServerlessTraceReader().parse(File("src/test/resources/trace")) - val runner = FaaSServiceHelper( - coroutineContext, - clock, - createMachineModel(), - RandomRoutingPolicy(), - FunctionTerminationPolicyFixed(coroutineContext, clock, timeout = Duration.ofMinutes(10)), - coldStartModel = ColdStartModel.GOOGLE - ) - - try { - runner.run(trace) - } finally { - runner.close() - } - - val stats = runner.service.getSchedulerStats() - - assertAll( - { assertEquals(14, stats.totalInvocations) }, - { assertEquals(2, stats.timelyInvocations) }, - { assertEquals(12, stats.delayedInvocations) }, - ) - } - - /** - * Construct the machine model to test with. - */ - private fun createMachineModel(): MachineModel { - val cpuNode = ProcessingNode("Intel", "Xeon", "amd64", 2) - - return MachineModel( - cpus = List(cpuNode.coreCount) { ProcessingUnit(cpuNode, it, 1000.0) }, - memory = List(4) { MemoryUnit("Crucial", "MTA18ASF4G72AZ-3G2B1", 3200.0, 32_000) } - ) - } -} diff --git a/opendc-faas/opendc-faas-workload/src/test/kotlin/org/opendc/faas/workload/ServerlessTraceReaderTest.kt b/opendc-faas/opendc-faas-workload/src/test/kotlin/org/opendc/faas/workload/ServerlessTraceReaderTest.kt deleted file mode 100644 index e835d4d9..00000000 --- a/opendc-faas/opendc-faas-workload/src/test/kotlin/org/opendc/faas/workload/ServerlessTraceReaderTest.kt +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2022 AtLarge Research - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package org.opendc.faas.workload - -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertAll -import java.io.File - -/** - * Test suite for [ServerlessTraceReader]. - */ -class ServerlessTraceReaderTest { - @Test - fun testSmoke() { - val path = File("src/test/resources/trace") - val trace = ServerlessTraceReader().parse(path) - - assertAll( - { assertEquals(2, trace.size) }, - { assertEquals("004c1ea5eb15978682b00ab659aed21e2835d5287668da8d5267f751fdfbdd78", trace[0].id) }, - { assertEquals(256, trace[0].maxMemory) } - ) - } -} |
