Skip to content

Instantly share code, notes, and snippets.

View alanbchristie's full-sized avatar

Alan B. Christie alanbchristie

View GitHub Profile
@alanbchristie
alanbchristie / packer-nextflow.json
Last active August 24, 2018 11:10
An example of a Nextflow Packer file in JSON
{
"builders": [
{
"access_key": "{{user `aws_access_key`}}",
"ami_name": "{{user `base_ami_name`}}",
"region": "eu-west-1",
"ssh_username": "{{user `aws_user`}}",
"type": "amazon-ebs",
"source_ami": "ami-e4515e0e",
"secret_key": "{{user `aws_secret_key`}}",
@alanbchristie
alanbchristie / packer-nextflow.yaml
Last active March 17, 2021 20:50
An example of a Nextflow Packer file in YAML
---
# Packer machine image configuration for a Nextflow/Docker machine.
#
# To use this file (Packer expects a JSON file) you need to
# use the project's yaml2json module to convert it to JSON.
# From this directory and a Suitable Python (see root's requirements.txt)
# you can run...
#
# ../../../yaml2json.py < nextflow.yml > nextflow.json
@alanbchristie
alanbchristie / hekcheck.py
Last active March 4, 2019 10:18
A simple Python 2.7 module to run basic validation checks on an exported Heketi database file
#!/usr/bin/env python
# hekcheck.py
#
# A simple Python 2.7 module to run basic validation checks
# on an exported Heketi database file.
#
# > This is a work in progress - driven by trying to fix a damaged
# deployment. It does not check everything yet but checks what I
# believed to be important things like whether the nodes, volumes,
@alanbchristie
alanbchristie / busy-job.yml
Created September 19, 2018 16:05
Simple OpenShift Job Template (with a volume)
---
# A minimal OpenShift template
# to create a BusyBox container with
# a volume claim that can be used to
# launch a Job and inspect a PVC.
#
# Create with:
# oc process -p PVC_CLAIM_NAME=my-claim -f busy-job.yaml | oc create -f -
# Destroy with:
@alanbchristie
alanbchristie / gluster-cmp.py
Created May 3, 2019 12:19
Generates volume discrepancies between Heketi and Gluster
#!/usr/bin/env python
# Usage: gluster-cmp.py <heketi-txt> <gluster-txt>
#
# Given two text files, the output of: -
#
# - heketi-cli volume list
# - gluster volume status all
#
# ...this utility lists volumes that gluster knows about that
@alanbchristie
alanbchristie / get-pvc-volumes.sh
Created May 3, 2019 14:20
List OKD PV volumes (paths)
#!/bin/bash
#
# Use the oc-command-set to get persistent volume paths.
# Useful in correlating PV to underlying gluster volume.
#
# Alan Christie
# May 2019
for pvc in $(oc get pv | grep pvc- | cut -f1 -d" ")
do
@alanbchristie
alanbchristie / topo.json
Created May 14, 2019 13:36
An example (ORN-Development) Heketi topology file
{
"clusters": [
{
"nodes": [
{
"node": {
"hostnames": {
"manage": [
"orn-glusterfs-01.openstacklocal"
],
@alanbchristie
alanbchristie / heketi-db.json
Last active May 14, 2019 13:41
An example (ORD Development) Heketi Database export
{
"clusterentries": {
"6e06c34748400f660b4cac621ac479a7": {
"Info": {
"id": "6e06c34748400f660b4cac621ac479a7",
"nodes": [
"3f06d6b371256b1e851d46a22185613c",
"7a10c940a9b5ecb446a6cc3eab02b618",
"c35cb2562cdb0abba4179c83b4eb75a9"
],
# The following is the result of running 'heketi-cli topology info'
# from the 'heketi-storage' pod on a functional OpenShift/Gluster deployment.
# It shows one cluster the volumes and devices.
# Taken on 14th May 2019 at arount 1pm
Cluster Id: 6e06c34748400f660b4cac621ac479a7
File: true
Block: true
@alanbchristie
alanbchristie / yum-lock-wait.yaml
Created May 30, 2019 15:52
Task for the yum lockfile error in Ansible 2.8.0
---
# A work-around for the Ansible 2.8.0 error: -
#
# yum lockfile is held by another process
#
# This is seen during yum/package operations. An error not seen
# in Ansible 2.7 and the problem appears to be caused by one of these
# lingering processes...
#