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

fix: hot swapping error in python ml function #1060

Merged
merged 2 commits into from
Mar 31, 2025
Merged

fix: hot swapping error in python ml function #1060

merged 2 commits into from
Mar 31, 2025

Conversation

ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Mar 29, 2025

What does this PR do?

In python-ml function, we copy over files to runtime-env here - https://github.com/open-runtimes/open-runtimes/blob/088ef387b097cc7bb29aff6602372ac1196c5925/runtimes/python/versions/latest/helpers/prepare-start.sh#L4

This folder contains various files, even including symlinks.

Symlinks when copied over won't be valid files anymore and hence the getAllFiles function in CLI throws an error trying to fetch absolute paths for it.

So the PR makes the function just skip any invalid symlinks.

Test Plan

Before:

Screenshot 2025-03-29 at 5 44 07 PM

After:

Screenshot 2025-03-29 at 5 44 36 PM

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

Yes.

Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make sure some of the other runtimes still work as expected? Particularly:

  • node
  • python
  • dart
  • bun

Also, it's possible to deploy a function where certain folders are symlinks. This helps to re-use code. For example, I have a symlink here to re-use this folder of common modules. Will this setup work locally with the CLI?

@ChiragAgg5k
Copy link
Member Author

ChiragAgg5k commented Mar 31, 2025

@stnguyen90 Yeah you are right, the approach i used would fail if any symlinks were used.

I have changed it to just skip symlinks that are not valid and that throw an error. It will work the same for all the other files.

@stnguyen90
Copy link
Contributor

And you've tested with multiple runtimes like:

  • node
  • python
  • dart
  • bun

@ChiragAgg5k
Copy link
Member Author

Screenshot 2025-03-31 at 10 32 04 PM

@stnguyen90 yep i just did doing so. lgtm

@stnguyen90 stnguyen90 merged commit e8144c9 into master Mar 31, 2025
37 checks passed
@stnguyen90 stnguyen90 deleted the pla-2730 branch March 31, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants