This file contains hidden or 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
# Edit the file google/cloud/ml/models/_cloud.py | |
.... | |
def _create_model_spec(self, graph_file, hyperparams): | |
tensorflow_graph = { | |
'tensorflow_graph': { | |
'graph_uri': graph_file, | |
'session': { | |
'model_to_keep': 'MIN_ERROR', | |
}, | |
} |
This file contains hidden or 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
from tensorflow.core.example import example_pb2 | |
from google.protobuf import json_format | |
import tensorflow as tf | |
import numpy as np | |
# Create a 2-d matrix | |
m = np.arange(4).reshape([2,2]) | |
print "row 1: {0}".format(m[0,:]) | |
print "row 2: {0}".format(m[1,:]) |
This file contains hidden or 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
from datetime import datetime,timedelta | |
import time | |
import logging | |
if __name__ == '__main__': | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
# Run log enough to let the logs get exported | |
endtime = datetime.now() + timedelta(seconds=300) | |
while datetime.now() < endtime: | |
logging.info('Current time %s', datetime.now()) |
This file contains hidden or 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
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: tensorboard | |
spec: | |
ports: | |
# Accept traffic sent to port 80 | |
- name: http | |
port: 80 | |
targetPort: 80 |
This file contains hidden or 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
apiVersion: v1 | |
data: | |
containers.input.conf: |- | |
# This configuration file for Fluentd is used | |
# to watch changes to Docker log files that live in the | |
# directory /var/lib/docker/containers/ and are symbolically | |
# linked to from the /var/log/containers directory using names that capture the | |
# pod name and container name. These logs are then submitted to | |
# Google Cloud Logging which assumes the installation of the cloud-logging plug-in. | |
# |
This file contains hidden or 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
{ | |
insertId: "pje4o8g2kqmney" | |
labels: { | |
compute.googleapis.com/resource_name: "gke-gke-jlewi-ml-dev-gci-default-pool-1e2fb977-6nwt" | |
container.googleapis.com/namespace_name: "default" | |
container.googleapis.com/pod_name: "worker-izch-0-l1drg" | |
container.googleapis.com/stream: "stderr" | |
} | |
logName: "projects/cloud-ml-dev/logs/tensorflow" | |
receiveTimestamp: "2017-09-04T20:38:27.236784454Z" |
This file contains hidden or 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
{"log":"{\"name\": \"root\", \"levelname\": \"INFO\", \"message\": \"Tensorflow version: 1.3.0-rc2\", \"created\": 1504557476.431349, \"lineno\": 86, \"pathname\": \"/opt/mlku | |
be/tf_smoke.py\", \"severity\": \"INFO\", \"timestampSeconds\": 1504557476, \"timestampNanos\": 431349039}\n","stream":"stderr","time":"2017-09-04T20:37:56.431986158Z"} | |
{"log":"{\"name\": \"root\", \"levelname\": \"INFO\", \"message\": \"Tensorflow git version: v1.3.0-rc1-27-g2784b1c\", \"created\": 1504557476.431712, \"lineno\": 87, \"pathna | |
me\": \"/opt/mlkube/tf_smoke.py\", \"severity\": \"INFO\", \"timestampSeconds\": 1504557476, \"timestampNanos\": 431711912}\n","stream":"stderr","time":"2017-09-04T20:37:56.43 | |
2154505Z"} | |
{"log":"{\"name\": \"root\", \"levelname\": \"INFO\", \"message\": \"tf_config: {u'cluster': {u'worker': [u'worker-izch-0:2222'], u'master': [u'master-izch-0:2222']}, u'task': | |
{u'index': 0, u'type': u'master'}}\", \"created\": 1504557476.431907, \"lineno\": 91, \"pathname\": \"/opt/mlkube/tf_smoke.py\", \"severity |
This file contains hidden or 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
""" | |
Code that goes along with the Airflow located at: | |
http://airflow.readthedocs.org/en/latest/tutorial.html | |
""" | |
from airflow import DAG | |
from airflow.operators import PythonOperator | |
from datetime import datetime, timedelta | |
default_args = { |
This file contains hidden or 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
[2017-11-13 20:44:00,026] {base_task_runner.py:95} INFO - Subtask: [2017-11-13 20:44:00,026] {util.py:30} INFO - Running: python -m py.release postsubmit --build_info_path=gs://mlkube-testing-airflow/runs/tf_k8 | |
s_tests/manual__2017-11-13T20_43_54/build_info.yaml --releases_path=gs://mlkube-testing-airflow/runs/tf_k8s_tests/manual__2017-11-13T20_43_54 --project=mlkube-testing | |
[2017-11-13 20:44:00,026] {base_task_runner.py:95} INFO - Subtask: cwd=None | |
[2017-11-13 20:47:35,713] {base_task_runner.py:95} INFO - Subtask: Subprocess output: | |
[2017-11-13 20:47:35,713] {base_task_runner.py:95} INFO - Subtask: | |
[2017-11-13 20:47:35,716] {base_task_runner.py:95} INFO - Subtask: b'INFO:root:Temporary go_dir: /tmp/tmpTfJobSrcqe_srhvf\nINFO:root:repo https://github.com/tensorflow/k8s.git\nINFO:root:Running: git clone http | |
s://github.com/tensorflow/k8s.git /tmp/tmpTfJobSrcqe_srhvf/src/github.com/tensorflow/k8s \ncwd=None\nINFO:root:Subprocess output:\nCloning into \'/tmp/tmpTfJobSrcqe_srhvf/src/github.com/tensorflow/k8s\'.. |
This file contains hidden or 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 google.auth | |
import google.auth.transport | |
import google.auth.transport.requests | |
import kubernetes | |
from kubernetes import client as k8s_client | |
from kubernetes import config as k8s_config | |
from kubernetes.config import kube_config | |
from kubernetes.client import ApiClient, ConfigurationObject, configuration | |
import os |