- Create a GKE cluster with a GPU node pool:
gcloud container clusters create gpu-sharing-demo --zone us-central1-c
sudo nmcli c add con-name wifibridge type ethernet ifname eth0 ipv4.method shared ipv6.method ignore | |
sudo nmcli con up wifibridge | |
nmcli con show |
#!/usr/bin/env python3 | |
import json | |
import os | |
import time | |
from datetime import datetime | |
from urllib.parse import quote | |
from urllib import request, parse | |
import pytz |
# Copyright 2020 Google LLC | |
# | |
# Licensed 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 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
#!/bin/bash | |
# Copyright 2019 Google Inc. | |
# | |
# Licensed 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 | |
# |
#!/bin/bash | |
# Copyright 2019 Google Inc. | |
# | |
# Licensed 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 | |
# |
#!/usr/bin/env bash | |
function packer-install() { | |
OS=$(uname -s) | |
[[ -f ${HOME}/bin/packer ]] && echo "`${HOME}/bin/packer version` already installed at ${HOME}/bin/packer" && return 0 | |
LATEST_URL=$(curl -sL https://releases.hashicorp.com/packer/index.json | jq -r '.versions[].builds[].url' | sort -n | egrep -v 'rc|beta' | egrep "${OS,,}.*amd64" |tail -1) | |
curl ${LATEST_URL} > /tmp/packer.zip | |
mkdir -p ${HOME}/bin | |
(cd ${HOME}/bin && unzip /tmp/packer.zip) | |
if [[ -z $(grep 'export PATH=${HOME}/bin:${PATH}' ~/.bashrc 2>/dev/null) ]]; then |
#!/bin/bash | |
function terraform-install() { | |
[[ -f ${HOME}/bin/terraform ]] && echo "`${HOME}/bin/terraform version` already installed at ${HOME}/bin/terraform" && return 0 | |
LATEST_URL=$(curl -sL https://releases.hashicorp.com/terraform/index.json | jq -r '.versions[].builds[].url' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | egrep -v 'rc|beta' | egrep 'linux.*amd64' |tail -1) | |
curl ${LATEST_URL} > /tmp/terraform.zip | |
mkdir -p ${HOME}/bin | |
(cd ${HOME}/bin && unzip /tmp/terraform.zip) | |
if [[ -z $(grep 'export PATH=${HOME}/bin:${PATH}' ~/.bashrc) ]]; then | |
echo 'export PATH=${HOME}/bin:${PATH}' >> ~/.bashrc |
function kube-pod() { | |
kubectl get pods --selector=run=$1 --output=jsonpath={.items..metadata.name} | |
} | |
function helm-install-rbac() { | |
kubectl create serviceaccount tiller --namespace kube-system | |
kubectl create clusterrolebinding tiller-cluster-rule \ | |
--clusterrole=cluster-admin \ | |
--serviceaccount=kube-system:tiller | |
helm init --service-account=tiller |