[fastpages] GitHub Pages Blog Using Nbdev

Please DM me your repo’s link if it is public. I will take a look, thanks for reporting the bug.

@hamelsmu Just DM’ed you! The “bug” doesn’t seem to be there anymore but if you find something let us know. Thanks for your help!

I created a new repo to incorporate latest changes in fastpages. When I tried local dev feature myblog_watcher_1 container failed to launch with the following error:

myblog_jupyter_1 is up-to-date
myblog_jekyll_1 is up-to-date
Starting myblog_watcher_1   ... error
Starting myblog_fastpages_1 ... done
Starting myblog_converter_1 ... done

ERROR: for myblog_watcher_1  Cannot start service watcher: OCI runtime create failed: container_linux.go:346: starting container pro
cess caused "exec: \"watchmedo\": executable file not found in $PATH": unknown

ERROR: for watcher  Cannot start service watcher: OCI runtime create failed: container_linux.go:346: starting container process caus
ed "exec: \"watchmedo\": executable file not found in $PATH": unknown
ERROR: Encountered errors while bringing up the project.

Also jupyter server requires token to access it through http://0.0.0.0:8888 which can be obtained by (might be helpful to have in DEVELOPMENT.md):

1) docker-compose exec jupyter /bin/bash
2) jupyter notebook list

ERROR: for myblog_watcher_1 Cannot start service watcher: OCI runtime create failed: container_linux.go:346: starting container pro
cess caused “exec: “watchmedo”: executable file not found in $PATH”: unknown

It seems like the image for converter / watcher / jupyter haven’t been rebuilt correctly. Try docker-compose build --no-cache --force-rm. This will take a minute or two as it’ll rebuild the images it uses from scratch.

Also jupyter server requires token to access it through http://0.0.0.0:8888 which can be obtained by (might be helpful to have in DEVELOPMENT.md ):

1) docker-compose exec jupyter /bin/bash
2) jupyter notebook list

Ha, thank you for that comment! We’ve had a chat with @hamelsmu about the token.

The easiest way to get a link with the token already in the link is to just click the link in the terminal log output. When you run docker-compose up with rebuilt images, it’ll spit out the link to localhost:8888 with the token in it.

The way you just mentioned also works:

# Assuming you've started docker-compose with -d
docker-compose up -d

# shell into the jupyter container
docker-compose exec jupyter /bin/bash

# grab the notebook list with the token in the jupyter container shell
jupyter notebook list

# OR, just do it in one command (haven't tried it, but should work):
docker-compose exec jupyter jupyter notebook list

There’s a way to disable token at all, if we launch Jupyter with cmd: jupyter notebook {{all other flags}} --NotebookApp.token=''. But I would not recommend doing that as this is a security risk, and even considering you’re just editing a blog, this is not a useful practice to remember and use.

1 Like

cc: @xnutsive

Did you execute docker-compose build first?
You can find the token in your logs that are printed out

@xnutsive I anticipate that folks may be confused by this token thing, perhaps we hardcode the password or something and put that in the docs?

EDIT: I see that @xnutsive has replied at the exact same time as me. My apologies if I created duplicate responses etc.

I ran docker-compose up

1 Like

Perhaps we should have a makefile that will shorten the command to

make rebuild or something incase people get this error?

Also I am still facing colon missing in the converted .md file issue. What is the proper way to have colon in the title? I created a new repo after the fix_colon was merged. Maybe I am missing something? Thanks :slight_smile:

This fixed the problem. Thanks.

See https://github.com/fastai/fastpages/blob/master/README.md#front-matter-related-options

So it’s not possible within notebook but only through markdown?

No its the same in a notebook

1 Like

Its too bad I can’t think of a way to make this clearer? Perhaps in the documentation?

I also am not sure how to throw a warning message from this situation.

Anybody know if they have any thoughts, I’ll add more examples in the README

Also I am not sure but I am not able to see local notebook images render on html. Generated markdown for images look identical to test.md so I am not able to understand what might the issue. :thinking:

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p><img src="/images/copied_from_nb/my_icons/you_read_alot.png" alt=""></p>


V.S.


</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p><img src="/images/copied_from_nb/my_icons/fastai_logo.png" alt=""></p>

Yet logo is visible but my local image is not.

That’s an edgecase when you’ve already had the containers built with the previous version, without watchdog installed. If they’re not built (as in after you checked out a repo), they’ll build when you first docker-compose up.

Already pushed a PR with a clarification about that.

1 Like

One thing I find helpful is to open developer tools in your browser https://developers.google.com/web/tools/chrome-devtools/open#chrome

Click on “console” and see if you are getting any errors about files not found. You will be able to see what path it is looking for. Make sure you refresh the page after opening the console so you can see if there are any errors. That helps solve 99% of my problems with this kind of thing. Let us know if that reveals anything helpful

2 Likes

It’s unable to find the images given in html: <p><img src="/images/copied_from_nb/my_icons/you_read_alot.png" alt=""></p>

http://0.0.0.0:4000/images/copied_from_nb/my_icons/you_read_alot.png 404 (Not Found)

Is there a file in that directory? Try running the notebook conversion command from DEVELOPMENT.md or saving the notebook and refreshing the server, as the copying of the image needs to be triggered with a conversion of your notebook to a blog post

Also provide a link to your repo if possible with these files

I tried the steps you mentioned but still getting the same issue even though I am able to see the image located under images/copied_from_nb/my_icons/you_read_alot.png relative to my repo.

I also tried rebuilding the docker images but didn’t work. Repo link

@kcturgutlu I’ll DM you to try to resolve this problem so we don’t pollute this thread with too much extreanous information and back and forth. Only thing I ask is when we are able to fix it you writeup your solution somewhere on these forums to share with the community!

1 Like