Skip to content

Instantly share code, notes, and snippets.

View tvansteenburgh's full-sized avatar

Tim Van Steenburgh tvansteenburgh

  • Stacklet.io
  • Gainesville, FL
View GitHub Profile
@tvansteenburgh
tvansteenburgh / protect-main-branches.py
Created January 13, 2022 20:04
Disable force pushing to main branches of Github repos
#!/usr/bin/env python3
import datetime
import os
import sys
from github import Github, GithubException
GITHUB_ACCESS_TOKEN = os.environ.get('GITHUB_ACCESS_TOKEN')
if not GITHUB_ACCESS_TOKEN:
@tvansteenburgh
tvansteenburgh / telegraf.sh
Created July 18, 2019 19:04
Install and configure Telegraf to parse Juju Charm Store API logs and write metrics to Influxdb
#!/bin/bash
# Install and configure Telegraf to parse Juju Charm Store API logs
# and write metrics to Influxdb.
set -ex
# Install Telegraf
wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/lsb-release
apiVersion: "kubeflow.org/v1alpha2"
kind: "TFJob"
metadata:
name: "tf-smoke-gpu"
spec:
tfReplicaSpecs:
PS:
replicas: 1
template:
metadata:
apiVersion: kubeflow.org/v1alpha2
kind: TFJob
metadata:
labels:
experiment: experiment10
name: tfjob-gpu
spec:
tfReplicaSpecs:
Ps:
replicas: 1
bundle: kubernetes
applications:
kubeflow-ambassador:
charm: cs:~kubeflow-charmers/kubeflow-ambassador-40
scale: 1
kubeflow-jupyterhub:
charm: cs:~kubeflow-charmers/kubeflow-jupyterhub-36
scale: 1
kubeflow-tf-job-dashboard:
charm: cs:~kubeflow-charmers/kubeflow-tf-job-dashboard-38
kubernetes-worker-gpu:
charm: cs:~containers/kubernetes-worker-118
constraints: instance-type=p2.xlarge root-disk=16G
expose: true
num_units: 3
options:
channel: 1.10/stable
kubelet-extra-args: "feature-gates=DevicePlugins=true"
docker-opts: "--default-runtime=nvidia"
from juju import placement
application = await model.deploy(
charm_dir_path,
application_name,
num_units=number_of_units,
to=placement.parse(machine_number)
)
from juju import loop
from juju.model import Model
async def main():
model = Model()
await model.connect_current()
application = await model.deploy(
'ubuntu-10',
application_name='ubuntu',
@tvansteenburgh
tvansteenburgh / Dockerfile
Created November 17, 2014 18:04
bundletester Dockerfile
FROM ubuntu:14.04
RUN apt-get update -qy
RUN apt-get install -qy software-properties-common
RUN apt-add-repository ppa:juju/stable
RUN apt-get install -qy lxc iptables
RUN apt-get -qy install juju-core juju-quickstart juju-deployer tmux charm-tools juju-local openssh-client
RUN apt-get install -qy python-pip git
RUN pip install git+git://github.com/juju-solutions/bundletester.git
RUN pip install blessings
RUN useradd ubuntu
@tvansteenburgh
tvansteenburgh / errors.yaml
Last active August 29, 2015 14:07
charmguardian-report filters
returncode: content != 0
test: content not in ('charm-proof', 'make lint')
output: not content.startswith('bundletester failed')