examples icon indicating copy to clipboard operation
examples copied to clipboard

[codelab-intro-mnist-feedback]:build

Open wanglj-lanzer opened this issue 7 years ago • 31 comments

kustomize build .

Error: no matches for OriginalId kubeflow.org_v1beta1_TFJob|~X|$(trainingName); no matches for CurrentId kubeflow.org_v1beta1_TFJob|~X|$(trainingName); failed to find unique target for patch kubeflow.org_v1beta1_TFJob|$(trainingName)

wanglj-lanzer avatar Jul 25 '19 06:07 wanglj-lanzer

Issue-Label Bot is automatically applying the label kind/bug to this issue, with a confidence of 0.83. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

issue-label-bot[bot] avatar Jul 25 '19 06:07 issue-label-bot[bot]

I encountered the same issue. What can we do to solve it?

miguelvcsoares avatar Jul 25 '19 16:07 miguelvcsoares

@wanglj-lanzer Which version of kustomize you used? we hit some problems due to kustomize bug, and seuggested (noted) using kustomize v2.0.3 in README file.

And which platform you tried, GCP or on-prem cluster? Thanks.

jinchihe avatar Jul 26 '19 05:07 jinchihe

GCP

I installed the kustomize via go get sigs.k8s.io/kustomize/cmd/kustomize

wanglj-lanzer avatar Jul 26 '19 05:07 wanglj-lanzer

See notes in the readme file Note: kustomize v2.0.3 is recommented since the problem in kustomize v2.1.0

Could you please try this by using v2.0.3 and following the Readme file? New kustomize has bug here.

jinchihe avatar Jul 26 '19 05:07 jinchihe

new errors after reinstall kustomize as the recommended version

Error: rawResources failed to read Resources: Load from path ../base failed: '../base' must be a file (got d='~/examples/mnist/training/base')

wanglj-lanzer avatar Jul 26 '19 18:07 wanglj-lanzer

I have also experienced same issues as @wanglj-lanzer – both on latest kustomize and v2.0.3.

andrewcantos avatar Jul 29 '19 07:07 andrewcantos

Following the README in the repo, that should work fine. Thanks.

jinchihe avatar Jul 30 '19 01:07 jinchihe

Unfortunately it doesn't work as expected on my machine. I have ensured I am running v2.0.3 using cloned latest from (this) examples repo. I have followed README instructions and error:

Error: rawResources failed to read Resources: Load from path ../base failed: '../base' must be a file (got d='~/kubeflow_examples/mnist/training/base')

Note: I ran this from mnist/training/GCS directory.

I was able to successfully build from local directory.

andrewcantos avatar Jul 30 '19 07:07 andrewcantos

@andrewcantos @wanglj-lanzer I'm not sure which steps has the problem? But that works fine on my env, below is a example, thanks.:

[root@jinchi1 GCS]# kustomize version
Version: {KustomizeVersion:2.0.3 GitCommit:a6f65144121d1955266b0cd836ce954c04122dc8 BuildDate:2019-03-05T20:37:42Z GoOs:linux GoArch:amd64}
[root@jinchi1 GCS]# BUCKET=distributed-test
[root@jinchi1 GCS]# kustomize edit add configmap mnist-map-training --from-literal=name=mnist-train-dist
[root@jinchi1 GCS]# kustomize edit set image training-image=docker.io/ibmlei/mykubeflow:0.1
[root@jinchi1 GCS]# ../base/definition.sh --numPs 1 --numWorkers 2
[root@jinchi1 GCS]# kustomize edit add configmap mnist-map-training --from-literal=trainSteps=200
[root@jinchi1 GCS]# kustomize edit add configmap mnist-map-training --from-literal=batchSize=100
[root@jinchi1 GCS]# kustomize edit add configmap mnist-map-training --from-literal=learningRate=0.01
[root@jinchi1 GCS]# MODEL_PATH=my-model
[root@jinchi1 GCS]# kustomize edit add configmap mnist-map-training --from-literal=modelDir=gs://${BUCKET}/${MODEL_PATH}
[root@jinchi1 GCS]# kustomize edit add configmap mnist-map-training --from-literal=exportDir=gs://${BUCKET}/${MODEL_PATH}/export
[root@jinchi1 GCS]# kustomize edit add configmap mnist-map-training --from-literal=secretName=user-gcp-sa
[root@jinchi1 GCS]# kustomize edit add configmap mnist-map-training --from-literal=secretMountPath=/var/secrets
[root@jinchi1 GCS]# kustomize edit add configmap mnist-map-training --from-literal=GOOGLE_APPLICATION_CREDENTIALS=/var/secrets/user-gcp-sa.json
[root@jinchi1 GCS]# kustomize build . |kubectl apply -f -
configmap/mnist-map-training-gfththd74g created
tfjob.kubeflow.org/mnist-train-dist created

jinchihe avatar Jul 30 '19 07:07 jinchihe

I'm following this tutorial. I'm pretty sure I followed the instructions correctly and I reached the same problem at step kustomize build .

$ kustomize build .
Error: no matches for OriginalId kubeflow.org_v1beta2_TFJob|~X|$(trainingName); no matches for CurrentId kubeflow.org_v1beta2_TFJob|~X|$(trainingName); failed to find unique target for patch kubeflow.org_v1beta2_TFJob|$(trainingName)

I installed kustomize from "Quickly curl the latest" here

my version is as below: Version: {KustomizeVersion:3.1.0 GitCommit:95f3303493fdea243ae83b767978092396169baf BuildDate:2019-07-26T18:11:16Z GoOs:linux GoArch:amd64}

ricoms avatar Aug 06 '19 02:08 ricoms

@ricoms use kustomize v2.0.3 please, new kustomize has bugs here.

jinchihe avatar Aug 06 '19 02:08 jinchihe

using v2.0.3 I fell on the issue you opened @jinchihe #1029 when I applied kustomize edit set image training-image=$IMAGE_PATH

I created a tag with export TAG=$(date +"%m-%d-%Y") and add it to the IMAGE_PATH like this export IMAGE_PATH=us.gcr.io/$PROJECT_ID/kubeflow-train:$TAG.

Then I was able to apply kustomize build . | kubectl apply -f - with success, the respose was a yaml file and below:

configmap/mnist-map-training-4c92g6hh6b unchanged
tfjob.kubeflow.org/my-train-1 unchanged

But the original "bug" seems so "simple"... the problem appears to be the trainingName variable, as pointed here. The kustomization.yaml requires trainingName variable and it is not being set anywhere, it seems. I would like to solve this problem by upgrading the tutorial to kustomize 3.1.0. Is it very hard? Could someone point me to the problem and where could I help?

ricoms avatar Aug 06 '19 18:08 ricoms

@ricoms See here https://github.com/kubernetes-sigs/kustomize/issues/1295 I think that has been fixed, and code may be merged in 3.x.

jinchihe avatar Aug 07 '19 00:08 jinchihe

Calling kustomize_3.x.x edit [...] once replaces

bases:
- ../base

with

resources:
- ../base

which leads to Error: rawResources failed to read Resources: Load from path ../base failed. Reverting that change and using kustomize_2.0.3 fixed it for me.

lucastheis avatar Aug 14 '19 17:08 lucastheis

Getting the same error kustomize build . |kubectl apply -f - Error: no matches for OriginalId extensions_v1beta1_Deployment|~X|$(svcName); no matches for CurrentId extensions_v1beta1_Deployment|~X|$(svcName); failed to find unique target for patch extensions_v1beta1_Deployment|$(svcName) error: no objects passed to apply Any solution for this? Thanks in advance.

sarika-pst avatar Sep 20 '19 13:09 sarika-pst

@aicdp1010 try it using kustomize v2.0.3 please.

jinchihe avatar Sep 22 '19 09:09 jinchihe

Above error is resolved using v2.0.3 but now I am getting

$ kustomize build . |kubectl apply -f -
configmap/mnist-map-training-2fg9c7886m created
error: unable to recognize "STDIN": no matches for kind "TFJob" in version "kubeflow.org/v1beta2"

I am new to this, Is the issue related to kubernetes cluster. Please guide me. Thank you.

sarika-pst avatar Sep 23 '19 12:09 sarika-pst

@aicdp1010 please check your cluster, what the TFJob version installed in your cluster?

jinchihe avatar Sep 23 '19 13:09 jinchihe

using v2.0.3 I fell on the issue you opened @jinchihe #1029 when I applied kustomize edit set image training-image=$IMAGE_PATH

I created a tag with export TAG=$(date +"%m-%d-%Y") and add it to the IMAGE_PATH like this export IMAGE_PATH=us.gcr.io/$PROJECT_ID/kubeflow-train:$TAG.

Then I was able to apply kustomize build . | kubectl apply -f - with success, the respose was a yaml file and below:

configmap/mnist-map-training-4c92g6hh6b unchanged
tfjob.kubeflow.org/my-train-1 unchanged

But the original "bug" seems so "simple"... the problem appears to be the trainingName variable, as pointed here. The kustomization.yaml requires trainingName variable and it is not being set anywhere, it seems. I would like to solve this problem by upgrading the tutorial to kustomize 3.1.0. Is it very hard? Could someone point me to the problem and where could I help?

Hi I tried to add trainingName but it already existed kustomize edit add configmap mnist-map-training --from-literal=trainingName=test_kubeflow Error: cannot add key trainingName, another key by that name already exists: map[GOOGLE_APPLICATION_CREDENTIALS:/var/secrets/user-gcp-sa.json batchSize:100 exportDir:gs://my_bucket_kubeflow/my-model/export learningRate:0.01 modelDir:gs://my_bucket_kubeflow/my-model name:my-train-1 secretMountPath:/var/secrets secretName:user-gcp-sa trainSteps:200 trainingName:test_kubeflow]

But when I am again trying to build it gives error

cloudshell:~/examples/mnist/training/GCS$ kustomize build Error: no matches for OriginalId kubeflow.org_v1beta2_TFJob|~X|$(trainingName); no matches for CurrentId kubeflow.org_v1beta2_TFJob|~X|$(trainingName); failed to find unique target for patch kubeflow.org_v1beta2_TFJob|$(trainingName)

shreya-verma19 avatar Oct 07 '19 10:10 shreya-verma19