mirror of https://github.com/kubeflow/examples.git
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:
parent
8a26b23e3d
commit
7924e0fe21
|
|
@ -28,8 +28,8 @@ import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from kubernetes import client as k8s_client
|
from kubernetes import client as k8s_client
|
||||||
from py import tf_job_client #pylint: disable=no-name-in-module
|
from kubeflow.tf_operator 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 test_runner #pylint: disable=no-name-in-module
|
||||||
|
|
||||||
from kubeflow.testing import ks_util
|
from kubeflow.testing import ks_util
|
||||||
from kubeflow.testing import test_util
|
from kubeflow.testing import test_util
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,14 @@ local srcDir = srcRootDir + "/" + prowDict.REPO_OWNER + "/" + prowDict.REPO_NAME
|
||||||
// value of KUBECONFIG environment variable. This should be a full path.
|
// value of KUBECONFIG environment variable. This should be a full path.
|
||||||
local kubeConfig = testDir + "/.kube/kubeconfig";
|
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
|
// These variables control where the docker images get pushed and what
|
||||||
// tag to use
|
// tag to use
|
||||||
local imageBase = "gcr.io/kubeflow-ci/github-issue-summarization";
|
local imageBase = "gcr.io/kubeflow-ci/github-issue-summarization";
|
||||||
|
|
@ -92,17 +100,13 @@ local buildTemplate = {
|
||||||
workingDir:: null,
|
workingDir:: null,
|
||||||
env_vars:: [],
|
env_vars:: [],
|
||||||
side_cars: [],
|
side_cars: [],
|
||||||
|
pythonPath: kubeflowTestingPy + ":" + tfOperatorPy,
|
||||||
|
|
||||||
|
|
||||||
activeDeadlineSeconds: 1800, // Set 30 minute timeout for each template
|
activeDeadlineSeconds: 1800, // Set 30 minute timeout for each template
|
||||||
|
|
||||||
local template = self,
|
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
|
// Actual template for Argo
|
||||||
argoTemplate: {
|
argoTemplate: {
|
||||||
|
|
@ -123,7 +127,7 @@ local buildTemplate = {
|
||||||
{
|
{
|
||||||
// Add the source directories to the python path.
|
// Add the source directories to the python path.
|
||||||
name: "PYTHONPATH",
|
name: "PYTHONPATH",
|
||||||
value: kubeflowTestingPy + ":" + tfOperatorPy,
|
value: template.pythonPath,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "GOOGLE_APPLICATION_CREDENTIALS",
|
name: "GOOGLE_APPLICATION_CREDENTIALS",
|
||||||
|
|
@ -269,6 +273,7 @@ local dagTemplates = [
|
||||||
"--artifacts_path=" + artifactsDir,
|
"--artifacts_path=" + artifactsDir,
|
||||||
],
|
],
|
||||||
workingDir: srcDir + "/github_issue_summarization/testing",
|
workingDir: srcDir + "/github_issue_summarization/testing",
|
||||||
|
pythonPath: tfOperatorPy + ":" + kubeflowTestingPy,
|
||||||
},
|
},
|
||||||
dependencies: ["build-images", "get-kubeconfig"],
|
dependencies: ["build-images", "get-kubeconfig"],
|
||||||
}, // tfjob-test
|
}, // tfjob-test
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ local testNamespace = "mnist-" + prowDict["BUILD_ID"];
|
||||||
// The directory within the kubeflow_testing submodule containing
|
// The directory within the kubeflow_testing submodule containing
|
||||||
// py scripts to use.
|
// py scripts to use.
|
||||||
local kubeflowTestingPy = srcRootDir + "/kubeflow/testing/py";
|
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.
|
// 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
|
// 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,
|
workingDir:: null,
|
||||||
env_vars:: [],
|
env_vars:: [],
|
||||||
side_cars: [],
|
side_cars: [],
|
||||||
pythonPath: kubeflowTestingPy,
|
pythonPath: kubeflowTestingPy + ":" + tfOperatorPy,
|
||||||
|
|
||||||
activeDeadlineSeconds: 1800, // Set 30 minute timeout for each template
|
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
|
// We don't want to add it to the other steps because
|
||||||
// of a top level path conflict see
|
// of a top level path conflict see
|
||||||
// https://github.com/kubeflow/tf-operator/issues/914
|
// https://github.com/kubeflow/tf-operator/issues/914
|
||||||
pythonPath: kubeflowTestingPy + ":" + tfOperatorPy,
|
pythonPath: tfOperatorPy+ ":" + kubeflowTestingPy,
|
||||||
workingDir: srcDir + "/mnist/testing",
|
workingDir: srcDir + "/mnist/testing",
|
||||||
},
|
},
|
||||||
dependencies: ["build-images", "create-namespace"],
|
dependencies: ["build-images", "create-namespace"],
|
||||||
|
|
@ -346,7 +346,7 @@ local dagTemplates = [
|
||||||
// We don't want to add it to the other steps because
|
// We don't want to add it to the other steps because
|
||||||
// of a top level path conflict see
|
// of a top level path conflict see
|
||||||
// https://github.com/kubeflow/tf-operator/issues/914
|
// https://github.com/kubeflow/tf-operator/issues/914
|
||||||
pythonPath: kubeflowTestingPy + ":" + tfOperatorPy,
|
pythonPath: tfOperatorPy+ ":" + kubeflowTestingPy,
|
||||||
workingDir: srcDir + "/mnist/testing",
|
workingDir: srcDir + "/mnist/testing",
|
||||||
},
|
},
|
||||||
dependencies: ["tfjob-test"],
|
dependencies: ["tfjob-test"],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue