Skip to content

Instantly share code, notes, and snippets.

@jsilberm
jsilberm / PyPi_Build_Release.md
Last active August 4, 2023 00:51
PyPi Build Release Cycle

Someday this will be automated. In the meantime, here is the sequence. This almost runs non=interactively. You will need the password for the amdpnso_release account

#!/bin/bash

if [ $# -ne 1 ]; then
   echo Usage: $0 release-ver
# 1: Remove systemd service (if any)
sudo systemctl stop portworx
sudo systemctl disable portworx
sudo rm -f /etc/systemd/system/portworx*.service
# NOTE: if the steps below fail, please reboot the node, and repeat the steps 2..5
# 2: Unmount oci (if required)
grep -q '/opt/pwx/oci /opt/pwx/oci' /proc/self/mountinfo && sudo umount /opt/pwx/oci
@jsilberm
jsilberm / jp
Created May 24, 2018 03:56
'journalctl portworx' utility script
#!/bin/bash
# Here’s a handy BASH/ZSH -shell alias in case you are tired of typing “journalctl ..” to get the PX logs.
# By default it’ll display only current/running PX-OCI’s logs,
# but the other journalctl-parameters also work (e.g. jp -f for “follow log” or jp --since yesterday).
#
# Courtesy [email protected]
#
jp () {
local args=${@:-_PID=$(systemctl show --property MainPID portworx | cut -d= -f2)}
journalctl --unit portworx $args
#!/usr/local/bin/python3.6
"""
pxify-gke:
This program takes an existing GKE cluster and makes it "Portworx-ready"
by adding one additional non-root, non-mounted disk.
[Specifying a GKE local SSD disk results in having it automatically mounted]
Prereqs:
@jsilberm
jsilberm / ready4px.py
Created August 9, 2017 05:33
Take a cluster that has been deployed through Tectonic, and make it ready to run/deploy Portworx
#!/usr/bin/env python3.6
#
# ready4px: Take a cluster that has been deployed through Tectonic,
# and make it ready to run/deploy Portworx
#
# Inputs:
# Environment:
# CLUSTER : Corresponds to CLUSTER from Tectonic
# AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID, AWS_REGION : Amazon credentials and region
#!/bin/bash
#
# Use this script to deploy an entire stack on Kubernetes:
# - etcd cluster
# - px daemonset
# - influxdb on pvc
# - Lighthouse
#
# Assumes running instance of Kubernetes 1.6 or above
#
@jsilberm
jsilberm / Restore MSSQL Adventureworks.md
Last active July 20, 2017 23:13
Restore instructions for AdventureWorks Database on Kubernetes

Copy Adventureworks to master

scp Adventureworks.bak to the master

Copy Into Container

POD=mssql-1121156913-8sms4
kubectl cp /root/AdventureWorks2016CTP3.bak $POD:/root/AdventureWorks2016CTP3.bak
@jsilberm
jsilberm / liquidweb.md
Last active August 2, 2017 13:22
mysql / wordpress stack on Portworx

Deploys a complete "Portworx-ready" Kubernetes cluster in GCP. Configurable elements:

  • Kubernetes version (default 1.7)
  • number of Minions (default 3)
  • volume size per minion (default 10GB)
  • machine type (default n1-standard-2 )
  • region (default us-central1)
  • region-zone (default us-central1-f)
@jsilberm
jsilberm / mssql.yml
Last active July 19, 2017 20:24
MS SQL Server on Kubernetes with Portworx
##### Portworx storage class
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: px-mssql-sc
provisioner: kubernetes.io/portworx-volume
parameters:
repl: "3"
snap_interval: "70"
io_priority: "high"
Clone Forked Repo
git clone https://..../repo.git
cd repo
git remote add upstream https://github.com/Azure/acs-engine.git
git remote -v
git fetch upstream
git checkout master
git merge upstream/master
git push origin