|
| 1 | + |
| 2 | + |
| 3 | +# In this How-To we explain how you setup IntelliJ IDEA |
| 4 | + |
| 5 | +First of all you can download IntelliJ here: https://lp.jetbrains.com/intellij-idea-promo/ |
| 6 | + |
| 7 | +# Basic steps |
| 8 | + |
| 9 | +``` |
| 10 | +git clone git@github.com:atlarge-research/opendc |
| 11 | +``` |
| 12 | + |
| 13 | +Check if you have a compatible java version available. Make sure to have one of these versions available: [19, 20, 21] |
| 14 | + |
| 15 | +If not install a supported version! |
| 16 | + |
| 17 | +On a MAC |
| 18 | + |
| 19 | +``` |
| 20 | +/usr/libexec/java_home -V |
| 21 | +``` |
| 22 | + |
| 23 | +On Debian |
| 24 | + |
| 25 | +``` |
| 26 | +update-alternatives --list java |
| 27 | +``` |
| 28 | + |
| 29 | +On Redhat/Centos |
| 30 | + |
| 31 | +``` |
| 32 | +yum list installed | grep java |
| 33 | +``` |
| 34 | + |
| 35 | + |
| 36 | +Open the project in IntelliJ |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +Now fix the settings so that you use the correct java version. (In the example the java version is set to "21") |
| 41 | +Navigation path in the settings pannel: "Build, Execution, Deployment" -> "Build Tools" -> "Gradle" |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +Now navigate in the file menu to and open the file: "gradle"/"libs.versions.toml" |
| 46 | + |
| 47 | +Make sure the java version is set to the same version as previously cofigured in the settings. |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +Now open the Gradle panel on the right-hand side of the editor (1) and hit the refresh button at the top of the panel (2). |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +# Setup your first experiment and run it from source |
| 58 | + |
| 59 | + |
| 60 | +Create a directory where you are going to put the files for your first experiment. |
| 61 | + |
| 62 | +File structure: |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +You can download the example workload trace (bitbrains-small-9d2e576e6684ddc57c767a6161e66963.zip) [here](https://atlarge-research.github.io/opendc/assets/files/bitbrains-small-9d2e576e6684ddc57c767a6161e66963.zip) |
| 67 | + |
| 68 | +Now unzip the trace. |
| 69 | + |
| 70 | +The content of "topology.json" |
| 71 | + |
| 72 | +``` |
| 73 | +{ |
| 74 | + "clusters": |
| 75 | + [ |
| 76 | + { |
| 77 | + "name": "C01", |
| 78 | + "hosts" : |
| 79 | + [ |
| 80 | + { |
| 81 | + "name": "H01", |
| 82 | + "cpu": |
| 83 | + { |
| 84 | + "coreCount": 32, |
| 85 | + "coreSpeed": 3200 |
| 86 | + }, |
| 87 | + "memory": { |
| 88 | + "memorySize": 256000 |
| 89 | + } |
| 90 | + } |
| 91 | + ] |
| 92 | + }, |
| 93 | + { |
| 94 | + "name": "C02", |
| 95 | + "hosts" : |
| 96 | + [ |
| 97 | + { |
| 98 | + "name": "H02", |
| 99 | + "count": 6, |
| 100 | + "cpu": |
| 101 | + { |
| 102 | + "coreCount": 8, |
| 103 | + "coreSpeed": 2930 |
| 104 | + }, |
| 105 | + "memory": { |
| 106 | + "memorySize": 64000 |
| 107 | + } |
| 108 | + } |
| 109 | + ] |
| 110 | + }, |
| 111 | + { |
| 112 | + "name": "C03", |
| 113 | + "hosts" : |
| 114 | + [ |
| 115 | + { |
| 116 | + "name": "H03", |
| 117 | + "count": 2, |
| 118 | + "cpu": |
| 119 | + { |
| 120 | + "coreCount": 16, |
| 121 | + "coreSpeed": 3200 |
| 122 | + }, |
| 123 | + "memory": { |
| 124 | + "memorySize": 128000 |
| 125 | + } |
| 126 | + } |
| 127 | + ] |
| 128 | + } |
| 129 | + ] |
| 130 | +} |
| 131 | +``` |
| 132 | + |
| 133 | +The content of "experiment.json" |
| 134 | + |
| 135 | +The paths in the "experiment.json" file are relative to the "working directory" which is configured next. |
| 136 | + |
| 137 | + |
| 138 | +``` |
| 139 | +{ |
| 140 | + "name": "simple", |
| 141 | + "topologies": [{ |
| 142 | + "pathToFile": "topology.json" |
| 143 | + }], |
| 144 | + "workloads": [{ |
| 145 | + "pathToFile": "bitbrains-small", |
| 146 | + "type": "ComputeWorkload" |
| 147 | + }] |
| 148 | +} |
| 149 | +``` |
| 150 | + |
| 151 | +In the project file structure on the left open the following file: |
| 152 | + |
| 153 | +"opendc-experiments"/"opendc-experiments-base"/"src"/"main"/"kotlin"/"org.opendc.experiment.base"/"runner"/"ExperimentCLi.kt" |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | +Now open the "Run/Debug" configuration (top right). |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | +We need to edit two settings: |
| 162 | + |
| 163 | +"Program arguments": --experiment-path experiment.json |
| 164 | + |
| 165 | +"Working Directory": a path where you have put the experiment files |
| 166 | + |
| 167 | + |
| 168 | + |
| 169 | +Now you can click "Run" and start your first experiment. |
| 170 | + |
| 171 | +In the working directory a "output" direcotry is created with the results of the experiment. |
| 172 | + |
0 commit comments