Fixed tf_operator import for github_issue_summarization example (#527)

* fixed tf_operator import

* updated tf-operator import path

* small change

* updated PYTHONPATH

* fixed syntax error

* formating issue
This commit is contained in:
zabbasi 2019-03-14 18:36:58 -07:00 committed by Kubernetes Prow Robot
parent 8a26b23e3d
commit 7924e0fe21
3 changed files with 17 additions and 12 deletions

View File

@ -28,8 +28,8 @@ import logging
import os
from kubernetes import client as k8s_client
from py import tf_job_client #pylint: disable=no-name-in-module
from py import test_runner #pylint: disable=no-name-in-module
from kubeflow.tf_operator import tf_job_client #pylint: disable=no-name-in-module
from kubeflow.tf_operator import test_runner #pylint: disable=no-name-in-module
from kubeflow.testing import ks_util
from kubeflow.testing import test_util

View File

@ -69,6 +69,14 @@ local srcDir = srcRootDir + "/" + prowDict.REPO_OWNER + "/" + prowDict.REPO_NAME
// value of KUBECONFIG environment variable. This should be a full path.
local kubeConfig = testDir + "/.kube/kubeconfig";
// The directory within the kubeflow_testing and kubeflow_tf-operator submodule containing
// py scripts to use.
local kubeflowTestingPy = srcRootDir + "/kubeflow/testing/py";
local tfOperatorPy = srcRootDir + "/kubeflow/tf-operator/py";
// These variables control where the docker images get pushed and what
// tag to use
local imageBase = "gcr.io/kubeflow-ci/github-issue-summarization";
@ -92,17 +100,13 @@ local buildTemplate = {
workingDir:: null,
env_vars:: [],
side_cars: [],
pythonPath: kubeflowTestingPy + ":" + tfOperatorPy,
activeDeadlineSeconds: 1800, // Set 30 minute timeout for each template
local template = self,
// The directory within the kubeflow_testing submodule containing
// py scripts to use.
local kubeflowTestingPy = srcRootDir + "/kubeflow/testing/py",
local tfOperatorPy = srcRootDir + "/kubeflow/tf-operator",
// Actual template for Argo
argoTemplate: {
@ -123,7 +127,7 @@ local buildTemplate = {
{
// Add the source directories to the python path.
name: "PYTHONPATH",
value: kubeflowTestingPy + ":" + tfOperatorPy,
value: template.pythonPath,
},
{
name: "GOOGLE_APPLICATION_CREDENTIALS",
@ -269,6 +273,7 @@ local dagTemplates = [
"--artifacts_path=" + artifactsDir,
],
workingDir: srcDir + "/github_issue_summarization/testing",
pythonPath: tfOperatorPy + ":" + kubeflowTestingPy,
},
dependencies: ["build-images", "get-kubeconfig"],
}, // tfjob-test

View File

@ -92,7 +92,7 @@ local testNamespace = "mnist-" + prowDict["BUILD_ID"];
// The directory within the kubeflow_testing submodule containing
// py scripts to use.
local kubeflowTestingPy = srcRootDir + "/kubeflow/testing/py";
local tfOperatorPy = srcRootDir + "/kubeflow/tf-operator";
local tfOperatorPy = srcRootDir + "/kubeflow/tf-operator/py";
// Workflow template is the name of the workflow template; typically the name of the ks component.
// This is used as a label to make it easy to identify all Argo workflows created from a given
@ -116,7 +116,7 @@ local buildTemplate = {
workingDir:: null,
env_vars:: [],
side_cars: [],
pythonPath: kubeflowTestingPy,
pythonPath: kubeflowTestingPy + ":" + tfOperatorPy,
activeDeadlineSeconds: 1800, // Set 30 minute timeout for each template
@ -325,7 +325,7 @@ local dagTemplates = [
// We don't want to add it to the other steps because
// of a top level path conflict see
// https://github.com/kubeflow/tf-operator/issues/914
pythonPath: kubeflowTestingPy + ":" + tfOperatorPy,
pythonPath: tfOperatorPy+ ":" + kubeflowTestingPy,
workingDir: srcDir + "/mnist/testing",
},
dependencies: ["build-images", "create-namespace"],
@ -346,7 +346,7 @@ local dagTemplates = [
// We don't want to add it to the other steps because
// of a top level path conflict see
// https://github.com/kubeflow/tf-operator/issues/914
pythonPath: kubeflowTestingPy + ":" + tfOperatorPy,
pythonPath: tfOperatorPy+ ":" + kubeflowTestingPy,
workingDir: srcDir + "/mnist/testing",
},
dependencies: ["tfjob-test"],