update to deployment
This commit is contained in:
Родитель
7b94baac80
Коммит
fc24589070
|
@ -9,14 +9,13 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"execution_count": 35,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"resource_group = \"fbaksrg\" # Feel free to modify these\n",
|
||||
"acs_name = \"fbaks\"\n",
|
||||
"location = \"eastus\"\n",
|
||||
"\n",
|
||||
"image_name = \"fboylu/tfkeras\" \n",
|
||||
|
@ -352,6 +351,607 @@
|
|||
"%%time\n",
|
||||
"!az aks create --resource-group $resource_group --name $cluster_name --node-count 1 --generate-ssh-keys -s Standard_NC6"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[33mDownloading client to /usr/local/bin/kubectl from https://storage.googleapis.com/kubernetes-release/release/v1.9.6/bin/linux/amd64/kubectl\u001b[0m\r\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!sudo az aks install-cli"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Merged \"fbAKSCluster\" as current context in /home/fboylu/.kube/config\r\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!az aks get-credentials --resource-group $resource_group --name $cluster_name"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"NAME STATUS ROLES AGE VERSION\r\n",
|
||||
"aks-nodepool1-28016997-0 Ready agent 20h v1.7.7\r\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!kubectl get nodes"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 48,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"NAMESPACE NAME READY STATUS RESTARTS AGE\r\n",
|
||||
"kube-system heapster-2574232661-9rnfw 2/2 Running 0 21h\r\n",
|
||||
"kube-system kube-dns-v20-2253765213-nc3lc 3/3 Running 0 21h\r\n",
|
||||
"kube-system kube-dns-v20-2253765213-tlrxc 3/3 Running 0 21h\r\n",
|
||||
"kube-system kube-proxy-g4gs2 1/1 Running 0 21h\r\n",
|
||||
"kube-system kube-svc-redirect-57f3x 1/1 Running 0 21h\r\n",
|
||||
"kube-system kubernetes-dashboard-2898242510-5f9m0 1/1 Running 0 21h\r\n",
|
||||
"kube-system tunnelfront-2759728499-dgvc5 1/1 Running 0 21h\r\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!kubectl get pods --all-namespaces"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 49,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"app_template = {\n",
|
||||
" \"apiVersion\": \"apps/v1beta1\",\n",
|
||||
" \"kind\": \"Deployment\",\n",
|
||||
" \"metadata\": {\n",
|
||||
" \"name\": \"azure-dl\"\n",
|
||||
" },\n",
|
||||
" \"spec\":{\n",
|
||||
" \"replicas\":1,\n",
|
||||
" \"template\":{\n",
|
||||
" \"metadata\":{\n",
|
||||
" \"labels\":{\n",
|
||||
" \"app\":\"azure-dl\"\n",
|
||||
" }\n",
|
||||
" },\n",
|
||||
" \"spec\":{\n",
|
||||
" \"containers\":[\n",
|
||||
" {\n",
|
||||
" \"name\": \"azure-dl\",\n",
|
||||
" \"image\": \"fboylu/tfkeras\",\n",
|
||||
" \"env\":[\n",
|
||||
" {\n",
|
||||
" \"name\": \"LD_LIBRARY_PATH\",\n",
|
||||
" \"value\": \"$LD_LIBRARY_PATH:/usr/local/nvidia/lib64:/opt/conda/envs/py3.6/lib\"\n",
|
||||
" }\n",
|
||||
" ],\n",
|
||||
" \"ports\":[\n",
|
||||
" {\n",
|
||||
" \"containerPort\":88,\n",
|
||||
" \"name\":\"model\"\n",
|
||||
" }\n",
|
||||
" ],\n",
|
||||
" \"volumeMounts\":[\n",
|
||||
" {\n",
|
||||
" \"name\": \"bin\",\n",
|
||||
" \"mountPath\":\"/usr/local/nvidia/bin\" \n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"name\": \"lib\",\n",
|
||||
" \"mountPath\":\"/usr/local/nvidia/lib64\" \n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"name\": \"libcuda\",\n",
|
||||
" \"mountPath\":\"/usr/lib/x86_64-linux-gnu/libcuda.so.1\" \n",
|
||||
" },\n",
|
||||
" ],\n",
|
||||
" \"resources\":{\n",
|
||||
" \"requests\":{\n",
|
||||
" \"alpha.kubernetes.io/nvidia-gpu\": 1\n",
|
||||
" },\n",
|
||||
" \"limits\":{\n",
|
||||
" \"alpha.kubernetes.io/nvidia-gpu\": 1\n",
|
||||
" }\n",
|
||||
" } \n",
|
||||
" }\n",
|
||||
" ],\n",
|
||||
" \"volumes\":[\n",
|
||||
" {\n",
|
||||
" \"name\": \"bin\",\n",
|
||||
" \"hostPath\":{\n",
|
||||
" \"path\":\"/usr/lib/nvidia-384/bin\"\n",
|
||||
" },\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"name\": \"lib\",\n",
|
||||
" \"hostPath\":{\n",
|
||||
" \"path\":\"/usr/lib/nvidia-384\"\n",
|
||||
" },\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"name\": \"libcuda\",\n",
|
||||
" \"hostPath\":{\n",
|
||||
" \"path\":\"/usr/lib/x86_64-linux-gnu/libcuda.so.1\"\n",
|
||||
" },\n",
|
||||
" },\n",
|
||||
" ]\n",
|
||||
" }\n",
|
||||
" }\n",
|
||||
" }\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"service_temp = {\n",
|
||||
" \"apiVersion\": \"v1\",\n",
|
||||
" \"kind\": \"Service\",\n",
|
||||
" \"metadata\": {\n",
|
||||
" \"name\": \"azure-dl\"\n",
|
||||
" },\n",
|
||||
" \"spec\":{\n",
|
||||
" \"type\": \"LoadBalancer\",\n",
|
||||
" \"ports\":[\n",
|
||||
" {\n",
|
||||
" \"port\":88\n",
|
||||
" }\n",
|
||||
" ],\n",
|
||||
" \"selector\":{\n",
|
||||
" \"app\":\"azure-dl\"\n",
|
||||
" }\n",
|
||||
" }\n",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 22,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 50,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def write_json_to_file(json_dict, filename, mode='w'):\n",
|
||||
" with open(filename, mode) as outfile:\n",
|
||||
" json.dump(json_dict, outfile, indent=4,sort_keys=True)\n",
|
||||
" outfile.write('\\n\\n')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 51,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"write_json_to_file(app_template, 'az-dl.json')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 52,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"write_json_to_file(service_temp, 'az-dl.json', mode='a')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 53,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{\r\n",
|
||||
" \"apiVersion\": \"apps/v1beta1\",\r\n",
|
||||
" \"kind\": \"Deployment\",\r\n",
|
||||
" \"metadata\": {\r\n",
|
||||
" \"name\": \"azure-dl\"\r\n",
|
||||
" },\r\n",
|
||||
" \"spec\": {\r\n",
|
||||
" \"replicas\": 1,\r\n",
|
||||
" \"template\": {\r\n",
|
||||
" \"metadata\": {\r\n",
|
||||
" \"labels\": {\r\n",
|
||||
" \"app\": \"azure-dl\"\r\n",
|
||||
" }\r\n",
|
||||
" },\r\n",
|
||||
" \"spec\": {\r\n",
|
||||
" \"containers\": [\r\n",
|
||||
" {\r\n",
|
||||
" \"env\": [\r\n",
|
||||
" {\r\n",
|
||||
" \"name\": \"LD_LIBRARY_PATH\",\r\n",
|
||||
" \"value\": \"$LD_LIBRARY_PATH:/usr/local/nvidia/lib64:/opt/conda/envs/py3.6/lib\"\r\n",
|
||||
" }\r\n",
|
||||
" ],\r\n",
|
||||
" \"image\": \"fboylu/tfkeras\",\r\n",
|
||||
" \"name\": \"azure-dl\",\r\n",
|
||||
" \"ports\": [\r\n",
|
||||
" {\r\n",
|
||||
" \"containerPort\": 88,\r\n",
|
||||
" \"name\": \"model\"\r\n",
|
||||
" }\r\n",
|
||||
" ],\r\n",
|
||||
" \"resources\": {\r\n",
|
||||
" \"limits\": {\r\n",
|
||||
" \"alpha.kubernetes.io/nvidia-gpu\": 1\r\n",
|
||||
" },\r\n",
|
||||
" \"requests\": {\r\n",
|
||||
" \"alpha.kubernetes.io/nvidia-gpu\": 1\r\n",
|
||||
" }\r\n",
|
||||
" },\r\n",
|
||||
" \"volumeMounts\": [\r\n",
|
||||
" {\r\n",
|
||||
" \"mountPath\": \"/usr/local/nvidia/bin\",\r\n",
|
||||
" \"name\": \"bin\"\r\n",
|
||||
" },\r\n",
|
||||
" {\r\n",
|
||||
" \"mountPath\": \"/usr/local/nvidia/lib64\",\r\n",
|
||||
" \"name\": \"lib\"\r\n",
|
||||
" },\r\n",
|
||||
" {\r\n",
|
||||
" \"mountPath\": \"/usr/lib/x86_64-linux-gnu/libcuda.so.1\",\r\n",
|
||||
" \"name\": \"libcuda\"\r\n",
|
||||
" }\r\n",
|
||||
" ]\r\n",
|
||||
" }\r\n",
|
||||
" ],\r\n",
|
||||
" \"volumes\": [\r\n",
|
||||
" {\r\n",
|
||||
" \"hostPath\": {\r\n",
|
||||
" \"path\": \"/usr/lib/nvidia-384/bin\"\r\n",
|
||||
" },\r\n",
|
||||
" \"name\": \"bin\"\r\n",
|
||||
" },\r\n",
|
||||
" {\r\n",
|
||||
" \"hostPath\": {\r\n",
|
||||
" \"path\": \"/usr/lib/nvidia-384\"\r\n",
|
||||
" },\r\n",
|
||||
" \"name\": \"lib\"\r\n",
|
||||
" },\r\n",
|
||||
" {\r\n",
|
||||
" \"hostPath\": {\r\n",
|
||||
" \"path\": \"/usr/lib/x86_64-linux-gnu/libcuda.so.1\"\r\n",
|
||||
" },\r\n",
|
||||
" \"name\": \"libcuda\"\r\n",
|
||||
" }\r\n",
|
||||
" ]\r\n",
|
||||
" }\r\n",
|
||||
" }\r\n",
|
||||
" }\r\n",
|
||||
"}\r\n",
|
||||
"\r\n",
|
||||
"{\r\n",
|
||||
" \"apiVersion\": \"v1\",\r\n",
|
||||
" \"kind\": \"Service\",\r\n",
|
||||
" \"metadata\": {\r\n",
|
||||
" \"name\": \"azure-dl\"\r\n",
|
||||
" },\r\n",
|
||||
" \"spec\": {\r\n",
|
||||
" \"ports\": [\r\n",
|
||||
" {\r\n",
|
||||
" \"port\": 88\r\n",
|
||||
" }\r\n",
|
||||
" ],\r\n",
|
||||
" \"selector\": {\r\n",
|
||||
" \"app\": \"azure-dl\"\r\n",
|
||||
" },\r\n",
|
||||
" \"type\": \"LoadBalancer\"\r\n",
|
||||
" }\r\n",
|
||||
"}\r\n",
|
||||
"\r\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!cat az-dl.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 54,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"deployment \"azure-dl\" created\n",
|
||||
"service \"azure-dl\" created\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!kubectl create -f az-dl.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 61,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"LAST SEEN FIRST SEEN COUNT NAME KIND SUBOBJECT TYPE REASON SOURCE MESSAGE\r\n",
|
||||
"22s 21h 1314 aks-nodepool1-28016997-0.151e0b00f2c2fa81 Node Warning FailedNodeAllocatableEnforcement kubelet, aks-nodepool1-28016997-0 Failed to update Node Allocatable Limits \"\": failed to set supported cgroup subsystems for cgroup : Failed to set config for supported subsystems : failed to write 59076296704 to memory.limit_in_bytes: write /var/lib/docker/overlay2/b13d017f80b0afbea6242f387627df263ea463c385c0655defa6221c49714e66/merged/sys/fs/cgroup/memory/memory.limit_in_bytes: invalid argument\r\n",
|
||||
"3m 3m 1 azure-dl-1710293173-p2ggn.151e5280fc957b25 Pod Normal Scheduled default-scheduler Successfully assigned azure-dl-1710293173-p2ggn to aks-nodepool1-28016997-0\r\n",
|
||||
"3m 3m 1 azure-dl-1710293173-p2ggn.151e528108573d0f Pod Normal SuccessfulMountVolume kubelet, aks-nodepool1-28016997-0 MountVolume.SetUp succeeded for volume \"libcuda\" \r\n",
|
||||
"3m 3m 1 azure-dl-1710293173-p2ggn.151e52810858a537 Pod Normal SuccessfulMountVolume kubelet, aks-nodepool1-28016997-0 MountVolume.SetUp succeeded for volume \"bin\" \r\n",
|
||||
"3m 3m 1 azure-dl-1710293173-p2ggn.151e5281085a378f Pod Normal SuccessfulMountVolume kubelet, aks-nodepool1-28016997-0 MountVolume.SetUp succeeded for volume \"lib\" \r\n",
|
||||
"3m 3m 1 azure-dl-1710293173-p2ggn.151e528108b1c71b Pod Normal SuccessfulMountVolume kubelet, aks-nodepool1-28016997-0 MountVolume.SetUp succeeded for volume \"default-token-tnsfr\" \r\n",
|
||||
"3m 3m 1 azure-dl-1710293173-p2ggn.151e52813b6d72b4 Pod spec.containers{azure-dl} Normal Pulling kubelet, aks-nodepool1-28016997-0 pulling image \"fboylu/tfkeras\"\r\n",
|
||||
"3m 3m 1 azure-dl-1710293173-p2ggn.151e5281eaf98ef8 Pod spec.containers{azure-dl} Normal Pulled kubelet, aks-nodepool1-28016997-0 Successfully pulled image \"fboylu/tfkeras\"\r\n",
|
||||
"3m 3m 1 azure-dl-1710293173-p2ggn.151e5281fa5d9dce Pod spec.containers{azure-dl} Normal Created kubelet, aks-nodepool1-28016997-0 Created container\r\n",
|
||||
"3m 3m 1 azure-dl-1710293173-p2ggn.151e528203c0c32d Pod spec.containers{azure-dl} Normal Started kubelet, aks-nodepool1-28016997-0 Started container\r\n",
|
||||
"3m 3m 1 azure-dl-1710293173.151e5280fc3f013d ReplicaSet Normal SuccessfulCreate replicaset-controller Created pod: azure-dl-1710293173-p2ggn\r\n",
|
||||
"47m 47m 1 azure-dl-21782637-lrsch.151e50169163a28d Pod Normal Scheduled default-scheduler Successfully assigned azure-dl-21782637-lrsch to aks-nodepool1-28016997-0\r\n",
|
||||
"47m 47m 1 azure-dl-21782637-lrsch.151e50169da86811 Pod Normal SuccessfulMountVolume kubelet, aks-nodepool1-28016997-0 MountVolume.SetUp succeeded for volume \"libcuda\" \r\n",
|
||||
"47m 47m 1 azure-dl-21782637-lrsch.151e50169da86a69 Pod Normal SuccessfulMountVolume kubelet, aks-nodepool1-28016997-0 MountVolume.SetUp succeeded for volume \"lib\" \r\n",
|
||||
"47m 47m 1 azure-dl-21782637-lrsch.151e50169da92715 Pod Normal SuccessfulMountVolume kubelet, aks-nodepool1-28016997-0 MountVolume.SetUp succeeded for volume \"bin\" \r\n",
|
||||
"47m 47m 1 azure-dl-21782637-lrsch.151e50169e11680b Pod Normal SuccessfulMountVolume kubelet, aks-nodepool1-28016997-0 MountVolume.SetUp succeeded for volume \"default-token-tnsfr\" \r\n",
|
||||
"47m 47m 1 azure-dl-21782637-lrsch.151e5016c8aabfff Pod spec.containers{azure-dl} Normal Pulling kubelet, aks-nodepool1-28016997-0 pulling image \"fboylu/tfkeras\"\r\n",
|
||||
"44m 44m 1 azure-dl-21782637-lrsch.151e5041fa4f99ab Pod spec.containers{azure-dl} Normal Pulled kubelet, aks-nodepool1-28016997-0 Successfully pulled image \"fboylu/tfkeras\"\r\n",
|
||||
"44m 44m 1 azure-dl-21782637-lrsch.151e504276172c87 Pod spec.containers{azure-dl} Normal Created kubelet, aks-nodepool1-28016997-0 Created container\r\n",
|
||||
"44m 44m 1 azure-dl-21782637-lrsch.151e50427e88f5a7 Pod spec.containers{azure-dl} Normal Started kubelet, aks-nodepool1-28016997-0 Started container\r\n",
|
||||
"4m 4m 1 azure-dl-21782637-lrsch.151e527353c79607 Pod spec.containers{azure-dl} Normal Killing kubelet, aks-nodepool1-28016997-0 Killing container with id docker://azure-dl:Need to kill Pod\r\n",
|
||||
"47m 47m 1 azure-dl-21782637.151e501690ee7703 ReplicaSet Normal SuccessfulCreate replicaset-controller Created pod: azure-dl-21782637-lrsch\r\n",
|
||||
"4m 4m 1 azure-dl-21782637.151e5270ee8be768 ReplicaSet Normal SuccessfulDelete replicaset-controller Deleted pod: azure-dl-21782637-lrsch\r\n",
|
||||
"47m 47m 1 azure-dl.151e50168f41674d Deployment Normal ScalingReplicaSet deployment-controller Scaled up replica set azure-dl-21782637 to 1\r\n",
|
||||
"47m 47m 1 azure-dl.151e50169300d1b2 Service Normal CreatingLoadBalancer service-controller Creating load balancer\r\n",
|
||||
"44m 44m 1 azure-dl.151e5045a59e72f8 Service Normal CreatedLoadBalancer service-controller Created load balancer\r\n",
|
||||
"4m 4m 1 azure-dl.151e5270ed4855c2 Deployment Normal ScalingReplicaSet deployment-controller Scaled down replica set azure-dl-21782637 to 0\r\n",
|
||||
"4m 4m 1 azure-dl.151e5271b9c97786 Service Normal DeletingLoadBalancer service-controller Deleting load balancer\r\n",
|
||||
"3m 3m 1 azure-dl.151e5280fb0610c5 Deployment Normal ScalingReplicaSet deployment-controller Scaled up replica set azure-dl-1710293173 to 1\r\n",
|
||||
"58s 58s 1 azure-dl.151e529f0cbc373d Service Normal DeletedLoadBalancer service-controller Deleted load balancer\r\n",
|
||||
"58s 58s 1 azure-dl.151e529f0cbc9ada Service Normal CreatingLoadBalancer service-controller Creating load balancer\r\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!kubectl get events"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 57,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"NAMESPACE NAME READY STATUS RESTARTS AGE\r\n",
|
||||
"default azure-dl-1710293173-p2ggn 1/1 Running 0 50s\r\n",
|
||||
"kube-system heapster-2574232661-9rnfw 2/2 Running 0 21h\r\n",
|
||||
"kube-system kube-dns-v20-2253765213-nc3lc 3/3 Running 0 21h\r\n",
|
||||
"kube-system kube-dns-v20-2253765213-tlrxc 3/3 Running 0 21h\r\n",
|
||||
"kube-system kube-proxy-g4gs2 1/1 Running 0 21h\r\n",
|
||||
"kube-system kube-svc-redirect-57f3x 1/1 Running 0 21h\r\n",
|
||||
"kube-system kubernetes-dashboard-2898242510-5f9m0 1/1 Running 0 21h\r\n",
|
||||
"kube-system tunnelfront-2759728499-dgvc5 1/1 Running 0 21h\r\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!kubectl get pods --all-namespaces"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 79,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"2018-03-22 18:47:22,486 CRIT Supervisor running as root (no user in config file)\r\n",
|
||||
"2018-03-22 18:47:22,488 INFO supervisord started with pid 7\r\n",
|
||||
"2018-03-22 18:47:23,489 INFO spawned: 'program_exit' with pid 15\r\n",
|
||||
"2018-03-22 18:47:23,491 INFO spawned: 'nginx' with pid 16\r\n",
|
||||
"2018-03-22 18:47:23,492 INFO spawned: 'gunicorn' with pid 17\r\n",
|
||||
"2018-03-22 18:47:24,523 INFO success: program_exit entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)\r\n",
|
||||
"2018-03-22 18:47:24.873263: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA\r\n",
|
||||
"2018-03-22 18:47:28,878 INFO success: nginx entered RUNNING state, process has stayed up for > than 5 seconds (startsecs)\r\n",
|
||||
"2018-03-22 18:47:33.594539: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties: \r\n",
|
||||
"name: Tesla K80 major: 3 minor: 7 memoryClockRate(GHz): 0.8235\r\n",
|
||||
"pciBusID: d333:00:00.0\r\n",
|
||||
"totalMemory: 11.17GiB freeMemory: 11.10GiB\r\n",
|
||||
"2018-03-22 18:47:33.594581: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: Tesla K80, pci bus id: d333:00:00.0, compute capability: 3.7)\r\n",
|
||||
"2018-03-22 18:47:43,605 INFO success: gunicorn entered RUNNING state, process has stayed up for > than 20 seconds (startsecs)\r\n",
|
||||
"Initialising\r\n",
|
||||
"Executing init() method...\r\n",
|
||||
"Downloading data from https://github.com/adamcasson/resnet152/releases/download/v0.1/resnet152_weights_tf.h5\r\n",
|
||||
"\r\n",
|
||||
" 8192/243179624 [..............................] - ETA: 58s\r\n",
|
||||
" 606208/243179624 [..............................] - ETA: 20s\r\n",
|
||||
" 2342912/243179624 [..............................] - ETA: 10s\r\n",
|
||||
" 6791168/243179624 [..............................] - ETA: 5s \r\n",
|
||||
" 14188544/243179624 [>.............................] - ETA: 3s\r\n",
|
||||
" 21635072/243179624 [=>............................] - ETA: 2s\r\n",
|
||||
" 24485888/243179624 [==>...........................] - ETA: 2s\r\n",
|
||||
" 26607616/243179624 [==>...........................] - ETA: 3s\r\n",
|
||||
" 32399360/243179624 [==>...........................] - ETA: 3s\r\n",
|
||||
" 36167680/243179624 [===>..........................] - ETA: 3s\r\n",
|
||||
" 39919616/243179624 [===>..........................] - ETA: 3s\r\n",
|
||||
" 47734784/243179624 [====>.........................] - ETA: 2s\r\n",
|
||||
" 53420032/243179624 [=====>........................] - ETA: 2s\r\n",
|
||||
" 61210624/243179624 [======>.......................] - ETA: 2s\r\n",
|
||||
" 69369856/243179624 [=======>......................] - ETA: 2s\r\n",
|
||||
" 73834496/243179624 [========>.....................] - ETA: 2s\r\n",
|
||||
" 77193216/243179624 [========>.....................] - ETA: 2s\r\n",
|
||||
" 80863232/243179624 [========>.....................] - ETA: 2s\r\n",
|
||||
" 84606976/243179624 [=========>....................] - ETA: 2s\r\n",
|
||||
" 87498752/243179624 [=========>....................] - ETA: 2s\r\n",
|
||||
" 92700672/243179624 [==========>...................] - ETA: 1s\r\n",
|
||||
"100884480/243179624 [===========>..................] - ETA: 1s\r\n",
|
||||
"106905600/243179624 [============>.................] - ETA: 1s\r\n",
|
||||
"107839488/243179624 [============>.................] - ETA: 1s\r\n",
|
||||
"111239168/243179624 [============>.................] - ETA: 1s\r\n",
|
||||
"119726080/243179624 [=============>................] - ETA: 1s\r\n",
|
||||
"126951424/243179624 [==============>...............] - ETA: 1s\r\n",
|
||||
"135438336/243179624 [===============>..............] - ETA: 1s\r\n",
|
||||
"142548992/243179624 [================>.............] - ETA: 1s\r\n",
|
||||
"149716992/243179624 [=================>............] - ETA: 1s\r\n",
|
||||
"155836416/243179624 [==================>...........] - ETA: 1s\r\n",
|
||||
"161472512/243179624 [==================>...........] - ETA: 1s\r\n",
|
||||
"167567360/243179624 [===================>..........] - ETA: 0s\r\n",
|
||||
"168747008/243179624 [===================>..........] - ETA: 0s\r\n",
|
||||
"173727744/243179624 [====================>.........] - ETA: 0s\r\n",
|
||||
"178184192/243179624 [====================>.........] - ETA: 0s\r\n",
|
||||
"183410688/243179624 [=====================>........] - ETA: 0s\r\n",
|
||||
"191455232/243179624 [======================>.......] - ETA: 0s\r\n",
|
||||
"196296704/243179624 [=======================>......] - ETA: 0s\r\n",
|
||||
"200417280/243179624 [=======================>......] - ETA: 0s\r\n",
|
||||
"203390976/243179624 [========================>.....] - ETA: 0s\r\n",
|
||||
"205791232/243179624 [========================>.....] - ETA: 0s\r\n",
|
||||
"209862656/243179624 [========================>.....] - ETA: 0s\r\n",
|
||||
"216006656/243179624 [=========================>....] - ETA: 0s\r\n",
|
||||
"223903744/243179624 [==========================>...] - ETA: 0s\r\n",
|
||||
"229294080/243179624 [===========================>..] - ETA: 0s\r\n",
|
||||
"233963520/243179624 [===========================>..] - ETA: 0s\r\n",
|
||||
"240500736/243179624 [============================>.] - ETA: 0s\r\n",
|
||||
"243187712/243179624 [==============================] - 3s 0us/step\r\n",
|
||||
"Model loading time: 34290.5 ms\r\n",
|
||||
"{\"path\": \"/opt/conda/envs/py3.5/lib/python3.5/site-packages/werkzeug/_internal.py\", \"tags\": [], \"msg\": \" * Running on %s://%s:%d/ %s\", \"logger\": \"werkzeug\", \"stack_info\": null, \"timestamp\": \"2018-03-22T18:47:59.132516Z\", \"message\": \" * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)\", \"level\": \"INFO\", \"host\": \"azure-dl-1710293173-p2ggn\"}\r\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!kubectl logs azure-dl-1710293173-p2ggn"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 82,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE\r\n",
|
||||
"azure-dl 1 1 1 1 16m\r\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!kubectl get deployment"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 83,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE\r\n",
|
||||
"azure-dl LoadBalancer 10.0.229.129 52.186.126.119 88:31690/TCP 16m\r\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!kubectl get service azure-dl"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Tear it all down"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 47,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"deployment \"azure-dl\" deleted\n",
|
||||
"service \"azure-dl\" deleted\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!kubectl delete -f az-dl.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"!az aks delete -n $cluster_name -g $resource_group -y"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"!az group delete --name $resource_group -y"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Test deployed web application"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"app_url = '52.186.126.119'"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"scoring_url = 'http://{}/score'.format(app_url)\n",
|
||||
"version_url = 'http://{}/version'.format(app_url)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"'http://52.186.126.119/version'"
|
||||
]
|
||||
},
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"version_url"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"^C\r\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"!curl $version_url # Reports the tensorflow version"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python [conda env:py35]",
|
||||
"language": "python",
|
||||
"name": "conda-env-py35-py"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.5.2"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
Загрузка…
Ссылка в новой задаче