Closed Rahuketu86 closed 2 years ago
Solved 3 Turns out if I set
custom_sidebar = False
and then run nbdev_sidebar --force
It generates a _quarto.yml and sidebar.yml with the right settings in nbs directory as follows
Perhaps adding the same in documentation could be helpful to others. (4) Still doesn't work
Also looking for some guidance on GitHub actions (5) though
Resolved 4 Steps :
I still think nbdev_preview should have a commandline option for host and default _quarto.yml should be generated with a host field to avoid all the roundabout steps like above.
Still looking for recommendations on (5) - Github Actions and Netlify deployment
(6) How to forcibly clean / stripout notebooks. I keep getting the following error
I have already
I have gone through the cycle a few times without much success
My test.yaml
name: CI
on: [workflow_dispatch, pull_request, push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
sudo apt install -y graphviz
- name: Fastai CI
uses: fastai/workflows/nbdev-ci@master
To get rid of the warnings for clean_ids
, set clean_ids = True
in settings.ini
. I got this answer from Hamel in #990
Also, a good place to check these migrations issues is in the forums, over here
Even I had faced the same issue with the sidebar, I had asked the question on the forums and I was able to resolve it.
@deven367 Setting clean_ids=True removed warnings Additionally, I have to manually do nbdev_clean-> nbdev_prepare-> commit every time to make sure CI works ( after stopping nbdev_preview)
However, I don't understand why this is required? I would have imagined nbdev_intall_hooks to set these things as pre-commit hooks.
If I don't do it I get CI failure with the following message
Reading code for composite action https://github.com/fastai/workflows/blob/master/nbdev-ci/action.yml I understand warning but not sure what is the optimal workaround for my setup?
Additionally for (1) if notebooks are in nbs folder instead of root folder _docs folder is generated inside nbs folder instead of root. I imagine this might break the GitHub deploy action.
My settings are same as described above with following fields
# Change to, e.g. "nbs", to put your notebooks in nbs dir instead of repo root
nbs_path = nbs
doc_path = docs
nbs folder looks as follows 👎
(nbs/_docs are not ignored from commit as intended with migration tutorial instructions)
Update on (1)
With above settings -> nbs_path = nbs and doc_path = docs
My nbdev version is nbdev 2.2.10
Finally found discord nbdev channel and upcomming version 2.3 release post. https://forums.fast.ai/t/upcoming-changes-in-v2-3/98905 . Looking forward to release . Absolutely love nbdev
@Rahuketu86 To fix your issue with the docs, you need to update the doc_path in your settings.ini
and you need to add _docs
in your gitignore, which is included in the final steps, these steps also remove the docs folder
@Rahuketu86 To fix your issue with the docs, you need to update the doc_path in your settings.ini
and you need to add
_docs
in your gitignore, which is included in the final steps, these steps also remove the docs folder
Please look at this comment. https://github.com/fastai/nbdev/issues/998#issuecomment-1241008303
I already did it nevertheless there is a discrepancy in where _docs is formed depending on command you run : nbdev_preview or nbdev_docs (if you have an nbs folder for notebook). I am hoping that this issue will be resolved in next version with _procs directory workflow
Version 2.3.0
Request for enhancement
Why not delegate publishing completely to quarto publishing framework? (Can provide a cleaner resolution for (5) as described above)
With the introduction of _proc in version 2.3.0 , nbdev resolves a few issues around publishing. But it still doesn't completely capitalize _quarto publishing functionality.
Let me try to explain When I run the nbdev_preview command a _docs folder is generated in the _proc directory. Looking at the source code I believe same/similar _docs folder is generated by the nbdev_docs command at the root directory.
My thought process is following
The below setup for deploy has not worked ( might be an issue with quarto-action) - with various combination of path[ _proc, ./_procs] or putting publish in multiple places ( _proc dir, root dir, both etc..)
name: CI
on:
push:
paths-ignore:
- 'book/**'
- 'nbs_pluto/**'
- 'nbs_pluto_html/**'
- 'devops/**'
pull_request:
workflow_dispatch:
jobs:
test-deploy:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
sudo apt install -y graphviz
- name: Fastai CI
uses: fastai/workflows/nbdev-ci@master
- name: Run nbdev_docs
shell: bash
run: |
nbdev_docs
- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: netlify
path: _proc
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
Failing with following message :-
No _publish.yml file available (_publish.yml specifying a destination required for non-interactive publish)
I am using the following to achieve netlify deployment
name: CI
on:
push:
paths-ignore:
- 'book/**'
- 'nbs_pluto/**'
- 'nbs_pluto_html/**'
- 'devops/**'
pull_request:
workflow_dispatch:
jobs:
test-deploy:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
sudo apt install -y graphviz
- name: Fastai CI
uses: fastai/workflows/nbdev-ci@master
- name: Run nbdev_docs
shell: bash
run: |
nbdev_docs
- name: Push to netlify site
uses: nwtgck/actions-netlify@v1.2
with:
publish-dir: './_docs'
production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: false
enable-commit-comment: true
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
@Rahuketu86
Request for enhancement: Why not delegate publishing completely to quarto publishing framework?
We do have some pointers regarding how to do something similar Deploying your docs on Other Platforms, which might give you some insight.
Can you please transfer your comment to a seperate GitHub Issue about generalizing the docs publishing Action to support various targets?
@Rahuketu86 just FYI I'm finding it hard to follow this issue at the moment. Can you please update this issue with a summary of what issues you are still facing it is not clear to me what issues are outstanding? Thanks much for your help
I think the original issue is resolved, so I'm going to close this. @Rahuketu86 please feel free to create another issue with your feature request re the quarto publishing framework – it's an interesting idea and I don't want it to get lost among the other comments :)!
I am looking for some guidance and clarification on migrating a repository created with nbdev 1 and customized for additional workflow steps. I have followed the instructions on nbdev1 migration tutorial but have identified some issues with which I need some help.
My setup consists of a remote ubuntu server. I usually work on jupyterlab which is exposed over the host IP 0.0.0.0 and prespecified port. In addition to regular nbdev generated docs I also have a jupyterbook folder where I maintained a recipe kind of documentation which could include more things not part of regular library setup.
Issues :
Old site looked like this
My current settings.ini is as follows :-
and Makefile is as follows
concurrency: group: main cancel-in-progress: true
jobs: build: runs-on: ubuntu-latest steps:
pip install nbdev jupyter
name: Run tests run: | nbdev_test_nbs
- name: Install dependencies for book
run: |
pip uninstall nbdev -y
pip install -r requirements.txt
pip install -e .[dev]
Push the book's HTML to github-pages