Skip to content

Instantly share code, notes, and snippets.

View jberkus's full-sized avatar
💭
Catching up and prepping for Kubecon Shanghai

Josh Berkus jberkus

💭
Catching up and prepping for Kubecon Shanghai
View GitHub Profile
@jberkus
jberkus / gist:807fcf4d4d484dca02079f29aa4a3865
Created July 18, 2018 18:35
Notes from VM Brasseur's Open Sourcing Internal Projects talk OSCON 2018
Open Sourcing an Internal Project
VM
Author of fossforge.com (book in beta)
Releasing software is just the start. If you want to get stuff, throwing code over the wall won't get you it. Guides you find for "how companies OSS" are too generic, you need to figure out what's specific to your company.
Slides: archive.org/details/oscon2018-internalproject
What Who APR MAY JUN JUL DEV WEEK TEST GATES
Start of Release Cycle Lead 2 week 1
Finalize Schedule Lead 4
Begin collecting planned work from SIGs Lead, Features Lead 9 week 2
Begin weekly release team meetings Lead 10
Begin weekly status reports at Community Lead, Shadow 12
Finalize Release Team Lead 15
Start Release Notes Draft Release Notes Lead 17 week 3
@jberkus
jberkus / bug_triage.md
Last active January 18, 2018 23:40
Very Draft Bug Triage Role Description

Bug Wrassler Release Team Role

Your job for the release is to make sure that bugs (issues) and their related PRs which affect the release are dealt with in a timely fashion. In general, you will be polling bugs, checking status, sending reminders and questions to contributors and SIG leads, and publishing summary reports.

Secondarily, you will be helping improve automation around issue management and release tagging.

How this works depends on where you are in the release cycle. There are five relevant periods where your workload changes:

  1. Early Release: between Feature Freeze and a week before Code Slush.
@jberkus
jberkus / gist:e4cadd6b8877c3bc59c8
Created September 19, 2014 00:36
Duplicate Index Query #1: Exact Duplicates
-- check for exact matches
WITH index_cols_ord as (
SELECT attrelid, attnum, attname
FROM pg_attribute
JOIN pg_index ON indexrelid = attrelid
WHERE indkey[0] > 0
ORDER BY attrelid, attnum
),
index_col_list AS (
SELECT attrelid,
@jberkus
jberkus / gist:6bbffae5ce10fb399d29
Last active January 13, 2018 06:55
Duplicate Index Query #2: Partial matches
-- check for containment
-- i.e. index A contains index B
-- and both share the same first column
-- but they are NOT identical
WITH index_cols_ord as (
SELECT attrelid, attnum, attname
FROM pg_attribute
JOIN pg_index ON indexrelid = attrelid
WHERE indkey[0] > 0
@jberkus
jberkus / gist:6c1d8e3991d6de4e869a
Created October 8, 2014 21:11
Interim Table Bloat Query
SELECT * FROM (
SELECT
schemaname, tablename,
ROUND(CASE WHEN otta=0 THEN 0.0 ELSE ((sml.relpages/otta::numeric) * 100 - 100) END) AS tbloat,
CASE WHEN relpages < otta THEN 0 ELSE round(bs*(sml.relpages-otta)::numeric / (1024^2)::numeric , 2 ) END AS wastedmb,
ROUND(AVG(CASE WHEN iotta >= ipages THEN 0
WHEN iotta = 0 THEN 0
ELSE (ipages/iotta::numeric) * 100 - 100 END), -1) AS idxbloat,
SUM(CASE WHEN ipages < iotta THEN 0 ELSE round( bs*(ipages-iotta)::numeric / (1024^2)::numeric, 2 ) END) AS wastedidxmb
FROM (
@jberkus
jberkus / gist:3950d8348e2ddb00070c
Last active January 13, 2018 06:52
New needed indexes query, temp version
WITH
write_adjust AS (
-- change the below to 1.0 if pg_stats goes back to
-- the creation of the database
SELECT 0.0 AS adjustment
),
index_usage AS (
SELECT sut.relid,
current_database() AS database,
sut.schemaname::text as schema_name,
@jberkus
jberkus / gist:06055068f02a0eab6cd3
Last active January 13, 2018 06:50
polling pg_stat_activity
#!/bin/bash
NUMMIN=$(($1 * 2 + 10))
CURMIN=0
while [ $CURMIN -lt $NUMMIN ]
do
psql -q -t -A -c "SELECT now() as ts, state, client_addr, count(*) as num_conn, avg(now() - query_start) as avg_query, \
max(now() - query_start) as max_query, avg(now() - xact_start) as avg_xact, \
@jberkus
jberkus / kube_dev_summit.md
Last active December 5, 2017 22:56
Kube Dev Summit Notes

Steering Committee Update

Showed list of Steering Committee backlog.

We had a meeting, and the two big items we'd been pushing on hard were:

  • votining in the proposals in the bootstrap committee
  • how we're going to handle incubator and contrib etc.
@jberkus
jberkus / gist:1b3e6989cf37a3852c60d2d4318a160e
Last active November 27, 2017 16:31
Atomic stuff at KubeCon
Demos in the booth
Virtualization Salon
OpenShift Commons
Talks?
Dinner/other team outing?