Skip to content

Instantly share code, notes, and snippets.

View cgwalters's full-sized avatar
👍
LGTM

Colin Walters cgwalters

👍
LGTM
View GitHub Profile
From ffc795562602637a7c3bc57bad7f20fdad58fa33 Mon Sep 17 00:00:00 2001
From: Stephen Lowrie <[email protected]>
Date: Thu, 3 Oct 2019 15:40:48 -0500
Subject: [PATCH] HACK: Manhole on failure
---
kola/cluster/cluster.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kola/cluster/cluster.go b/kola/cluster/cluster.go
#!/bin/bash
# forked from https://gist.github.com/innovia/fbba8259042f71db98ea8d4ad19bd708
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
```
walters@toolbox ~/s/g/c/coreos-assembler> git diff
diff --git a/src/create_disk.sh b/src/create_disk.sh
index e9cd8596..76808b3e 100755
--- a/src/create_disk.sh
+++ b/src/create_disk.sh
@@ -10,6 +10,9 @@
# an issue and we can discuss configuration needs.
set -euo pipefail
#!/bin/bash
# Automate an end-to-end run of coreos-installer with the metal image, which then
# boots and writes a success message to a virtio-serial port, which we read on the host.
set -euo pipefail
run_tmp_webserver() {
local statedir=$1
shift
local dir=$1
shift
@cgwalters
cgwalters / gist:4e5eb36bd439f5995928e9232d865f67
Last active December 13, 2019 16:06
Testing FCOS/RHCOS OSTree upgrades manually
On host in your cosa build directory run e.g.:
```
$ cd /srv/walters/rhcos-4.4
$ python3 -m http.server
```
```
$ cosa run -d rhcos-4.2.0-qemu.qcow2
# ostree remote add --set=gpg-verify=false local http://10.0.2.2:8000/tmp/repo
# while ! rpm-ostree rebase local:tmpref-rhcos; do sleep 0.1; done
@cgwalters
cgwalters / gist:5741d640f4c2af811f47c043de392c32
Created December 13, 2019 21:32
Overriding content in an old RHCOS AMI for testing
First, given a build like: https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/rhcos-4.3/43.81.201911081536.0/x86_64/meta.json
Download the qemu image:
```
$ curl -L https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/rhcos-4.3/43.81.201911081536.0/x86_64/rhcos-43.81.201911081536.0-qemu.x86_64.qcow2.gz | gunzip > rhcos-43.81.201911081536.0-qemu.x86_64.qcow2
```
Download new RPM or other content you want, in this case let's assume it's a new hyperkube we want to drop in `/usr/bin`:
`$ curl -L http://example/openshift-hyperkube-4.3.0-201912131246.git.0.09a9468.el8.x86_64.rpm | rpm2cpio | cpio -div`
@cgwalters
cgwalters / raul.md
Last active December 17, 2019 18:37
fio RHCOS LUKS null cipher vs direct XFS
@cgwalters
cgwalters / cosa-extend.md
Created January 2, 2020 17:51
Extend previous coreos-assembler build with a new AWS region

First you'll need an initialized cosa workdir:

cosa init https://github.com/coreos/fedora-coreos-config

Now, we need the previous build data: coreos/coreos-assembler#1013

But we can hand-roll that too:

$ buildid=31.20191219.20.1
```
diff --git a/data/data/gcp/main.tf b/data/data/gcp/main.tf
index ec683906e..9268f5244 100644
--- a/data/data/gcp/main.tf
+++ b/data/data/gcp/main.tf
@@ -98,4 +98,6 @@ resource "google_compute_image" "cluster" {
raw_disk {
source = var.gcp_image_uri
}
+
From f5771ce23b71492167ce7ce592a369f1a1a5d0c9 Mon Sep 17 00:00:00 2001
From: Colin Walters <[email protected]>
Date: Wed, 11 Mar 2020 19:20:51 +0000
Subject: [PATCH] mantle: Really avoid crashing if no port is set for SSH
Actually tested this time.
---
mantle/platform/cluster.go | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)