This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import matplotlib.pyplot as plt | |
""" | |
K means 2D demo, in pytorch | |
""" | |
n = 30 # must be even number | |
k = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jupyter kernelspec list | |
Available kernels: | |
python2 /home/duane/PycharmProjects/.venv/imm/share/jupyter/kernels/python2 | |
cd /home/duane/PycharmProjects/.venv/imm/share/jupyter/kernels/python2 | |
vi kernel.json | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
from torchvision.datasets import CIFAR10 | |
from torch.utils.data import DataLoader, random_split, Dataset, ConcatDataset | |
from tqdm import tqdm | |
from torch.optim import Adam, SGD | |
from torchvision.transforms import * | |
import statistics as stats | |
from pathlib import Path | |
from torch.nn.functional import avg_pool2d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snap install helm --classic | |
/snap/bin/helm init | |
kubectl create serviceaccount --namespace kube-system tiller | |
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller | |
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' | |
wget https://raw.githubusercontent.com/kubernetes/charts/master/stable/redis/values.yaml | |
vi values.yaml | |
#change usePassword: false | |
helm install stable/redis -n ppo-redis --values values.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install docker ce https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
setup docker cri https://kubernetes.io/docs/setup/cri/ | |
# Setup daemon. | |
cat > /etc/docker/daemon.json <<EOF | |
{ | |
"exec-opts": ["native.cgroupdriver=systemd"], | |
"log-driver": "json-file", | |
"log-opts": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -O - https://gist.githubusercontent.com/DuaneNielsen/3f021803cabd3bf70d013f566c450b96/raw/fbeeea40aa0be56098ea34cce9357292a603f15e/install_docker.sh | bash | |
wget -O - https://gist.githubusercontent.com/DuaneNielsen/3f021803cabd3bf70d013f566c450b96/raw/0c6915f2ceea8fa953f7c5de9825e1b2c627aa5c/config_linux.sh | bash | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lxc launch ubuntu:bionic test | |
lxc exec test /bin/bash -- | |
<install docker ce> | |
lxc stop test | |
lxc profile edit docker | |
lxc profile assign test docker | |
mount -o bind /var/lib/kubelet /var/lib/kubelet | |
mount --make shared /var/lib/kubelet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snap install --channel 1.13/stable --classic microk8s | |
microk8s.enable registry | |
microk8s.enable dns | |
microk8s.enable storage # not sure if i need this | |
#install | |
snap install helm --classic | |
/snap/bin/helm init | |
helm install stable/redis -n ppo-redis | |
snap alias microk8s.kubectl kubectl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c@ccube:~$ sudo snap install helm | |
helm 2.9.1 from 'snapcrafters' installed | |
c@ccube:~$ /snap/bin/helm init | |
Please copy Kubernetes config to /home/c/snap/helm/common/kube/config. | |
c@ccube:~$ cp /snap/microk8s/current/client.config /home/c/snap/helm/common/kube/config | |
c@ccube:~$ /snap/bin/helm init | |
Creating /home/c/snap/helm/common/repository | |
Creating /home/c/snap/helm/common/repository/cache | |
Creating /home/c/snap/helm/common/repository/local | |
Creating /home/c/snap/helm/common/plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use 1.13 stable, it still supports docker well | |
snap install --channel 1.13/stable --classic microk8s | |
microk8s.docker build Dockerfile | |
microk8s.docker tag <container from last step> 127.0.0.1:32000/<name you want for container> | |
mickrok8s.docker push 127.0.0.1:32000/<name you want for container> | |
container will now be available as 127.0.0.1:32000/<name you want for container> |