Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use tensorboard viewer using mount path #4208

Closed
haibingzhao opened this issue Jul 14, 2020 · 10 comments
Closed

Unable to use tensorboard viewer using mount path #4208

haibingzhao opened this issue Jul 14, 2020 · 10 comments
Assignees
Labels
area/frontend help wanted The community is welcome to contribute. kind/feature lifecycle/stale The issue / pull request is stale, any activities remove this label. status/triaged Whether the issue has been explicitly triaged

Comments

@haibingzhao
Copy link
Contributor

haibingzhao commented Jul 14, 2020

What steps did you take:

deploy 'ml-pipeline-ui' deployment with env:
VIEWER_TENSORBOARD_POD_TEMPLATE_SPEC_PATH=/config/view_spec_template.json

content of /config/view_spec_template.json is:

{
  "spec": {
    "containers": [{
      "volumeMounts": [{
        "name": "output",
        "mountPath": "/output"
      }]
    }],
    "volumes": [{
      "name": "output",
      "hostPath": {
        "path": "/data/output",
        "type": "Directory"
      }
    }]
  }
}

run pipeline component and finished with Unsupported storage path: /output/5/1/record/rnn error:
image

What happened:

switch to Artifact tab, show Unsupported storage path: /output/5/1/record/rnn error

What did you expect to happen:

no errors and show tensorboard open card as below:
image

Environment:

How did you deploy Kubeflow Pipelines (KFP)?
deploy kubeflow pipeline locally with k3s

KFP version: 0.5.1
KFP SDK version: 0.5.1

Anything else you would like to add:

search for source code WorkflowParser, it is confused that why not support local file schema start with '/'?

/kind bug

@Bobgy
Copy link
Contributor

Bobgy commented Jul 15, 2020

developer guide in https://github.com/kubeflow/pipelines/tree/master/frontend.

Would you mind trying adding a branch in source code to handle local file and if that works for you?

@Bobgy Bobgy added area/frontend help wanted The community is welcome to contribute. labels Jul 15, 2020
@Bobgy Bobgy self-assigned this Jul 15, 2020
@Bobgy Bobgy added the status/triaged Whether the issue has been explicitly triaged label Jul 15, 2020
@Bobgy
Copy link
Contributor

Bobgy commented Jul 15, 2020

Thanks for the report! we haven't been supporting local volume mount for tensorboard, so this is a feature request.
/assign @jingzhang36

@haibingzhao
Copy link
Contributor Author

haibingzhao commented Jul 16, 2020

developer guide in https://github.com/kubeflow/pipelines/tree/master/frontend.

Would you mind trying adding a branch in source code to handle local file and if that works for you?

I'm glad to support this feature, some small code change works now. Detail info please refer to: WorkflowParser.ts#L365 and artifacts.ts#L105

How to use?

  1. clone source code, build frontend docker image, detail info: https://github.com/kubeflow/pipelines/tree/master/frontend:
cd your_pipeline_path/frontend
npm run docker
  1. create config map for ml-pipeline-ui
kubectl apply -f - <<EOF
apiVersion: v1
data:
  view-spec-template.json: |-
    {
      "spec": {
          "containers": [{
            "volumeMounts": [{
              "name": "output",
              "mountPath": "/output"
            }]
          }],
          "volumes": [{
            "name": "output",
            "persistentVolumeClaim": {
              "claimName": "output"
            }
          }]
        }
    }
kind: ConfigMap
metadata:
  name: ui-view-spec-template-configmap
  namespace: kubeflow
EOF

view-spec-template.json content will be used by Viewer CRD, and tensorboad can use any path in /output directory. your tensorflow training pipeline component can attach output volume and output your data.

  1. patch update ml-pipeline-ui deployment
kubectl patch deployment ml-pipeline-ui -nkubeflow --type strategic --patch '
spec:
  template:
    spec:
      containers:
      - env:
        - name: VIEWER_TENSORBOARD_POD_TEMPLATE_SPEC_PATH
          value: "/config/view_spec_template.json"
        image: gcr.io/ml-pipeline/frontend:your_build_image_version
        name: ml-pipeline-ui
        volumeMounts:
          - mountPath: /config/view_spec_template.json
            subPath: view_spec_template.json
            name: view-template-config
          - mountPath: /output
            name: output
      volumes:
        - name: view-template-config
          configMap:
            name: ui-view-spec-template-configmap
            items:
              - key: view-spec-template.json
                path: view_spec_template.json
        - name: output
           persistentVolumeClaim:
                claimName: output,
                readOnly: true
'

ml-pipeline-ui deployment attach output volume only if you want to output Confusion matrix , Markdown, ROC curve, Table, Web app data file to output volume and want to displayed at UI. if you just use TensorBoard , output volume can be removed from ml-pipeline-ui deployment.

haibingzhao added a commit to haibingzhao/pipelines that referenced this issue Jul 16, 2020
@Bobgy
Copy link
Contributor

Bobgy commented Jul 17, 2020

That's awesome!
PR welcomed

@haibingzhao
Copy link
Contributor Author

That's awesome!
PR welcomed

PR was ready: #4236

@Bobgy
Copy link
Contributor

Bobgy commented Aug 6, 2020

Hi @haibingzhao, we can wait for #4236 to be merged now.
Do you want to contribute to this feature's documentation too?

Because this is relatively complex, I think it probably needs its own page for documentation. I think you can start from adding a markdown documentation in this repo probably in docs/config/volume-support.md.

Later we can target moving the documentation to somewhere near https://www.kubeflow.org/docs/pipelines/sdk/output-viewer/.

k8s-ci-robot pushed a commit that referenced this issue Aug 6, 2020
…s using volume mount path. Part of #4208 (#4236)

* support local file storage type for local volume mount path, refer: #4208

* add todo comment to support directory and filePath include wildcards '*', detail refer: #4208

* revert old code indent

* run 'npm run format' to format code

* support tensorboard viewer and other visualize Results using volume mount path, modify 'file' schema to 'volume':

1. source schema: volume://volume-name/relative/path/from/volume/xxx.csv
2. for tensorboard(also support Series1:volume://volume-name/path_to_model_dir_1,Series2:volume://volume-name/path_to_model_dir_2):
* check volume-name was specified in podTemplateSpec( which was inject by VIEWER_TENSORBOARD_POD_TEMPLATE_SPEC_PATH env)
* check /relative/path/from/volume/xxx file path was prefix-mounted in podTemplateSpec
3. for others:
* check volume-name was specified at ml-pipeline-ui pod
* check /relative/path/from/volume/xxx.csv file path exist

* fix test and add more tests

* change error message not found to not exist.

* fix tensorboard create test

* combining volume mount path and key as artifacts path

* extra complex code to a function and add more test

* use ml-pipeline-ui container name to find server container instead of use containers[0]

* fix review suggestion: #4236

* format code

* extract how to find file path on a pod volume to a common function, and optimize error message

* fix k8s-helper.test error

* add more documentation and fix mistake: volumeMountPath to filePathInVolume

* fix test error

* Update k8s-helper.test.ts

* format error message

Co-authored-by: Yuan (Bob) Gong <gongyuan94@gmail.com>
@haibingzhao
Copy link
Contributor Author

Hi @haibingzhao, we can wait for #4236 to be merged now.
Do you want to contribute to this feature's documentation too?

Because this is relatively complex, I think it probably needs its own page for documentation. I think you can start from adding a markdown documentation in this repo probably in docs/config/volume-support.md.

Later we can target moving the documentation to somewhere near https://www.kubeflow.org/docs/pipelines/sdk/output-viewer/.

ok, I will document this later.

chensun pushed a commit to chensun/pipelines that referenced this issue Aug 7, 2020
…s using volume mount path. Part of kubeflow#4208 (kubeflow#4236)

* support local file storage type for local volume mount path, refer: kubeflow#4208

* add todo comment to support directory and filePath include wildcards '*', detail refer: kubeflow#4208

* revert old code indent

* run 'npm run format' to format code

* support tensorboard viewer and other visualize Results using volume mount path, modify 'file' schema to 'volume':

1. source schema: volume://volume-name/relative/path/from/volume/xxx.csv
2. for tensorboard(also support Series1:volume://volume-name/path_to_model_dir_1,Series2:volume://volume-name/path_to_model_dir_2):
* check volume-name was specified in podTemplateSpec( which was inject by VIEWER_TENSORBOARD_POD_TEMPLATE_SPEC_PATH env)
* check /relative/path/from/volume/xxx file path was prefix-mounted in podTemplateSpec
3. for others:
* check volume-name was specified at ml-pipeline-ui pod
* check /relative/path/from/volume/xxx.csv file path exist

* fix test and add more tests

* change error message not found to not exist.

* fix tensorboard create test

* combining volume mount path and key as artifacts path

* extra complex code to a function and add more test

* use ml-pipeline-ui container name to find server container instead of use containers[0]

* fix review suggestion: kubeflow#4236

* format code

* extract how to find file path on a pod volume to a common function, and optimize error message

* fix k8s-helper.test error

* add more documentation and fix mistake: volumeMountPath to filePathInVolume

* fix test error

* Update k8s-helper.test.ts

* format error message

Co-authored-by: Yuan (Bob) Gong <gongyuan94@gmail.com>
@haibingzhao
Copy link
Contributor Author

@Bobgy I submit a PR to document this at: #4345, any suggestion will be welcome

k8s-ci-robot pushed a commit that referenced this issue Aug 17, 2020
…ize results (#4345)

* support local file storage type for local volume mount path, refer: #4208

* add todo comment to support directory and filePath include wildcards '*', detail refer: #4208

* revert old code indent

* run 'npm run format' to format code

* support tensorboard viewer and other visualize Results using volume mount path, modify 'file' schema to 'volume':

1. source schema: volume://volume-name/relative/path/from/volume/xxx.csv
2. for tensorboard(also support Series1:volume://volume-name/path_to_model_dir_1,Series2:volume://volume-name/path_to_model_dir_2):
* check volume-name was specified in podTemplateSpec( which was inject by VIEWER_TENSORBOARD_POD_TEMPLATE_SPEC_PATH env)
* check /relative/path/from/volume/xxx file path was prefix-mounted in podTemplateSpec
3. for others:
* check volume-name was specified at ml-pipeline-ui pod
* check /relative/path/from/volume/xxx.csv file path exist

* fix test and add more tests

* change error message not found to not exist.

* fix tensorboard create test

* combining volume mount path and key as artifacts path

* extra complex code to a function and add more test

* use ml-pipeline-ui container name to find server container instead of use containers[0]

* fix review suggestion: #4236

* format code

* extract how to find file path on a pod volume to a common function, and optimize error message

* fix k8s-helper.test error

* add more documentation and fix mistake: volumeMountPath to filePathInVolume

* fix test error

* Update k8s-helper.test.ts

* format error message

* document volume support for tensorboard viewer and other visualize results

* add beta status

* change beta status to alpha status

Co-authored-by: Yuan (Bob) Gong <gongyuan94@gmail.com>
@stale
Copy link

stale bot commented Nov 8, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the lifecycle/stale The issue / pull request is stale, any activities remove this label. label Nov 8, 2020
Jeffwan pushed a commit to Jeffwan/pipelines that referenced this issue Dec 9, 2020
…s using volume mount path. Part of kubeflow#4208 (kubeflow#4236)

* support local file storage type for local volume mount path, refer: kubeflow#4208

* add todo comment to support directory and filePath include wildcards '*', detail refer: kubeflow#4208

* revert old code indent

* run 'npm run format' to format code

* support tensorboard viewer and other visualize Results using volume mount path, modify 'file' schema to 'volume':

1. source schema: volume://volume-name/relative/path/from/volume/xxx.csv
2. for tensorboard(also support Series1:volume://volume-name/path_to_model_dir_1,Series2:volume://volume-name/path_to_model_dir_2):
* check volume-name was specified in podTemplateSpec( which was inject by VIEWER_TENSORBOARD_POD_TEMPLATE_SPEC_PATH env)
* check /relative/path/from/volume/xxx file path was prefix-mounted in podTemplateSpec
3. for others:
* check volume-name was specified at ml-pipeline-ui pod
* check /relative/path/from/volume/xxx.csv file path exist

* fix test and add more tests

* change error message not found to not exist.

* fix tensorboard create test

* combining volume mount path and key as artifacts path

* extra complex code to a function and add more test

* use ml-pipeline-ui container name to find server container instead of use containers[0]

* fix review suggestion: kubeflow#4236

* format code

* extract how to find file path on a pod volume to a common function, and optimize error message

* fix k8s-helper.test error

* add more documentation and fix mistake: volumeMountPath to filePathInVolume

* fix test error

* Update k8s-helper.test.ts

* format error message

Co-authored-by: Yuan (Bob) Gong <gongyuan94@gmail.com>
Jeffwan pushed a commit to Jeffwan/pipelines that referenced this issue Dec 9, 2020
…ize results (kubeflow#4345)

* support local file storage type for local volume mount path, refer: kubeflow#4208

* add todo comment to support directory and filePath include wildcards '*', detail refer: kubeflow#4208

* revert old code indent

* run 'npm run format' to format code

* support tensorboard viewer and other visualize Results using volume mount path, modify 'file' schema to 'volume':

1. source schema: volume://volume-name/relative/path/from/volume/xxx.csv
2. for tensorboard(also support Series1:volume://volume-name/path_to_model_dir_1,Series2:volume://volume-name/path_to_model_dir_2):
* check volume-name was specified in podTemplateSpec( which was inject by VIEWER_TENSORBOARD_POD_TEMPLATE_SPEC_PATH env)
* check /relative/path/from/volume/xxx file path was prefix-mounted in podTemplateSpec
3. for others:
* check volume-name was specified at ml-pipeline-ui pod
* check /relative/path/from/volume/xxx.csv file path exist

* fix test and add more tests

* change error message not found to not exist.

* fix tensorboard create test

* combining volume mount path and key as artifacts path

* extra complex code to a function and add more test

* use ml-pipeline-ui container name to find server container instead of use containers[0]

* fix review suggestion: kubeflow#4236

* format code

* extract how to find file path on a pod volume to a common function, and optimize error message

* fix k8s-helper.test error

* add more documentation and fix mistake: volumeMountPath to filePathInVolume

* fix test error

* Update k8s-helper.test.ts

* format error message

* document volume support for tensorboard viewer and other visualize results

* add beta status

* change beta status to alpha status

Co-authored-by: Yuan (Bob) Gong <gongyuan94@gmail.com>
@stale
Copy link

stale bot commented Feb 8, 2021

This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend help wanted The community is welcome to contribute. kind/feature lifecycle/stale The issue / pull request is stale, any activities remove this label. status/triaged Whether the issue has been explicitly triaged
Projects
None yet
Development

No branches or pull requests

4 participants