Hugo warns that it's unnecessarily slow due to an outdated Ruby version.
10:37:46 AM: Attempting ruby version 2.3.6, read from environment
10:37:47 AM:
10:37:47 AM: ** WARNING **
10:37:47 AM: Using custom ruby version 2.3.6, this will slow down the build.
10:37:47 AM: To ensure fast builds, set the RUBY_VERSION environment variable, or .ruby-version file, to an included ruby version.
10:37:47 AM: Included versions: 2.7.1 2.6.2
10:37:47 AM:
10:37:47 AM: Required ruby-2.3.6 is not installed - installing.
10:37:48 AM: Searching for binary rubies, this might take some time.
10:37:48 AM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/16.04/x86_64/ruby-2.3.6.tar.bz2
Given that we don't currently specify a Ruby version in netlify.toml, Netlify may be defaulting to an earlier version for maximum breadth of support. (Just a guess!)
Slow builds scale poorly.
Follow Netlify's advice and specify a Ruby version (are folks OK with 2.7.1?) in netlify.toml:
[build.environment]
HUGO_VERSION = "0.70.0"
NODE_VERSION = "10.20.0"
RUBY_VERSION = "2.7.1"
It's a straightforward addition, so anyone can do it, including first-time contributors.
Note that this counts as an architectural change, and architectural changes require approval from chairs or tech leads.
/sig docs
/good-first-issue
/cc @kbhawkey @onlydole @sftim @jimangel @kbarnard10
/priority important-soon
@zacharysarah:
This request has been marked as suitable for new contributors.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.
In response to this:
What's the problem?
Hugo warns that it's unnecessarily slow due to an outdated Ruby version.
10:37:46 AM: Attempting ruby version 2.3.6, read from environment 10:37:47 AM: 10:37:47 AM: ** WARNING ** 10:37:47 AM: Using custom ruby version 2.3.6, this will slow down the build. 10:37:47 AM: To ensure fast builds, set the RUBY_VERSION environment variable, or .ruby-version file, to an included ruby version. 10:37:47 AM: Included versions: 2.7.1 2.6.2 10:37:47 AM: 10:37:47 AM: Required ruby-2.3.6 is not installed - installing. 10:37:48 AM: Searching for binary rubies, this might take some time. 10:37:48 AM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/16.04/x86_64/ruby-2.3.6.tar.bz2Given that we don't currently specify a Ruby version in
netlify.toml, Netlify may be defaulting to an earlier version for maximum breadth of support. (Just a guess!)Why does it matter?
Slow builds scale poorly.
How do we fix it?
Follow Netlify's advice and specify a Ruby version (probably 2.7.1) in
netlify.toml:[build.environment] HUGO_VERSION = "0.70.0" NODE_VERSION = "10.20.0" RUBY_VERSION = "2.7.1"Who can fix it?
It's a straightforward addition, so anyone can do it, including first-time contributors.
Note that this counts as an architectural change, and architectural changes require approval from chairs or tech leads.
/sig docs
/good-first-issue
/assign @kbhawkey @onlydole @sftim @jimangel @kbarnard10
/priority important-soon
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
What are the Ruby dependencies? Is this something that should be set higher up?
@kbhawkey I think netlify.toml is as high as our hierarchy gets.
As far as dependencies--good question, I honestly don't know off the top of my head. We don't have any obvious dependencies or invocations in the repo. The only thing that comes to mind is a hidden Netlify dependency.
@kbhawkey I think
netlify.tomlis as high as our hierarchy gets. Do you mean why are we invoking Ruby at all?
Yes, what library is dependent on Ruby? Guessing one of the post processors, but need to understand why.
I thought all post processing used Javascript.
A post processor would make sense. 💯
I'd like this resolved sooner than later. Preview builds are not snappy.
AFAIK the only external processor used by hugo is postcss-cli/autoprefixer which are both javascript. I'm pretty sure they have the old version of ruby in there to support older versions of jekyll.
AFAIK the only external processor used by hugo is postcss-cli/autoprefixer which are both javascript. I'm pretty sure they have the old version of ruby in there to support older versions of jekyll.
OK. How does this affect the current build if there are no dependencies on Ruby?
I have no idea where it's picking 2.3.6 from 😬 I did a little more digging and Netlify's default is 2.6.2 for trusty and 2.7.1 for xenial. I have no idea where it's picking up that version of ruby. I did a search for 2.3.6 with hound and didn't find anything. I also didn't see anything in the env vars defined in netlify's site itself for it.
Ubuntu Xenial 16.04 (default) appears to be set. Meant to say that there is an option (beta) to switch the build-image.
https://github.com/netlify/build-image/blob/xenial/included_software.md
@zacharysarah , Q: Where did you see this warning? I'd rather not have a local setting for a language that is not directly used.
Can we check back with netlify?
@kbhawkey I see it in every build where Ruby isn’t already cached. (Cached builds still use 2.3.6.)
OK. Just trawled through previous netlify discussions.That warning seems to happen in a number of instances
Computing checksum with sha256sum
10:14:27 AM: Checksums matched!
10:14:29 AM: Now using node v8.16.0 (npm v6.4.1)
10:14:29 AM: Attempting ruby version 2.3.6, read from environment
10:14:30 AM:
10:14:30 AM: ** WARNING **
10:14:30 AM: Using custom ruby version 2.3.6, this will slow down the build.
10:14:30 AM: To ensure fast builds, set the RUBY_VERSION environment variable, or .ruby-version file, to an included ruby version.
10:14:30 AM: Included versions: 2.6.2
10:14:30 AM:
10:14:30 AM: Required ruby-2.3.6 is not installed - installing.
10:14:31 AM: Searching for binary rubies, this might take some time.
10:14:31 AM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/16.04/x86_64/ruby-2.3.6.tar.bz2
10:14:31 AM: Checking requirements for ubuntu.
10:14:32 AM: Requirements installation successful.
Is the search for the ruby installer the problem or something else?
Checking out, https://gohugo.io/troubleshooting/build-performance/#template-metrics
Also, should the site add, postcss.config.js? I assume this isn't automatically picked up from the theme directory.
https://github.com/google/docsy/blob/master/postcss.config.js
build cmd from theme:
command = "git submodule update -f --init && cd userguide && npm install postcss-cli && hugo --themesDir ../.."
package.json from theme differs from current docs:
"@babel/core": "^7.0.1",
"@slack/client": "^4.4.0",
"autoprefixer": "^9.7.6",
"babel-loader": "^8.0.2",
"netlify-lambda": "^0.4.0",
"node-fetch": "^2.2.0",
"postcss-cli": "^7.1.1"
@kbhawkey
Also, should the site add, postcss.config.js?
Good question--let's open a separate issue for that discussion.
@kbhawkey
Is the search for the ruby installer the problem or something else?
Nothing stands out in template metrics locally.
Given that Hugo warns that older versions of Ruby will cause slow builds, it seems reasonable to infer that the search/install process isn't helping.
Created #22308.
Relevant to https://github.com/kubernetes/website/issues/22229#issuecomment-653647254: after testing Ruby with #22307, it looks like Ruby is less responsible for slow builds than post processing, which appears responsible for over 50% of the build time.
1:22:38 PM: Build ready to start
...
1:24:40 PM: │ Netlify Build Complete │
...
1:25:57 PM: Post processing - HTML
1:27:11 PM: Finished processing build request in 4m31.225809448s