PYQ Blog

「想成为真正的工程师」

OCI Runtime Specification——Configuration

OCI Runtime-Spec/config.json

OCI Runtime Spec Configuration 容器的配置文件包含了构建标准容器的元数据,包括用户指定进程、运行环境和环境变量等。 本篇介绍以Linux平台为主。 Specification version 只含ociVersion一个元素用于标识oci运行时规范版本号。 1 2 // string, REQUIRED "ociVersion": "0.1.0" ...

OCI Runtime Specification

OCI Runtime-Spec

本篇是对Open Container Initiative Runtime Specification的介绍,主要是Linux平台。 OCI Runtime-Spec主要包括对容器配置文件、运行环境和生命周期的规范: 容器的配置文件 (config.json),详细说明了创建容器的平台和其他详细信息 执行环境确保容器中的应用程序在不同运行时的环境一致 容器的生命周期定义了容...

NVIDIA-Container-Toolkit—源码阅读—hook

NVIDIA-Container-Toolkit—CodeReading—hook

nvidia-container-runtime-hook hook_config.go 定义的一些结构体和变量: 1 2 3 4 5 6 const ( configPath = "/etc/nvidia-container-runtime/config.toml" driverPath = "/run/nvidia/driver" ) var defaultPaths = [....

NVIDIA-Container-Toolkit—源码阅读—runtime

NVIDIA-Container-Toolkit—CodeReading—runtime

modifier stable.go 定义了一个stableRuntimeModifier结构体用于加入hook: 1 2 3 4 type stableRuntimeModifier struct { logger logger.Interface nvidiaContainerRuntimeHookPath string } ...

How GitHub contributions counts

why-are-your-contributions-not-showing-up-on-my-profile?

前言 “TL;DR”:给自己的repo提交了,但是并未显示在GitHub的profile中。一开始以为是private repo的原因,但是在profile中开启了private contributions也没有解决问题。 “RDTM”:why-are-my-contributions-not-showing-up-on-my-profile? Why? 只有如下操作计入contri...

NVIDIA-Container-Toolkit—源码阅读—ctk

NVIDIA-Container-Toolkit—CodeReading—ctk

nvidia-ctk main.go 定义了一个options结构体,用于表示CLI启动的模式,包括Debug和Quiet模式: 1 2 3 4 type options struct { Debug bool Quiet bool } main函数创建了一个叫nvidia-ctk的cli程序,flag包括–debug和–quiet,这两个flag和options中的两个变量相...

NVIDIA-Container-Toolkit—源码阅读—pkg

NVIDIA-Container-Toolkit—CodeReading—pkg

config enginee docker option.go 属于docker包。 定义的一些类型结构体:命名为builder应该是设计模式中的builder模式。 1 2 3 4 5 6 type builder struct { logger logger.Interface path string } // Option defines a function th...

NVIDIA-Container-Toolkit—源码阅读—tools

NVIDIA-Container-Toolkit—CodeReading—tools

tools/container tree 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 . ├── containerd │   ├── config_v1_test.go │   ├── config_v2_test.go │   └── containerd.go ├── container.go ...

Runc 创建、启动和删除容器的调用参数

How runc create, start and delete container?

runc是一个基于oci标准实现的一个轻量级容器运行工具,用来创建和运行容器。runc也是最流行的底层运行时工具,docker和k8s等均默认采用runc作为其底层运行时。通常我们不会直接去使用runc去创建和管理容器,也不建议我们直接去操作,而是由更高级的容器运行时(containerd、cri-o等)进行操作和管理。而用户则直接通过docker或者k8s提供的工具和命令与高级容器运行时进...

容器钩子

Container Hook

container hooks hooks 什么是钩子呢? Wikipedia中的定义如下。 In computer programming, the term hooking covers a range of techniques used to alter or augment the behavior of an operating system, of applica...