Skip to content

Instantly share code, notes, and snippets.

View pdmack's full-sized avatar

Pete MacKinnon pdmack

  • NVIDIA @egx
  • Raleigh NC
View GitHub Profile
@pdmack
pdmack / simple-pod.yaml
Created May 24, 2019 13:33
Simple sleeper pod
kind: Pod
apiVersion: v1
metadata:
name: simple-pod
spec:
containers:
- name: sleeper
image: registry.access.redhat.com/ubi7:latest
command: ['sleep', '6000']
@pdmack
pdmack / jupyterhub-template.yaml
Last active April 22, 2021 05:21
OpenShift template for deploying Kubeflow (0.4.1) JupyterHub; launches jupyterhub/singleuser:latest image for unknown reason
# CREATE
# oc create -f <this raw gist> -n openshift
# oc new-project jupyterhub
# oc adm policy add-scc-to-user anyuid -z jupyter
# oc process openshift-jupyterhub -n openshift | oc create -f -
# CLEAN UP
# oc delete all --all
# oc delete sa jupyter
# oc delete cm jupyter-config
# oc delete rolebinding jupyter-role
@pdmack
pdmack / gpu-cpu.py
Last active June 7, 2020 21:56
Simple CPU/GPU TF comparison (TF 1.x)
# Simple CPU/GPU TF comparison
import tensorflow as tf
import timeit
# See https://www.tensorflow.org/tutorials/using_gpu#allowing_gpu_memory_growth
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
with tf.device('/cpu:0'):
@pdmack
pdmack / okd-helm-setup.md
Last active August 24, 2020 09:41
Helm install on OKD 3.11

Obtain the oc client tool from OKD github releases and install the appropriate binary for your platform. Also, install Docker and configure it to have an insecure registry CIDR of 172.30.0.0/16.

Do a basic localhost install of OKD

oc cluster up

If desired, fix the config for exposing the console and routes outside localhost (127.0.0.1)

shutting down current dask cluster if it exists...
... cluster shut down
initializing dask scheduler...
... scheduler started
starting 2 worker(s)...
... starting gpu worker 1
@pdmack
pdmack / conda.txt
Created June 22, 2018 21:12
kaggle/python conda list
_ipyw_jlab_nb_ext_conf 0.1.0 py36he11e457_0
absl-py 0.1.13 <pip>
alabaster 0.7.10 py36h306e16b_0
algopy 0.5.7 <pip>
altair 1.2.1 <pip>
anaconda custom py36hbbc8b67_0
anaconda-client 1.6.5 py36h19c0dcd_0
anaconda-navigator 1.6.9 py36h11ddaaa_0
anaconda-project 0.8.0 py36h29abdf5_0
annoy 1.11.5 <pip>
@pdmack
pdmack / foo-pv-volume.yaml
Last active May 10, 2018 18:46
hostPath PV test
kind: PersistentVolume
apiVersion: v1
metadata:
name: foo-pv-volume
labels:
type: local
spec:
storageClassName: ""
capacity:
storage: 10Gi
@pdmack
pdmack / spongodb.py
Last active December 20, 2017 00:04
Adaptation of PySpark/MongoDB example illustrating dynamic jar loading: works with spark-submit AND python interpreter
from __future__ import print_function
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
cd /opt/stack/trove; /usr/local/bin/trove-api —config-file=/etc/trove/trove.conf —debug
cd /opt/stack/trove; /usr/local/bin/trove-taskmanager —config-file=/etc/trove/trove-taskmanager.conf —debug
cd /opt/stack/trove; /usr/local/bin/trove-conductor —config-file=/etc/trove/trove-conductor.conf —debug
@pdmack
pdmack / gist:e482978f0f5309ed9868
Created January 14, 2015 15:57
trusty kick-start mysql
pmackinn@ubuntu:~/trove-integration/scripts$ ./redstack kick-start mysql
*******************************************************************************
Initializing Configuration for Running Tests...
*******************************************************************************
*******************************************************************************
Installing python test packages.
*******************************************************************************
The directory '/home/pmackinn/trove-integration/scripts/.cache/pip/log' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want the -H flag.
The directory '/home/pmackinn/trove-integration/scripts/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want the -H fla