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

--entry-point in subfolder does not work #7

Open
dacort opened this issue Mar 28, 2023 · 7 comments
Open

--entry-point in subfolder does not work #7

dacort opened this issue Mar 28, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@dacort
Copy link
Contributor

dacort commented Mar 28, 2023

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 dacort added the bug Something isn't working label Apr 3, 2023
@kirillklimenko
Copy link

Any updates?

@dacort
Copy link
Contributor Author

dacort commented Oct 16, 2023

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

@dacort
Copy link
Contributor Author

dacort commented Oct 17, 2023

@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?

@kirillklimenko
Copy link

@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/

@dacort
Copy link
Contributor Author

dacort commented Oct 17, 2023

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.

@kirillklimenko
Copy link

@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.

@dacort
Copy link
Contributor Author

dacort commented Oct 18, 2023

Ok, thank you, that's helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants