amazon-emr-cli icon indicating copy to clipboard operation
amazon-emr-cli copied to clipboard

--entry-point in subfolder does not work

Open dacort opened this issue 3 years ago • 7 comments

If the entrypoint file is in a subfolder locally, it attempts to use that subfolder in constructing the entrypoint path on S3.

We should either:

  • Truncate the folder when constructing the entrypoint
  • Upload the entrypoint to the same subfolder in S3

dacort avatar Mar 28 '23 18:03 dacort

Any updates?

thekiryu avatar Oct 16 '23 12:10 thekiryu

Not as of yet - thanks for the bump, might try to take a look this week. Contributions also welcome.

dacort avatar Oct 16 '23 17:10 dacort

@kirillklimenko I'd love to have more details about your use-case and/or expectations.

If I went with option 1 (truncate the folder when constructing the entrypoint), would that break anything for you like relative imports?

dacort avatar Oct 17 '23 19:10 dacort

@dacort

I ran into an error when I passed a relative path to an entrypoint and it wasn't found for example:

  • --entrypoint src/entrypoints/main.py
  • --s3-code-uri s3://${S3_BUCKET}/projects/

thekiryu avatar Oct 17 '23 19:10 thekiryu

Yep, makes sense - does your main.py reference modules relative to src/entrypoints?

For example, given a structure like this:

.
└── src
    ├── entrypoints
    │   ├── main.py
    │   └── vendor
    │       └── example.py
    └── utils
        └── udf.py

5 directories, 3 files

I could image if main.py were moved outside of the src/entrypoints folder and tried to use from vendor.example import Vendor it would fail.

from utils.udf import SomeFunction would likely still work as the Python project would get get packaged up properly.

dacort avatar Oct 17 '23 19:10 dacort

@dacort

Yes, main.py has dependencies on the files inside the package.

If I move main.py from the entrypoints folder to the root and specify it as -- entrypoint main.py, then everything works, but if it is inside the package (the src folder), it does not work --entrypoint src/entrypoints/main.py.

I have multiple entrypoints in the entrypoints folder, so it doesn't make sense for me to put each one at the root of the project.

thekiryu avatar Oct 18 '23 05:10 thekiryu

Ok, thank you, that's helpful!

dacort avatar Oct 18 '23 06:10 dacort