Skip to content

Instantly share code, notes, and snippets.

View mdbooth's full-sized avatar

Matthew Booth mdbooth

View GitHub Profile
#!/bin/bash
# A script to run tests using khaleesi
# Usage:
#
# Run tests using a RHOS 7/RHEL 7 environment
# ./tools/khaleesi.sh
#
# Run tests using a RHOS 5/RHEL 7 environment
@mdbooth
mdbooth / log_merge.sh
Created July 17, 2015 16:52
Merge sort openstack log files
#!/bin/bash
# Merge all given openstack log files into a single, sorted output stream. Each
# output line has the source filename prepended, e.g.:
# screen-n-cond.txt: 2015-07-14 16:33:24.669 DEBUG nova.o...
# screen-n-cond.txt: 2015-07-14 16:33:24.669 DEBUG nova.o...
# screen-n-cond.txt: 2015-07-14 16:33:24.670 DEBUG nova.o...
# screen-n-cell-child.txt: 2015-07-14 16:33:24.708 DEBUG ...
# screen-n-cond.txt: 2015-07-14 16:33:24.710 DEBUG nova.o...
#!/bin/sh
find ~/devstack ~/openstack -name .git -type d | while read dir; do
working=$(dirname "$dir")
pushd "$working" >/dev/null
# Don't update if we're not on the master branch
if [ $(git rev-parse HEAD master | uniq | wc -l) != "1" ]; then
echo "Skipping $working: not on master branch"
continue
@mdbooth
mdbooth / nova-compute-maintenance.py
Last active October 2, 2017 20:17
Put a nova compute node into 'maintenance mode'. Disable its service, and attempt to migrate all instances on it to other nodes.
#!/usr/bin/env python
import argparse
from collections import defaultdict
import os
import sys
import time
from novaclient import client
from novaclient import exceptions
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
# Python3 support in OpenStack starts with version 3.5,
# which is only in Fedora 24+
%if 0%{?fedora} >= 24
%global with_python3 1
%endif
%global library osc-placement
@mdbooth
mdbooth / clouds-to-env.sh
Last active May 7, 2021 13:57
Convert an entry in clouds.yaml to OS_* environment variables
#!/bin/sh
exec yq -r '.clouds.'$1'
| paths(scalars) as $p
| "export OS_" + ($p|last|ascii_upcase) + "=\"" + (getpath($p)|tostring) + "\""' \
< ~/.config/openstack/clouds.yaml
@mdbooth
mdbooth / keybase.md
Last active November 17, 2021 11:22

Keybase proof

I hereby claim:

  • I am mdbooth on github.
  • I am mdbooth (https://keybase.io/mdbooth) on keybase.
  • I have a public key whose fingerprint is AC03 E8DF 13C9 2ED8 A4D8 7E47 A91B AB3C 70FE 6769

To claim this, I am signing this object:

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: atop-debug
namespace: default
spec:
selector:
matchLabels:
app: atop-debug
template:
#!/bin/bash
scriptdir=${scriptdir:-.}
function get_release_image() (
version=latest
if [ "$OPENSHIFT_RELEASE" != "nightly" ]; then
version="$version-$OPENSHIFT_RELEASE"
fi
@mdbooth
mdbooth / PWL Cache unwindpmp profiling.md
Last active July 4, 2023 15:36
PWL cache unwindpmp profiling
  • VM configured with rbd_cache = false in both cases
  • PWL enabled/disabled by setting rbd_plugins to pwl_cache/"" respectively
  • PWL enabled/disabled status configured by output of rbd status libvirt-pool/pwl-test
  1. Boot VM
  2. Run perf test[^1] in the guest without profiling in the host
  3. Repeat twice:
    1. Run perf test in the guest
    2. Simultaneously run unwindpmp -n 900 -p <qemu pid> > ... on the host
  4. Ensure sampling starts after and finishes before test