First build pilot with GCFLAGS="all=-n -l"
:
GCFLAGS="all=-N -l" HUB=docker.io/slandow TAG=slandow BUILD_IN_CONTAINER=1 make docker.pilot
Then we can wrap that image in one that includes delve:
# Sometimes I have some tedious thing to do like data entry | |
# Sometimes I script that tedious thing using selenium | |
# Sometimes I have to login to something to enter that data | |
# This allows you to rerun your script using the same session | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
import os | |
SELENIUM_SESSION_FILE = './selenium_session' |
#/usr/bin/env python | |
import re | |
def parse_fk(fk_str): | |
res = re.search("foreign key \(([^\)]+)\) references ([^ ]+) \(([^\)]+)\)", fk_str) | |
return res.group(1), res.group(2), res.group(3) | |
#!/usr/bin/env python | |
from PIL import Image | |
image = Image.open("base.png") | |
def is_empty(line): | |
for x in range(line.width): | |
r, g, b, a = line.getpixel((x, 0)) | |
if r + g + b + a > 0: |
[alias] | |
tlog = log --graph --full-history --date-order --pretty=format:'%w(120, 0, 9)%C(yellow)%h%Cred%d%Creset %C(green)%an%Creset %C(white)%s%Creset' | |
tdlog = log --graph --full-history --date-order --pretty=format:'%w(120, 0, 9)%C(yellow)%h%Cred%d%Creset %C(magenta)(%ci)%Creset %C(green)%an%Creset %C(white)%s%Creset' |
# sets up a, b, c deployments with services for a and b | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: a | |
labels: | |
app: a | |
spec: | |
ports: |
# scales deployment a to 500 replicas | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: a | |
spec: | |
replicas: 500 | |
selector: | |
matchLabels: |
# triggers a new "b" pod to be created | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: b | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
package main | |
import ( | |
"fmt" | |
"encoding/json" | |
"istio.io/istio/pkg/kube" | |
"k8s.io/apimachinery/pkg/runtime" | |
) |