-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
PR81 Breaks builds on Intel Macs #82
Comments
Also: using this image works on both Apple and Intel CPUs, albeit slower than yours did: |
Hmm, well, I made two changes in the last week. Moved from Ruby 2 to 3 (now that the latest Jekyll has added webrick by default)... and removed bundler 1.x so that it only has 2.x. I'll assume your issue is related to Ruby 3, though seeing it behave differently on a certain platform and not the other is very odd. There's a post that's saying the latest Ruby 3.2 has an issue with Liquid, which I didn't dig into, but I made you some things to help in testing. Luckily I tag builds and keep old versions so that we can compare them. I recommend when testing that you pin the Here's a unique tag for the latest build, 3 days ago: https://github.com/BretFisher/jekyll-serve/pkgs/container/jekyll/63555853?tag=stable-20230115120431 Here's the tag for last month's build: https://github.com/BretFisher/jekyll-serve/pkgs/container/jekyll/59034762?tag=stable-20221215120509 I've also created two PRs for testing (PRs are how I get GitHub Actions to make us some images to play with). PR builds won't be in Docker Hub, so you'll need to use the GHCR names: One uses Ruby 3.1 rather than 3.2: #83 One uses Ruby 2.7 like it did before last week: #84 Lastly, with Docker Desktop you can force using one platforms image on a different platform. In this case I'd say if you still have the issue with I'd also do the inverse on the M1, forcing it to run the intel: I hope that helps with your testing. Also, if you get me a reproducible test, I'm happy to help. |
This helps quite a bit, thank you :) I now have a better plan of attack for when images get the better of me again. Looking at things more closely now, builds aren't failing, but what used to take around 300 seconds is now taking upwards of hours. To the writers, this looks like a failure, particularly without I probably should have mentioned that we primarily use the Here're the results of my testing our clean dev server build (
I haven't the foggiest as to why the supposed current Docker Hub version of your image is much faster than the latest tagged version and is on par with the September version. The latest Docker Desktop has Rosetta for Linux support, so it's handling Intel code a lot faster than QEMU did. This occurred while I was traveling to HQ for the first time to meet up with my team, so I only brought the M1 Mac with me. Why would I have needed two laptops for this trip? :) Once my coworkers have some bandwidth, I can get some hard numbers on their builds. |
First set of Intel numbers. This is from the older MacBook Pro with an 8-core Core i9 2.3 GHz.
Color me confused. I'll have a few more coworkers test, and see if I can get someone at home to pop open Zoom on my Intel Mac to do more involved testing with the larger repository. I was able to test PR83 on the M1 and found no real differences from current stable in build time, but I did see those deprecation messages for the first time. They did not occur with |
Thanks for the info. I've never had to worry about the performance of this repo, so I have no idea if a specific type of Jekyll install is faster than others. I believe this issue comes down to the version of Ruby, Jekyll, and its dependencies, which I don't track or usually have to deal with. But in your case, with the desire to do large builds as fast as possible. You'll likely need to start caring, testing, and ultimately tracking your own version changes that you test with before upgrading. Sadly, I don't do any of that in this repo 'cus it's simple and not something I would use for a team's production workflow. But I'm still happy to help where I can, and I'm learning here too :) The I don't see you testing the PRs I built, which I think will shine the real light on this issue. You can use pr-based tags to test my 3.1 and 2.7 Ruby builds against
Lastly, I've updated these PRs just now to also update system gem's, which in the case of Ruby 2, are outdated enough in the official images to cause build fails on installing the Jekyll gem. I've never had to do that, but it seems its getting more complicated to keep things working between Ruby version, Jekyll version, and the Liquid templating version. So test those PRs and LMK please. |
Got it! I wasn't sure if there was much difference between your stock Jekyll image and the Jekyll-serve image. I'm not seeing much difference between PR-83 and PR-84 on the M1 Max, but I'm getting to the point where I think this thing can handle anything I throw at it. I just wish it wasn't so heavy. I'm going to have my team test both PRs on both our projects and I'll report back. It seems like by the end of this I'm going to be better off rolling my own image, as I can't seem to rely on what Jekyll considers their "official" images, and your images seem to be fitter for your purposes or smaller projects. I wouldn't even know where to start with that, so you'll likely find me in your class sooner than later :) |
If I were you, I'd find the fastest build, have it spit out the versions for ruby, jekyll, and liquid (at minimum), and pin to those with apt and gem, in the dockerfile. Then build a new image and test. Hopefully, I'm right and the speed difference is in the older versions of these many dependencies, and I guess the latest versions are slower and give you linting warnings like you're seeing (which are likely valid warnings, meaning you have outdated code). Ideally, the latest version of everything is always the fastest, but that's not always the case, and the mix of various versions seems to be what's giving you all the different build speeds. So your "fastest build" was likely accidental because every image someone ran had different versions than the month before (I've been rebuilding Once you find the versions of ruby, jekyll, and liquid, you'll likely want to pin with apt and gem. I didn't see a gemfile in your zip, so you'll want that too, to control gem versions. This article seems good on speeding up builds by replacing slower tools and keeping things updated. Good luck! |
I was curious about the wildly different build times so I did some version comparisons with the build times. Your best-case image was Note that different package managers will install different versions and builds of Jekyll, so when you're not pinning versions, everything seems random between different Docker base images (and apt vs. apk vs. gem) This is what that old image is running:
Next, I tried to use
Next, I tried
Next, I tried
Next, I used the latest
Lastly, I wondered "it is as simple as pinning to Jekyll 4.2.x?" So I tried it on the Debian ruby:2 and Debian ruby:3, while using With ruby:2, it was 15.5 seconds! Which should you use?I think the answer lies in you needing to pin to the latest Jekyll 4.2, which is 4.2.2 released about a year ago, and only use that on a Ruby 2.7 latest image. It seems both Ruby 3 or Jekyll 4.3+ will cause either warnings, slow builds, or errors on your site. I tested both Alpine-based and Debian-based images and Alpine was 16s and Debian was 15.5s. Since Debian is easier to use IMO, and can pin all things if you want, this is the Dockerfile I recommend. I've updated the Ruby:2 PR to be this Dockerfile. If you just wanted a simpler jekyll-serve you could use a trimmed down version of that one above like this: FROM ruby:2.7
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
RUN gem install bundler && gem install jekyll -v 4.2.2
EXPOSE 4000
WORKDIR /site
CMD [ "bundle", "exec", "jekyll", "serve", "--force_polling", "-H", "0.0.0.0", "-P", "4000" ] So I did this and came out on M1 Pro with 15-16s:
Once you digest all this, I recommend storing your own Dockerfile (or forking this repo) and building your own image so I don't accidently break your builds by updating my versions. The Docker Mastery course can fill in the gaps of building, running, compose, GitHub Actions, etc. https://www.bretfisher.com/courses |
@BretFisher thanks so much for the above research and the simplified ruby:2.7 Dockerfile. You just saved my life with something I've been working on, as I had been trying to track down why jekyll serve was running so slow on my container on M1 mac. 15-16 sec is about accurate now that I'm using ruby:2.7. |
Great! |
I should add a build example so we can track times in each PR/commit so this doesn't happen again. |
We've been using your image for your Jekyll project, and since 1/13 our Intel Mac users have had issues building. Either the build seems to hang and never completes, or it completes with a lot of warnings after a very extended amount of time. One of my writers ran with
--verbose
and saw that it was indeed rendering pages, but much, much slower than before. On an M1 Max I had no issues.I've attached screenshots of


top
running in the Docker container and most of the warnings that occurred before the build completes:Dunno if this is an "us" issue or not. As some background, we're using your image as
jekyll/jekyll
still has the webrick issue that you took care of. I don't have a lot of Docker knowledge; I inherited this project. Already this year I've had to find a suitable replacement forjekyll/jekyll-minimal
as envygeeks images are all AMD64 and we're transitioning to Apple Silicon now. Please let me know if you need anything more from me.The text was updated successfully, but these errors were encountered: