Skip to content

Instantly share code, notes, and snippets.

View travishen's full-sized avatar
🎹
Play till the end.

ssivart travishen

🎹
Play till the end.
View GitHub Profile
graph TD
  a[("snaphsot3(active)")] --> b[("snaphsot2(committed)")]
  b --> c[("snaphsot1(committed)")]
  c --> d[("snaphsot0(committed)")]
graph LR
    subgraph a[Clients]
        a1[kubectl]
        a2[docker]
        a3[ctr]
    end
    subgraph b[Container engine]
        b1[kubernetes]
 b2[dockerd]
指令 儲存 能否並行
docker build 基於 containerd 的原始 content,透過 Dockerfile 定義去操作 content layer by layer,無法並行建構
docker buildx build 基於 containerd 的 content 抽象層 snapshot,透過一個後端服務 (LLB) 來操作 snapshot,得益於 snapshot 的特性,可以拿來建構更複雜更有彈性的依賴結構 資料結構是 DAG,相同 parent 的 node 可以並行建構

BuildKit Survey

experiment 1

  1. Create a simple Dockerfile to build an apline image.
  2. Use build and buildx build to build the same Dockerfile.
  3. Examine the image layer.

Dockerfile

Example Postmortem

Shakespeare Sonnet++ Postmortem (incident #465)

Date: 2015-10-21

Authors: jennifer, martym, agoogler

Example Incident State Document

Shakespeare Sonnet++ Overload: 2015-10-21
Incident management info: https://incident-management-cheat-sheet

(Communications lead to keep summary updated.)
Summary: Shakespeare search service in cascading failure due to newly discovered sonnet not in search index.

Status: active, incident #465

class EntityMeta(type):
"""Metaclass for business entities with validated fields"""
def __init__(cls, name, bases, attr_dict):
# handover to type.__init__
super().__init__(name, bases, attr_dict)
for key, attr in attr_dict.items():
if isinstance(attr, Validated):
type_name = type(attr).__name__
attr.storage_name = f'_{type_name}#{key}'
def record_factory(cls_name, field_names):
try:
field_names = field_names.replace(',', ' ').split()
except AttributeError:
pass
filed_names = tuple(field_names)
def __init__(self, *args, **kwargs):
attrs = dict(zip(self.__slots__, args))
attrs.update(kwargs)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class Quantity:
__counter = 0
def __init__(self):
cls = self.__class__
self.storage_name = f'_{cls.__name__}#{cls.__counter}'
cls.__counter += 1
def __get__(self, instance, owner): # `owner` is the ref of the managed class
if instance is None: