Skip to content

Instantly share code, notes, and snippets.

View samos123's full-sized avatar
🎯
Focusing

Sam Stoelinga samos123

🎯
Focusing
View GitHub Profile
@samos123
samos123 / kubelet-stat.json
Created November 26, 2019 00:46
You can get these stats by doing curl localhost:10255/stats/summary on a gke node
{
"node": {
"nodeName": "gke-standard-cluster-1-default-pool-8fd0527d-sv9q",
"systemContainers": [
{
"name": "runtime",
"startTime": "2019-11-26T00:38:22Z",
"cpu": {
"time": "2019-11-26T00:45:50Z",
"usageNanoCores": 28894845,
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: iperf3-server
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: iperf3-server
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: customizations
labels:
app: customizations
spec:
selector:
matchLabels:
app: customizations
#!/bin/bash
set -x
export MAIN_CLUSTER_CTX=main-1
export MAIN_CLUSTER_NAME=main-1
export REMOTE_CLUSTER_CTX=remote-2
export REMOTE_CLUSTER_NAME=remote-2
export MAIN_CLUSTER_NETWORK=network1
#!/usr/bin/env bash
set -x
REGION=$1
ZONE=$REGION-a
gcloud compute routers create router-$REGION --network=default --region=$REGION
gcloud compute routers nats create nat-$REGION \
@samos123
samos123 / gist:d6cfd92bd5d0db1c60cdd5b9eb7ae607
Created August 15, 2023 05:51
create-k8s-client-in-or-out-ofcluster.go
func CreateKubernetesClient() (*kubernetes.Clientset, error) {
// Try in-cluster config
config, err := rest.InClusterConfig()
if err != nil {
// If there's an error, it means we're not in-cluster, try out-of-cluster config
kubeconfig := os.Getenv("KUBECONFIG") // Path to a kubeconfig. Only required if out-of-cluster
if kubeconfig == "" {
kubeconfig = os.Getenv("HOME") + "/.kube/config"
}
{
"classes": [
{
"class": "Instrument",
"description": "A musical instrument.",
"vectorIndexType": "hnsw",
"vectorizer": "text2vec-transformers",
"properties": [
{
"name": "name",
#!/usr/bin/env bash
# source a SO question I forgot to capture link of
ffmpeg -y -i $1 \
-filter_complex "fps=5,scale=980:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=32[p];[s1][p]paletteuse=dither=bayer" \
$2
@samos123
samos123 / gist:bd293d16bc8ad4be2c1f5b96539967a2
Last active August 4, 2024 06:29
benchmark vllm using openai backend and random dataset
#!/usr/bin/env bash
git clone https://github.com/vllm-project/vllm.git
cd vllm/benchmarks
python3 benchmark_serving.py --backend openai \
--base-url http://127.0.0.1:8080 \
--dataset-name=random \
--model neuralmagic/Meta-Llama-3.1-8B-Instruct-FP8 \
--seed 12345