Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/modeling.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ TechnologySystemSoftware, TechnologyService, TechnologyArtifact). The same princ
down to the team, which points to nothing further. On a TechnologyFacility, `servedBy` stays the operator of
the site.
14. A client device (developer workstation, laptop, phone) is a `TechnologyDevice` with a client `device/type` and
`device/os`, `device/osVersion`, `device/arch`, `device/ownership`, `device/managed` and `device/encryption`; the
`device/os`, `device/osVersion`, `device/arch` (the CPU generation of a server is `device/cpu`, the exact model `device/cpuModel`), `device/ownership`, `device/managed` and `device/encryption`; the
vendor and product are in `device/model` (also for a hardened workstation that runs the user's operating system
virtualized beside other isolated sessions, which is a `workstation`). Model the individual machine when it is
inventoried, otherwise one `TechnologyNode` per client platform `realizedBy` the devices. The operating system is
Expand Down
6 changes: 6 additions & 0 deletions examples/archsight/technology/devices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ metadata:
device/type: server
device/role: hypervisor
device/model: 2U server
device/arch: x86_64
device/cpu: Ice Lake
spec:
locatedAt:
technologyFacilities:
Expand All @@ -28,6 +30,8 @@ metadata:
device/type: server
device/role: hypervisor
device/model: 2U server
device/arch: x86_64
device/cpu: Ice Lake
spec:
locatedAt:
technologyFacilities:
Expand Down Expand Up @@ -95,6 +99,8 @@ metadata:
device/type: server
device/role: hypervisor
device/model: 2U server
device/arch: x86_64
device/cpu: Sapphire Rapids
spec:
locatedAt:
technologyFacilities:
Expand Down
14 changes: 14 additions & 0 deletions lib/archsight/resources/technology_device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ class Archsight::Resources::TechnologyDevice < Archsight::Resources::Base
- Who uses it is the team or role (`servedBy`), not a person; a client device needs no room, `locatedAt` an
office is optional

## CPU generation

`device/arch` is the instruction set; `device/cpu` is the microarchitecture or generation ("Ice Lake",
"Zen 5") and `device/cpuModel` the exact model number. Hosts of one generation share the CPU features a VM can
be given and the live-migration domain, so `device/cpu == "Ice Lake"` lists them. The vendor product of the
machine stays in `device/model`.

## Not this kind

- A VM, a Kubernetes node or a host role is a `TechnologyNode`
Expand Down Expand Up @@ -115,6 +122,13 @@ class Archsight::Resources::TechnologyDevice < Archsight::Resources::Base
title: "Architecture",
enum: %w[x86_64 arm64 riscv64 other],
filter: :word
annotation "device/cpu",
description: "CPU microarchitecture or generation, e.g. Ice Lake, Sierra Forest, Zen 5",
title: "CPU",
filter: :word
annotation "device/cpuModel",
description: "Exact CPU model number, e.g. Xeon Gold 6338",
title: "CPU Model"
annotation "device/ownership",
description: "Who owns the device",
title: "Ownership",
Expand Down
8 changes: 8 additions & 0 deletions test/technology_device_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,14 @@ def test_client_device_types_and_attributes_are_enums
assert_empty klass.annotations.select { |a| a.key.start_with?("device/") && a.enum }.map(&:key) - klass.annotations.select(&:filterable?).map(&:key)
end

def test_cpu_generation_is_a_filterable_free_text_annotation
klass = Archsight::Resources::TechnologyDevice

assert_predicate klass.annotation_matching("device/cpu"), :filterable?
assert klass.annotation_matching("device/cpu").valid?("Sapphire Rapids")
assert_equal "CPU Model", klass.annotation_matching("device/cpuModel").title
end

def test_the_operating_system_is_a_summary_annotation_within_the_limit
summary = Archsight::Resources::TechnologyDevice.summary_annotations.map(&:key)

Expand Down
Loading