Skip to content

Commit

Permalink
Apply readout k8s resource requirements only if real hardware is used
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrothea committed Aug 24, 2023
1 parent 4aca3c8 commit 7074e42
Showing 1 changed file with 43 additions and 40 deletions.
83 changes: 43 additions & 40 deletions python/daqconf/apps/readout_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,52 +808,55 @@ def generate(
readout_app = App(mgraph, host=RU_DESCRIPTOR.host_name)


# Kubernetes-specific extensions
# FELIX
if RU_DESCRIPTOR.kind == 'flx':

c = card_override if card_override != -1 else RU_DESCRIPTOR.iface
readout_app.resources = {
f"felix.cern/flx{c}-data": "1", # requesting FLX{c}
# "memory": f"{}Gi" # yes bro
}
readout_app.pod_privileged = True

readout_app.mounted_dirs += [{
'name': 'devfs',
'physical_location': '/dev',
'in_pod_location': '/dev',
'read_only': False,
}]

# DPDK
elif RU_DESCRIPTOR.kind == 'eth':

readout_app.resources = {
f"intel.com/intel_sriov_dpdk": "1", # requesting sriov
}
if cfg.use_fake_cards:
pass
else:
# Kubernetes-specific extensions
# FELIX
if RU_DESCRIPTOR.kind == 'flx':

c = card_override if card_override != -1 else RU_DESCRIPTOR.iface
readout_app.resources = {
f"felix.cern/flx{c}-data": "1", # requesting FLX{c}
# "memory": f"{}Gi" # yes bro
}
readout_app.pod_privileged = True

readout_app.mounted_dirs += [
{
readout_app.mounted_dirs += [{
'name': 'devfs',
'physical_location': '/dev',
'in_pod_location': '/dev',
'read_only': False,
},
{
'name': 'linux-firmware',
'physical_location': '/lib/firmware',
'in_pod_location': '/lib/firmware',
'read_only': True,
}]

# DPDK
elif RU_DESCRIPTOR.kind == 'eth':

readout_app.resources = {
f"intel.com/intel_sriov_dpdk": "1", # requesting sriov
}
]

# Remove in favour of capabilites
readout_app.pod_privileged = True
readout_app.pod_capabilities += [
"IPC_LOCK",
"CAP_NET_ADMIN"
]

readout_app.mounted_dirs += [
{
'name': 'devfs',
'physical_location': '/dev',
'in_pod_location': '/dev',
'read_only': False,
},
{
'name': 'linux-firmware',
'physical_location': '/lib/firmware',
'in_pod_location': '/lib/firmware',
'read_only': True,
}
]

# Remove in favour of capabilites
readout_app.pod_privileged = True
readout_app.pod_capabilities += [
"IPC_LOCK",
"CAP_NET_ADMIN"
]

dir_names = set()

Expand Down

0 comments on commit 7074e42

Please sign in to comment.