From a832277c60198b607889ab92d126135fb18175fc Mon Sep 17 00:00:00 2001
From: Pierre Jacquot <pierre.jacquot@inria.fr>
Date: Mon, 15 Jan 2024 18:51:41 +0100
Subject: [PATCH] Basic config that generate ref-api

---
 .../lyon/clusters/test/nodes/test-1.json      | 89 +++++++++++++++++++
 .../lyon/clusters/test/nodes/test-2.json      | 89 +++++++++++++++++++
 .../sites/lyon/clusters/test/test.json        | 16 ++++
 input/grid5000/ipv4.yaml                      |  1 +
 .../sites/lyon/clusters/test/test.yaml        | 54 +++++++++++
 .../sites/lyon/clusters/test/test_ip.yaml.erb | 17 ++++
 6 files changed, 266 insertions(+)
 create mode 100644 data/grid5000/sites/lyon/clusters/test/nodes/test-1.json
 create mode 100644 data/grid5000/sites/lyon/clusters/test/nodes/test-2.json
 create mode 100644 data/grid5000/sites/lyon/clusters/test/test.json
 create mode 100644 input/grid5000/sites/lyon/clusters/test/test.yaml
 create mode 100644 input/grid5000/sites/lyon/clusters/test/test_ip.yaml.erb

diff --git a/data/grid5000/sites/lyon/clusters/test/nodes/test-1.json b/data/grid5000/sites/lyon/clusters/test/nodes/test-1.json
new file mode 100644
index 00000000000..874cba8849f
--- /dev/null
+++ b/data/grid5000/sites/lyon/clusters/test/nodes/test-1.json
@@ -0,0 +1,89 @@
+{
+  "architecture": {
+    "nb_cores": 32,
+    "nb_procs": 2,
+    "nb_threads": 64,
+    "platform_type": "x86_64"
+  },
+  "bios": {
+    "vendor": "Dell Inc."
+  },
+  "exotic": false,
+  "main_memory": {
+  },
+  "management_tools": {
+    "bmc_vendor_tool": "ipmitool",
+    "ipmitool": {
+      "retries": 5
+    }
+  },
+  "memory_devices": [
+
+  ],
+  "network_adapters": [
+    {
+      "device": "eth0",
+      "enabled": true,
+      "interface": "Ethernet",
+      "ip": "172.16.57.1",
+      "ip6": "2001:660:4406:400:10::1",
+      "kavlan": false,
+      "mac": "aa:bb:cc:dd:ee:ff",
+      "management": false,
+      "mountable": true,
+      "mounted": true,
+      "network_address": "test-1.lyon.grid5000.fr",
+      "switch": null,
+      "switch_port": null
+    },
+    {
+      "device": "bmc",
+      "enabled": true,
+      "interface": "Ethernet",
+      "ip": "172.17.63.1",
+      "kavlan": false,
+      "mac": "aa:bb:cc:dd:ee:af",
+      "management": true,
+      "mountable": false,
+      "mounted": false,
+      "network_address": "test-1-bmc.lyon.grid5000.fr"
+    }
+  ],
+  "performance": {
+    "core_flops": 67200000000,
+    "node_flops": 2150400000000
+  },
+  "processor": {
+    "cache_l1": null,
+    "clock_speed": 2100000000,
+    "microarchitecture": "Ice Lake",
+    "other_description": "Intel(R) Xeon(R) Gold 5118 CPU @ 2.30GHz"
+  },
+  "software": {
+    "forced-deployment-timestamp": 202007300948,
+    "postinstall-version": "1.2023121409",
+    "standard-environment": "debian11-x64-std"
+  },
+  "storage_devices": [
+    {
+      "by_id": "",
+      "by_path": "/dev/disk/by-path/dummy",
+      "id": "disk0",
+      "interface": "SAS",
+      "model": "unknown",
+      "storage": "SSD",
+      "vendor": "Unknown"
+    }
+  ],
+  "supported_job_types": {
+    "besteffort": true,
+    "deploy": true,
+    "max_walltime": 0,
+    "queues": [
+      "admin",
+      "testing"
+    ]
+  },
+  "type": "node",
+  "uid": "test-1"
+}
\ No newline at end of file
diff --git a/data/grid5000/sites/lyon/clusters/test/nodes/test-2.json b/data/grid5000/sites/lyon/clusters/test/nodes/test-2.json
new file mode 100644
index 00000000000..abe34dac4ac
--- /dev/null
+++ b/data/grid5000/sites/lyon/clusters/test/nodes/test-2.json
@@ -0,0 +1,89 @@
+{
+  "architecture": {
+    "nb_cores": 32,
+    "nb_procs": 2,
+    "nb_threads": 64,
+    "platform_type": "x86_64"
+  },
+  "bios": {
+    "vendor": "Dell Inc."
+  },
+  "exotic": false,
+  "main_memory": {
+  },
+  "management_tools": {
+    "bmc_vendor_tool": "ipmitool",
+    "ipmitool": {
+      "retries": 5
+    }
+  },
+  "memory_devices": [
+
+  ],
+  "network_adapters": [
+    {
+      "device": "eth0",
+      "enabled": true,
+      "interface": "Ethernet",
+      "ip": "172.16.57.2",
+      "ip6": "2001:660:4406:400:10::2",
+      "kavlan": false,
+      "mac": "aa:bb:cc:dd:ee:fe",
+      "management": false,
+      "mountable": true,
+      "mounted": true,
+      "network_address": "test-2.lyon.grid5000.fr",
+      "switch": null,
+      "switch_port": null
+    },
+    {
+      "device": "bmc",
+      "enabled": true,
+      "interface": "Ethernet",
+      "ip": "172.17.63.2",
+      "kavlan": false,
+      "mac": "aa:bb:cc:dd:ee:ae",
+      "management": true,
+      "mountable": false,
+      "mounted": false,
+      "network_address": "test-2-bmc.lyon.grid5000.fr"
+    }
+  ],
+  "performance": {
+    "core_flops": 67200000000,
+    "node_flops": 2150400000000
+  },
+  "processor": {
+    "cache_l1": null,
+    "clock_speed": 2100000000,
+    "microarchitecture": "Ice Lake",
+    "other_description": "Intel(R) Xeon(R) Gold 5118 CPU @ 2.30GHz"
+  },
+  "software": {
+    "forced-deployment-timestamp": 202007300948,
+    "postinstall-version": "1.2023121409",
+    "standard-environment": "debian11-x64-std"
+  },
+  "storage_devices": [
+    {
+      "by_id": "",
+      "by_path": "/dev/disk/by-path/dummy",
+      "id": "disk0",
+      "interface": "SAS",
+      "model": "unknown",
+      "storage": "SSD",
+      "vendor": "Unknown"
+    }
+  ],
+  "supported_job_types": {
+    "besteffort": true,
+    "deploy": true,
+    "max_walltime": 0,
+    "queues": [
+      "admin",
+      "testing"
+    ]
+  },
+  "type": "node",
+  "uid": "test-2"
+}
\ No newline at end of file
diff --git a/data/grid5000/sites/lyon/clusters/test/test.json b/data/grid5000/sites/lyon/clusters/test/test.json
new file mode 100644
index 00000000000..b1ec0d74c08
--- /dev/null
+++ b/data/grid5000/sites/lyon/clusters/test/test.json
@@ -0,0 +1,16 @@
+{
+  "boot_type": "bios",
+  "created_at": "Mon, 15 Jan 2024 00:00:00 GMT",
+  "exotic": false,
+  "kavlan": false,
+  "metrics": [
+
+  ],
+  "model": "test",
+  "queues": [
+    "admin",
+    "testing"
+  ],
+  "type": "cluster",
+  "uid": "test"
+}
\ No newline at end of file
diff --git a/input/grid5000/ipv4.yaml b/input/grid5000/ipv4.yaml
index 948425c9d2c..ba2d03db325 100644
--- a/input/grid5000/ipv4.yaml
+++ b/input/grid5000/ipv4.yaml
@@ -35,6 +35,7 @@ ipv4:
       lyon neowise eth0 0 0 7 0
       lyon neowise eth1 0 0 7 10
       lyon sirius eth0 0 0 8 0
+      lyon test eth0 0 0 9 0
       nancy graffiti eth2 0 0 0 0
       nancy gros eth0 0 0 2 0
       nancy gros eth1 0 0 2 128
diff --git a/input/grid5000/sites/lyon/clusters/test/test.yaml b/input/grid5000/sites/lyon/clusters/test/test.yaml
new file mode 100644
index 00000000000..a39ddbdb3d6
--- /dev/null
+++ b/input/grid5000/sites/lyon/clusters/test/test.yaml
@@ -0,0 +1,54 @@
+model: test #TODO: change me !
+created_at: 2024-01-15 #TODO: change me !
+kavlan: false
+boot_type: bios #TODO: change me ! ('bios' / 'uefi')
+exotic: false
+queues:
+  - admin
+  - testing
+nodes:
+  test-[1-2]: #TODO: change me !  
+    supported_job_types:
+      deploy: true
+      besteffort: true
+      max_walltime: 0
+    architecture:
+      nb_procs: 2 # TODO: change me !
+      nb_cores: 32 # TODO: change me !
+      nb_threads: 64 # TODO: change me !
+      platform_type: x86_64 #TODO: change me !
+    bios:
+      vendor: Dell Inc. # This value will be updated by g5k-checks
+    processor:
+      # TODO: change microarchitecture and remove the comments below once
+      #       it's done.
+      # see https://en.wikipedia.org/wiki/List_of_Intel_Xeon_microprocessors View Xeon processor list
+      # or see https://en.wikipedia.org/wiki/List_of_AMD_CPU_microarchitectures AMD processor list
+      microarchitecture: Ice Lake
+      clock_speed: 2100000000 # This value will be updated by g5k_checks
+      other_description: Intel(R) Xeon(R) Gold 5118 CPU @ 2.30GHz # This value will be updated by g5k-checks
+    memory_devices: []
+    software:
+      standard-environment: debian11-x64-std
+    management_tools:
+      bmc_vendor_tool: ipmitool # TODO: change me !
+    network_adapters:
+      bmc:
+        interface: Ethernet
+        management: true
+        enabled: true 
+        mountable: false 
+        mounted: false 
+      eth0:
+        interface: Ethernet
+        management: false
+        enabled: true
+        mountable: true
+        mounted: true
+    storage_devices:
+      disk0:
+        id: disk0
+        interface: SAS
+        storage: SSD
+        model: unknown
+        by_path: "/dev/disk/by-path/dummy"
diff --git a/input/grid5000/sites/lyon/clusters/test/test_ip.yaml.erb b/input/grid5000/sites/lyon/clusters/test/test_ip.yaml.erb
new file mode 100644
index 00000000000..e2fb0b56d28
--- /dev/null
+++ b/input/grid5000/sites/lyon/clusters/test/test_ip.yaml.erb
@@ -0,0 +1,17 @@
+nodes:
+  <% (1..2).each { |i| %>
+  test-<%= i %>:
+    network_adapters:
+      eth0:
+        ip: 172.16.63.<%= i %>
+        mac: <%= %w(
+          aa:bb:cc:dd:ee:ff
+          aa:bb:cc:dd:ee:fe
+        )[i-1] %>
+      bmc:
+        ip: 172.17.63.<%= i %>
+        mac: <%= %w(
+          aa:bb:cc:dd:ee:af
+          aa:bb:cc:dd:ee:ae
+        )[i-1] %>
+    <% } %>
-- 
GitLab