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

Backend - Fixed handling of sample compilation failure #387

Conversation

Ark-kun
Copy link
Contributor

@Ark-kun Ark-kun commented Nov 27, 2018

Fixes #354


This change is Reviewable

@Ark-kun Ark-kun force-pushed the avolkov/Backend---Fixed-handling-of-sample-compilation-failure branch from 1253593 to 9297d40 Compare November 27, 2018 02:45
@qimingj
Copy link
Contributor

qimingj commented Nov 27, 2018

There is a build-image failure...

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Nov 27, 2018

@qimingj Looks like the dsl-compiler fails to load the file in some cases. Can you please investigate this?

I suspect that there are some problems with file path handling.
The paths are most likely in the following format:

./xgboost-spark/xgboost-training-cm.py
build-api-server-image:	Step 21/32 : RUN  for pipeline in "$(find . -maxdepth 2 -name '*.py' -type f)"; do dsl-compile --py "$pipeline" --output "$pipeline.tar.gz"; done
build-api-server-image:	 ---> Running in 1af2bec754d0
build-api-server-image:	Traceback (most recent call last):
build-api-server-image:	  File "/usr/local/bin/dsl-compile", line 11, in <module>
build-api-server-image:	    sys.exit(main())
build-api-server-image:	  File "/usr/local/lib/python3.5/site-packages/kfp/compiler/main.py", line 100, in main
build-api-server-image:	    compile_pyfile(args.py, args.function, args.output)
build-api-server-image:	  File "/usr/local/lib/python3.5/site-packages/kfp/compiler/main.py", line 88, in compile_pyfile
build-api-server-image:	    __import__(os.path.splitext(filename)[0])
build-api-server-image:	ImportError: No module named 'xgboost-training-cm'
build-api-server-image:	The command '/bin/sh -c for pipeline in "$(find . -maxdepth 2 -name '*.py' -type f)"; do dsl-compile --py "$pipeline" --output "$pipeline.tar.gz"; done' returned a non-zero code: 1

@qimingj
Copy link
Contributor

qimingj commented Nov 27, 2018

You don't need the quotes around find command.

RUN for pipeline in "$(find . -maxdepth 2 -name '*.py' -type f)"; do dsl-compile --py "$pipeline" --output "$pipeline.tar.gz"; done

should be:

RUN for pipeline in $(find . -maxdepth 2 -name '*.py' -type f); do dsl-compile --py "$pipeline" --output "$pipeline.tar.gz"; done

With the quotes the results are treated as a single string with multiple lines.

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Nov 27, 2018

@qimingj Thanks for fixing the problem. I checked the code locally and it did not occur to me that it would work differently in Docker. I think we should modify the compiler so that it checks the existence of a file and give a meaningful error if the file does not exist.

You don't need the quotes around find command.

I've checked that the quotes are needed when the files can have spaces. Otherwise for breaks them into parts. I wonder why this works differently when run by Docker.

@qimingj
Copy link
Contributor

qimingj commented Nov 27, 2018

/lgtm

@qimingj
Copy link
Contributor

qimingj commented Nov 27, 2018

The other pair of quotes ("$pipeline") should take care of the space in file names?

I can reproduce the problem locally with your previous command.

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Nov 27, 2018

The other pair of quotes ("$pipeline") should take care of the space in file names?

Those quotes cannot help when the file name is already split into parts by for:

$ ls -la
total 16
drwxr-xr-x  2 avolkov primarygroup 4096 Nov 26 18:20  .
drwxrwxrwt 16 root    root         4096 Nov 26 18:20  ..
-rw-r--r--  1 avolkov primarygroup    4 Nov 26 18:20 'aa bb'
-rw-r--r--  1 avolkov primarygroup    4 Nov 26 18:20 'cc dd'
$ for file in "$(find . -type f)"; do echo $file; done
./cc dd ./aa bb
$ for file in $(find . -type f); do echo $file; done
./cc
dd
./aa
bb

@qimingj
Copy link
Contributor

qimingj commented Nov 27, 2018

/lgtm

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Nov 27, 2018

/test presubmit-e2e-test

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Nov 27, 2018

/approve

@IronPan
Copy link
Member

IronPan commented Nov 27, 2018

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ark-kun, IronPan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Nov 28, 2018

/test build-image

1 similar comment
@Ark-kun
Copy link
Contributor Author

Ark-kun commented Nov 28, 2018

/test build-image

@k8s-ci-robot k8s-ci-robot merged commit 2a3ec15 into master Nov 28, 2018
@Ark-kun Ark-kun deleted the avolkov/Backend---Fixed-handling-of-sample-compilation-failure branch November 28, 2018 17:35
Linchin pushed a commit to Linchin/pipelines that referenced this pull request Apr 11, 2023
HumairAK pushed a commit to red-hat-data-services/data-science-pipelines that referenced this pull request Mar 11, 2024
* Update the backend test instructions with go test

* Apply suggestions from code review

Co-authored-by: Animesh Singh <singhan@us.ibm.com>

Co-authored-by: Animesh Singh <singhan@us.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants