diff --git a/mnist/README.md b/mnist/README.md index 9ff64ed0..e8a096cb 100644 --- a/mnist/README.md +++ b/mnist/README.md @@ -16,13 +16,14 @@ - [Using S3](#using-s3) - [Monitoring](#monitoring) - [Tensorboard](#tensorboard) + - [Local storage](#local-storage-1) - [Using GCS](#using-gcs-1) - [Using S3](#using-s3-1) - [Deploying TensorBoard](#deploying-tensorboard) - [Serving the model](#serving-the-model) - [GCS](#gcs) - [S3](#s3) - - [Local storage](#local-storage-1) + - [Local storage](#local-storage-2) - [Web Front End](#web-front-end) - [Connecting via port forwarding](#connecting-via-port-forwarding) - [Using IAP on GCP](#using-iap-on-gcp) @@ -469,6 +470,21 @@ There are various ways to monitor workflow/training job. In addition to using `k ### Tensorboard +#### Local storage + +Enter the `monitoring/local` from the `mnist` application directory. +``` +cd monitoring/local +``` + +Configure PVC name, mount point, and set log directory. +``` +kustomize edit add configmap mnist-map-monitoring --from-literal=pvcName=${PVC_NAME} +kustomize edit add configmap mnist-map-monitoring --from-literal=pvcMountPath=/mnt +kustomize edit add configmap mnist-map-monitoring --from-literal=logDir=/mnt +``` + + #### Using GCS Enter the `monitoring/GCS` from the `mnist` application directory. diff --git a/mnist/monitoring/local/deployment_patch.yaml b/mnist/monitoring/local/deployment_patch.yaml new file mode 100644 index 00000000..83ee30fe --- /dev/null +++ b/mnist/monitoring/local/deployment_patch.yaml @@ -0,0 +1,12 @@ +- op: add + path: /spec/template/spec/containers/0/volumeMounts + value: + - mountPath: $(pvcMountPath) + name: local-storage + +- op: add + path: /spec/template/spec/volumes + value: + - name: local-storage + persistentVolumeClaim: + claimName: $(pvcName) diff --git a/mnist/monitoring/local/kustomization.yaml b/mnist/monitoring/local/kustomization.yaml new file mode 100644 index 00000000..aef16d83 --- /dev/null +++ b/mnist/monitoring/local/kustomization.yaml @@ -0,0 +1,30 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +bases: +- ../base +configurations: +- params.yaml + +vars: +- fieldref: + fieldPath: data.pvcName + name: pvcName + objref: + apiVersion: v1 + kind: ConfigMap + name: mnist-map-monitoring +- fieldref: + fieldPath: data.pvcMountPath + name: pvcMountPath + objref: + apiVersion: v1 + kind: ConfigMap + name: mnist-map-monitoring + +patchesJson6902: +- path: deployment_patch.yaml + target: + group: apps + kind: Deployment + name: tensorboard-tb + version: v1beta1 diff --git a/mnist/monitoring/local/params.yaml b/mnist/monitoring/local/params.yaml new file mode 100644 index 00000000..62647c8a --- /dev/null +++ b/mnist/monitoring/local/params.yaml @@ -0,0 +1,5 @@ +varReference: +- path: spec/template/spec/volumes/persistentVolumeClaim/claimName + kind: Deployment +- path: spec/template/spec/containers/volumeMounts/mountPath + kind: Deployment