WWDC 2020

Keynote voide

WWDC 2020 Special Event Keynote — Apple

iOS

iOS 14 ,当前最新13.5.1

  • app组织管理(app organization) 和主屏管理(homescreen organization)
    • app library(分类文件夹?)
    • smart widgets 主屏幕小部件
    • smart stack
  • PiP Mode for video 画中画
  • siri: 界面更轻量
    • 语音识别
    • 翻译
  • iMessage Features
    • Memoji
    • Pinned conversation
    • Group
  • map
    • cycling
    • EV routing
  • CarPlay
    • BMW 5-series (car key) NFC
  • APPStore
    • App Clips(小程序,不需要安装)

iPad OS

  • iPadOS当前最新13.5.1 和iOS一样
  • watchOS 最新是6.2.6
  • iPad OS 14
  • photos
    • 浏览管理照片
  • music
  • siri
  • 电话
    • 不再全屏
  • 搜索

Apple Pencil

  • scribble 手写识别(中文当然是可以的 :-) )

AirPods

  • 多设备切换
  • surround sound

watch

  • share face
  • workout
    • Activity->Fitness
  • Health
  • hand-washing detection

Privacy

  • Tracking control

Home

  • lights
  • cameras

macOS

  • Big Sur
  • 照片
  • 地图
  • safari
    • 性能
    • 隐私
    • 默认背景
    • 多tabs,预览
    • 翻译

Apple silicon(chips)

  • 性能
    • Office
    • Adobe
    • Photoshop
    • Final cut Pro(视频)
    • Maya
    • Game

AWS Fargate

what is Farget

AWS Fargate is a serverless compute engine for containers that works with both Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS). Fargate makes it easy for you to focus on building your applications. Fargate removes the need to provision and manage servers, lets you specify and pay for resources per application, and improves security through application isolation by design.

  • You only pay for the resources required to run your containers
  • 独立的内核 & 安全隔离

收益

  • 部署管理自己的应用,不在管理基础设施(VM)
  • 便宜,也可以使用竞价实例(spot),用多少付多少
  • 安全隔离

EC2对比

  • 不需要管理VM(EC2 客户自己管理)
  • Fargate 按每秒付费
  • 运行的任务和EC2中的类似,也可以加入VPCs,LB,IAM

推荐场景

  • Machine Learning
  • CI/CD pipelines
  • Serverless

FireCracker

Secure and Fast microVM for Serverless Computing microVM

  • 解决overhead (对比VM,EC2),管理成本高
  • 事件驱动的场景(有事件,才需要计算,计算完成,释放资源)
  • 既要安全隔离,又要小的overhead

  • 使用KVM(Linux Kernel-based Virtual Machine)
  • 微VM
  • 安全、速度、效率
    • 只启动必须的linux内核
    • 指定特定的内核编译参数(内核编译有1000+项参数)
    • 不支持图形功能及图形加速器?
    • 不支持硬件直通?(passthrough)
    • 只支持 virtio net 和 virtio block
  • Open-source virtualization technology(microVM)
  • Security and siolation of traditional VMs
  • Speed and density of containers
  • Low resource overhead

  • security (基于VM)
  • Startup time ()
  • Utilization

  • Scale and efficiency (< 5MB memory)
  • Firecracker-Containerd
  • light as container, secure as VM

设计原则

  • Multi-tenant 多租户
  • 任意的vCPU和内存组合
  • 可超售 oversubscription permissible
  • 硬件是他的唯一限制(不会因为VMM占用资源太多??)

使用场景

  • AWS Lambda
  • 快速启动
  • 高密度部署

其他

  • Kata Containers, Weave FireKube 都集成了FireCracker
  • Unik
  • OSv

Secure and Fast microVM for Serverless Computing AWS re:Inforce 2019: Firecracker: Secure and Fast microVMs for Serverless Computing (SEP316)


k8s federation

what is federation

github

  • manage multiple, disparate Kubernetes clusters

Kubernetes Multi-cluster vs. Multi-tenant vs. Federation

  • Kubernetes Multi-tenancy : usually namespaces

examples

apiVersion: v1
kind: Namespace
metadata:
  name: nginx-test
---
apiVersion: types.kubefed.io/v1beta1
kind: FederatedNamespace
metadata:
  name: nginx-test
  namespace: nginx-test
spec:
  placement:
    clusters:
    - name: cluster1
    - name: cluster2
    - name: cluster3
apiVersion: types.kubefed.io/v1beta1
kind: FederatedDeployment
metadata:
  name: nginx-test
  namespace: nginx-test
spec:
  template:
    metadata:
      labels:
        app: nginx
    spec:
      replicas: 4
      selector:
        matchLabels:
          app: nginx
      template:
        metadata:
          labels:
            app: nginx
        spec:
          containers:
          - image: nginx
            name: nginx
  placement:
    clusters:
    - name: cluster1
    - name: cluster3

Kubernetes Federation: What it is and how to set it up


golang 开发环境

go docs

表达力强、简洁、干净、高效

Module |__package |__package

Go Modules

golang.org

新项目初始化Module

$ go mod init example.com/hello

// 使用测试或者build的方式,会自动加载依赖的Module
$ go test
$ go build ./...

//查看,依赖点 Modules
$ cat go.mod

$ go list -m all

更新依赖

// get the latest version of rsc.io/sampler
$ go get rsc.io/sampler

// list the available tagged versions of sampler
$ go list -m -versions rsc.io/sampler
rsc.io/sampler v1.0.0 v1.2.0 v1.2.1 v1.3.0 v1.3.1 v1.99.99

// get the specific version of sampler
$ go get rsc.io/sampler@v1.3.1

go build/install

$go env -w GOBIN=/path/to/your/bin
$go build
$go install
$go list -f ''

使用本地项目替换远程module

go mod edit -replace example.com/greetings=../greetings
  • 这串数字代表什么? require example.com/greetings v0.0.0-00010101000000-000000000000

The number following the module path is a pseudo-version number – a generated number used in place of a semantic version number (which the module doesn’t have yet).

移除不使用的

$go mod tidy

go mod 还可以直接把依赖的包,复制到vendor中

$go mod vendor

让vs code 识别到vendor目录

在vscode的setting中加入配置

{
    "go.toolsEnvVars": {
        "GOFLAGS": "-mod=vendor"
    }
}

language

struct & interface

  • 用户自定义类型
  • 方法
  • 内置类型 & 引用类型
  • 接口
  • 嵌入类型(内部类型属性提升到外部类型)
  • public & private
  • 函数及方法
  • 接口要小

Pointers & Values parameters

goroutine

golang使用逻辑的处理器概念。

array & slice

  • array
  • slice

map

  • 非线程安全
  • syn.Map

channel

  • channel
   ch := make(chan int)
  • buffered channel
   ch := make(chan int, 2)
  • 用channel并发编程,和内存共享的差异

sync.Mutex & sync.Cond

pool

system modules

testing framework

  • Unit Test
  • Benchmark Test

协程与锁

  • on the train

  • 泛型
  • generative code
  • map(hash table)

error

casbin

trace

  • opentracing
  • opentelemetry
  • opencensus

  • trace id format
  • zipkin/jaeger
  • skywalking
  • opentelemetry agent & sdk
  • oltp

  • GitOps
  • IaC
  • Oam

  • CI/CD tools
  • jenkins
  • certs
  • x509
  • openssl

  • TLS Handshake
  • ssl
  • resource allocation

  • Recommending
  • GC
  • Automated planning and scheduling
  • writing techniques
  • Zero Trust : Never Trust, always verify

  • football
  • pursue a differnent career path
  • find docker images which are suitable for initialization
  • infinitive
  • gerund
  • name/first name=given name/last name=family name
  • By the time I’m retired, …
  • By the time of the year, I …
  • Pagoda cave
  • train
  • missing way
  • perspective
  • semi-final

  • power distance
  • We are the champion
  • WAF/L7DDos

  • static website tools
  • Hugo/Jekyll
  • arc42

  • pixels

  • Mike
  • Present Simple
  • Present Continuous
  • cover letter
  • google: A quarter century(25)
  • Pay for Double tap?
  • pop/push
  • volatile-lru
  • request/response time
  • isolate worker
  • web security
  • A/AAAA
  • DNSSEC
  • http code
  • animals
  • hook
  • publicDNS
  • DNS over HTTPS
  • Moon festival
  • Driving: L2++?
  • National day
  • Best view of North
  • start a new journey
  • pages & workers
  • M2 Pro
  • registry
  • rotate & rolling-over
  • drawing

  • Goroutines
  • opentelemetry
  • TLS

kubernetes调度器scheduler

默认调度器

  • 可以运行在一个pod中
  • 监听pod的创建需求
  • 获取Node列表,并调度
  • 绑定pod和Node关系(告诉给API Server)

和API的关系

  • 独立的服务
  • 通过API的结果,监听、获取数据、提交绑定关系数据

自定义调度器

常用流量

  • 实现类似默认调度器的逻辑
  • 运行自定义调度器(pod)方式
  • 调度其他pod时,指定自定义调度器的名称

taint & tolerant

scheduler