Skip to content

Instantly share code, notes, and snippets.

View fai555's full-sized avatar
πŸ‘¨β€πŸ’»

Imran fai555

πŸ‘¨β€πŸ’»
View GitHub Profile
# create GPU pool
gcloud container node-pools create <GPU_POOL_NAME> \
--accelerator type=nvidia-tesla-k80,count=1 \
--zone us-central1-a --cluster <CLUSTER_NAME> \
--num-nodes=1 --machine-type=n1-standard-4 --min-nodes=0 --max-nodes=5 --enable-autoscaling
apiVersion: v1
kind: Service
metadata:
labels:
app: mnist
name: mnist-service
namespace: kubeflow
spec:
ports:
- name: grpc-tf-serving
apiVersion: v1
kind: Service
metadata:
labels:
app: mnist
name: mnist-service
namespace: kubeflow
spec:
ports:
- name: grpc-tf-serving
# absolute path to the directory where label_map.pbtxt and input image files are. It must be an absolute path. Docker volume mounting doesn't work with relative path. All other paths in this scripts will work with relative path.
export VOLUME_PATH=""
export SERVER_URL="http://EXTERNAL_IP:8500/v1/models/mnist:predict"
# relative path to the test image. i.e. config/image1.jpg. The path is relative to VOLUME_PATH
export IMAGE_PATH=""
# relative path to the output json. i.e. config/out_image1.json. The path is relative to VOLUME_PATH
export OUTPUT_JSON=""
# relative path to the label_map.pbtxt. i.e. config/label_map.pbtxt. The path is relative to VOLUME_PATH
export LABEL_MAP=""
# Specify True if you want to save the output image.
@fai555
fai555 / update-firewall-rules-for-GKE-istio.sh
Created April 16, 2020 11:31
update-firewall-rules-for-GKE-istio
gcloud compute firewall-rules list --filter="name~gke-<CLUSTER_NAME>-[0-9a-z]*-master"
gcloud compute firewall-rules update <FIREWALL_RULE_NAME> --allow tcp:10250,tcp:443,tcp:15017
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: <APP_NAME>
# REST OF YOUR YAML CONFIG WILL BE AS IT IS
---
apiVersion: v1
kind: Service
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: <GATEWAY_NAME>
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: <VIRTUAL_SERVICE_NAME>
spec:
hosts:
- "*"
gateways:
- <GATEWAY_NAME>
http:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: <VIRTUAL_SERVICE_NAME>
spec:
hosts:
- "*"
gateways:
- <GATEWAY_NAME>
http:
"""
This script generates RSA public/private key pair using python.
And uses the Keys to Generate JWT Token.
The series of steps are listed below
1. Generate the Key
2. Generate the Public and Private Keys
3. Generate the Token using the Private Key from step 2
4. Validate the JWT Token using the Public key from step 2