Skip to content

Instantly share code, notes, and snippets.

package api
import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
DevMgmtAPIVersion = "devmgmtproto.k8s.io/v1alpha1"
)
@klueska
klueska / nodeResourceSlice.go
Created February 12, 2024 10:24
NodeResourceSliceSpec
package main
import (
semverv4 "github.com/blang/semver/v4"
"k8s.io/apimachinery/pkg/api/resource"
)
type NodeResourceSliceSpec struct {
// NodeName identifies the node where the capacity is available.
// A field selector can be used to list only NodeResources
diff --git a/pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go b/pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go
index cea6317257e..bdec8984139 100644
--- a/pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go
+++ b/pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go
@@ -44,10 +44,9 @@ func (s *server) RegisterPlugin(pluginName string, endpoint string, versions []s
func (s *server) DeRegisterPlugin(pluginName string) {
klog.V(2).InfoS("Deregistering plugin", "plugin", pluginName)
- s.mutex.Lock()
- defer s.mutex.Unlock()
# Run the export command of nvidia-mig-parted
nvidia-mig-parted export
# Show nvidia-smi on the host with 8 full GPUs
nvidia-smi -L
# List out the NVIDIA container toolkit packages installed
dpkg -l | grep nvidia-container; dpkg -l | grep nvidia-docker
# Show that docker is configured to run with the nvidia container toolkit
layout title date slug
blog
Kubernetes Topology Manager Moves to Beta - Align Up!
2020-03-30
kubernetes-1-18-feature-topoloy-manager-beta

Authors: Kevin Klues (NVIDIA), Victor Pickard (RedHat), Conor Nolan (Intel)

This blog post describes the TopologyManager, a beta feature of Kubernetes in release 1.18. The TopologyManager feature enables NUMA alignment of CPUs and peripheral devices (such as SR-IOV VFs and GPUs), allowing your workload to run in an environment optimized for low-latency.

--- blog-orig.md 2020-03-31 13:06:09.899071690 +0200
+++ blog.md 2020-03-31 13:04:49.594078489 +0200
@@ -7,46 +7,52 @@
**Authors:** Kevin Klues (NVIDIA), Victor Pickard (RedHat), Conor Nolan (Intel)
-This blog post describes the **<code>TopologyManager</code>**, a beta feature of Kubernetes in release 1.18. The <strong><code>TopologyManager</code></strong> feature enables NUMA alignment of CPUs and peripheral devices (such as SR-IOV VFs and GPUs), allowing your workload to run in an environment optimized for low-latency.
+This blog post describes the **<code>TopologyManager</code>**, a beta feature of Kubernetes in release 1.18. The **<code>TopologyManager</code>** feature enables NUMA alignment of CPUs and peripheral devices (such as SR-IOV VFs and GPUs), allowing your workload to run in an environment optimized for low-latency.
-Prior to the introduction of the **<code>TopologyManager</code>**, the CPU and Device Manager would make resource allocation decisions independent of each other. This could resu
#!/usr/bin/env bash
# Declare some helper functions
function get_kubernetes_hostname() {
local json="$(kubectl get nodes -o json)"
echo ${json} | python -c "$(cat << EOF
import sys
import json
nodes = json.load(sys.stdin)
import itertools
import prettytable
from prettytable import PrettyTable
affinities = [
(0,1),
(1,0),
(1,1),
]
$ mesos --help
Mesos CLI
Usage:
mesos (-h | --help)
mesos --version
mesos <command> [<args>...]
Options:
-h --help Show this screen.
#!/bin/bash
declare -a pids
NUM_LOGGERS=$1
cleanup() {
echo "Caught SIGINT/HUP/TERM - Cleaning up PIDs.."
for p in ${pids[@]}
do
echo "Cleaning up PID ${p}"