Closed FMKerckhof closed 10 months ago
Hi there @FMKerckhof, thank you for opening up this issue! That is a little perplexing...what version of vetiver
and rsconnect-python
are you using? This error had previously popped up in rsconnect-python, and vetiver pinned rsconnect-python to avoid older versions and hopefully avoid this. If possible, I'd recommend running pip install --upgrade vetiver rsconnect-python
to get the latest versions. Let me know if that helps!
As for documentation, we are in the process of updating all the information on the Connect docs to use vetiver.deploy_rsconnect
, but you make a great point that some sort of trouble-shooting might be useful.
Hi @isabelizimm , thank you for the swift reply - I am using vetiver 0.2.1 and rsconnect-python 1.20.0. I will upgrade vetiver to latest (0.2.3) and get back to you.
I upgraded vetiver to the latest (0.2.3) using pip as instructed, and the issue still persists - I get the exact same error message.
@isabelizimm apologies that I did not catch this earlier - since I am working on Posit workbench, I have a python version installed in /opt/python/...
(as per Posit docs) - as well as a system python. On both I also had a version of rsconnect-python
installed. In the terminal (and the Posit Workbench terminal) rsconnect-python
was 1.20.0, but for jupyterlab the rsconnect-python
version was 1.10.0 - after updating deploy did start.
In case other users would land here because deploys fail: I had to add a very minimal requirements.txt
to the "extra_files" argument of deploy_rsconnect - in my case, automatic resolution caused the deploy to crash because I had RPy2 imported in the environment (and it is very hard to publish something using RPy2 to connect apparently). If I did not specify this, pip freeze
would create a very large requirements.txt
.
Finally, @isabelizimm I would like to ask you something about a warning which I do not really understand (unless I should make a dedicated issue out of this?):
/opt/python/3.10.6/lib/python3.10/site-packages/vetiver/write_fastapi.py:21: UserWarning: Pinned vetiver model has no active version and no datetime on versions,
Do you need to check your pinned model?
Using version 4524
Could you tell me what this means, how should we "activate" a pinned vetiver model?
This is a super helpful update! That's a good thing to note--in Posit Workbench, oftentimes people specify a Python environment to "deploy," that is different than the one they are working in.
The way to activate a pinned version would be to pass in a version number as an argument (eg, your function might look like deploy_rsconnect(connect_server, board, pin_name, version="4524", extra_files=['requirements.txt'])
) . Otherwise, it will deploy the latest version of the pin. This warning primarily exists to nudge users to ensure the pin they expect is being used. I'm open to any feedback if there's a way to make this more clear for users (in this issue or a separate one)!
Thanks - I don't think it's necessary to raise an issue - more a matter of documentation. Is there a way I could contribute to the documentation?
I have documented R packages in the past, but have only very limited experience with python - nonetheless it seems like you are using the Makefile to autogenerate some documentation - for deploy_rsconnect
I take it takes the info from here?
Yes please! Any documentation contribution would be so welcome 😄 And you are correct, that's the correct spot in deploy_rsconnect
! In the Python world, docs are usually generated from docstrings, which is what you linked, similar to roxygen comments in R. Vetiver uses a numpydoc style, and you'll likely want to use something like a "Notes" section to add extra context to a function.
I'm going to close out this issue since the original question has been resolved, but please let me know if you have any follow up questions/comments!
Describe the bug
Dear, I am trying to deploy an sklearn random forest model to Posit connect from within an ipython notebook in jupyterlab on Posit workbench. I have followed the python instructions from the Get started-guide as well as the Posit youtube video on MLOps and all works well until I am trying to deploy the model using
vetiver.deploy_rsconnect
where I get the following error:RSConnectException: -n/--name cannot be specified in conjunction with options -s/--server
(full error trace below)Full error trace
``` /opt/python/3.10.6/lib/python3.10/site-packages/vetiver/write_fastapi.py:21: UserWarning: Pinned vetiver model has no active version and no datetime on versions, Do you need to check your pinned model? Using version 4509 warnings.warn( --------------------------------------------------------------------------- RSConnectException Traceback (most recent call last) Input In [10], inI find the documentation generally a bit limited to figure out what is going on. I have been looking at the Vetiver python function reference, the documentation of Posit connect on deploying Vetiver and the Rsconnect-python documentation but I get sometimes contradictory information (for example should I use
deploy_rsconnect
ordeploy_python_fastapi
?).Because my notebook kernel kept dying unexpectedly (after very long waits of doing nothing), I tried to also execute the
deploy_python_fastapi
in interactive python REPL from the terminal - this just keeps hanging for hours without any errors.I did not yet try to directly use the rsconnect-python CLI outside of an interactive python environment, but I hoped that I could just run the example without any problems.
To Reproduce
I tried to publish the default example to my posit connect server and I observe the same error. To reproduce this example, you will need to have a Posit connect server to publish to.
Expected behavior
I would expect that following the code above allows me to deploy my model to Posit connect
Desktop (please complete the following information):