{"action":"created","issue":{"url":"https://api.github.com/repos/kubeflow/tf-operator/issues/815","repository_url":"https://api.github.com/repos/kubeflow/tf-operator","labels_url":"https://api.github.com/repos/kubeflow/tf-operator/issues/815/labels{/name}","comments_url":"https://api.github.com/repos/kubeflow/tf-operator/issues/815/comments","events_url":"https://api.github.com/repos/kubeflow/tf-operator/issues/815/events","html_url":"https://github.com/kubeflow/tf-operator/pull/815","id":356151559,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyNTE1Mjg2","number":815,"title":"If a TFJob spec is invalid mark the job as failed with an appropriate…","user":{"login":"jlewi","id":777219,"node_id":"MDQ6VXNlcjc3NzIxOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/777219?v=4","gravatar_id":"","url":"https://api.github.com/users/jlewi","html_url":"https://github.com/jlewi","followers_url":"https://api.github.com/users/jlewi/followers","following_url":"https://api.github.com/users/jlewi/following{/other_user}","gists_url":"https://api.github.com/users/jlewi/gists{/gist_id}","starred_url":"https://api.github.com/users/jlewi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlewi/subscriptions","organizations_url":"https://api.github.com/users/jlewi/orgs","repos_url":"https://api.github.com/users/jlewi/repos","events_url":"https://api.github.com/users/jlewi/events{/privacy}","received_events_url":"https://api.github.com/users/jlewi/received_events","type":"User","site_admin":false},"labels":[{"id":838195525,"node_id":"MDU6TGFiZWw4MzgxOTU1MjU=","url":"https://api.github.com/repos/kubeflow/tf-operator/labels/size/L","name":"size/L","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-31T23:47:35Z","updated_at":"2018-08-31T23:47:43Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/kubeflow/tf-operator/pulls/815","html_url":"https://github.com/kubeflow/tf-operator/pull/815","diff_url":"https://github.com/kubeflow/tf-operator/pull/815.diff","patch_url":"https://github.com/kubeflow/tf-operator/pull/815.patch"},"body":"… condition.\r\n\r\n* If a TFJob spec is invalid (e.g. can't be marshaled to TFJob YAML) we\r\n  want to update the TFJob status to indicate it failed.\r\n\r\n* We need to use the REST API to update the TFJob status because we won't\r\n  be able to deserialize the json to TFJob.\r\n\r\n* Related to #755\r\n\r\n* I created invalid-tfjob.jsonnet which can be used in an E2E test but\r\n  I haven't included the E2E test in this PR.\r\n\r\n* I tested it manually and got the following result\r\n\r\napiVersion: kubeflow.org/v1alpha2\r\nkind: TFJob\r\nmetadata:\r\n  clusterName: \"\"\r\n  creationTimestamp: 2018-08-31T23:37:14Z\r\n  generation: 1\r\n  labels:\r\n    app.kubernetes.io/deploy-manager: ksonnet\r\n    ksonnet.io/component: invalid-tfjob\r\n  name: invalid-tfjob\r\n  namespace: kubeflow\r\n  resourceVersion: \"1826961\"\r\n  selfLink: /apis/kubeflow.org/v1alpha2/namespaces/kubeflow/tfjobs/invalid-tfjob\r\n  uid: ca7b4b02-ad76-11e8-be57-42010a8e0084\r\nspec:\r\n  notTheActualField:\r\n    Ps:\r\n      replicas: 2\r\n      restartPolicy: Never\r\n      template:\r\n        spec:\r\n          containers:\r\n          - image: busybox\r\n            name: tensorflow\r\n    Worker:\r\n      replicas: 4\r\n      restartPolicy: Never\r\n      template:\r\n        spec:\r\n          containers:\r\n          - image: busybox\r\n            name: tensorflow\r\nstatus:\r\n  conditions:\r\n  - lastTransitionTime: 2018-08-31T23:37:14Z\r\n    lastUpdateTime: 2018-08-31T23:37:14Z\r\n    message: 'Failed to marshal the object to TFJob; the spec is invalid: Failed to\r\n      marshal the object to TFJob'\r\n    reason: FailedInvalidTFJobSpec\r\n    status: \"True\"\r\n    type: Failed\r\n  tfReplicaStatuses: null\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/kubeflow/tf-operator/815)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/kubeflow/tf-operator/issues/comments/417815437","html_url":"https://github.com/kubeflow/tf-operator/pull/815#issuecomment-417815437","issue_url":"https://api.github.com/repos/kubeflow/tf-operator/issues/815","id":417815437,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzgxNTQzNw==","user":{"login":"k8s-ci-robot","id":20407524,"node_id":"MDQ6VXNlcjIwNDA3NTI0","avatar_url":"https://avatars0.githubusercontent.com/u/20407524?v=4","gravatar_id":"","url":"https://api.github.com/users/k8s-ci-robot","html_url":"https://github.com/k8s-ci-robot","followers_url":"https://api.github.com/users/k8s-ci-robot/followers","following_url":"https://api.github.com/users/k8s-ci-robot/following{/other_user}","gists_url":"https://api.github.com/users/k8s-ci-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/k8s-ci-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8s-ci-robot/subscriptions","organizations_url":"https://api.github.com/users/k8s-ci-robot/orgs","repos_url":"https://api.github.com/users/k8s-ci-robot/repos","events_url":"https://api.github.com/users/k8s-ci-robot/events{/privacy}","received_events_url":"https://api.github.com/users/k8s-ci-robot/received_events","type":"User","site_admin":false},"created_at":"2018-08-31T23:47:43Z","updated_at":"2018-08-31T23:47:43Z","author_association":"NONE","body":"[APPROVALNOTIFIER] This PR is **NOT APPROVED**\n\nThis pull-request has been approved by:\nTo fully approve this pull request, please assign additional approvers.\nWe suggest the following additional approver: **jlewi**\n\nIf they are not already assigned, you can assign the PR to them by writing `/assign @jlewi` in a comment when ready.\n\nThe full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands).\n\nThe pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)\n\n<details open>\nNeeds approval from an approver in each of these files:\n\n- **[OWNERS](https://github.com/kubeflow/tf-operator/blob/master/OWNERS)**\n\nApprovers can indicate their approval by writing `/approve` in a comment\nApprovers can cancel approval by writing `/approve cancel` in a comment\n</details>\n<!-- META={\"approvers\":[\"jlewi\"]} -->"}}
{"actor":{"display_login":"k8s-ci-robot"}}