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

Add capability to deploy models remotely #652

Merged
merged 21 commits into from
Nov 25, 2024
Merged

Conversation

jakeichikawasalesforce
Copy link
Collaborator

@jakeichikawasalesforce jakeichikawasalesforce commented Nov 20, 2024

Remote Deploy

This PR adds the capability to deploy models to a remote server by creating a client with remote_server=true. See this PR's docs/tabpy-tools.md for usage.

  • Pass deploy to _remote_deploy if client is connected to a remote server.
  • In _remote_deploy generate a python script to run on the TabPy server: (i) create client instance, (ii) add credentials if necessary, (iii) add source code, (iv) deploy function with user's parameters.
  • Then pass to _evaluate_remote_script, which will use the TabPy server's /evaluate endpoint to run the script.

If TABPY_EVALUATE_ENABLE is set to False in the config, this remote deployment will not work, which is the intended behavior (otherwise this would provide a hack where the user can upload arbitrary code and then execute it with the query endpoint).

Other Fixes:

  • Add user's docstring to _gen_endpoint, which apparently was not being set at all (always defaulting to "no docstring found"). This uses CustomQueryObject's get_doc_string.
    • However, was running into issues with GitHub's Windows CI/CD Runner, so only fixing this on Mac and Linux for now. This seems to work when ran locally on Windows. Needs more investigation.
  • Add time.sleep(interval) to beginning of _wait_for_endpoint_deployment; this helps prevent a 500 error response when the model did indeed deploy.
  • Now deleting an endpoint's stage directory as well, when removing an endpoint.
  • Include all local log files in .gitignore.

@pep8speaks
Copy link

pep8speaks commented Nov 20, 2024

Hello @jakeichikawasalesforce! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-11-25 21:44:20 UTC

@jakeichikawasalesforce jakeichikawasalesforce marked this pull request as ready for review November 22, 2024 16:19
@jakeichikawasalesforce jakeichikawasalesforce changed the title Add capability to deploying models remotely Add capability to deploy models remotely Nov 22, 2024
tabpy/tabpy_tools/client.py Outdated Show resolved Hide resolved
tabpy/tabpy_tools/client.py Outdated Show resolved Hide resolved
@jakeichikawasalesforce jakeichikawasalesforce merged commit fe613a1 into master Nov 25, 2024
20 checks passed
@jakeichikawasalesforce jakeichikawasalesforce deleted the remote_server branch November 25, 2024 22:31
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.

4 participants