New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto regeneration doesn't work using Boot2Docker #14

Closed
tduchateau opened this Issue May 15, 2015 · 12 comments

Comments

3 participants
@tduchateau

Hi,

Here is the context:

  • I'm using a custom build of the Jekyll Docker image that just adds the Asciidoctor gem as you suggested, based on the latest tag of https://registry.hub.docker.com/u/jekyll/jekyll/
  • I'm on Windows 8.1 and Boot2Docker v1.6.0
  • My Jekyll site lives in C:\Users\<my-user>\my-jekyll-site. Note that Boot2Docker automatically mounts the C:\Users\ directory to /c/Users/ in the VM

So to run my site, I just go to /c/Users/<my-user>/my-jekyll-site (on my Boot2Docker VM) and run:

docker run --rm -v $(pwd):/srv/jekyll -p 4000:4000 dandelion/jekyll

Problem: as soon as any file is modified in C:\Users\<my-user>\my-jekyll-site, Jekyll doesn't seem to detect any change and so doesn't trigger a site regeneration, despite the log message:

root@a415d7f224d3:/srv/jekyll$ jekyll s
Configuration file: /srv/jekyll/_config.yml
            Source: /srv/jekyll
       Destination: /srv/jekyll/_site
      Generating...
                    done.
 Auto-regeneration: enabled for '/srv/jekyll'
Configuration file: /srv/jekyll/_config.yml
   Server address: http://0.0.0.0:4000/
  Server running... press ctrl-c to stop.

Any idea?
Thanks!

@envygeeks

This comment has been minimized.

Show comment
Hide comment
@envygeeks

envygeeks May 15, 2015

Owner

There is no reason to have a custom fork just for a gem, you can add it to the Gemfile and it will install it for you, see the README.md for details on that. If we support ASCIIDoc by default (@parkr would have to confirm that because I don't ever use it) then I'd also be happy to include it in the default lineup since we want to target large audiences with this image and a parser is no big deal to add.

As far as the regeneration problem, I don't actually know if this is a problem on our end or a problem on their end, since I've never played with boot2docker I don't actually know if it even supports inotify on Linux or if we have to provide inotify ourselves (since this is typically provided by the Kernel.) With that said, this will have to wait for a while until I can get on my Windows computer and test it out to see if it's a our problem or a their problem, but I can quickly check right now if it's an our problem by trying it on my LInux system.

Owner

envygeeks commented May 15, 2015

There is no reason to have a custom fork just for a gem, you can add it to the Gemfile and it will install it for you, see the README.md for details on that. If we support ASCIIDoc by default (@parkr would have to confirm that because I don't ever use it) then I'd also be happy to include it in the default lineup since we want to target large audiences with this image and a parser is no big deal to add.

As far as the regeneration problem, I don't actually know if this is a problem on our end or a problem on their end, since I've never played with boot2docker I don't actually know if it even supports inotify on Linux or if we have to provide inotify ourselves (since this is typically provided by the Kernel.) With that said, this will have to wait for a while until I can get on my Windows computer and test it out to see if it's a our problem or a their problem, but I can quickly check right now if it's an our problem by trying it on my LInux system.

@tduchateau

This comment has been minimized.

Show comment
Hide comment
@tduchateau

tduchateau May 17, 2015

Thanks for the tip @envygeeks, indeed it works like a charm using the Gemfile.
However, until the regeneration problem is fixed, I'll keep using my custom image, just because I don't want to recreate tons of containers everytime I need to generate the site. Currently I start a container with bash and hit CTRL+C / jekyll s to manually regenerate the site.

Regarding the regeneration problem, let me know if I can be of any help.

Thanks!

Thanks for the tip @envygeeks, indeed it works like a charm using the Gemfile.
However, until the regeneration problem is fixed, I'll keep using my custom image, just because I don't want to recreate tons of containers everytime I need to generate the site. Currently I start a container with bash and hit CTRL+C / jekyll s to manually regenerate the site.

Regarding the regeneration problem, let me know if I can be of any help.

Thanks!

@envygeeks

This comment has been minimized.

Show comment
Hide comment
@envygeeks

envygeeks May 17, 2015

Owner

@tduchateau I'm curious does it work when you do --force-polling?

Owner

envygeeks commented May 17, 2015

@tduchateau I'm curious does it work when you do --force-polling?

@tduchateau

This comment has been minimized.

Show comment
Hide comment
@tduchateau

tduchateau May 17, 2015

Nop, but with --force_polling it does! :-)

Is there any drawback using polling? Performance maybe?

One important note: jekyll --help doesn't mention this option. It would definitely help.

Huge THANKS @envygeeks! ❤️

Nop, but with --force_polling it does! :-)

Is there any drawback using polling? Performance maybe?

One important note: jekyll --help doesn't mention this option. It would definitely help.

Huge THANKS @envygeeks! ❤️

@envygeeks

This comment has been minimized.

Show comment
Hide comment
@envygeeks

envygeeks May 18, 2015

Owner

It's not listed because there are drawbacks but those only apply to extremely large sites, for the most part it won't affect you, it never has me when I needed to use it, not until I hit thousand page scale.

Owner

envygeeks commented May 18, 2015

It's not listed because there are drawbacks but those only apply to extremely large sites, for the most part it won't affect you, it never has me when I needed to use it, not until I hit thousand page scale.

@jhabdas

This comment has been minimized.

Show comment
Hide comment
@jhabdas

jhabdas May 20, 2015

Not sure if it's relevant, but while working with Vagrant in the past on Windows I noticed some hiccups while mounting shared file systems. Specifically when working with dependency trees with lots of files and file watchers. My solution to that prob was to mount only raw source files to Windows so they could be modified with the Editor of choice and let the deps and watcher dump files into a non-shared space.

jhabdas commented May 20, 2015

Not sure if it's relevant, but while working with Vagrant in the past on Windows I noticed some hiccups while mounting shared file systems. Specifically when working with dependency trees with lots of files and file watchers. My solution to that prob was to mount only raw source files to Windows so they could be modified with the Editor of choice and let the deps and watcher dump files into a non-shared space.

@envygeeks

This comment has been minimized.

Show comment
Hide comment
@envygeeks

envygeeks May 20, 2015

Owner

I'm pretty sure networked filesystems don't support inotify, I'd have to go back and check the API's but last I remember samba and the likes of what virtualbox would use (probably samba's libs) won't support any of the inotify api's which means there is nothing we can do. I could try and detect the file system and force polling for you but that's not ideal at all.

If one of you wants to boot the docker image in the setup on Windows and give me some system information that it gives you I would know even further what the extents of what I can do is. Basically I need to know how the VM mounts the system and then how Docker sees that system.

Owner

envygeeks commented May 20, 2015

I'm pretty sure networked filesystems don't support inotify, I'd have to go back and check the API's but last I remember samba and the likes of what virtualbox would use (probably samba's libs) won't support any of the inotify api's which means there is nothing we can do. I could try and detect the file system and force polling for you but that's not ideal at all.

If one of you wants to boot the docker image in the setup on Windows and give me some system information that it gives you I would know even further what the extents of what I can do is. Basically I need to know how the VM mounts the system and then how Docker sees that system.

@envygeeks

This comment has been minimized.

Show comment
Hide comment
@envygeeks

envygeeks May 20, 2015

Owner

Actually a quick google search points to this being the case actually:

Owner

envygeeks commented May 20, 2015

Actually a quick google search points to this being the case actually:

@envygeeks

This comment has been minimized.

Show comment
Hide comment
@envygeeks

envygeeks May 21, 2015

Owner

There is nothing we can do so I added a note about --force-polling to the README.md

Owner

envygeeks commented May 21, 2015

There is nothing we can do so I added a note about --force-polling to the README.md

@envygeeks envygeeks closed this May 21, 2015

@tduchateau

This comment has been minimized.

Show comment
Hide comment
@tduchateau

tduchateau May 22, 2015

Just a note @envygeeks, if I'm not mistaken, there's a typo in the README: --force-polling should be --force_polling

Just a note @envygeeks, if I'm not mistaken, there's a typo in the README: --force-polling should be --force_polling

@jhabdas

This comment has been minimized.

Show comment
Hide comment
@jhabdas

jhabdas May 22, 2015

I believe there's a PR out for that
On Fri, May 22, 2015 at 3:52 PM Thibault Duchateau notifications@github.com
wrote:

Just a note @envygeeks https://github.com/envygeeks, if I'm not
mistaken, there's a typo in the README: --force-polling should be
--force_polling


Reply to this email directly or view it on GitHub
#14 (comment)
.

jhabdas commented May 22, 2015

I believe there's a PR out for that
On Fri, May 22, 2015 at 3:52 PM Thibault Duchateau notifications@github.com
wrote:

Just a note @envygeeks https://github.com/envygeeks, if I'm not
mistaken, there's a typo in the README: --force-polling should be
--force_polling


Reply to this email directly or view it on GitHub
#14 (comment)
.

@tduchateau

This comment has been minimized.

Show comment
Hide comment
@tduchateau

tduchateau May 22, 2015

Indeed, don't pay attention to my comment :-)

Indeed, don't pay attention to my comment :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment