├── .dockerignore ├── .editorconfig ├── .gitattributes ├── .github ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── build.yml │ ├── deploy.yml │ ├── publish.yml │ ├── release.yml │ ├── test-gradle-rc.yml │ └── test-java-ea.yml ├── .gitignore ├── CITATION.cff ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── build.gradle.kts ├── buildSrc ├── build.gradle.kts ├── settings.gradle.kts └── src │ └── main │ └── kotlin │ ├── Libs.kt │ ├── benchmark-conventions.gradle.kts │ ├── dokka-conventions.gradle.kts │ ├── jacoco-aggregation.gradle.kts │ ├── jacoco-conventions.gradle.kts │ ├── java-conventions.gradle.kts │ ├── java-library-conventions.gradle.kts │ ├── kotlin-conventions.gradle.kts │ ├── kotlin-library-conventions.gradle.kts │ ├── license.kt │ ├── publishing-conventions.gradle.kts │ ├── quarkus-conventions.gradle.kts │ ├── spotless-conventions.gradle.kts │ └── testing-conventions.gradle.kts ├── codecov.yml ├── docker-compose.override.yml ├── docker-compose.prod.yml ├── docker-compose.yml ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── opendc-common ├── build.gradle.kts └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── opendc │ │ │ └── common │ │ │ ├── Dispatcher.java │ │ │ ├── DispatcherHandle.java │ │ │ ├── DispatcherProvider.java │ │ │ └── util │ │ │ ├── Pacer.java │ │ │ └── TimerScheduler.java │ ├── kotlin │ │ └── org │ │ │ └── opendc │ │ │ └── common │ │ │ ├── DispatcherCoroutineDispatcher.kt │ │ │ ├── Dispatchers.kt │ │ │ ├── annotations │ │ │ └── InternalUse.kt │ │ │ ├── logger │ │ │ └── Logger.kt │ │ │ ├── units │ │ │ ├── DataRate.kt │ │ │ ├── DataSize.kt │ │ │ ├── Energy.kt │ │ │ ├── Frequency.kt │ │ │ ├── Percentage.kt │ │ │ ├── Power.kt │ │ │ ├── TimeDelta.kt │ │ │ ├── Timestamp.kt │ │ │ ├── Unit.kt │ │ │ └── UnitSerializer.kt │ │ │ └── utils │ │ │ └── DoubleUtils.kt │ └── resources │ │ └── log4j2.xml │ └── test │ └── kotlin │ └── org │ └── opendc │ └── common │ ├── DispatcherCoroutineDispatcherTest.kt │ └── util │ ├── PacerTest.kt │ └── TimerSchedulerTest.kt ├── opendc-compute ├── build.gradle.kts ├── opendc-compute-api │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ └── org │ │ └── opendc │ │ └── compute │ │ └── api │ │ ├── Flavor.kt │ │ ├── Image.kt │ │ ├── InsufficientTaskCapacityException.kt │ │ ├── Resource.kt │ │ └── TaskState.kt ├── opendc-compute-carbon │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── org │ │ │ └── opendc │ │ │ └── compute │ │ │ └── carbon │ │ │ ├── CarbonTraceLoader.kt │ │ │ └── CarbonTraceReader.kt │ │ └── test │ │ └── resources │ │ └── log4j2.xml ├── opendc-compute-failure │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── org │ │ │ └── opendc │ │ │ └── compute │ │ │ └── failure │ │ │ ├── hostfault │ │ │ ├── HostFault.kt │ │ │ └── StartStopHostFault.kt │ │ │ ├── models │ │ │ ├── FailureModel.kt │ │ │ ├── SampleBasedFailureModel.kt │ │ │ └── TraceBasedFailureModel.kt │ │ │ ├── prefab │ │ │ ├── G5k06.kt │ │ │ ├── Lanl05.kt │ │ │ ├── Ldns04.kt │ │ │ ├── Microsoft99.kt │ │ │ ├── Nd07cpu.kt │ │ │ ├── Overnet03.kt │ │ │ ├── Pl05.kt │ │ │ ├── PrefabFailureModelFactory.kt │ │ │ ├── Skype06.kt │ │ │ └── Websites02.kt │ │ │ └── victimselector │ │ │ ├── StochasticVictimSelector.kt │ │ │ └── VictimSelector.kt │ │ └── test │ │ └── resources │ │ └── log4j2.xml ├── opendc-compute-simulator │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── opendc │ │ │ │ └── compute │ │ │ │ └── simulator │ │ │ │ ├── host │ │ │ │ ├── HostListener.java │ │ │ │ ├── HostModel.java │ │ │ │ └── HostState.java │ │ │ │ ├── service │ │ │ │ ├── ComputeService.java │ │ │ │ ├── HostView.java │ │ │ │ ├── ServiceFlavor.java │ │ │ │ ├── ServiceImage.java │ │ │ │ ├── ServiceTask.java │ │ │ │ └── TaskNature.java │ │ │ │ └── telemetry │ │ │ │ ├── GuestCpuStats.java │ │ │ │ ├── GuestSystemStats.java │ │ │ │ ├── HostCpuStats.java │ │ │ │ ├── HostSystemStats.java │ │ │ │ └── SchedulerStats.java │ │ └── kotlin │ │ │ └── org │ │ │ └── opendc │ │ │ └── compute │ │ │ └── simulator │ │ │ ├── ServiceRegistry.kt │ │ │ ├── TaskWatcher.kt │ │ │ ├── checkpoints │ │ │ └── CheckpointModel.kt │ │ │ ├── host │ │ │ └── SimHost.kt │ │ │ ├── internal │ │ │ ├── Guest.kt │ │ │ └── GuestListener.kt │ │ │ ├── provisioner │ │ │ ├── ComputeMonitorProvisioningStep.kt │ │ │ ├── ComputeServiceProvisioningStep.kt │ │ │ ├── ComputeSteps.kt │ │ │ ├── HostsProvisioningStep.kt │ │ │ ├── Provisioner.kt │ │ │ ├── ProvisioningContext.kt │ │ │ └── ProvisioningStep.kt │ │ │ ├── scheduler │ │ │ ├── ComputeScheduler.kt │ │ │ ├── ComputeSchedulers.kt │ │ │ ├── FilterScheduler.kt │ │ │ ├── MemorizingScheduler.kt │ │ │ ├── filters │ │ │ │ ├── ComputeFilter.kt │ │ │ │ ├── DifferentHostFilter.kt │ │ │ │ ├── HostFilter.kt │ │ │ │ ├── InstanceCountFilter.kt │ │ │ │ ├── RamFilter.kt │ │ │ │ ├── SameHostFilter.kt │ │ │ │ ├── VCpuCapacityFilter.kt │ │ │ │ └── VCpuFilter.kt │ │ │ ├── timeshift │ │ │ │ ├── MemorizingTimeshift.kt │ │ │ │ ├── TaskStopper.kt │ │ │ │ ├── TimeshiftScheduler.kt │ │ │ │ └── Timeshifter.kt │ │ │ └── weights │ │ │ │ ├── CoreRamWeigher.kt │ │ │ │ ├── HostWeigher.kt │ │ │ │ ├── InstanceCountWeigher.kt │ │ │ │ ├── RamWeigher.kt │ │ │ │ ├── VCpuCapacityWeigher.kt │ │ │ │ └── VCpuWeigher.kt │ │ │ └── telemetry │ │ │ ├── ComputeMetricReader.kt │ │ │ ├── ComputeMonitor.kt │ │ │ ├── OutputFiles.kt │ │ │ ├── parquet │ │ │ ├── ComputeExportConfig.kt │ │ │ ├── DfltBatteryExportColumns.kt │ │ │ ├── DfltHostExportColumns.kt │ │ │ ├── DfltPowerSourceExportColumns.kt │ │ │ ├── DfltServiceExportColumns.kt │ │ │ ├── DfltTaskExportColumns.kt │ │ │ ├── ParquetComputeMonitor.kt │ │ │ └── README.md │ │ │ └── table │ │ │ ├── battery │ │ │ ├── BatteryInfo.kt │ │ │ ├── BatteryTableReader.kt │ │ │ └── BatteryTableReaderImpl.kt │ │ │ ├── host │ │ │ ├── HostInfo.kt │ │ │ ├── HostTableReader.kt │ │ │ └── HostTableReaderImpl.kt │ │ │ ├── powerSource │ │ │ ├── PowerSourceInfo.kt │ │ │ ├── PowerSourceTableReader.kt │ │ │ └── PowerSourceTableReaderImpl.kt │ │ │ ├── service │ │ │ ├── ServiceData.kt │ │ │ ├── ServiceTableReader.kt │ │ │ └── ServiceTableReaderImpl.kt │ │ │ └── task │ │ │ ├── TaskInfo.kt │ │ │ ├── TaskTableReader.kt │ │ │ └── TaskTableReaderImpl.kt │ │ └── test │ │ └── kotlin │ │ └── org │ │ └── opendc │ │ └── compute │ │ └── simulator │ │ └── scheduler │ │ ├── FilterSchedulerTest.kt │ │ ├── MemorizingSchedulerTest.kt │ │ └── TimeshiftSchedulerTest.kt ├── opendc-compute-topology │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── org │ │ │ └── opendc │ │ │ └── compute │ │ │ └── topology │ │ │ ├── TopologyFactories.kt │ │ │ ├── TopologyReader.kt │ │ │ └── specs │ │ │ ├── BatterySpec.kt │ │ │ ├── ClusterSpec.kt │ │ │ ├── HostSpec.kt │ │ │ ├── PowerSourceSpec.kt │ │ │ ├── TopologySchema.json │ │ │ └── TopologySpecs.kt │ │ └── test │ │ └── resources │ │ └── log4j2.xml └── opendc-compute-workload │ ├── build.gradle.kts │ └── src │ ├── main │ └── kotlin │ │ └── org │ │ └── opendc │ │ └── compute │ │ └── workload │ │ ├── ComputeWorkloadLoader.kt │ │ ├── Task.kt │ │ └── WorkloadLoader.kt │ └── test │ └── resources │ └── log4j2.xml ├── opendc-experiments ├── build.gradle.kts ├── opendc-experiments-base │ ├── build.gradle.kts │ └── src │ │ ├── jmh │ │ ├── kotlin │ │ │ └── org │ │ │ │ └── opendc │ │ │ │ └── experiments │ │ │ │ └── capelin │ │ │ │ └── CapelinBenchmarks.kt │ │ └── resources │ │ │ ├── log4j2.xml │ │ │ └── topology.txt │ │ ├── main │ │ ├── kotlin │ │ │ └── org │ │ │ │ └── opendc │ │ │ │ └── experiments │ │ │ │ └── base │ │ │ │ ├── experiment │ │ │ │ ├── ExperimentFactories.kt │ │ │ │ ├── ExperimentReader.kt │ │ │ │ ├── ExperimentWriter.kt │ │ │ │ ├── Scenario.kt │ │ │ │ └── specs │ │ │ │ │ ├── CheckpointModelSpec.kt │ │ │ │ │ ├── ExperimentSpec.kt │ │ │ │ │ ├── ExportModelSpec.kt │ │ │ │ │ ├── FailureModelSpec.kt │ │ │ │ │ ├── PowerModelSpec.kt │ │ │ │ │ ├── ScenarioSpec.kt │ │ │ │ │ ├── ScenarioTopologySpec.kt │ │ │ │ │ ├── WorkloadSpec.kt │ │ │ │ │ └── allocation │ │ │ │ │ ├── AllocationPolicySpec.kt │ │ │ │ │ ├── HostFilterSpec.kt │ │ │ │ │ └── HostWeigherSpec.kt │ │ │ │ └── runner │ │ │ │ ├── ExperimentCli.kt │ │ │ │ ├── ExperimentRunner.kt │ │ │ │ ├── ScenarioReplayer.kt │ │ │ │ └── ScenarioRunner.kt │ │ └── resources │ │ │ ├── bitbrains-small │ │ │ ├── interference-model.json │ │ │ └── trace │ │ │ │ ├── meta.parquet │ │ │ │ └── trace.parquet │ │ │ ├── env │ │ │ ├── multi.txt │ │ │ └── single.txt │ │ │ └── log4j2.xml │ │ └── test │ │ ├── kotlin │ │ └── org │ │ │ └── opendc │ │ │ └── experiments │ │ │ └── base │ │ │ ├── BatteryTest.kt │ │ │ ├── CarbonTest.kt │ │ │ ├── ExperimentRunnerTest.kt │ │ │ ├── ExperimentTest.kt │ │ │ ├── FailuresAndCheckpointingTest.kt │ │ │ ├── FlowDistributorTest.kt │ │ │ ├── FragmentScalingTest.kt │ │ │ ├── SchedulerTest.kt │ │ │ └── TestingUtils.kt │ │ └── resources │ │ ├── carbonTraces │ │ ├── 2022-01-01_2022-12-31_BE.parquet │ │ ├── 2022-01-01_2022-12-31_DE.parquet │ │ ├── 2022-01-01_2022-12-31_FR.parquet │ │ ├── 2022-01-01_2022-12-31_NL.parquet │ │ ├── 2022-01-01_single_100.parquet │ │ └── 2022-01-01_two_80_120.parquet │ │ ├── experiments │ │ └── experiment_1.json │ │ ├── failureTraces │ │ ├── single_failure.parquet │ │ ├── single_failure_2.parquet │ │ └── two_failures.parquet │ │ ├── topologies │ │ ├── batteries │ │ │ ├── experiment1.json │ │ │ ├── experiment2.json │ │ │ ├── experiment3.json │ │ │ └── experiment4.json │ │ ├── single_1_2000.json │ │ ├── single_1_2000_BE.json │ │ ├── single_1_2000_DE.json │ │ ├── single_1_2000_FR.json │ │ ├── single_1_2000_NL.json │ │ ├── single_2_2000.json │ │ ├── single_5000_2000.json │ │ ├── single_50_big.json │ │ └── single_50_big_BE.json │ │ └── workloadTraces │ │ ├── bitbrains-small │ │ ├── fragments.parquet │ │ ├── interference-model.json │ │ └── tasks.parquet │ │ └── single_task │ │ ├── fragments.parquet │ │ └── tasks.parquet └── opendc-experiments-m3sa │ ├── build.gradle.kts │ └── src │ └── main │ ├── kotlin │ └── org │ │ └── opendc │ │ └── experiments │ │ └── m3sa │ │ ├── M3saAnalyzer.kt │ │ ├── runner │ │ ├── M3SACli.kt │ │ └── M3SARunner.kt │ │ └── scenario │ │ └── M3SAFactories.kt │ └── python │ ├── accuracy_evaluator.py │ ├── input_parser.py │ ├── main.py │ ├── models │ ├── MetaModel.py │ ├── Model.py │ └── MultiModel.py │ ├── requirements.txt │ ├── simulator_specifics.py │ └── utils.py ├── opendc-simulator ├── build.gradle.kts ├── opendc-simulator-compute │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── opendc │ │ │ │ └── simulator │ │ │ │ └── compute │ │ │ │ ├── cpu │ │ │ │ ├── CPUPowerModelsFactory.kt │ │ │ │ ├── CpuPowerModel.java │ │ │ │ ├── CpuPowerModels.java │ │ │ │ └── SimCpu.java │ │ │ │ ├── machine │ │ │ │ ├── PerformanceCounters.java │ │ │ │ └── SimMachine.java │ │ │ │ ├── memory │ │ │ │ └── Memory.java │ │ │ │ ├── models │ │ │ │ ├── CpuModel.java │ │ │ │ ├── MachineModel.java │ │ │ │ └── MemoryUnit.java │ │ │ │ ├── power │ │ │ │ ├── CarbonFragment.java │ │ │ │ ├── CarbonModel.java │ │ │ │ ├── CarbonReceiver.java │ │ │ │ ├── SimPowerSource.java │ │ │ │ ├── SimPsu.java │ │ │ │ └── batteries │ │ │ │ │ ├── BatteryAggregator.java │ │ │ │ │ ├── BatteryState.java │ │ │ │ │ ├── PowerSourceType.java │ │ │ │ │ ├── SimBattery.java │ │ │ │ │ └── policy │ │ │ │ │ ├── BatteryPolicy.java │ │ │ │ │ ├── DoubleThresholdBatteryPolicy.java │ │ │ │ │ ├── RunningMeanBatteryPolicy.java │ │ │ │ │ ├── RunningMeanPlusBatteryPolicy.java │ │ │ │ │ └── SingleThresholdBatteryPolicy.java │ │ │ │ └── workload │ │ │ │ ├── ChainWorkload.java │ │ │ │ ├── CheckpointModel.java │ │ │ │ ├── SimWorkload.java │ │ │ │ ├── VirtualMachine.java │ │ │ │ ├── Workload.java │ │ │ │ └── trace │ │ │ │ ├── SimTraceWorkload.java │ │ │ │ ├── TraceFragment.java │ │ │ │ ├── TraceWorkload.java │ │ │ │ └── scaling │ │ │ │ ├── NoDelayScaling.java │ │ │ │ ├── PerfectScaling.java │ │ │ │ └── ScalingPolicy.java │ │ └── kotlin │ │ │ └── org │ │ │ └── opendc │ │ │ └── simulator │ │ │ └── compute │ │ │ └── Coroutines.kt │ │ └── test │ │ └── kotlin │ │ └── org │ │ └── opendc │ │ └── simulator │ │ └── compute │ │ └── SimMachineTest.kt ├── opendc-simulator-core │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── opendc │ │ │ │ └── simulator │ │ │ │ ├── SimulationDispatcher.java │ │ │ │ └── TaskQueue.java │ │ └── kotlin │ │ │ └── org │ │ │ └── opendc │ │ │ └── simulator │ │ │ └── kotlin │ │ │ ├── SimulationBuilders.kt │ │ │ ├── SimulationController.kt │ │ │ └── SimulationCoroutineScope.kt │ │ └── test │ │ └── kotlin │ │ └── org │ │ └── opendc │ │ └── simulator │ │ ├── SimulationDispatcherTest.kt │ │ ├── TaskQueueTest.kt │ │ └── kotlin │ │ └── SimulationBuildersTest.kt └── opendc-simulator-flow │ ├── build.gradle.kts │ └── src │ ├── main │ └── java │ │ └── org │ │ └── opendc │ │ └── simulator │ │ └── engine │ │ ├── engine │ │ ├── FlowCycleQueue.java │ │ ├── FlowEngine.java │ │ ├── FlowEventQueue.java │ │ └── InvocationStack.java │ │ └── graph │ │ ├── FlowConsumer.java │ │ ├── FlowDistributor.java │ │ ├── FlowEdge.java │ │ ├── FlowNode.java │ │ └── FlowSupplier.java │ └── test │ └── kotlin │ └── InvocationStackTest.kt ├── opendc-trace ├── build.gradle.kts ├── opendc-trace-api │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── org │ │ │ └── opendc │ │ │ └── trace │ │ │ ├── Table.kt │ │ │ ├── TableColumn.kt │ │ │ ├── TableColumnType.kt │ │ │ ├── TableReader.kt │ │ │ ├── TableWriter.kt │ │ │ ├── Trace.kt │ │ │ ├── conv │ │ │ ├── CarbonIntensityColumns.kt │ │ │ ├── FailureColumns.kt │ │ │ ├── InterferenceGroupColumns.kt │ │ │ ├── ResourceColumns.kt │ │ │ ├── ResourceStateColumns.kt │ │ │ ├── Tables.kt │ │ │ └── TaskColumns.kt │ │ │ ├── formats │ │ │ ├── azure │ │ │ │ ├── AzureResourceStateTableReader.kt │ │ │ │ ├── AzureResourceTableReader.kt │ │ │ │ └── AzureTraceFormat.kt │ │ │ ├── bitbrains │ │ │ │ ├── BitbrainsExResourceStateTableReader.kt │ │ │ │ ├── BitbrainsExTraceFormat.kt │ │ │ │ ├── BitbrainsResourceStateTableReader.kt │ │ │ │ ├── BitbrainsResourceTableReader.kt │ │ │ │ └── BitbrainsTraceFormat.kt │ │ │ ├── carbon │ │ │ │ ├── CarbonTableReader.kt │ │ │ │ ├── CarbonTraceFormat.kt │ │ │ │ └── parquet │ │ │ │ │ ├── CarbonIntensityFragment.kt │ │ │ │ │ ├── CarbonIntensityReadSupport.kt │ │ │ │ │ └── CarbonIntensityRecordMaterializer.kt │ │ │ ├── failure │ │ │ │ ├── FailureTableReader.kt │ │ │ │ ├── FailureTraceFormat.kt │ │ │ │ └── parquet │ │ │ │ │ ├── FailureFragment.kt │ │ │ │ │ ├── FailureReadSupport.kt │ │ │ │ │ └── FailureRecordMaterializer.kt │ │ │ ├── gwf │ │ │ │ ├── GwfTaskTableReader.kt │ │ │ │ └── GwfTraceFormat.kt │ │ │ ├── opendc │ │ │ │ ├── OdcVmInterferenceJsonTableReader.kt │ │ │ │ ├── OdcVmInterferenceJsonTableWriter.kt │ │ │ │ ├── OdcVmResourceStateTableReader.kt │ │ │ │ ├── OdcVmResourceStateTableWriter.kt │ │ │ │ ├── OdcVmResourceTableReader.kt │ │ │ │ ├── OdcVmResourceTableWriter.kt │ │ │ │ ├── OdcVmTraceFormat.kt │ │ │ │ └── parquet │ │ │ │ │ ├── Resource.kt │ │ │ │ │ ├── ResourceReadSupport.kt │ │ │ │ │ ├── ResourceRecordMaterializer.kt │ │ │ │ │ ├── ResourceState.kt │ │ │ │ │ ├── ResourceStateReadSupport.kt │ │ │ │ │ ├── ResourceStateRecordMaterializer.kt │ │ │ │ │ ├── ResourceStateWriteSupport.kt │ │ │ │ │ └── ResourceWriteSupport.kt │ │ │ ├── swf │ │ │ │ ├── SwfTaskTableReader.kt │ │ │ │ └── SwfTraceFormat.kt │ │ │ ├── wfformat │ │ │ │ ├── WfFormatTaskTableReader.kt │ │ │ │ └── WfFormatTraceFormat.kt │ │ │ └── wtf │ │ │ │ ├── WtfTaskTableReader.kt │ │ │ │ ├── WtfTraceFormat.kt │ │ │ │ └── parquet │ │ │ │ ├── Task.kt │ │ │ │ ├── TaskReadSupport.kt │ │ │ │ └── TaskRecordMaterializer.kt │ │ │ ├── internal │ │ │ ├── TableImpl.kt │ │ │ └── TraceImpl.kt │ │ │ ├── spi │ │ │ ├── TableDetails.kt │ │ │ └── TraceFormat.kt │ │ │ └── util │ │ │ ├── CompositeTableReader.kt │ │ │ └── TableColumnConversion.kt │ │ └── test │ │ ├── kotlin │ │ └── formats │ │ │ ├── azure │ │ │ └── AzureTraceFormatTest.kt │ │ │ ├── bitbrains │ │ │ ├── BitbrainsExTraceFormatTest.kt │ │ │ └── BitbrainsTraceFormatTest.kt │ │ │ ├── gwf │ │ │ └── GwfTraceFormatTest.kt │ │ │ ├── opendc │ │ │ └── OdcVmTraceFormatTest.kt │ │ │ ├── swf │ │ │ └── SwfTraceFormatTest.kt │ │ │ ├── wfformat │ │ │ ├── WfFormatTaskTableReaderTest.kt │ │ │ └── WfFormatTraceFormatTest.kt │ │ │ └── wtf │ │ │ ├── TableReaderTestKit.kt │ │ │ ├── TableWriterTestKit.kt │ │ │ └── WtfTraceFormatTest.kt │ │ └── resources │ │ ├── azure │ │ └── trace │ │ │ ├── vm_cpu_readings │ │ │ └── vm_cpu_readings-file-1-of-125.csv.gz │ │ │ └── vmtable │ │ │ └── vmtable.csv.gz │ │ ├── bitbrains │ │ ├── bitbrains.csv │ │ └── vm.txt │ │ ├── gwf │ │ └── trace.gwf │ │ ├── opendc │ │ ├── trace-v2.0 │ │ │ ├── fragments.parquet │ │ │ └── tasks.parquet │ │ └── trace-v2.1 │ │ │ ├── fragments.parquet │ │ │ ├── interference-model.json │ │ │ └── tasks.parquet │ │ ├── swf │ │ └── trace.swf │ │ ├── wfformat │ │ └── trace.json │ │ └── wtf │ │ ├── shell │ │ ├── tasks │ │ │ └── schema-1.0 │ │ │ │ └── part.0.parquet │ │ ├── workflows │ │ │ └── schema-1.0 │ │ │ │ └── part.0.parquet │ │ └── workload │ │ │ └── schema-1.0 │ │ │ └── generic_information.json │ │ └── wtf-trace │ │ └── tasks │ │ └── schema-1.0 │ │ └── part.0.parquet ├── opendc-trace-calcite │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── org │ │ │ └── opendc │ │ │ └── trace │ │ │ └── calcite │ │ │ ├── InsertableTable.kt │ │ │ ├── TraceReaderEnumerator.kt │ │ │ ├── TraceSchema.kt │ │ │ ├── TraceSchemaFactory.kt │ │ │ ├── TraceTable.kt │ │ │ ├── TraceTableModify.kt │ │ │ └── TraceTableModifyRule.kt │ │ └── test │ │ ├── kotlin │ │ └── org │ │ │ └── opendc │ │ │ └── trace │ │ │ └── calcite │ │ │ ├── CalciteTest.kt │ │ │ └── TraceSchemaFactoryTest.kt │ │ └── resources │ │ ├── model.json │ │ └── trace │ │ ├── fragments.parquet │ │ ├── interference-model.json │ │ └── tasks.parquet ├── opendc-trace-parquet │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── org │ │ │ └── opendc │ │ │ └── trace │ │ │ └── util │ │ │ └── parquet │ │ │ ├── LocalInputFile.kt │ │ │ ├── LocalOutputFile.kt │ │ │ ├── LocalParquetReader.kt │ │ │ ├── LocalParquetWriter.kt │ │ │ ├── ParquetDataWriter.kt │ │ │ └── exporter │ │ │ ├── ExportColumn.kt │ │ │ ├── ExportColumnSerializer.kt │ │ │ ├── Exportable.kt │ │ │ └── Exporter.kt │ │ └── test │ │ └── kotlin │ │ └── org │ │ └── opendc │ │ └── trace │ │ └── util │ │ └── parquet │ │ └── ParquetTest.kt ├── opendc-trace-testkit │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ └── org │ │ └── opendc │ │ └── trace │ │ └── testkit │ │ ├── TableReaderTestKit.kt │ │ └── TableWriterTestKit.kt └── opendc-trace-tools │ ├── build.gradle.kts │ └── src │ └── main │ ├── kotlin │ └── org │ │ └── opendc │ │ └── trace │ │ └── tools │ │ ├── ConvertCommand.kt │ │ ├── QueryCommand.kt │ │ └── TraceTools.kt │ └── resources │ └── log4j2.xml ├── opendc-web ├── build.gradle.kts ├── opendc-web-client │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ └── org │ │ └── opendc │ │ └── web │ │ └── client │ │ ├── OpenDCClient.kt │ │ ├── PortfolioResource.kt │ │ ├── ProjectResource.kt │ │ ├── ScenarioResource.kt │ │ ├── SchedulerResource.kt │ │ ├── TopologyResource.kt │ │ ├── TraceResource.kt │ │ ├── auth │ │ ├── AuthController.kt │ │ └── OpenIdAuthController.kt │ │ ├── internal │ │ ├── ClientUtils.kt │ │ ├── OAuthTokenRequest.kt │ │ ├── OAuthTokenResponse.kt │ │ └── OpenIdConfiguration.kt │ │ ├── runner │ │ ├── JobResource.kt │ │ └── OpenDCRunnerClient.kt │ │ └── transport │ │ ├── HttpTransportClient.kt │ │ └── TransportClient.kt ├── opendc-web-proto │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ └── org │ │ └── opendc │ │ └── web │ │ └── proto │ │ ├── JobState.kt │ │ ├── Machine.kt │ │ ├── MemoryUnit.kt │ │ ├── OperationalPhenomena.kt │ │ ├── ProcessingUnit.kt │ │ ├── ProtocolError.kt │ │ ├── Rack.kt │ │ ├── Room.kt │ │ ├── RoomTile.kt │ │ ├── Targets.kt │ │ ├── Trace.kt │ │ ├── Workload.kt │ │ ├── runner │ │ ├── Job.kt │ │ ├── Portfolio.kt │ │ ├── Scenario.kt │ │ └── Topology.kt │ │ └── user │ │ ├── Job.kt │ │ ├── Portfolio.kt │ │ ├── Project.kt │ │ ├── ProjectRole.kt │ │ ├── Scenario.kt │ │ ├── Topology.kt │ │ ├── User.kt │ │ └── UserAccounting.kt ├── opendc-web-runner-quarkus-deployment │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── opendc │ │ └── web │ │ └── runner │ │ └── deployment │ │ ├── OpenDCRunnerBuildItem.java │ │ ├── OpenDCRunnerConfig.java │ │ └── OpenDCRunnerProcessor.java ├── opendc-web-runner-quarkus │ ├── build.gradle.kts │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── opendc │ │ │ └── web │ │ │ └── runner │ │ │ └── runtime │ │ │ ├── OpenDCRunnerRecorder.java │ │ │ └── OpenDCRunnerRuntimeConfig.java │ │ └── resources │ │ └── META-INF │ │ └── quarkus-extension.yaml ├── opendc-web-runner │ ├── Dockerfile │ ├── build.gradle.kts │ └── src │ │ ├── cli │ │ └── kotlin │ │ │ └── org │ │ │ └── opendc │ │ │ └── web │ │ │ └── runner │ │ │ └── Main.kt │ │ └── main │ │ ├── kotlin │ │ └── org │ │ │ └── opendc │ │ │ └── web │ │ │ └── runner │ │ │ ├── JobManager.kt │ │ │ ├── OpenDCRunner.kt │ │ │ └── internal │ │ │ ├── JobManagerImpl.kt │ │ │ └── WebComputeMonitor.kt │ │ └── resources │ │ └── log4j2.xml ├── opendc-web-server │ ├── Dockerfile │ ├── build.gradle.kts │ ├── config │ │ └── application.properties │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── opendc │ │ │ │ └── web │ │ │ │ └── server │ │ │ │ ├── model │ │ │ │ ├── Job.java │ │ │ │ ├── Portfolio.java │ │ │ │ ├── Project.java │ │ │ │ ├── ProjectAuthorization.java │ │ │ │ ├── Scenario.java │ │ │ │ ├── Topology.java │ │ │ │ ├── Trace.java │ │ │ │ ├── UserAccounting.java │ │ │ │ └── Workload.java │ │ │ │ ├── rest │ │ │ │ ├── BaseProtocol.java │ │ │ │ ├── SchedulerResource.java │ │ │ │ ├── TraceResource.java │ │ │ │ ├── error │ │ │ │ │ ├── MissingKotlinParameterExceptionMapper.java │ │ │ │ │ └── WebApplicationExceptionMapper.java │ │ │ │ ├── runner │ │ │ │ │ ├── JobResource.java │ │ │ │ │ └── RunnerProtocol.java │ │ │ │ └── user │ │ │ │ │ ├── PortfolioResource.java │ │ │ │ │ ├── PortfolioScenarioResource.java │ │ │ │ │ ├── ProjectResource.java │ │ │ │ │ ├── ScenarioResource.java │ │ │ │ │ ├── TopologyResource.java │ │ │ │ │ ├── UserProtocol.java │ │ │ │ │ └── UserResource.java │ │ │ │ ├── service │ │ │ │ ├── JobService.java │ │ │ │ └── UserAccountingService.java │ │ │ │ └── util │ │ │ │ ├── DevSecurityOverrideFilter.java │ │ │ │ ├── KotlinModuleCustomizer.java │ │ │ │ ├── QuarkusObjectMapperSupplier.java │ │ │ │ └── runner │ │ │ │ └── QuarkusJobManager.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── branding │ │ │ │ └── logo.png │ │ │ ├── application-dev.properties │ │ │ ├── application-docker.properties │ │ │ ├── application-prod.properties │ │ │ ├── application-test.properties │ │ │ ├── application.properties │ │ │ ├── hypersistence-utils.properties │ │ │ └── load_data.sql │ │ └── test │ │ └── java │ │ └── org │ │ └── opendc │ │ └── web │ │ └── server │ │ ├── rest │ │ ├── SchedulerResourceTest.java │ │ ├── TraceResourceTest.java │ │ ├── runner │ │ │ └── JobResourceTest.java │ │ └── user │ │ │ ├── PortfolioResourceTest.java │ │ │ ├── PortfolioScenarioResourceTest.java │ │ │ ├── ProjectResourceTest.java │ │ │ ├── ScenarioResourceTest.java │ │ │ ├── TopologyResourceTest.java │ │ │ └── UserResourceTest.java │ │ └── service │ │ ├── JobServiceTest.java │ │ └── UserAccountingServiceTest.java ├── opendc-web-ui-quarkus-deployment │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── opendc │ │ └── web │ │ └── ui │ │ └── deployment │ │ ├── AuthConfiguration.java │ │ ├── OpenDCUiConfig.java │ │ ├── OpenDCUiProcessor.java │ │ └── OpenDCUiRoutingBuildItem.java ├── opendc-web-ui-quarkus │ ├── build.gradle.kts │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── opendc │ │ │ └── web │ │ │ └── ui │ │ │ └── runtime │ │ │ ├── OpenDCUiRecorder.java │ │ │ └── OpenDCUiRuntimeConfig.java │ │ └── resources │ │ └── META-INF │ │ └── quarkus-extension.yaml └── opendc-web-ui │ ├── .dockerignore │ ├── .eslintrc │ ├── .gitignore │ ├── .prettierrc.yaml │ ├── Dockerfile │ ├── README.md │ ├── build.gradle.kts │ ├── next.config.js │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── favicon.ico │ ├── humans.txt │ ├── img │ │ ├── avatar.svg │ │ ├── datacenter-drawing.png │ │ ├── logo.png │ │ ├── logo.svg │ │ ├── opendc-architecture.png │ │ ├── opendc-timeline-v2.png │ │ ├── portraits │ │ │ ├── aiosup.png │ │ │ ├── evaneyk.png │ │ │ ├── fmastenbroek.png │ │ │ ├── gandreadis.png │ │ │ ├── hhe.png │ │ │ ├── jbosch.png │ │ │ ├── jburley.png │ │ │ ├── lfdversluis.png │ │ │ ├── loverweel.png │ │ │ ├── sjounaid.png │ │ │ ├── vvanbeek.png │ │ │ └── wlai.png │ │ ├── screenshot-construction.png │ │ ├── screenshot-simulation.png │ │ ├── stakeholders │ │ │ ├── Developer.png │ │ │ ├── Manager.png │ │ │ ├── Researcher.png │ │ │ ├── Sales.png │ │ │ └── Student.png │ │ ├── topology │ │ │ ├── cpu-icon.png │ │ │ ├── gpu-icon.png │ │ │ ├── memory-icon.png │ │ │ ├── rack-energy-icon.png │ │ │ ├── rack-space-icon.png │ │ │ └── storage-icon.png │ │ └── tudelft-icon.png │ ├── manifest.json │ └── robots.txt │ ├── scripts │ └── envsubst.sh │ └── src │ ├── api │ ├── index.js │ ├── portfolios.js │ ├── projects.js │ ├── scenarios.js │ ├── schedulers.js │ ├── topologies.js │ ├── traces.js │ └── users.js │ ├── auth.js │ ├── components │ ├── AppHeader.js │ ├── AppHeader.module.css │ ├── AppHeaderTools.js │ ├── AppHeaderUser.js │ ├── AppPage.js │ ├── context │ │ ├── ContextSelectionSection.js │ │ ├── ContextSelectionSection.module.css │ │ ├── ContextSelector.js │ │ ├── ContextSelector.module.css │ │ ├── PortfolioSelector.js │ │ ├── ProjectSelector.js │ │ └── TopologySelector.js │ ├── portfolios │ │ ├── NewScenario.js │ │ ├── NewScenarioModal.js │ │ ├── PortfolioOverview.js │ │ ├── PortfolioResultInfo.js │ │ ├── PortfolioResults.js │ │ ├── ScenarioState.js │ │ └── ScenarioTable.js │ ├── projects │ │ ├── FilterPanel.js │ │ ├── FilterPanel.module.css │ │ ├── NewPortfolio.js │ │ ├── NewPortfolioModal.js │ │ ├── NewTopology.js │ │ ├── NewTopologyModal.js │ │ ├── PortfolioTable.js │ │ ├── ProjectCollection.js │ │ ├── ProjectOverview.js │ │ └── TopologyTable.js │ ├── topologies │ │ ├── RoomTable.js │ │ ├── TopologyMap.js │ │ ├── TopologyOverview.js │ │ ├── map │ │ │ ├── GrayContainer.js │ │ │ ├── MapConstants.js │ │ │ ├── MapStage.js │ │ │ ├── MapStage.module.css │ │ │ ├── RackContainer.js │ │ │ ├── RackEnergyFillContainer.js │ │ │ ├── RackSpaceFillContainer.js │ │ │ ├── RoomContainer.js │ │ │ ├── TileContainer.js │ │ │ ├── TopologyContainer.js │ │ │ ├── WallContainer.js │ │ │ ├── controls │ │ │ │ ├── Collapse.js │ │ │ │ ├── Collapse.module.css │ │ │ │ ├── ScaleIndicator.js │ │ │ │ ├── ScaleIndicator.module.css │ │ │ │ ├── Toolbar.js │ │ │ │ └── Toolbar.module.css │ │ │ ├── elements │ │ │ │ ├── Backdrop.js │ │ │ │ ├── GrayLayer.js │ │ │ │ ├── HoverTile.js │ │ │ │ ├── ImageComponent.js │ │ │ │ ├── RackFillBar.js │ │ │ │ ├── RoomTile.js │ │ │ │ ├── TileObject.js │ │ │ │ ├── TilePlusIcon.js │ │ │ │ └── WallSegment.js │ │ │ ├── groups │ │ │ │ ├── GridGroup.js │ │ │ │ ├── RackGroup.js │ │ │ │ ├── RoomGroup.js │ │ │ │ ├── TileGroup.js │ │ │ │ ├── TopologyGroup.js │ │ │ │ └── WallGroup.js │ │ │ └── layers │ │ │ │ ├── HoverLayerComponent.js │ │ │ │ ├── MapLayer.js │ │ │ │ ├── ObjectHoverLayer.js │ │ │ │ └── RoomHoverLayer.js │ │ └── sidebar │ │ │ ├── NameComponent.js │ │ │ ├── TopologySidebar.js │ │ │ ├── TopologySidebar.module.css │ │ │ ├── building │ │ │ ├── BuildingSidebar.js │ │ │ ├── NewRoomConstructionComponent.js │ │ │ └── NewRoomConstructionContainer.js │ │ │ ├── machine │ │ │ ├── DeleteMachine.js │ │ │ ├── MachineSidebar.js │ │ │ ├── UnitAddComponent.js │ │ │ ├── UnitAddContainer.js │ │ │ ├── UnitListComponent.js │ │ │ ├── UnitListContainer.js │ │ │ ├── UnitTabsComponent.js │ │ │ └── UnitType.js │ │ │ ├── rack │ │ │ ├── AddPrefab.js │ │ │ ├── DeleteRackContainer.js │ │ │ ├── MachineComponent.js │ │ │ ├── MachineListComponent.js │ │ │ ├── MachineListContainer.js │ │ │ ├── RackNameContainer.js │ │ │ ├── RackSidebar.js │ │ │ └── RackSidebar.module.css │ │ │ └── room │ │ │ ├── DeleteRoomContainer.js │ │ │ ├── EditRoomContainer.js │ │ │ ├── RackConstructionComponent.js │ │ │ ├── RackConstructionContainer.js │ │ │ ├── RoomName.js │ │ │ └── RoomSidebar.js │ └── util │ │ ├── TableEmptyState.js │ │ └── modals │ │ ├── ConfirmationModal.js │ │ ├── Modal.js │ │ └── TextInputModal.js │ ├── config.js │ ├── data │ ├── experiments.js │ ├── project.js │ ├── query.js │ ├── topology.js │ └── user.js │ ├── pages │ ├── 404.js │ ├── _app.js │ ├── _document.js │ ├── logout.js │ └── projects │ │ ├── [project] │ │ ├── index.js │ │ ├── portfolios │ │ │ └── [portfolio].js │ │ └── topologies │ │ │ └── [topology].js │ │ └── index.js │ ├── redux │ ├── actions │ │ ├── interaction-level.js │ │ └── topology │ │ │ ├── building.js │ │ │ ├── index.js │ │ │ ├── machine.js │ │ │ ├── rack.js │ │ │ └── room.js │ ├── index.js │ ├── reducers │ │ ├── construction-mode.js │ │ ├── index.js │ │ ├── interaction-level.js │ │ └── topology │ │ │ ├── index.js │ │ │ ├── machine.js │ │ │ ├── rack.js │ │ │ ├── room.js │ │ │ ├── tile.js │ │ │ └── topology.js │ └── sagas │ │ ├── index.js │ │ └── topology.js │ ├── shapes.js │ ├── style │ └── index.css │ └── util │ ├── authorizations.js │ ├── available-metrics.js │ ├── colors.js │ ├── date-time.js │ ├── date-time.test.js │ ├── effect-ref.js │ ├── tile-calculations.js │ ├── topology-schema.js │ └── unit-specifications.js └── settings.gradle.kts /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .env 3 | .idea/ 4 | **/out 5 | *.iml 6 | .idea_modules/ 7 | 8 | .gradle 9 | **/build 10 | **/node_modules 11 | 12 | **/Dockerfile 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 4 9 | 10 | end_of_line = lf 11 | charset = utf-8 12 | trim_trailing_whitespace = true 13 | insert_final_newline = true 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | 18 | # Ensure YAML formatting adheres to standard 19 | [*.{yml,yaml}] 20 | indent_size = 2 21 | 22 | [*.java] 23 | ij_java_packages_to_use_import_on_demand = unset 24 | ij_java_class_count_to_use_import_on_demand = 2147483647 25 | 26 | # ktlint 27 | [*.{kt, kts}] 28 | ij_kotlin_name_count_to_use_star_import = 2147483647 29 | ij_kotlin_name_count_to_use_star_import_for_members = 2147483647 30 | ij_kotlin_packages_to_use_import_on_demand = unset 31 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # https://help.github.com/articles/dealing-with-line-endings/ 2 | # 3 | # These are explicitly windows files and should use crlf 4 | *.bat text eol=crlf 5 | *.sh text eol=lf 6 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Set update schedule for GitHub Actions 2 | version: 2 3 | updates: 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "weekly" -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Summary 2 | 3 | A small summary of the requirements (in one/two sentences). 4 | 5 | ## Implementation Notes :hammer_and_pick: 6 | 7 | * Briefly outline the overall technical solution. If necessary, identify talking points where the reviewer's attention should be drawn to. 8 | 9 | ## External Dependencies :four_leaf_clover: 10 | 11 | * 12 | 13 | ## Breaking API Changes :warning: 14 | 15 | * 16 | 17 | *Simply specify none (N/A) if not applicable.* -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy app.opendc.org 2 | 3 | on: 4 | push: 5 | branches: ["prod"] 6 | 7 | jobs: 8 | deploy-app: 9 | runs-on: ubuntu-22.04 10 | steps: 11 | - name: Create SSH key 12 | run: | 13 | mkdir -p ~/.ssh/ 14 | echo "$SSH_PRIVATE_KEY" > ../opendc.key 15 | sudo chmod 600 ../opendc.key 16 | echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts 17 | shell: bash 18 | env: 19 | SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}} 20 | SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}} 21 | - name: Pull Changes 22 | run: ssh -i ../opendc.key opendc@opendc.org 'cd /opt/opendc && git pull origin' 23 | - name: Rebuild Images 24 | run: ssh -i ../opendc.key opendc@opendc.org 'cd /opt/opendc && sudo docker-compose -f docker-compose.yml -f docker-compose.prod.yml build frontend api simulator' 25 | - name: Deploy Images 26 | run: ssh -i ../opendc.key opendc@opendc.org 'cd /opt/opendc && sudo docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d' 27 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | # Workflow for creating a draft release once a new tag is pushed to GitHub 2 | name: Release 3 | 4 | on: 5 | push: 6 | tags: ['v*'] 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | name: Build OpenDC 12 | runs-on: ubuntu-22.04 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@v4 16 | - name: Validate Gradle wrapper 17 | uses: gradle/actions/wrapper-validation@v3 18 | - name: Set up JDK 19 | uses: actions/setup-java@v4 20 | with: 21 | distribution: 'zulu' 22 | java-version: 21 23 | - name: Publish with Gradle 24 | uses: gradle/actions/setup-gradle@v3 25 | with: 26 | arguments: assembleDist 27 | - name: Create Release 28 | uses: softprops/action-gh-release@v2 29 | with: 30 | draft: true 31 | prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-m') }} 32 | files: "**/build/distributions/*" 33 | env: 34 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 35 | -------------------------------------------------------------------------------- /.github/workflows/test-gradle-rc.yml: -------------------------------------------------------------------------------- 1 | name: Test latest Gradle RC 2 | on: 3 | schedule: 4 | - cron: 0 0 * * 0 # weekly 5 | 6 | jobs: 7 | gradle-rc: 8 | runs-on: ubuntu-22.04 9 | steps: 10 | - uses: actions/checkout@v4 11 | - uses: actions/setup-java@v4 12 | with: 13 | distribution: 'zulu' 14 | java-version: 20 15 | - uses: gradle/actions/setup-gradle@v3 16 | with: 17 | cache-disabled: true 18 | gradle-version: release-candidate 19 | arguments: build --dry-run # just test build configuration 20 | -------------------------------------------------------------------------------- /.github/workflows/test-java-ea.yml: -------------------------------------------------------------------------------- 1 | name: Test Java EA release 2 | on: 3 | schedule: 4 | - cron: 0 0 * * 0 # weekly 5 | 6 | jobs: 7 | java-ea: 8 | runs-on: ubuntu-22.04 9 | steps: 10 | - uses: actions/checkout@v4 11 | - uses: actions/setup-java@v4 12 | with: 13 | distribution: 'zulu' 14 | java-version: 21-ea 15 | - uses: gradle/actions/setup-gradle@v3 16 | with: 17 | cache-disabled: true 18 | gradle-version: release-candidate 19 | arguments: build 20 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 AtLarge Research 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | plugins { 24 | `dokka-conventions` 25 | `jacoco-aggregation` 26 | } 27 | 28 | group = "org.opendc" 29 | version = "3.0-SNAPSHOT" 30 | -------------------------------------------------------------------------------- /buildSrc/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | rootProject.name = "buildSrc" 24 | 25 | dependencyResolutionManagement { 26 | versionCatalogs { 27 | create("libs") { 28 | from(files("../gradle/libs.versions.toml")) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/dokka-conventions.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | plugins { 24 | id("org.jetbrains.dokka") 25 | } 26 | 27 | repositories { 28 | mavenCentral() 29 | } 30 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | plugins { 24 | `java-library` 25 | jacoco 26 | } 27 | 28 | jacoco { 29 | toolVersion = "0.8.11" 30 | } 31 | 32 | tasks.jacocoTestReport { 33 | reports { 34 | html.required.set(true) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/java-conventions.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | plugins { 24 | `java-library` 25 | id("spotless-conventions") 26 | } 27 | 28 | /* Project configuration */ 29 | repositories { 30 | mavenCentral() 31 | } 32 | 33 | java { 34 | toolchain { 35 | val javaVersion = project.defaultVersionCatalog.getVersion("java") 36 | languageVersion.set(JavaLanguageVersion.of(javaVersion)) 37 | } 38 | } 39 | 40 | tasks.withType { 41 | options.compilerArgs.add("-parameters") 42 | } 43 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/java-library-conventions.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | plugins { 24 | id("java-conventions") 25 | id("publishing-conventions") 26 | id("testing-conventions") 27 | id("jacoco-conventions") 28 | } 29 | 30 | java { 31 | withSourcesJar() 32 | } 33 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/license.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) $YEAR AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | target: 70% 6 | threshold: 70% 7 | 8 | patch: 9 | default: 10 | target: 70% 11 | threshold: 70% 12 | -------------------------------------------------------------------------------- /docker-compose.override.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | 3 | # Docker Compose overrides for development environments 4 | services: 5 | ui: 6 | build: opendc-web/opendc-web-ui 7 | ports: 8 | - "8080:3000" 9 | environment: 10 | NEXT_PUBLIC_API_BASE_URL: http://localhost:8081 11 | 12 | server: 13 | build: 14 | context: . 15 | dockerfile: opendc-web/opendc-web-server/Dockerfile 16 | args: 17 | OPENDC_AUTH0_DOMAIN: ${OPENDC_AUTH0_DOMAIN:?No Auth0 domain specified} 18 | OPENDC_AUTH0_AUDIENCE: ${OPENDC_AUTH0_AUDIENCE:?No Auth0 audience specified} 19 | OPENDC_AUTH0_DOCS_CLIENT_ID: ${OPENDC_AUTH0_DOCS_CLIENT_ID} 20 | ports: 21 | - "8081:8080" 22 | environment: 23 | SENTRY_ENVIRONMENT: "development" 24 | 25 | postgres: 26 | ports: 27 | - "5432:5432" 28 | 29 | pgadmin: 30 | image: dpage/pgadmin4 31 | restart: on-failure 32 | networks: 33 | - backend 34 | depends_on: 35 | - postgres 36 | ports: 37 | - "5050:80" 38 | environment: 39 | PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org} 40 | PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin} 41 | PGADMIN_CONFIG_SERVER_MODE: 'False' 42 | 43 | volumes: 44 | pgadmin: 45 | -------------------------------------------------------------------------------- /docker-compose.prod.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | 3 | # Docker Compose overrides for production environments 4 | services: 5 | ui: 6 | ports: 7 | - "8080:3000" 8 | environment: 9 | NEXT_PUBLIC_API_BASE_URL: ${OPENDC_API_BASE_URL} 10 | 11 | server: 12 | ports: 13 | - "8081:8080" 14 | environment: 15 | SENTRY_ENVIRONMENT: "production" 16 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | ui: 4 | image: atlargeresearch/opendc-ui:v2.1 5 | restart: on-failure 6 | networks: 7 | - backend 8 | depends_on: 9 | - server 10 | environment: 11 | NEXT_PUBLIC_AUTH0_DOMAIN: ${OPENDC_AUTH0_DOMAIN} 12 | NEXT_PUBLIC_AUTH0_CLIENT_ID: ${OPENDC_AUTH0_CLIENT_ID} 13 | NEXT_PUBLIC_AUTH0_AUDIENCE: ${OPENDC_AUTH0_AUDIENCE} 14 | NEXT_PUBLIC_SENTRY_DSN: ${OPENDC_UI_SENTRY_DSN-} 15 | 16 | server: 17 | image: atlargeresearch/opendc:v2.1 18 | restart: on-failure 19 | networks: 20 | - backend 21 | depends_on: 22 | - postgres 23 | volumes: 24 | - type: bind 25 | source: ./traces 26 | target: /opt/opendc/traces 27 | environment: 28 | OPENDC_DB_USERNAME: ${OPENDC_DB_USERNAME:?No database username specified} 29 | OPENDC_DB_PASSWORD: ${OPENDC_DB_PASSWORD:?No database password specified} 30 | OPENDC_DB_URL: jdbc:postgresql://postgres:5432/opendc 31 | OPENDC_AUTH0_DOMAIN: ${OPENDC_AUTH0_DOMAIN:?No Auth0 domain specified} 32 | OPENDC_AUTH0_AUDIENCE: ${OPENDC_AUTH0_AUDIENCE:?No Auth0 audience specified} 33 | OPENDC_API_URL: ${OPENDC_API_BASE_URL:-http://web:8080} 34 | SENTRY_DSN: ${OPENDC_SERVER_SENTRY_DSN-} 35 | 36 | postgres: 37 | image: postgres 38 | restart: on-failure 39 | environment: 40 | POSTGRES_USER: ${OPENDC_DB_USERNAME} 41 | POSTGRES_PASSWORD: ${OPENDC_DB_PASSWORD} 42 | networks: 43 | - backend 44 | volumes: 45 | - postgres:/var/lib/postgresql/data 46 | 47 | volumes: 48 | postgres: 49 | 50 | networks: 51 | backend: {} 52 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021 AtLarge Research 3 | # 4 | # Permission is hereby granted, free of charge, to any person obtaining a copy 5 | # of this software and associated documentation files (the "Software"), to deal 6 | # in the Software without restriction, including without limitation the rights 7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | # copies of the Software, and to permit persons to whom the Software is 9 | # furnished to do so, subject to the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in all 12 | # copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | # SOFTWARE. 21 | # 22 | 23 | # For Dokka https://github.com/Kotlin/dokka/issues/1405 24 | org.gradle.jvmargs=-XX:MaxMetaspaceSize=10G 25 | 26 | org.gradle.parallel=true 27 | org.gradle.caching=true 28 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /opendc-common/src/main/java/org/opendc/common/DispatcherHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.common; 24 | 25 | /** 26 | * A handle returned by a {@link Dispatcher} representing a scheduled task. 27 | */ 28 | public interface DispatcherHandle { 29 | /** 30 | * Attempt to cancel execution of the task. 31 | */ 32 | void cancel(); 33 | } 34 | -------------------------------------------------------------------------------- /opendc-common/src/main/java/org/opendc/common/DispatcherProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.common; 24 | 25 | /** 26 | * Interface to expose the {@link Dispatcher} instance used by a class. 27 | */ 28 | public interface DispatcherProvider { 29 | /** 30 | * Return the {@link Dispatcher} associated with this class. 31 | */ 32 | Dispatcher getDispatcher(); 33 | } 34 | -------------------------------------------------------------------------------- /opendc-common/src/main/kotlin/org/opendc/common/Dispatchers.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.common 24 | 25 | import kotlinx.coroutines.CoroutineDispatcher 26 | 27 | /** 28 | * Convert a [Dispatcher] to a [CoroutineDispatcher]. 29 | */ 30 | public fun Dispatcher.asCoroutineDispatcher(): CoroutineDispatcher { 31 | return DispatcherCoroutineDispatcher(this) 32 | } 33 | -------------------------------------------------------------------------------- /opendc-common/src/main/kotlin/org/opendc/common/annotations/InternalUse.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.common.annotations 24 | 25 | @RequiresOptIn(message = "This symbol is for internal use only") 26 | @Retention(AnnotationRetention.BINARY) 27 | @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.CONSTRUCTOR) 28 | public annotation class InternalUse 29 | -------------------------------------------------------------------------------- /opendc-compute/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | description = "Cloud computing fabric controller of OpenDC" 24 | 25 | subprojects { 26 | group = "org.opendc.compute" 27 | } 28 | -------------------------------------------------------------------------------- /opendc-compute/opendc-compute-api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | description = "API interface for the OpenDC Compute service" 24 | 25 | // Build configuration 26 | plugins { 27 | `kotlin-library-conventions` 28 | } 29 | dependencies { 30 | implementation(project(mapOf("path" to ":opendc-simulator:opendc-simulator-compute"))) 31 | } 32 | -------------------------------------------------------------------------------- /opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Image.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.compute.api 24 | 25 | /** 26 | * An image containing a bootable operating system that can directly be executed by physical or virtual task. 27 | */ 28 | public interface Image : Resource 29 | -------------------------------------------------------------------------------- /opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/InsufficientTaskCapacityException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.compute.api 24 | 25 | /** 26 | * This exception is thrown to indicate that the compute service does not have enough capacity at the moment to 27 | * fulfill a launch request. 28 | */ 29 | public class InsufficientTaskCapacityException( 30 | override val cause: Throwable? = null, 31 | ) : Exception("There was insufficient capacity available to satisfy the launch request") 32 | -------------------------------------------------------------------------------- /opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/service/TaskNature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.compute.simulator.service; 24 | 25 | public class TaskNature { 26 | 27 | public final boolean deferrable; 28 | 29 | public TaskNature(boolean deferrable) { 30 | this.deferrable = deferrable; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/checkpoints/CheckpointModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.compute.simulator.checkpoints 24 | 25 | public data class CheckpointModel( 26 | val checkpointWait: Long = 60 * 60 * 1000, 27 | val checkpointTime: Long = 5 * 60 * 1000, 28 | ) 29 | -------------------------------------------------------------------------------- /opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/battery/BatteryInfo.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.compute.simulator.telemetry.table.battery 24 | 25 | public data class BatteryInfo( 26 | val name: String, 27 | val clusterName: String, 28 | val arch: String, 29 | val capacity: Double, 30 | ) 31 | -------------------------------------------------------------------------------- /opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/host/HostInfo.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.compute.simulator.telemetry.table.host 24 | 25 | /** 26 | * Information about a host exposed to the telemetry service. 27 | */ 28 | public data class HostInfo( 29 | val name: String, 30 | val clusterName: String, 31 | val arch: String, 32 | val coreCount: Int, 33 | val coreSpeed: Double, 34 | val memCapacity: Long, 35 | ) 36 | -------------------------------------------------------------------------------- /opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/powerSource/PowerSourceInfo.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.compute.simulator.telemetry.table.powerSource 24 | 25 | public data class PowerSourceInfo( 26 | val name: String, 27 | val clusterName: String, 28 | val arch: String, 29 | val capacity: Double, 30 | ) 31 | -------------------------------------------------------------------------------- /opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/task/TaskInfo.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.compute.simulator.telemetry.table.task 24 | 25 | /** 26 | * Static information about a task exposed to the telemetry service. 27 | */ 28 | public data class TaskInfo( 29 | val id: String, 30 | val name: String, 31 | val type: String, 32 | val arch: String, 33 | val cpuCount: Int, 34 | val memCapacity: Long, 35 | ) 36 | -------------------------------------------------------------------------------- /opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/BatterySpec.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.compute.topology.specs 24 | 25 | public data class BatterySpec( 26 | val name: String, 27 | val capacity: Double, 28 | val chargingSpeed: Double, 29 | val batteryPolicy: BatteryPolicyJSONSpec, 30 | val initialCharge: Double, 31 | val embodiedCarbon: Double = 1000.0, 32 | val expectedLifetime: Double = 10.0, 33 | ) 34 | -------------------------------------------------------------------------------- /opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/ClusterSpec.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.compute.topology.specs 24 | 25 | public data class ClusterSpec( 26 | val name: String, 27 | val hostSpecs: List, 28 | val powerSource: PowerSourceSpec, 29 | val battery: BatteryJSONSpec? = null, 30 | ) 31 | -------------------------------------------------------------------------------- /opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/PowerSourceSpec.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.compute.topology.specs 24 | 25 | // TODO: add name to class 26 | public data class PowerSourceSpec( 27 | val name: String = "unknown", 28 | val meta: Map = emptyMap(), 29 | val totalPower: Long = Long.MAX_VALUE, 30 | val carbonTracePath: String? = null, 31 | ) 32 | -------------------------------------------------------------------------------- /opendc-experiments/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | subprojects { 24 | group = "org.opendc.experiments" 25 | } 26 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/jmh/resources/topology.txt: -------------------------------------------------------------------------------- 1 | ClusterID;ClusterName;Cores;Speed;Memory;numberOfHosts;memoryCapacityPerHost;coreCountPerHost 2 | A01;A01;32;3.2;2048;1;256;32 3 | B01;B01;48;2.93;1256;6;64;8 4 | C01;C01;32;3.2;2048;2;128;16 5 | 6 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/experiment/specs/CheckpointModelSpec.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.experiments.base.experiment.specs 24 | 25 | import kotlinx.serialization.Serializable 26 | 27 | @Serializable 28 | public data class CheckpointModelSpec( 29 | val checkpointInterval: Long = 60 * 60 * 1000, 30 | val checkpointDuration: Long = 5 * 60 * 1000, 31 | val checkpointIntervalScaling: Double = 1.0, 32 | ) 33 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/experiment/specs/PowerModelSpec.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.experiments.base.experiment.specs 24 | 25 | import kotlinx.serialization.Serializable 26 | 27 | @Serializable 28 | public data class PowerModelSpec( 29 | val type: String = "constant", 30 | val idlePower: Double = 200.0, 31 | val maxPower: Double = 350.0, 32 | ) 33 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/main/resources/bitbrains-small/interference-model.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "vms": [ 4 | "141", 5 | "379", 6 | "851", 7 | "116" 8 | ], 9 | "minServerLoad": 0.0, 10 | "performanceScore": 0.8830158730158756 11 | }, 12 | { 13 | "vms": [ 14 | "205", 15 | "116", 16 | "463" 17 | ], 18 | "minServerLoad": 0.0, 19 | "performanceScore": 0.7133055555552751 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/main/resources/bitbrains-small/trace/meta.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/main/resources/bitbrains-small/trace/meta.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/main/resources/bitbrains-small/trace/trace.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/main/resources/bitbrains-small/trace/trace.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/main/resources/env/multi.txt: -------------------------------------------------------------------------------- 1 | ClusterID;ClusterName;Cores;Speed;Memory;numberOfHosts;memoryCapacityPerHost;coreCountPerHost 2 | A01;A01;32;3.2;2048;1;256;32 3 | B01;B01;48;2.93;1256;6;64;8 4 | C01;C01;32;3.2;2048;2;128;16 5 | 6 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/main/resources/env/single.txt: -------------------------------------------------------------------------------- 1 | ClusterID;ClusterName;Cores;Speed;Memory;numberOfHosts;memoryCapacityPerHost;coreCountPerHost 2 | A01;A01;8;3.2;128;1;128;8 3 | 4 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/carbonTraces/2022-01-01_2022-12-31_BE.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/carbonTraces/2022-01-01_2022-12-31_BE.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/carbonTraces/2022-01-01_2022-12-31_DE.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/carbonTraces/2022-01-01_2022-12-31_DE.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/carbonTraces/2022-01-01_2022-12-31_FR.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/carbonTraces/2022-01-01_2022-12-31_FR.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/carbonTraces/2022-01-01_2022-12-31_NL.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/carbonTraces/2022-01-01_2022-12-31_NL.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/carbonTraces/2022-01-01_single_100.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/carbonTraces/2022-01-01_single_100.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/carbonTraces/2022-01-01_two_80_120.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/carbonTraces/2022-01-01_two_80_120.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/experiments/experiment_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "topologies": [ 3 | {"pathToFile": "src/test/resources/topologies/single_50_big.json"}, 4 | {"pathToFile": "src/test/resources/topologies/single_50_big_BE.json"} 5 | ], 6 | "workloads": [{ 7 | "pathToFile": "src/test/resources/workloadTraces/bitbrains-small", 8 | "type": "ComputeWorkload", 9 | "submissionTime": "2024-03-01T00:00:00" 10 | }], 11 | "allocationPolicies": [ 12 | { 13 | "type": "prefab", 14 | "policyName": "Mem" 15 | } 16 | ], 17 | "exportModels": [ 18 | { 19 | "exportInterval": 3600, 20 | "printFrequency": 24 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/failureTraces/single_failure.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/failureTraces/single_failure.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/failureTraces/single_failure_2.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/failureTraces/single_failure_2.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/failureTraces/two_failures.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/failureTraces/two_failures.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/batteries/experiment1.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 1, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "powerModel": { 19 | "modelType": "linear", 20 | "power": 400.0, 21 | "idlePower": 100.0, 22 | "maxPower": 200.0 23 | } 24 | } 25 | ], 26 | "powerSource": { 27 | "carbonTracePath": "src/test/resources/carbonTraces/2022-01-01_single_100.parquet" 28 | }, 29 | "battery": { 30 | "capacity": 0.1, 31 | "chargingSpeed": 1000, 32 | "batteryPolicy": 33 | { 34 | "type": "single", 35 | "carbonThreshold": 90 36 | } 37 | } 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/batteries/experiment2.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 1, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "powerModel": { 19 | "modelType": "linear", 20 | "power": 400.0, 21 | "idlePower": 100.0, 22 | "maxPower": 200.0 23 | } 24 | } 25 | ], 26 | "powerSource": { 27 | "carbonTracePath": "src/test/resources/carbonTraces/2022-01-01_single_100.parquet" 28 | }, 29 | "battery": { 30 | "capacity": 0.1, 31 | "chargingSpeed": 1000, 32 | "batteryPolicy": 33 | { 34 | "type": "single", 35 | "carbonThreshold": 120 36 | } 37 | } 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/batteries/experiment3.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 1, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "powerModel": { 19 | "modelType": "linear", 20 | "power": 400.0, 21 | "idlePower": 100.0, 22 | "maxPower": 200.0 23 | } 24 | } 25 | ], 26 | "powerSource": { 27 | "carbonTracePath": "src/test/resources/carbonTraces/2022-01-01_two_80_120.parquet" 28 | }, 29 | "battery": { 30 | "capacity": 0.02, 31 | "chargingSpeed": 1000, 32 | "batteryPolicy": 33 | { 34 | "type": "single", 35 | "carbonThreshold": 100 36 | } 37 | } 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/batteries/experiment4.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 1, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "powerModel": { 19 | "modelType": "linear", 20 | "power": 400.0, 21 | "idlePower": 100.0, 22 | "maxPower": 200.0 23 | } 24 | } 25 | ], 26 | "powerSource": { 27 | "carbonTracePath": "src/test/resources/carbonTraces/2022-01-01_two_80_120.parquet" 28 | } 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/single_1_2000.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 1, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "powerModel": { 19 | "modelType": "linear", 20 | "power": 400.0, 21 | "idlePower": 100.0, 22 | "maxPower": 200.0 23 | } 24 | } 25 | ] 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/single_1_2000_BE.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 1, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "powerModel": { 19 | "modelType": "linear", 20 | "power": 400.0, 21 | "idlePower": 100.0, 22 | "maxPower": 200.0 23 | } 24 | } 25 | ], 26 | "powerSource": { 27 | "carbonTracePath": "src/test/resources/carbonTraces/2022-01-01_2022-12-31_BE.parquet" 28 | } 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/single_1_2000_DE.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 1, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "powerModel": { 19 | "modelType": "linear", 20 | "power": 400.0, 21 | "idlePower": 100.0, 22 | "maxPower": 200.0 23 | } 24 | } 25 | ], 26 | "powerSource": { 27 | "carbonTracePath": "src/test/resources/carbonTraces/2022-01-01_2022-12-31_DE.parquet" 28 | } 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/single_1_2000_FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 1, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "powerModel": { 19 | "modelType": "linear", 20 | "power": 400.0, 21 | "idlePower": 100.0, 22 | "maxPower": 200.0 23 | } 24 | } 25 | ], 26 | "powerSource": { 27 | "carbonTracePath": "src/test/resources/carbonTraces/2022-01-01_2022-12-31_FR.parquet" 28 | } 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/single_1_2000_NL.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 1, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "powerModel": { 19 | "modelType": "linear", 20 | "power": 400.0, 21 | "idlePower": 100.0, 22 | "maxPower": 200.0 23 | } 24 | } 25 | ], 26 | "powerSource": { 27 | "carbonTracePath": "src/test/resources/carbonTraces/2022-01-01_2022-12-31_NL.parquet" 28 | } 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/single_2_2000.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 2, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "powerModel": { 19 | "modelType": "linear", 20 | "power": 400.0, 21 | "idlePower": 100.0, 22 | "maxPower": 200.0 23 | } 24 | } 25 | ] 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/single_5000_2000.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 1, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "count": 5000 19 | } 20 | ] 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/single_50_big.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 64, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "powerModel": { 19 | "modelType": "linear", 20 | "power": 400.0, 21 | "idlePower": 100.0, 22 | "maxPower": 200.0 23 | } 24 | } 25 | ] 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/topologies/single_50_big_BE.json: -------------------------------------------------------------------------------- 1 | { 2 | "clusters": 3 | [ 4 | { 5 | "name": "C01", 6 | "hosts" : 7 | [ 8 | { 9 | "name": "H01", 10 | "cpu": 11 | { 12 | "coreCount": 64, 13 | "coreSpeed": 2000 14 | }, 15 | "memory": { 16 | "memorySize": 140457600000 17 | }, 18 | "powerModel": { 19 | "modelType": "linear", 20 | "power": 400.0, 21 | "idlePower": 100.0, 22 | "maxPower": 200.0 23 | } 24 | } 25 | ], 26 | "powerSource": { 27 | "carbonTracePath": "src/test/resources/carbonTraces/2022-01-01_2022-12-31_BE.parquet" 28 | } 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/workloadTraces/bitbrains-small/fragments.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/workloadTraces/bitbrains-small/fragments.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/workloadTraces/bitbrains-small/interference-model.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "vms": [ 4 | "141", 5 | "379", 6 | "851", 7 | "116" 8 | ], 9 | "minServerLoad": 0.0, 10 | "performanceScore": 0.8830158730158756 11 | }, 12 | { 13 | "vms": [ 14 | "205", 15 | "116", 16 | "463" 17 | ], 18 | "minServerLoad": 0.0, 19 | "performanceScore": 0.7133055555552751 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/workloadTraces/bitbrains-small/tasks.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/workloadTraces/bitbrains-small/tasks.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/workloadTraces/single_task/fragments.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/workloadTraces/single_task/fragments.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-base/src/test/resources/workloadTraces/single_task/tasks.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-experiments/opendc-experiments-base/src/test/resources/workloadTraces/single_task/tasks.parquet -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-m3sa/src/main/python/main.py: -------------------------------------------------------------------------------- 1 | from os import sys 2 | 3 | from input_parser import read_input 4 | from models.MetaModel import MetaModel 5 | from models.MultiModel import MultiModel 6 | 7 | 8 | def main(): 9 | multimodel = MultiModel( 10 | user_input=read_input(sys.argv[2]), 11 | path=sys.argv[1], 12 | ) 13 | 14 | multimodel.generate_plot() 15 | 16 | MetaModel(multimodel) 17 | 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-m3sa/src/main/python/requirements.txt: -------------------------------------------------------------------------------- 1 | matplotlib==3.8.4 2 | numpy==2.1.1 3 | pandas==2.2.2 4 | pyarrow==16.1.0 5 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-m3sa/src/main/python/simulator_specifics.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file is the integration layer of the M3SA tool upon any (ICT) simulator. 3 | 4 | The system will use the elements from this file in the analysis / meta-simulation process. 5 | """ 6 | 7 | """ 8 | SIMULATION_DATA_FILE (str): The name of the file containing the simulation data. Enter only the name, not the path, not 9 | the extension. The data file must be parquet format. 10 | 11 | ✅ Good: "host", "simulation_data", "cats_predictions" 12 | ❌ Wrong: "host.json", "opendc/folder_x/folder_y/data" 13 | """ 14 | SIMULATION_DATA_FILE = "host" # opendc outputs in file host.parquet 15 | -------------------------------------------------------------------------------- /opendc-experiments/opendc-experiments-m3sa/src/main/python/utils.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | """ 4 | Constants for the main.py file 5 | """ 6 | 7 | SIMULATION_ANALYSIS_FOLDER_NAME = 'simulation-analysis' 8 | EMISSIONS_ANALYSIS_FOLDER_NAME = 'carbon_emission' 9 | ENERGY_ANALYSIS_FOLDER_NAME = 'power_draw' 10 | 11 | """ 12 | Utility functions 13 | """ 14 | 15 | 16 | def clean_analysis_file(metric): 17 | analysis_file_path = SIMULATION_ANALYSIS_FOLDER_NAME + "/" 18 | if metric == "power_draw": 19 | analysis_file_path += ENERGY_ANALYSIS_FOLDER_NAME 20 | else: 21 | analysis_file_path += EMISSIONS_ANALYSIS_FOLDER_NAME 22 | analysis_file_path += "/analysis.txt" 23 | 24 | with open(analysis_file_path, "w") as f: 25 | f.write("") 26 | -------------------------------------------------------------------------------- /opendc-simulator/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | description = "Low-level simulation components of OpenDC" 24 | 25 | subprojects { 26 | group = "org.opendc.simulator" 27 | } 28 | -------------------------------------------------------------------------------- /opendc-simulator/opendc-simulator-compute/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | description = "Library for simulating computing workloads" 24 | 25 | plugins { 26 | `kotlin-library-conventions` 27 | `benchmark-conventions` 28 | } 29 | 30 | dependencies { 31 | api(projects.opendcSimulator.opendcSimulatorFlow) 32 | implementation(projects.opendcSimulator.opendcSimulatorCore) 33 | 34 | testImplementation(libs.slf4j.simple) 35 | } 36 | -------------------------------------------------------------------------------- /opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/power/CarbonReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.simulator.compute.power; 24 | 25 | public interface CarbonReceiver { 26 | 27 | public void updateCarbonIntensity(double carbonIntensity); 28 | 29 | public void setCarbonModel(CarbonModel carbonModel); 30 | 31 | public void removeCarbonModel(CarbonModel carbonModel); 32 | } 33 | -------------------------------------------------------------------------------- /opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/power/batteries/BatteryState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.simulator.compute.power.batteries; 24 | 25 | public enum BatteryState { 26 | CHARGING, 27 | IDLE, 28 | DISCHARGING 29 | } 30 | -------------------------------------------------------------------------------- /opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/power/batteries/PowerSourceType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.simulator.compute.power.batteries; 24 | 25 | public enum PowerSourceType { 26 | PowerSource, 27 | Battery 28 | } 29 | -------------------------------------------------------------------------------- /opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/workload/trace/TraceFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.simulator.compute.workload.trace; 24 | 25 | public record TraceFragment(long duration, double cpuUsage, int coreCount) { 26 | 27 | public TraceFragment(long start, long duration, double cpuUsage, int coreCount) { 28 | this(duration, cpuUsage, coreCount); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /opendc-simulator/opendc-simulator-core/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | description = "Simulation-specific code for use in OpenDC" 24 | 25 | // Build configuration 26 | plugins { 27 | `kotlin-library-conventions` 28 | } 29 | 30 | dependencies { 31 | api(projects.opendc.opendcCommon) 32 | api(libs.kotlinx.coroutines) 33 | } 34 | -------------------------------------------------------------------------------- /opendc-simulator/opendc-simulator-flow/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | description = "High-performance flow simulator" 24 | 25 | plugins { 26 | `kotlin-library-conventions` 27 | `benchmark-conventions` 28 | } 29 | 30 | dependencies { 31 | api(projects.opendc.opendcCommon) 32 | implementation(libs.slf4j.api) 33 | 34 | testImplementation(projects.opendcSimulator.opendcSimulatorCore) 35 | testImplementation(libs.slf4j.simple) 36 | 37 | jmhImplementation(projects.opendcSimulator.opendcSimulatorCore) 38 | } 39 | -------------------------------------------------------------------------------- /opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowConsumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.simulator.engine.graph; 24 | 25 | public interface FlowConsumer { 26 | 27 | void handleIncomingSupply(FlowEdge supplierEdge, double newSupply); 28 | 29 | void pushOutgoingDemand(FlowEdge supplierEdge, double newDemand); 30 | 31 | void addSupplierEdge(FlowEdge supplierEdge); 32 | 33 | void removeSupplierEdge(FlowEdge supplierEdge); 34 | } 35 | -------------------------------------------------------------------------------- /opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.simulator.engine.graph; 24 | 25 | public interface FlowSupplier { 26 | 27 | void handleIncomingDemand(FlowEdge consumerEdge, double newDemand); 28 | 29 | void pushOutgoingSupply(FlowEdge consumerEdge, double newSupply); 30 | 31 | void addConsumerEdge(FlowEdge consumerEdge); 32 | 33 | void removeConsumerEdge(FlowEdge consumerEdge); 34 | 35 | double getCapacity(); 36 | } 37 | -------------------------------------------------------------------------------- /opendc-trace/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | description = "Workload trace processing in OpenDC" 24 | 25 | subprojects { 26 | group = "org.opendc.trace" 27 | } 28 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | description = "Workload trace library for OpenDC" 24 | 25 | // Build configuration 26 | plugins { 27 | `kotlin-library-conventions` 28 | } 29 | dependencies { 30 | 31 | implementation(libs.jackson.dataformat.csv) 32 | 33 | implementation(project(mapOf("path" to ":opendc-trace:opendc-trace-parquet"))) 34 | testImplementation(project(mapOf("path" to ":opendc-trace:opendc-trace-testkit"))) 35 | } 36 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/TableColumn.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.trace 24 | 25 | /** 26 | * A column in a [Table]. 27 | * 28 | * @property name The universal name of this column. 29 | * @property type The type of the column. 30 | * @property isNullable A flag to indicate that the column is nullable. 31 | */ 32 | public data class TableColumn( 33 | public val name: String, 34 | public val type: TableColumnType, 35 | public val isNullable: Boolean = false, 36 | ) 37 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/CarbonIntensityColumns.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | @file:JvmName("CarbonIntensityColumns") 24 | 25 | package org.opendc.trace.conv 26 | 27 | /** 28 | * A column containing the task identifier. 29 | */ 30 | public const val CARBON_INTENSITY_TIMESTAMP: String = "timestamp" 31 | 32 | /** 33 | * A column containing the task identifier. 34 | */ 35 | public const val CARBON_INTENSITY_VALUE: String = "carbon_intensity" 36 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/formats/carbon/parquet/CarbonIntensityFragment.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.trace.formats.carbon.parquet 24 | 25 | import java.time.Instant 26 | 27 | /** 28 | * A task in the Workflow Trace Format. 29 | */ 30 | internal data class CarbonIntensityFragment( 31 | val timestamp: Instant, 32 | val carbonIntensity: Double, 33 | ) 34 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/formats/failure/parquet/FailureFragment.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.trace.formats.failure.parquet 24 | 25 | /** 26 | * A task in the Workflow Trace Format. 27 | */ 28 | internal data class FailureFragment( 29 | val failureInterval: Long, 30 | val failureDuration: Long, 31 | val failureIntensity: Double, 32 | ) 33 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/formats/opendc/parquet/ResourceState.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.trace.formats.opendc.parquet 24 | 25 | import java.time.Duration 26 | import java.time.Instant 27 | 28 | internal class ResourceState( 29 | val id: String, 30 | val timestamp: Instant, 31 | val duration: Duration, 32 | val cpuCount: Int, 33 | val cpuUsage: Double, 34 | ) 35 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/spi/TableDetails.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.trace.spi 24 | 25 | import org.opendc.trace.Table 26 | import org.opendc.trace.TableColumn 27 | 28 | /** 29 | * A class used by the [TraceFormat] interface for describing the metadata of a [Table]. 30 | * 31 | * @param columns The available columns in the table. 32 | */ 33 | public data class TableDetails(val columns: List) 34 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/azure/trace/vm_cpu_readings/vm_cpu_readings-file-1-of-125.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-trace/opendc-trace-api/src/test/resources/azure/trace/vm_cpu_readings/vm_cpu_readings-file-1-of-125.csv.gz -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/azure/trace/vmtable/vmtable.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-trace/opendc-trace-api/src/test/resources/azure/trace/vmtable/vmtable.csv.gz -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/bitbrains/vm.txt: -------------------------------------------------------------------------------- 1 | 1631911500 21.2 22.10 0.0 0.0 0.67 1.2 0.0 0.0 5 1 abc 1 0.01 1 10 0.0 0.0 2699 vm 4096 2 | 1631911800 30.4 31.80 0.0 0.0 0.56 1.3 0.0 0.0 5 1 abc 1 0.02 1 10 0.0 0.0 2699 vm 4096 3 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/opendc/trace-v2.0/fragments.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-trace/opendc-trace-api/src/test/resources/opendc/trace-v2.0/fragments.parquet -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/opendc/trace-v2.0/tasks.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-trace/opendc-trace-api/src/test/resources/opendc/trace-v2.0/tasks.parquet -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/opendc/trace-v2.1/fragments.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-trace/opendc-trace-api/src/test/resources/opendc/trace-v2.1/fragments.parquet -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/opendc/trace-v2.1/interference-model.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "vms": [ 4 | "1019", 5 | "1023", 6 | "1052" 7 | ], 8 | "minServerLoad": 0.0, 9 | "performanceScore": 0.8830158730158756 10 | }, 11 | { 12 | "vms": [ 13 | "1023", 14 | "1052", 15 | "1073" 16 | ], 17 | "minServerLoad": 0.0, 18 | "performanceScore": 0.7133055555552751 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/opendc/trace-v2.1/tasks.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-trace/opendc-trace-api/src/test/resources/opendc/trace-v2.1/tasks.parquet -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/swf/trace.swf: -------------------------------------------------------------------------------- 1 | ; Excerpt from the PWA: CTC-SP2-1996-3.1-cln.swf 2 | 1 0 588530 937 306 142.00 -1 -1 35100 -1 1 97 -1 307 3 -1 -1 -1 3 | 2 164472 356587 75 17 2.00 -1 -1 300 -1 1 81 -1 195 3 -1 -1 -1 4 | 3 197154 459987 35268 306 32792 -1 -1 35100 -1 0 97 -1 307 3 -1 -1 -1 5 | 4 310448 50431 29493 64 28745 -1 -1 64800 -1 1 38 -1 38 1 -1 -1 -1 6 | 5 310541 50766 29063 64 28191 -1 -1 64800 -1 1 38 -1 69 1 -1 -1 -1 7 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/wtf/shell/tasks/schema-1.0/part.0.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-trace/opendc-trace-api/src/test/resources/wtf/shell/tasks/schema-1.0/part.0.parquet -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/wtf/shell/workflows/schema-1.0/part.0.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-trace/opendc-trace-api/src/test/resources/wtf/shell/workflows/schema-1.0/part.0.parquet -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/wtf/shell/workload/schema-1.0/generic_information.json: -------------------------------------------------------------------------------- 1 | {"total_workflows": 3403, "total_tasks": 10208, "domain": "Industrial", "date_start": null, "date_end": null, "num_sites": 3403, "num_resources": 10208.0, "num_users": 1, "num_groups": 1, "total_resource_seconds": 89229.863, "authors": ["Shenjun Ma", "Alexey Ilyushkin", "Alexander Stegehuis", "Alexandru Iosup"], "min_resource_task": 1.0, "max_resource_task": 1.0, "std_resource_task": 0.0, "mean_resource_task": 1.0, "median_resource_task": 1.0, "first_quartile_resource_task": 1.0, "third_quartile_resource_task": 1.0, "cov_resource_task": 0.0, "min_memory": -1, "max_memory": -1, "std_memory": 0.0, "mean_memory": -1.0, "median_memory": -1, "first_quartile_memory": -1, "third_quartile_memory": -1, "cov_memory": -0.0, "min_network_usage": -1, "max_network_usage": -1, "std_network_usage": 0.0, "mean_network_usage": -1.0, "median_network_usage": -1, "first_quartile_network_usage": -1, "third_quartile_network_usage": -1, "cov_network_usage": -0.0, "min_disk_space_usage": -1, "max_disk_space_usage": -1, "std_disk_space_usage": 0.0, "mean_disk_space_usage": -1.0, "median_disk_space_usage": -1, "first_quartile_disk_space_usage": -1, "third_quartile_disk_space_usage": -1, "cov_disk_space_usage": -0.0, "min_energy": -1, "max_energy": -1, "std_energy": 0.0, "mean_energy": -1.0, "median_energy": -1, "first_quartile_energy": -1, "third_quartile_energy": -1, "cov_energy": -0.0, "workload_description": "Chronos is a trace from Shell's Chronos IoT production system. It contains pipelines where sensor data is obtained, checked if values are within range (e.g. temperature, operational status, etc.), and the outcomes are written to persistent storage."} -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-api/src/test/resources/wtf/wtf-trace/tasks/schema-1.0/part.0.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-trace/opendc-trace-api/src/test/resources/wtf/wtf-trace/tasks/schema-1.0/part.0.parquet -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-calcite/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | description = "Apache Calcite (SQL) integration for the OpenDC trace library" 24 | 25 | // Build configuration 26 | plugins { 27 | `kotlin-library-conventions` 28 | } 29 | 30 | dependencies { 31 | api(projects.opendcTrace.opendcTraceApi) 32 | 33 | api(libs.calcite.core) 34 | 35 | testRuntimeOnly(libs.slf4j.simple) 36 | } 37 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-calcite/src/test/resources/model.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "defaultSchema": "trace", 4 | "schemas": [ 5 | { 6 | "name": "trace", 7 | "type": "custom", 8 | "factory": "org.opendc.trace.calcite.TraceSchemaFactory", 9 | "operand": { 10 | "path": "trace", 11 | "format": "opendc-vm" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-calcite/src/test/resources/trace/fragments.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-trace/opendc-trace-calcite/src/test/resources/trace/fragments.parquet -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-calcite/src/test/resources/trace/interference-model.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "vms": [ 4 | "1019", 5 | "1023", 6 | "1052" 7 | ], 8 | "minServerLoad": 0.0, 9 | "performanceScore": 0.8830158730158756 10 | }, 11 | { 12 | "vms": [ 13 | "1023", 14 | "1052", 15 | "1073" 16 | ], 17 | "minServerLoad": 0.0, 18 | "performanceScore": 0.7133055555552751 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-calcite/src/test/resources/trace/tasks.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-trace/opendc-trace-calcite/src/test/resources/trace/tasks.parquet -------------------------------------------------------------------------------- /opendc-trace/opendc-trace-testkit/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | description = "Reusable test suite for implementors" 24 | 25 | // Build configuration 26 | plugins { 27 | `kotlin-library-conventions` 28 | } 29 | 30 | dependencies { 31 | api(projects.opendcTrace.opendcTraceApi) 32 | implementation(libs.junit.jupiter.api) 33 | implementation(libs.junit.jupiter.params) 34 | } 35 | -------------------------------------------------------------------------------- /opendc-web/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | description = "Interactive web interface for OpenDC" 24 | 25 | subprojects { 26 | group = "org.opendc.web" 27 | } 28 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-client/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | description = "Client for the OpenDC web API" 24 | 25 | // Build configuration 26 | plugins { 27 | `kotlin-library-conventions` 28 | } 29 | 30 | dependencies { 31 | api(projects.opendcWeb.opendcWebProto) 32 | implementation(libs.jackson.module.kotlin) 33 | implementation(libs.jackson.datatype.jsr310) 34 | implementation(libs.jakarta.validation) 35 | } 36 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/MemoryUnit.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.web.proto 24 | 25 | /** 26 | * A memory unit in a system. 27 | */ 28 | public data class MemoryUnit( 29 | val id: String, 30 | val name: String, 31 | val speedMbPerS: Double, 32 | val sizeMb: Double, 33 | val energyConsumptionW: Double, 34 | ) 35 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/OperationalPhenomena.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.web.proto 24 | 25 | /** 26 | * Object describing the enabled operational phenomena for a scenario. 27 | */ 28 | public data class OperationalPhenomena( 29 | val failures: Boolean, 30 | val interference: Boolean, 31 | ) 32 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/ProcessingUnit.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.web.proto 24 | 25 | /** 26 | * A CPU model. 27 | */ 28 | public data class ProcessingUnit( 29 | val id: String, 30 | val name: String, 31 | val clockRateMhz: Double, 32 | val numberOfCores: Int, 33 | val energyConsumptionW: Double, 34 | ) 35 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/ProtocolError.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.web.proto 24 | 25 | /** 26 | * Container for reporting errors. 27 | */ 28 | public data class ProtocolError(val code: Int, val message: String) 29 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Rack.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.web.proto 24 | 25 | /** 26 | * A rack in a datacenter. 27 | */ 28 | public data class Rack( 29 | val id: String, 30 | val name: String, 31 | val capacity: Int, 32 | val powerCapacityW: Double, 33 | val machines: List, 34 | ) 35 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Room.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.web.proto 24 | 25 | /** 26 | * A room in a datacenter. 27 | */ 28 | public data class Room( 29 | val id: String, 30 | val name: String, 31 | val tiles: Set, 32 | val topologyId: String? = null, 33 | ) 34 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/RoomTile.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.web.proto 24 | 25 | /** 26 | * A room tile. 27 | */ 28 | public data class RoomTile( 29 | val id: String, 30 | val positionX: Double, 31 | val positionY: Double, 32 | val rack: Rack? = null, 33 | val roomId: String? = null, 34 | ) 35 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Targets.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.web.proto 24 | 25 | import jakarta.validation.constraints.Min 26 | 27 | /** 28 | * The targets of a portfolio. 29 | * 30 | * @param metrics The selected metrics to track during simulation. 31 | * @param repeats The number of repetitions per scenario. 32 | */ 33 | public data class Targets( 34 | val metrics: Set, 35 | @field:Min(1) 36 | val repeats: Int = 1, 37 | ) 38 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Trace.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.web.proto 24 | 25 | /** 26 | * A workload trace available for simulation. 27 | * 28 | * @param id The unique identifier of the trace. 29 | * @param name The name of the trace. 30 | * @param type The type of trace. 31 | */ 32 | public data class Trace( 33 | val id: String, 34 | val name: String, 35 | val type: String, 36 | ) 37 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/User.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.web.proto.user 24 | 25 | /** 26 | * A user of OpenDC. 27 | */ 28 | public data class User( 29 | val userId: String, 30 | val accounting: UserAccounting, 31 | ) 32 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/UserAccounting.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.opendc.web.proto.user 24 | 25 | import java.time.LocalDate 26 | 27 | /** 28 | * Accounting data for a user. 29 | */ 30 | public data class UserAccounting( 31 | val periodEnd: LocalDate, 32 | val simulationTime: Int, 33 | val simulationTimeBudget: Int, 34 | ) 35 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-runner-quarkus/src/main/resources/META-INF/quarkus-extension.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "OpenDC Web Runner" 3 | metadata: 4 | status: "preview" 5 | unlisted: true 6 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-runner/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:21-slim 2 | MAINTAINER OpenDC Maintainers 3 | 4 | # Obtain (cache) Gradle wrapper 5 | COPY gradlew /app/ 6 | COPY gradle /app/gradle 7 | WORKDIR /app 8 | RUN ./gradlew --version 9 | 10 | # Build project 11 | COPY ./ /app/ 12 | RUN ./gradlew --no-daemon :opendc-web:opendc-web-runner:installDist 13 | 14 | FROM openjdk:21-slim 15 | COPY --from=0 /app/opendc-web/opendc-web-runner/build/install /opt/ 16 | COPY --from=0 /app/opendc-experiments/opendc-experiments-base/src/test/resources/workloadTraces \ 17 | /opt/opendc/traces 18 | WORKDIR /opt/opendc 19 | CMD bin/opendc-web-runner 20 | 21 | LABEL org.opencontainers.image.authors="OpenDC Maintainers " 22 | LABEL org.opencontainers.image.url="https://opendc.org" 23 | LABEL org.opencontainers.image.documentation="https://opendc.org" 24 | LABEL org.opencontainers.image.source="https://github.com/atlarge-research/opendc" 25 | LABEL org.opencontainers.image.title="OpenDC Web Runner UI" 26 | LABEL org.opencontainers.image.description="OpenDC Web Runner Docker Image" 27 | LABEL org.opencontainers.image.vendor="AtLarge Research" 28 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:21-slim 2 | MAINTAINER OpenDC Maintainers 3 | 4 | # Obtain (cache) Gradle wrapper 5 | COPY gradlew /app/ 6 | COPY gradle /app/gradle 7 | WORKDIR /app 8 | RUN ./gradlew --version 9 | 10 | # Build project 11 | ARG OPENDC_AUTH0_DOMAIN 12 | ARG OPENDC_AUTH0_AUDIENCE 13 | ARG OPENDC_AUTH0_DOCS_CLIENT_ID 14 | 15 | ENV OPENDC_AUTH0_DOMAIN=$OPENDC_AUTH0_DOMAIN 16 | ENV OPENDC_AUTH0_AUDIENCE=$OPENDC_AUTH0_AUDIENCE 17 | ENV OPENDC_AUTH0_DOCS_CLIENT_ID=$OPENDC_AUTH0_DOCS_CLIENT_ID 18 | 19 | COPY ./ /app/ 20 | RUN ./gradlew --no-daemon :opendc-web:opendc-web-server:quarkusBuild -Dquarkus.profile=docker 21 | 22 | FROM openjdk:21-slim 23 | COPY --from=0 /app/opendc-web/opendc-web-server/build/quarkus-app /opt/opendc 24 | WORKDIR /opt/opendc 25 | CMD java -jar quarkus-run.jar 26 | 27 | LABEL org.opencontainers.image.authors="OpenDC Maintainers " 28 | LABEL org.opencontainers.image.url="https://opendc.org" 29 | LABEL org.opencontainers.image.documentation="https://opendc.org" 30 | LABEL org.opencontainers.image.source="https://github.com/atlarge-research/opendc" 31 | LABEL org.opencontainers.image.title="OpenDC" 32 | LABEL org.opencontainers.image.description="OpenDC Docker Image" 33 | LABEL org.opencontainers.image.vendor="AtLarge Research" 34 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-server/config/application.properties: -------------------------------------------------------------------------------- 1 | # Custom server properties 2 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-server/src/main/resources/META-INF/branding/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-server/src/main/resources/META-INF/branding/logo.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-server/src/main/resources/hypersistence-utils.properties: -------------------------------------------------------------------------------- 1 | hypersistence.utils.jackson.object.mapper=org.opendc.web.server.util.QuarkusObjectMapperSupplier 2 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui-quarkus/src/main/resources/META-INF/quarkus-extension.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "OpenDC Web UI" 3 | metadata: 4 | status: "preview" 5 | unlisted: true 6 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | 3 | .idea/ 4 | **/out 5 | *.iml 6 | .idea_modules/ 7 | 8 | node_modules 9 | build 10 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next", "eslint:recommended"], 3 | "env": { 4 | "browser": true, 5 | "node": true, 6 | "es6": true 7 | }, 8 | "overrides": [ 9 | { 10 | "files": ["src/**/*.test.js"], 11 | "env": { 12 | "jest": true 13 | } 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Testing 5 | /coverage 6 | 7 | # Production 8 | /build 9 | 10 | # Misc 11 | .DS_Store 12 | .env.local 13 | .env.development.local 14 | .env.test.local 15 | .env.production.local 16 | 17 | npm-debug.log* 18 | yarn-debug.log* 19 | yarn-error.log* 20 | 21 | # IntelliJ IDEA 22 | /.idea 23 | 24 | # Environment variables 25 | .env.local 26 | 27 | /.next 28 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/.prettierrc.yaml: -------------------------------------------------------------------------------- 1 | trailingComma: "es5" 2 | tabWidth: 4 3 | semi: false 4 | singleQuote: true 5 | printWidth: 120 6 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:18-slim AS staging 2 | MAINTAINER OpenDC Maintainers 3 | 4 | # Copy package details 5 | COPY ./package.json ./package-lock.json /opendc/ 6 | RUN cd /opendc && npm ci 7 | 8 | # Build frontend 9 | FROM node:18-slim AS build 10 | 11 | COPY ./ /opendc 12 | COPY --from=staging /opendc/node_modules /opendc/node_modules 13 | RUN cd /opendc/ \ 14 | # Environmental variables that will be substituted during image runtime 15 | && export NEXT_PUBLIC_API_BASE_URL="%%NEXT_PUBLIC_API_BASE_URL%%" \ 16 | NEXT_PUBLIC_SENTRY_DSN="%%NEXT_PUBLIC_SENTRY_DSN%%" \ 17 | NEXT_PUBLIC_AUTH0_DOMAIN="%%NEXT_PUBLIC_AUTH0_DOMAIN%%" \ 18 | NEXT_PUBLIC_AUTH0_CLIENT_ID="%%NEXT_PUBLIC_AUTH0_CLIENT_ID%%" \ 19 | NEXT_PUBLIC_AUTH0_AUDIENCE="%%NEXT_PUBLIC_AUTH0_AUDIENCE%%" \ 20 | && npm run build \ 21 | && npm cache clean --force \ 22 | && mv build/next build/next.template 23 | 24 | 25 | FROM node:18-slim 26 | COPY --from=build /opendc /opendc 27 | WORKDIR /opendc 28 | CMD ./scripts/envsubst.sh; npm run start 29 | 30 | LABEL org.opencontainers.image.authors="OpenDC Maintainers " 31 | LABEL org.opencontainers.image.url="https://opendc.org" 32 | LABEL org.opencontainers.image.documentation="https://opendc.org" 33 | LABEL org.opencontainers.image.source="https://github.com/atlarge-research/opendc" 34 | LABEL org.opencontainers.image.title="OpenDC Web UI" 35 | LABEL org.opencontainers.image.description="OpenDC Web UI Docker Image" 36 | LABEL org.opencontainers.image.vendor="AtLarge Research" 37 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/favicon.ico -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/humans.txt: -------------------------------------------------------------------------------- 1 | /* TEAM */ 2 | Benevolent Dictator for Life: Alexandru Iosup. 3 | Site: http://www.ds.ewi.tudelft.nl/~iosup/ 4 | Twitter: aiosup. 5 | Location: Delft, Netherlands. 6 | 7 | Full-Stack Engineer: Georgios Andreadis. 8 | Site: https://github.com/gandreadis 9 | Location: Delft, Netherlands. 10 | 11 | Simulation Engineer: Fabian Mastenbroek. 12 | Site: https://github.com/fabianishere 13 | Location: Delft, Netherlands. 14 | 15 | Simulation Engineer: Jacob Burley. 16 | Site: https://github.com/jc0b 17 | Location: Amsterdam, Netherlands. 18 | 19 | Backend Engineer: Leon Overweel. 20 | Site: http://leonoverweel.com/ 21 | Twitter: layon_overwhale. 22 | Location: Delft, Netherlands. 23 | 24 | Simulation Engineer: Matthijs Bijman. 25 | Site: https://github.com/MDBijman 26 | Location: Delft, Netherlands. 27 | 28 | /* THANKS */ 29 | Executive Producer: Vincent van Beek. 30 | Executive Producer: Tim Hegeman. 31 | 32 | /* SITE */ 33 | Standards: HTML5, Sass, ES6 34 | Components: React.js, Redux, create-react-app, react-konva 35 | Software: WebStorm, Vim, Visual Studio 36 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/avatar.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/datacenter-drawing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/datacenter-drawing.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/logo.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/opendc-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/opendc-architecture.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/opendc-timeline-v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/opendc-timeline-v2.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/portraits/aiosup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/portraits/aiosup.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/portraits/evaneyk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/portraits/evaneyk.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/portraits/fmastenbroek.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/portraits/fmastenbroek.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/portraits/gandreadis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/portraits/gandreadis.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/portraits/hhe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/portraits/hhe.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/portraits/jbosch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/portraits/jbosch.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/portraits/jburley.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/portraits/jburley.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/portraits/lfdversluis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/portraits/lfdversluis.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/portraits/loverweel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/portraits/loverweel.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/portraits/sjounaid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/portraits/sjounaid.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/portraits/vvanbeek.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/portraits/vvanbeek.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/portraits/wlai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/portraits/wlai.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/screenshot-construction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/screenshot-construction.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/screenshot-simulation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/screenshot-simulation.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/stakeholders/Developer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/stakeholders/Developer.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/stakeholders/Manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/stakeholders/Manager.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/stakeholders/Researcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/stakeholders/Researcher.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/stakeholders/Sales.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/stakeholders/Sales.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/stakeholders/Student.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/stakeholders/Student.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/topology/cpu-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/topology/cpu-icon.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/topology/gpu-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/topology/gpu-icon.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/topology/memory-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/topology/memory-icon.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/topology/rack-energy-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/topology/rack-energy-icon.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/topology/rack-space-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/topology/rack-space-icon.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/topology/storage-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/topology/storage-icon.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/img/tudelft-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlarge-research/opendc/c7e303ad1b5217e2ff24cee9538ac841d6149706/opendc-web/opendc-web-ui/public/img/tudelft-icon.png -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "OpenDC", 3 | "name": "OpenDC", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "16x16", 8 | "type": "image/png" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#00A6D6", 14 | "background_color": "#eeeeee" 15 | } 16 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /projects/ 3 | Disallow: /profile/ 4 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/scripts/envsubst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | auto_envsubst() { 6 | input_path="build/next.template" 7 | output_path="build/next" 8 | 9 | cp -r "$input_path" "$output_path" 10 | find "$output_path" -type f -name '*.js' -exec perl -pi -e 's/%%(NEXT_PUBLIC_[_A-Z0-9]+)%%/$ENV{$1}/g' {} \; 11 | } 12 | 13 | auto_envsubst 14 | exit 0 15 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/api/schedulers.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | import { request } from './index' 24 | 25 | export function fetchSchedulers(auth) { 26 | return request(auth, 'schedulers/') 27 | } 28 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/api/traces.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | import { request } from './index' 24 | 25 | export function fetchTraces(auth) { 26 | return request(auth, 'traces/') 27 | } 28 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/api/users.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | import { request } from './index' 24 | 25 | /** 26 | * Fetch information about the user from the web server. 27 | * 28 | * @param auth The authentication object. 29 | */ 30 | export function fetchUser(auth) { 31 | return request(auth, `users/me`) 32 | } 33 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/context/ContextSelectionSection.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | import PropTypes from 'prop-types' 24 | import { contextSelectionSection } from './ContextSelectionSection.module.css' 25 | 26 | function ContextSelectionSection({ children }) { 27 | return
{children}
28 | } 29 | 30 | ContextSelectionSection.propTypes = { 31 | children: PropTypes.node, 32 | } 33 | 34 | export default ContextSelectionSection 35 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/context/ContextSelectionSection.module.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | .contextSelectionSection { 24 | padding-left: var(--pf-c-page__main-breadcrumb--PaddingLeft); 25 | flex-shrink: 0; 26 | border-bottom: var(--pf-global--BorderWidth--sm) solid var(--pf-global--BorderColor--100); 27 | background-color: var(--pf-c-page__main-breadcrumb--BackgroundColor); 28 | } 29 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/projects/FilterPanel.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | import { ToggleGroup, ToggleGroupItem } from '@patternfly/react-core' 4 | import { filterPanel } from './FilterPanel.module.css' 5 | 6 | export const FILTERS = { SHOW_ALL: 'All Projects', SHOW_OWN: 'My Projects', SHOW_SHARED: 'Shared with me' } 7 | 8 | const FilterPanel = ({ onSelect, activeFilter = 'SHOW_ALL' }) => ( 9 | 10 | {Object.keys(FILTERS).map((filter) => ( 11 | activeFilter === filter || onSelect(filter)} 14 | isSelected={activeFilter === filter} 15 | text={FILTERS[filter]} 16 | /> 17 | ))} 18 | 19 | ) 20 | 21 | FilterPanel.propTypes = { 22 | onSelect: PropTypes.func.isRequired, 23 | activeFilter: PropTypes.string, 24 | } 25 | 26 | export default FilterPanel 27 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/projects/FilterPanel.module.css: -------------------------------------------------------------------------------- 1 | .filterPanel { 2 | display: flex; 3 | } 4 | 5 | .filterPanel > button { 6 | flex: 1 !important; 7 | } 8 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/MapConstants.js: -------------------------------------------------------------------------------- 1 | export const MAP_SIZE = 50 2 | export const TILE_SIZE_IN_PIXELS = 100 3 | export const TILE_SIZE_IN_METERS = 0.5 4 | export const MAP_SIZE_IN_PIXELS = MAP_SIZE * TILE_SIZE_IN_PIXELS 5 | 6 | export const OBJECT_MARGIN_IN_PIXELS = TILE_SIZE_IN_PIXELS / 5 7 | export const TILE_PLUS_MARGIN_IN_PIXELS = TILE_SIZE_IN_PIXELS / 3 8 | export const OBJECT_SIZE_IN_PIXELS = TILE_SIZE_IN_PIXELS - OBJECT_MARGIN_IN_PIXELS * 2 9 | 10 | export const GRID_LINE_WIDTH_IN_PIXELS = 2 11 | export const WALL_WIDTH_IN_PIXELS = TILE_SIZE_IN_PIXELS / 16 12 | export const OBJECT_BORDER_WIDTH_IN_PIXELS = TILE_SIZE_IN_PIXELS / 16 13 | export const TILE_PLUS_WIDTH_IN_PIXELS = TILE_SIZE_IN_PIXELS / 10 14 | 15 | export const RACK_FILL_ICON_WIDTH = OBJECT_SIZE_IN_PIXELS / 3 16 | export const RACK_FILL_ICON_OPACITY = 0.8 17 | 18 | export const MAP_MOVE_PIXELS_PER_EVENT = 20 19 | export const MAP_SCALE_PER_EVENT = 1.1 20 | export const MAP_MIN_SCALE = 0.5 21 | export const MAP_MAX_SCALE = 1.5 22 | 23 | export const MAX_NUM_UNITS_PER_MACHINE = 6 24 | export const DEFAULT_RACK_SLOT_CAPACITY = 42 25 | export const DEFAULT_RACK_POWER_CAPACITY = 10000 26 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/MapStage.module.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | .mapContainer { 24 | background-color: var(--pf-global--Color--light-200); 25 | position: relative; 26 | display: flex; 27 | width: 100%; 28 | height: 100%; 29 | } 30 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/RackEnergyFillContainer.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | import { useSelector } from 'react-redux' 4 | import RackFillBar from './elements/RackFillBar' 5 | 6 | function RackSpaceFillContainer({ rackId, ...props }) { 7 | const fillFraction = useSelector((state) => { 8 | const rack = state.topology.racks[rackId] 9 | if (!rack) { 10 | return 0 11 | } 12 | 13 | const { machines, cpus, gpus, memories, storages } = state.topology 14 | let energyConsumptionTotal = 0 15 | 16 | for (const machineId of rack.machines) { 17 | if (!machineId) { 18 | continue 19 | } 20 | const machine = machines[machineId] 21 | machine.cpus.forEach((id) => (energyConsumptionTotal += cpus[id].energyConsumptionW)) 22 | machine.gpus.forEach((id) => (energyConsumptionTotal += gpus[id].energyConsumptionW)) 23 | machine.memories.forEach((id) => (energyConsumptionTotal += memories[id].energyConsumptionW)) 24 | machine.storages.forEach((id) => (energyConsumptionTotal += storages[id].energyConsumptionW)) 25 | } 26 | 27 | return Math.min(1, energyConsumptionTotal / rack.powerCapacityW) 28 | }) 29 | return 30 | } 31 | 32 | RackSpaceFillContainer.propTypes = { 33 | rackId: PropTypes.string.isRequired, 34 | } 35 | 36 | export default RackSpaceFillContainer 37 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import { TILE_SIZE_IN_METERS, TILE_SIZE_IN_PIXELS } from '../MapConstants' 4 | import { scaleIndicator } from './ScaleIndicator.module.css' 5 | 6 | function ScaleIndicator({ scale }) { 7 | return ( 8 |
9 | {TILE_SIZE_IN_METERS}m 10 |
11 | ) 12 | } 13 | 14 | ScaleIndicator.propTypes = { 15 | scale: PropTypes.number.isRequired, 16 | } 17 | 18 | export default ScaleIndicator 19 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.module.css: -------------------------------------------------------------------------------- 1 | .scaleIndicator { 2 | position: absolute; 3 | right: 10px; 4 | bottom: 10px; 5 | z-index: 50; 6 | 7 | border: solid 2px #212529; 8 | border-top: none; 9 | border-left: none; 10 | } 11 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import { control, toolBar } from './Toolbar.module.css' 4 | import { Button } from '@patternfly/react-core' 5 | import { SearchPlusIcon, SearchMinusIcon, CameraIcon } from '@patternfly/react-icons' 6 | 7 | function Toolbar({ onZoom, onExport }) { 8 | return ( 9 |
10 | 13 | 16 | 24 |
25 | ) 26 | } 27 | 28 | Toolbar.propTypes = { 29 | onZoom: PropTypes.func, 30 | onExport: PropTypes.func, 31 | } 32 | 33 | export default Toolbar 34 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.module.css: -------------------------------------------------------------------------------- 1 | .toolBar { 2 | position: absolute; 3 | bottom: var(--pf-global--spacer--md); 4 | left: var(--pf-global--spacer--xl); 5 | } 6 | 7 | .control:global(.pf-m-tertiary) { 8 | margin-right: var(--pf-global--spacer--xs); 9 | margin-top: var(--pf-global--spacer--xs); 10 | background-color: var(--pf-global--BackgroundColor--100); 11 | border: none; 12 | border-radius: var(--pf-global--BorderRadius--sm); 13 | box-shadow: var(--pf-global--BoxShadow--sm); 14 | } 15 | 16 | .control:global(.pf-m-tertiary):not(:global(.pf-m-disabled)) { 17 | background-color: var(--pf-global--BackgroundColor--100); 18 | } 19 | 20 | .control:global(.pf-m-tertiary):after { 21 | display: none; 22 | } 23 | 24 | .control:global(.pf-m-tertiary):hover { 25 | border: none; 26 | box-shadow: var(--pf-global--BoxShadow--md); 27 | } 28 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/elements/Backdrop.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Rect } from 'react-konva' 3 | import { BACKDROP_COLOR } from '../../../../util/colors' 4 | import { MAP_SIZE_IN_PIXELS } from '../MapConstants' 5 | 6 | function Backdrop() { 7 | return 8 | } 9 | 10 | export default Backdrop 11 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/elements/GrayLayer.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import { Rect } from 'react-konva' 4 | import { GRAYED_OUT_AREA_COLOR } from '../../../../util/colors' 5 | import { MAP_SIZE_IN_PIXELS } from '../MapConstants' 6 | 7 | function GrayLayer({ onClick }) { 8 | return ( 9 | 17 | ) 18 | } 19 | 20 | GrayLayer.propTypes = { 21 | onClick: PropTypes.func, 22 | } 23 | 24 | export default GrayLayer 25 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/elements/HoverTile.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import { Rect } from 'react-konva' 4 | import { ROOM_HOVER_INVALID_COLOR, ROOM_HOVER_VALID_COLOR } from '../../../../util/colors' 5 | import { TILE_SIZE_IN_PIXELS } from '../MapConstants' 6 | 7 | function HoverTile({ x, y, isValid, scale = 1, onClick }) { 8 | return ( 9 | 19 | ) 20 | } 21 | 22 | HoverTile.propTypes = { 23 | x: PropTypes.number.isRequired, 24 | y: PropTypes.number.isRequired, 25 | isValid: PropTypes.bool.isRequired, 26 | scale: PropTypes.number, 27 | onClick: PropTypes.func.isRequired, 28 | } 29 | 30 | export default HoverTile 31 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/elements/ImageComponent.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React, { useEffect, useState } from 'react' 3 | import { Image } from 'react-konva' 4 | 5 | const imageCaches = {} 6 | 7 | function ImageComponent({ src, x, y, width, height, opacity }) { 8 | const [image, setImage] = useState(null) 9 | 10 | useEffect(() => { 11 | if (imageCaches[src]) { 12 | setImage(imageCaches[src]) 13 | return 14 | } 15 | 16 | const image = new window.Image() 17 | image.src = src 18 | image.onload = () => { 19 | setImage(image) 20 | imageCaches[src] = image 21 | } 22 | }, [src]) 23 | 24 | // eslint-disable-next-line jsx-a11y/alt-text 25 | return 26 | } 27 | 28 | ImageComponent.propTypes = { 29 | src: PropTypes.string.isRequired, 30 | x: PropTypes.number.isRequired, 31 | y: PropTypes.number.isRequired, 32 | width: PropTypes.number.isRequired, 33 | height: PropTypes.number.isRequired, 34 | opacity: PropTypes.number.isRequired, 35 | } 36 | 37 | export default ImageComponent 38 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/elements/RoomTile.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import { Rect } from 'react-konva' 4 | import { Tile } from '../../../../shapes' 5 | import { TILE_SIZE_IN_PIXELS } from '../MapConstants' 6 | 7 | function RoomTile({ tile, color }) { 8 | return ( 9 | 16 | ) 17 | } 18 | 19 | RoomTile.propTypes = { 20 | tile: Tile, 21 | color: PropTypes.string, 22 | } 23 | 24 | export default RoomTile 25 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/elements/TileObject.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import { Rect } from 'react-konva' 4 | import { OBJECT_BORDER_COLOR } from '../../../../util/colors' 5 | import { OBJECT_BORDER_WIDTH_IN_PIXELS, OBJECT_MARGIN_IN_PIXELS, TILE_SIZE_IN_PIXELS } from '../MapConstants' 6 | 7 | function TileObject({ positionX, positionY, color }) { 8 | return ( 9 | 18 | ) 19 | } 20 | 21 | TileObject.propTypes = { 22 | positionX: PropTypes.number.isRequired, 23 | positionY: PropTypes.number.isRequired, 24 | color: PropTypes.string.isRequired, 25 | } 26 | 27 | export default TileObject 28 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/elements/TilePlusIcon.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import { Group, Line } from 'react-konva' 4 | import { TILE_PLUS_COLOR } from '../../../../util/colors' 5 | import { TILE_PLUS_MARGIN_IN_PIXELS, TILE_PLUS_WIDTH_IN_PIXELS, TILE_SIZE_IN_PIXELS } from '../MapConstants' 6 | 7 | function TilePlusIcon({ x, y, scale = 1 }) { 8 | const linePoints = [ 9 | [ 10 | x + 0.5 * TILE_SIZE_IN_PIXELS * scale, 11 | y + TILE_PLUS_MARGIN_IN_PIXELS * scale, 12 | x + 0.5 * TILE_SIZE_IN_PIXELS * scale, 13 | y + TILE_SIZE_IN_PIXELS * scale - TILE_PLUS_MARGIN_IN_PIXELS * scale, 14 | ], 15 | [ 16 | x + TILE_PLUS_MARGIN_IN_PIXELS * scale, 17 | y + 0.5 * TILE_SIZE_IN_PIXELS * scale, 18 | x + TILE_SIZE_IN_PIXELS * scale - TILE_PLUS_MARGIN_IN_PIXELS * scale, 19 | y + 0.5 * TILE_SIZE_IN_PIXELS * scale, 20 | ], 21 | ] 22 | return ( 23 | 24 | {linePoints.map((points, index) => ( 25 | 33 | ))} 34 | 35 | ) 36 | } 37 | 38 | TilePlusIcon.propTypes = { 39 | x: PropTypes.number, 40 | y: PropTypes.number, 41 | scale: PropTypes.number, 42 | } 43 | 44 | export default TilePlusIcon 45 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/elements/WallSegment.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Line } from 'react-konva' 3 | import { WallSegment as WallSegmentShape } from '../../../../shapes' 4 | import { WALL_COLOR } from '../../../../util/colors' 5 | import { TILE_SIZE_IN_PIXELS, WALL_WIDTH_IN_PIXELS } from '../MapConstants' 6 | 7 | function WallSegment({ wallSegment }) { 8 | let points 9 | if (wallSegment.isHorizontal) { 10 | points = [ 11 | wallSegment.startPosX * TILE_SIZE_IN_PIXELS, 12 | wallSegment.startPosY * TILE_SIZE_IN_PIXELS, 13 | (wallSegment.startPosX + wallSegment.length) * TILE_SIZE_IN_PIXELS, 14 | wallSegment.startPosY * TILE_SIZE_IN_PIXELS, 15 | ] 16 | } else { 17 | points = [ 18 | wallSegment.startPosX * TILE_SIZE_IN_PIXELS, 19 | wallSegment.startPosY * TILE_SIZE_IN_PIXELS, 20 | wallSegment.startPosX * TILE_SIZE_IN_PIXELS, 21 | (wallSegment.startPosY + wallSegment.length) * TILE_SIZE_IN_PIXELS, 22 | ] 23 | } 24 | 25 | return 26 | } 27 | 28 | WallSegment.propTypes = { 29 | wallSegment: WallSegmentShape, 30 | } 31 | 32 | export default WallSegment 33 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/groups/GridGroup.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Group, Line } from 'react-konva' 3 | import { GRID_COLOR } from '../../../../util/colors' 4 | import { GRID_LINE_WIDTH_IN_PIXELS, MAP_SIZE, MAP_SIZE_IN_PIXELS, TILE_SIZE_IN_PIXELS } from '../MapConstants' 5 | 6 | const MAP_COORDINATE_ENTRIES = Array.from(new Array(MAP_SIZE), (x, i) => i) 7 | const HORIZONTAL_POINT_PAIRS = MAP_COORDINATE_ENTRIES.map((index) => [ 8 | 0, 9 | index * TILE_SIZE_IN_PIXELS, 10 | MAP_SIZE_IN_PIXELS, 11 | index * TILE_SIZE_IN_PIXELS, 12 | ]) 13 | const VERTICAL_POINT_PAIRS = MAP_COORDINATE_ENTRIES.map((index) => [ 14 | index * TILE_SIZE_IN_PIXELS, 15 | 0, 16 | index * TILE_SIZE_IN_PIXELS, 17 | MAP_SIZE_IN_PIXELS, 18 | ]) 19 | 20 | function GridGroup() { 21 | return ( 22 | 23 | {HORIZONTAL_POINT_PAIRS.concat(VERTICAL_POINT_PAIRS).map((points, index) => ( 24 | 31 | ))} 32 | 33 | ) 34 | } 35 | 36 | export default GridGroup 37 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/groups/RackGroup.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Group } from 'react-konva' 3 | import { Tile } from '../../../../shapes' 4 | import { RACK_BACKGROUND_COLOR } from '../../../../util/colors' 5 | import TileObject from '../elements/TileObject' 6 | import RackSpaceFillContainer from '../RackSpaceFillContainer' 7 | import RackEnergyFillContainer from '../RackEnergyFillContainer' 8 | 9 | function RackGroup({ tile }) { 10 | return ( 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ) 19 | } 20 | 21 | RackGroup.propTypes = { 22 | tile: Tile, 23 | } 24 | 25 | export default RackGroup 26 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/groups/TileGroup.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import { Group } from 'react-konva' 4 | import { Tile } from '../../../../shapes' 5 | import { ROOM_DEFAULT_COLOR, ROOM_IN_CONSTRUCTION_COLOR } from '../../../../util/colors' 6 | import RoomTile from '../elements/RoomTile' 7 | import RackContainer from '../RackContainer' 8 | 9 | function TileGroup({ tile, newTile, onClick }) { 10 | let tileObject 11 | if (tile.rack) { 12 | tileObject = 13 | } else { 14 | tileObject = null 15 | } 16 | 17 | let color = ROOM_DEFAULT_COLOR 18 | if (newTile) { 19 | color = ROOM_IN_CONSTRUCTION_COLOR 20 | } 21 | 22 | return ( 23 | onClick(tile)}> 24 | 25 | {tileObject} 26 | 27 | ) 28 | } 29 | 30 | TileGroup.propTypes = { 31 | tile: Tile, 32 | newTile: PropTypes.bool, 33 | onClick: PropTypes.func, 34 | } 35 | 36 | export default TileGroup 37 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/groups/TopologyGroup.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Group } from 'react-konva' 3 | import { InteractionLevel, Topology } from '../../../../shapes' 4 | import RoomContainer from '../RoomContainer' 5 | import GrayContainer from '../GrayContainer' 6 | 7 | function TopologyGroup({ topology, interactionLevel }) { 8 | if (!topology) { 9 | return 10 | } 11 | 12 | if (interactionLevel.mode === 'BUILDING') { 13 | return ( 14 | 15 | {topology.rooms.map((roomId) => ( 16 | 17 | ))} 18 | 19 | ) 20 | } 21 | 22 | return ( 23 | 24 | {topology.rooms 25 | .filter((roomId) => roomId !== interactionLevel.roomId) 26 | .map((roomId) => ( 27 | 28 | ))} 29 | {interactionLevel.mode === 'ROOM' ? : null} 30 | {topology.rooms 31 | .filter((roomId) => roomId === interactionLevel.roomId) 32 | .map((roomId) => ( 33 | 34 | ))} 35 | 36 | ) 37 | } 38 | 39 | TopologyGroup.propTypes = { 40 | topology: Topology, 41 | interactionLevel: InteractionLevel, 42 | } 43 | 44 | export default TopologyGroup 45 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/map/groups/WallGroup.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import { Group } from 'react-konva' 4 | import { Tile } from '../../../../shapes' 5 | import { deriveWallLocations } from '../../../../util/tile-calculations' 6 | import WallSegment from '../elements/WallSegment' 7 | 8 | function WallGroup({ tiles }) { 9 | return ( 10 | 11 | {deriveWallLocations(tiles).map((wallSegment, index) => ( 12 | 13 | ))} 14 | 15 | ) 16 | } 17 | 18 | WallGroup.propTypes = { 19 | tiles: PropTypes.arrayOf(Tile).isRequired, 20 | } 21 | 22 | export default WallGroup 23 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/sidebar/building/BuildingSidebar.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import NewRoomConstructionContainer from './NewRoomConstructionContainer' 3 | 4 | function BuildingSidebar() { 5 | return 6 | } 7 | 8 | export default BuildingSidebar 9 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitAddComponent.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React, { useState } from 'react' 3 | import { Button, InputGroup, Select, SelectOption, SelectVariant } from '@patternfly/react-core' 4 | import PlusIcon from '@patternfly/react-icons/dist/js/icons/plus-icon' 5 | 6 | function UnitAddComponent({ units, onAdd }) { 7 | const [isOpen, setOpen] = useState(false) 8 | const [selected, setSelected] = useState(null) 9 | 10 | return ( 11 | 12 | 30 | 33 | 34 | ) 35 | } 36 | 37 | UnitAddComponent.propTypes = { 38 | units: PropTypes.array.isRequired, 39 | onAdd: PropTypes.func.isRequired, 40 | } 41 | 42 | export default UnitAddComponent 43 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitType.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | import PropTypes from 'prop-types' 24 | 25 | export default PropTypes.oneOf(['cpus', 'gpus', 'memories', 'storages']) 26 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/sidebar/rack/MachineComponent.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import { Flex, Label } from '@patternfly/react-core' 4 | import { Machine } from '../../../../shapes' 5 | 6 | const UnitIcon = ({ id, type }) => ( 7 | // eslint-disable-next-line @next/next/no-img-element 8 | {'Machine 9 | ) 10 | 11 | UnitIcon.propTypes = { 12 | id: PropTypes.string, 13 | type: PropTypes.string, 14 | } 15 | 16 | function MachineComponent({ machine, onClick }) { 17 | const hasNoUnits = 18 | machine.cpus.length + machine.gpus.length + machine.memories.length + machine.storages.length === 0 19 | 20 | return ( 21 | onClick()}> 22 | {machine.cpus.length > 0 ? : undefined} 23 | {machine.gpus.length > 0 ? : undefined} 24 | {machine.memories.length > 0 ? : undefined} 25 | {machine.storages.length > 0 ? : undefined} 26 | {hasNoUnits ? ( 27 | 30 | ) : undefined} 31 | 32 | ) 33 | } 34 | 35 | MachineComponent.propTypes = { 36 | machine: Machine.isRequired, 37 | onClick: PropTypes.func, 38 | } 39 | 40 | export default MachineComponent 41 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/sidebar/rack/RackNameContainer.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import { useDispatch, useSelector } from 'react-redux' 4 | import NameComponent from '../NameComponent' 5 | import { editRackName } from '../../../../redux/actions/topology/rack' 6 | 7 | const RackNameContainer = ({ tileId }) => { 8 | const { name: rackName, id } = useSelector((state) => state.topology.racks[state.topology.tiles[tileId].rack]) 9 | const dispatch = useDispatch() 10 | const callback = (name) => { 11 | if (name) { 12 | dispatch(editRackName(id, name)) 13 | } 14 | } 15 | return 16 | } 17 | 18 | RackNameContainer.propTypes = { 19 | tileId: PropTypes.string.isRequired, 20 | } 21 | 22 | export default RackNameContainer 23 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/sidebar/rack/RackSidebar.module.css: -------------------------------------------------------------------------------- 1 | .sidebarContainer { 2 | display: flex; 3 | flex-direction: column; 4 | 5 | height: 100%; 6 | } 7 | 8 | .machineListContainer { 9 | overflow-y: auto; 10 | 11 | flex: 1 0 300px; 12 | 13 | margin-top: 10px; 14 | } 15 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/sidebar/room/RackConstructionComponent.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import { Button } from '@patternfly/react-core' 4 | import { PlusIcon, TimesIcon } from '@patternfly/react-icons' 5 | 6 | const RackConstructionComponent = ({ onStart, onStop, inRackConstructionMode, isEditingRoom }) => { 7 | if (inRackConstructionMode) { 8 | return ( 9 | 12 | ) 13 | } 14 | 15 | return ( 16 | 25 | ) 26 | } 27 | 28 | RackConstructionComponent.propTypes = { 29 | onStart: PropTypes.func, 30 | onStop: PropTypes.func, 31 | inRackConstructionMode: PropTypes.bool, 32 | isEditingRoom: PropTypes.bool, 33 | } 34 | 35 | export default RackConstructionComponent 36 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/topologies/sidebar/room/RoomSidebar.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import RoomName from './RoomName' 4 | import RackConstructionContainer from './RackConstructionContainer' 5 | import EditRoomContainer from './EditRoomContainer' 6 | import DeleteRoomContainer from './DeleteRoomContainer' 7 | import { 8 | TextContent, 9 | TextList, 10 | TextListItem, 11 | TextListItemVariants, 12 | TextListVariants, 13 | Title, 14 | } from '@patternfly/react-core' 15 | 16 | const RoomSidebar = ({ roomId }) => { 17 | return ( 18 | 19 | Details 20 | 21 | 25 | Name 26 | 27 | 28 | 29 | 30 | 31 | Construction 32 | 33 | 34 | 35 | 36 | ) 37 | } 38 | 39 | RoomSidebar.propTypes = { 40 | roomId: PropTypes.string.isRequired, 41 | } 42 | 43 | export default RoomSidebar 44 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/util/modals/ConfirmationModal.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import Modal from './Modal' 4 | 5 | function ConfirmationModal({ title, message, isOpen, callback }) { 6 | return ( 7 | callback(true)} 11 | onCancel={() => callback(false)} 12 | submitButtonType="danger" 13 | submitButtonText="Confirm" 14 | > 15 | {message} 16 | 17 | ) 18 | } 19 | 20 | ConfirmationModal.propTypes = { 21 | title: PropTypes.string.isRequired, 22 | message: PropTypes.string.isRequired, 23 | isOpen: PropTypes.bool.isRequired, 24 | callback: PropTypes.func.isRequired, 25 | } 26 | 27 | export default ConfirmationModal 28 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/components/util/modals/Modal.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | import { Button, Modal as PModal, ModalVariant } from '@patternfly/react-core' 4 | 5 | function Modal({ children, title, isOpen, onSubmit, onCancel, submitButtonType, submitButtonText }) { 6 | const actions = [ 7 | , 10 | , 13 | ] 14 | 15 | return ( 16 | 17 | {children} 18 | 19 | ) 20 | } 21 | 22 | Modal.propTypes = { 23 | title: PropTypes.string.isRequired, 24 | isOpen: PropTypes.bool, 25 | onSubmit: PropTypes.func.isRequired, 26 | onCancel: PropTypes.func.isRequired, 27 | submitButtonType: PropTypes.string, 28 | submitButtonText: PropTypes.string, 29 | children: PropTypes.node, 30 | } 31 | 32 | Modal.defaultProps = { 33 | submitButtonType: 'primary', 34 | submitButtonText: 'Save', 35 | isOpen: false, 36 | } 37 | 38 | export default Modal 39 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/pages/404.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Head from 'next/head' 3 | import { AppPage } from '../components/AppPage' 4 | import { 5 | Bullseye, 6 | EmptyState, 7 | EmptyStateBody, 8 | EmptyStateIcon, 9 | PageSection, 10 | PageSectionVariants, 11 | Title, 12 | } from '@patternfly/react-core' 13 | import { UnknownIcon } from '@patternfly/react-icons' 14 | 15 | const NotFound = () => { 16 | return ( 17 | 18 | 19 | Page Not Found - OpenDC 20 | 21 | 22 | 23 | 24 | 25 | 26 | 404: That page does not exist 27 | 28 | 29 | The requested page is not found. Try refreshing the page if it was recently added. 30 | 31 | 32 | 33 | 34 | 35 | ) 36 | } 37 | 38 | export default NotFound 39 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/redux/actions/topology/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | export const OPEN_TOPOLOGY = 'OPEN_TOPOLOGY' 24 | export const STORE_TOPOLOGY = 'STORE_TOPOLOGY' 25 | 26 | export function openTopology(projectId, id) { 27 | return { 28 | type: OPEN_TOPOLOGY, 29 | projectId, 30 | id, 31 | } 32 | } 33 | 34 | export function storeTopology(topology, entities) { 35 | return { 36 | type: STORE_TOPOLOGY, 37 | topology, 38 | entities, 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/redux/actions/topology/machine.js: -------------------------------------------------------------------------------- 1 | export const DELETE_MACHINE = 'DELETE_MACHINE' 2 | export const ADD_UNIT = 'ADD_UNIT' 3 | export const DELETE_UNIT = 'DELETE_UNIT' 4 | 5 | export function deleteMachine(machineId) { 6 | return { 7 | type: DELETE_MACHINE, 8 | machineId, 9 | } 10 | } 11 | 12 | export function addUnit(machineId, unitType, unitId) { 13 | return { 14 | type: ADD_UNIT, 15 | machineId, 16 | unitType, 17 | unitId, 18 | } 19 | } 20 | 21 | export function deleteUnit(machineId, unitType, unitId) { 22 | return { 23 | type: DELETE_UNIT, 24 | machineId, 25 | unitType, 26 | unitId, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/redux/actions/topology/rack.js: -------------------------------------------------------------------------------- 1 | import { v4 as uuid } from 'uuid' 2 | 3 | export const EDIT_RACK_NAME = 'EDIT_RACK_NAME' 4 | export const DELETE_RACK = 'DELETE_RACK' 5 | export const ADD_MACHINE = 'ADD_MACHINE' 6 | 7 | export function editRackName(rackId, name) { 8 | return { 9 | type: EDIT_RACK_NAME, 10 | name, 11 | rackId, 12 | } 13 | } 14 | 15 | export function deleteRack(tileId, rackId) { 16 | return { 17 | type: DELETE_RACK, 18 | rackId, 19 | tileId, 20 | } 21 | } 22 | 23 | export function addMachine(rackId, position) { 24 | return { 25 | type: ADD_MACHINE, 26 | machine: { 27 | id: uuid(), 28 | rackId, 29 | position, 30 | cpus: [], 31 | gpus: [], 32 | memories: [], 33 | storages: [], 34 | }, 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/redux/reducers/construction-mode.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux' 2 | import { GO_DOWN_ONE_INTERACTION_LEVEL } from '../actions/interaction-level' 3 | import { 4 | CANCEL_NEW_ROOM_CONSTRUCTION_SUCCEEDED, 5 | FINISH_NEW_ROOM_CONSTRUCTION, 6 | FINISH_ROOM_EDIT, 7 | START_NEW_ROOM_CONSTRUCTION_SUCCEEDED, 8 | START_ROOM_EDIT, 9 | } from '../actions/topology/building' 10 | import { DELETE_ROOM, START_RACK_CONSTRUCTION, STOP_RACK_CONSTRUCTION } from '../actions/topology/room' 11 | 12 | export function currentRoomInConstruction(state = '-1', action) { 13 | switch (action.type) { 14 | case START_NEW_ROOM_CONSTRUCTION_SUCCEEDED: 15 | return action.roomId 16 | case START_ROOM_EDIT: 17 | return action.roomId 18 | case CANCEL_NEW_ROOM_CONSTRUCTION_SUCCEEDED: 19 | case FINISH_NEW_ROOM_CONSTRUCTION: 20 | case FINISH_ROOM_EDIT: 21 | case DELETE_ROOM: 22 | return '-1' 23 | default: 24 | return state 25 | } 26 | } 27 | 28 | export function inRackConstructionMode(state = false, action) { 29 | switch (action.type) { 30 | case START_RACK_CONSTRUCTION: 31 | return true 32 | case STOP_RACK_CONSTRUCTION: 33 | case GO_DOWN_ONE_INTERACTION_LEVEL: 34 | return false 35 | default: 36 | return state 37 | } 38 | } 39 | 40 | export const construction = combineReducers({ 41 | currentRoomInConstruction, 42 | inRackConstructionMode, 43 | }) 44 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/redux/reducers/index.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux' 2 | import { construction } from './construction-mode' 3 | import { interactionLevel } from './interaction-level' 4 | import topology from './topology' 5 | 6 | const rootReducer = combineReducers({ 7 | topology, 8 | construction, 9 | interactionLevel, 10 | }) 11 | 12 | export default rootReducer 13 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/redux/sagas/index.js: -------------------------------------------------------------------------------- 1 | import { fork } from 'redux-saga/effects' 2 | import { watchServer, updateServer } from './topology' 3 | 4 | export default function* rootSaga() { 5 | yield fork(watchServer) 6 | yield fork(updateServer) 7 | } 8 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/style/index.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2021 AtLarge Research 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | body, 24 | #__next { 25 | height: 100%; 26 | 27 | background: #eee; 28 | } 29 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/util/authorizations.js: -------------------------------------------------------------------------------- 1 | import HomeIcon from '@patternfly/react-icons/dist/js/icons/home-icon' 2 | import EditIcon from '@patternfly/react-icons/dist/js/icons/edit-icon' 3 | import EyeIcon from '@patternfly/react-icons/dist/js/icons/eye-icon' 4 | 5 | export const AUTH_ICON_MAP = { 6 | OWNER: HomeIcon, 7 | EDITOR: EditIcon, 8 | VIEWER: EyeIcon, 9 | } 10 | 11 | export const AUTH_NAME_MAP = { 12 | OWNER: 'Owner', 13 | EDITOR: 'Editor', 14 | VIEWER: 'Viewer', 15 | } 16 | 17 | export const AUTH_DESCRIPTION_MAP = { 18 | OWNER: 'You own this project', 19 | EDITOR: 'You can edit this project', 20 | VIEWER: 'You can view this project', 21 | } 22 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/util/colors.js: -------------------------------------------------------------------------------- 1 | export const GRID_COLOR = 'rgba(0, 0, 0, 0.5)' 2 | export const BACKDROP_COLOR = 'rgba(255, 255, 255, 1)' 3 | export const WALL_COLOR = 'rgba(0, 0, 0, 1)' 4 | 5 | export const ROOM_DEFAULT_COLOR = 'rgba(150, 150, 150, 1)' 6 | export const ROOM_IN_CONSTRUCTION_COLOR = 'rgba(51, 153, 255, 1)' 7 | export const ROOM_HOVER_VALID_COLOR = 'rgba(51, 153, 255, 1)' 8 | export const ROOM_HOVER_INVALID_COLOR = 'rgba(255, 102, 0, 1)' 9 | export const ROOM_NAME_COLOR = 'rgba(245, 245, 245, 1)' 10 | export const ROOM_TYPE_COLOR = 'rgba(245, 245, 245, 1)' 11 | 12 | export const TILE_PLUS_COLOR = 'rgba(0, 0, 0, 1)' 13 | 14 | export const OBJECT_BORDER_COLOR = 'rgba(0, 0, 0, 1)' 15 | 16 | export const RACK_BACKGROUND_COLOR = 'rgba(170, 170, 170, 1)' 17 | export const RACK_SPACE_BAR_BACKGROUND_COLOR = 'rgba(222, 235, 247, 0.6)' 18 | export const RACK_SPACE_BAR_FILL_COLOR = 'rgba(91, 155, 213, 0.7)' 19 | export const RACK_ENERGY_BAR_BACKGROUND_COLOR = 'rgba(255, 242, 204, 0.6)' 20 | export const RACK_ENERGY_BAR_FILL_COLOR = 'rgba(244, 215, 0, 0.7)' 21 | export const COOLING_ITEM_BACKGROUND_COLOR = 'rgba(40, 50, 230, 1)' 22 | export const PSU_BACKGROUND_COLOR = 'rgba(230, 50, 60, 1)' 23 | 24 | export const GRAYED_OUT_AREA_COLOR = 'rgba(0, 0, 0, 0.6)' 25 | 26 | export const SIM_LOW_COLOR = 'rgba(197, 224, 180, 1)' 27 | export const SIM_MID_LOW_COLOR = 'rgba(255, 230, 153, 1)' 28 | export const SIM_MID_HIGH_COLOR = 'rgba(248, 203, 173, 1)' 29 | export const SIM_HIGH_COLOR = 'rgba(249, 165, 165, 1)' 30 | -------------------------------------------------------------------------------- /opendc-web/opendc-web-ui/src/util/date-time.test.js: -------------------------------------------------------------------------------- 1 | import { convertSecondsToFormattedTime } from './date-time' 2 | 3 | describe('tick formatting', () => { 4 | it("returns '0s' for numbers <= 0", () => { 5 | expect(convertSecondsToFormattedTime(-1)).toEqual('0s') 6 | expect(convertSecondsToFormattedTime(0)).toEqual('0s') 7 | }) 8 | it('returns only seconds for values under a minute', () => { 9 | expect(convertSecondsToFormattedTime(1)).toEqual('1s') 10 | expect(convertSecondsToFormattedTime(59)).toEqual('59s') 11 | }) 12 | it('returns seconds and minutes for values under an hour', () => { 13 | expect(convertSecondsToFormattedTime(60)).toEqual('1m00s') 14 | expect(convertSecondsToFormattedTime(61)).toEqual('1m01s') 15 | expect(convertSecondsToFormattedTime(3599)).toEqual('59m59s') 16 | }) 17 | it('returns full time for values over an hour', () => { 18 | expect(convertSecondsToFormattedTime(3600)).toEqual('1h00m00s') 19 | expect(convertSecondsToFormattedTime(3601)).toEqual('1h00m01s') 20 | }) 21 | }) 22 | --------------------------------------------------------------------------------