Skip to content

Instantly share code, notes, and snippets.

View chenchun's full-sized avatar
🦖
go for{vacation()}

Chun Chen chenchun

🦖
go for{vacation()}
View GitHub Profile
@chenchun
chenchun / MagicScaler.md
Last active September 11, 2023 09:41
MagicScaler: Uncertainty-aware, Predictive Autoscaling

SUMMARISE

我读到的主要的一些亮点:

  1. 阿里云机器需求是高度不确定的(因为集群是多租户需求的总和),使用高斯过程来量化t+1时刻的不确定性
  2. 使用transformer模型中的attention机制来学习时间序列中复杂的依赖模式(非论文原创,之前一些论文也有这样的思路),设计了一种新颖的基于多尺度注意力算法来提取时间序列的特征
  3. 将scaler的缩放过程建模为强化学习中的MDP过程
  4. 使用蒙特卡洛方法,即采样有限视野的值来近似未来无限时间的最优成本策略

ABSTRACT

@chenchun
chenchun / flag-2022.md
Last active February 8, 2022 03:19
2022年flag
  • coursera上完成4门课程
    • 机器学习
    • 神经网络
    • 算法2
    • 游戏
  • 刷题
    • leetcode上刷100道
  • 吉他弹奏三首歌
    • 老男孩
  • 钢琴两首歌(TODO)
@chenchun
chenchun / machine_learning.md
Last active May 30, 2022 14:17
#coursera #Machine Learning #机器学习

title: 机器学习学习笔记

第一周

  • Superivsed Learning
    • regression(规划)类问题,根据已有的房子销售情况预测房子估价
    • classification(分类)问题,将乳腺癌根据肿瘤大小、患者年龄等标签分为良性和恶心肿瘤
  • Unsupervised Learning 给出一些数据,自动发现数据的数据结构、分类
    • 谷歌新闻分类
  • 基因分类,分为人群,国家
@chenchun
chenchun / kubernetes_cgroup.md
Last active January 19, 2021 08:00
kubernetes cgroup

Node Allocatable

这是一个用于说明节点可分配(Node Allocatable)计算方式的示例:

节点拥有 32Gi memeory,16 CPU 和 100Gi Storage 资源

  • --kube-reserved 被设置为 cpu=1,memory=2Gi,ephemeral-storage=1Gi
  • --system-reserved 被设置为 cpu=500m,memory=1Gi,ephemeral-storage=1Gi
  • --eviction-hard 被设置为 memory.available<500Mi,nodefs.available<10%
@chenchun
chenchun / create_crd.sh
Created July 23, 2020 08:31
scale test
cat <<EOF | kubectl create -f -
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: tapps.apps.tkestack.io
spec:
group: apps.tkestack.io
version: v1
names:
kind: TApp
@chenchun
chenchun / scale.md
Last active February 19, 2021 09:28
kuberentes scale api
token=$(cat ~/.kube/config  | grep token | awk -F: '{print $2}' | awk '{print $1}')
echo $token
server=$(cat ~/.kube/config | grep server | awk -F"server: " '{print $2}')
echo $server $token

curl -k -H "Authorization: Bearer ${token}" "${server}/apis/apps/v1/namespaces/default/statefulsets/ramists/scale"

{
@chenchun
chenchun / client.go
Created June 23, 2020 02:12
golang unixsocket
package main
import (
"bytes"
"flag"
"io/ioutil"
"log"
"net"
"net/http"
"net/http/httputil"
@chenchun
chenchun / grafana.md
Last active October 15, 2021 06:36
metrics server, prometheus, vpa
wget https://get.helm.sh/helm-v3.2.1-linux-amd64.tar.gz
tar -zxvf helm-v3.2.1-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm repo update
helm install grafana stable/grafana
kubectl port-forward --address 0.0.0.0 -n default svc/grafana 8081:80
# grafana password
kubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
@chenchun
chenchun / vps
Created February 28, 2020 04:46 — forked from hex108/vps
Manage(start/stop/status) vps on DigitalOcean. You could install shadowsocks automatically when creating a new vps.
#!/bin/bash
set -e
set -u
#set -x
SSH_KEY="05:8b:8f:f5:09:35:ae:61:a9:3b:21:ea:1c:36:bf:0c"
USER_DATA_FILE="$(dirname $0)/vps.userdata"
### sub functions