Open Tor-Saxberg opened 1 year ago
I found this comment on stackoverflow: "You can only deploy functions directly from Tabpy server. remote deployment is not possible." But I also found that Feature Request: Ability to remotely publish code #64 was closed as "completed."
I'm not sure how I would use Tabpy + Heroku if there was no way to use even the predeployed functions , so is there another way to deploy models?
I tried to just copy the entire 'tabpy/tabpy_server/staging/' directory like this:
cp -r /opt/homebrew/lib/python3.10/site-packages/tabpy/tabpy_server/staging/endpoints tabpy/tabpy_server/staging/endpoints
, but that gives the following error (after pushing):
>>> from tabpy.tabpy_tools.client import Client
>>> client = Client('https://xxx.herokuapp.com/')
>>> client.set_credentials('xxx','xxx')
>>> def anova(_arg1, _arg2, *_argN):
...
>>> client.deploy('anova', anova, 'computes anova p-value between several groups', override=True)
Overwriting existing file "/app/tabpy/tabpy_server/staging/endpoints/anova/1" when saving query object
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/app/tabpy/tabpy_tools/client.py", line 248, in deploy
self._wait_for_endpoint_deployment(obj["name"], obj["version"])
File "/app/tabpy/tabpy_tools/client.py", line 361, in _wait_for_endpoint_deployment
raise RuntimeError(f'LoadFailed: {ep["last_error"]}')
RuntimeError: LoadFailed: Load failed: code() argument 13 must be str, not int
Also, I noticed that endpoints/anova/1/
was not the latest version among the endpoints/anova/
directories, which suggests that the get_endpoints
method in the Client
class in tabpy/tabpy_tools/Client.py
is not reading it correctly or something.
Environment information:
Describe the issue I have Tabpy running on a Heroku server, but no models are deployed on launch. I tried to deploy a model like this:
But this returns the below error message:
Steps to reproduce I clicked on the tabpy deploy button, cloned a tabpy repository into the (empty) https://git.heroku.com/xxx.git, and ran the above code.
Expected behavior The model would be deployed, show as deployed in https://xxx.herokuapp.com/, and function properly in Tableau Cloud.
Additional context I also ran this for context:
Then I tried this, following the code in tabpy/models/deploy_models.py:
which returned this error for each model:
on local machine (not heroku), tabpy-deploy-model succesfully creates the directory /opt/homebrew/lib/python3.10/site-packages/tabpy/tabpy_server/staging/endpoints... So I tried deploying to the heroku instance without entering the heroku shell:
but this returns an error:
Lastly, I noticed in deploy-to-heroku.md that the default port should be set to 443, but
port, auth_on, prefix = setup_utils.parse_config(file_path)
shows that the port is actually 9004. Furthermore, when the app is launched in Heroku, it fills out the procfile asexport TABPY_PORT=#random number# && export TABPY_PWD_FILE=./file.txt && tabpy-user add -u xxx -p xxx -f ./file.txt && tabpy
. So, is this a port-mismatch error?