-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Environment Specifics
pythonversion: 3.7.7rsconnectversion: 1.6.0
What I'm Trying To Do
I have a notebook that is intended to be read as a report (thus I would like to hide all input cells) and scheduled to run daily. In keeping with my organization's deployment practice, I would like to deploy using a manifest.json.
The Issue
I've tried many permutations of the snippet provided on the RSConnect Docs.
The original snippet is like
rsconnect write-manifest notebook \
--hide-all-input \
mynotebook.ipynb
However, this does not work as expected even when trying to run the command (as specified in the CLI help output) like
rsconnect write-manifest notebook --hide-all-input true main.ipynb
What Happens
What happens is that the manifest.json file is created but it is missing the juptyer key in the JSON file. It works if I manually add that field to the end of the manifest like:
{
"version": 1,
"metadata": {
"appmode": "jupyter-static",
"entrypoint": "main.ipynb"
},
"locale": "en_US.UTF-8",
"python": {
"version": "3.7.7",
"package_manager": {
"name": "pip",
"version": "21.2.4",
"package_file": "requirements.txt"
}
},
"files": {
"main.ipynb": {
"checksum": "eefe5c7815587d3d95205fb9720dbdca"
},
"requirements.txt": {
"checksum": "589718f69aca09581483dc295fb63832"
}
}
},
"juptyer": {
"hide_all_input": true
}
How did I obtain the above manifest?
The above manifest.json came from:
- Deploying the Juptyer Notebook using the
PublishGUI on RStudio Workbench. - After it has deployed, I downloaded the created bundle (from the
Source Versionsoption on RStudio Connect) and looked at the generatedmanifest.json.
Possible Areas of Investigation
write-manifest notebook function call stack
It looks like the rsconnect write-manifest notebook command is handled by:
- First, calling the
write_manifest_notebook(..., hide_all_input, hide_tagged_input)function. - This calls
write_notebook_manifest_json(.., hide_all_input, hide_tagged_input)to create the actualmanifest.json. - The actual data within the
manifest.jsonis first computed as a dictionary returned by the functionmake_source_manifest.
However, it seems that the hide_all_input and hide_tagged_input params are not used anywhere in this call chain hence the jupyter key is not showing up in the final manifest.
write_manifest function
Doing some more digging led to this write_manifest function which properly handles the hide_all_input and hide_tagged_input flags however I'm not sure where/if this function is used in the write_manifest_notebook function described above as this function also calls the make_source_manifest function to create a manifest dictionary.
Conclusion
To summarize, here is what I think is happening:
- In handling the
rsconnect write-manifest notebook OPTIONS FILE EXTRA_FILEScommand, we callwrite_notebook_manifest_json(). - This function doesn't do anything with the
hide_all_inputorhide_tagged_inputparams but another functionwrite_manifest()properly handles those params.
Any guidance on this issue is greatly appreciated and also let me know if I can provide more information on the issue, thank you in advance!