Skip to content

rsconnect write-manifest notebook not parsing --hide-all-input or --hide-tagged-input options #302

@rparmasar

Description

@rparmasar

Environment Specifics

  • python version: 3.7.7
  • rsconnect version: 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:

  1. Deploying the Juptyer Notebook using the Publish GUI on RStudio Workbench.
  2. After it has deployed, I downloaded the created bundle (from the Source Versions option on RStudio Connect) and looked at the generated manifest.json.

Possible Areas of Investigation

write-manifest notebook function call stack

It looks like the rsconnect write-manifest notebook command is handled by:

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:

  1. In handling the rsconnect write-manifest notebook OPTIONS FILE EXTRA_FILES command, we call write_notebook_manifest_json().
  2. This function doesn't do anything with the hide_all_input or hide_tagged_input params but another function write_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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions