-
Notifications
You must be signed in to change notification settings - Fork 777
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
Netlify build command cleanup #3628
Netlify build command cleanup #3628
Conversation
@chalin: GitHub didn't allow me to request PR reviews from the following users: nate-double-u. Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: chalin The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @chalin. Thanks for your PR. I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
||
[context.production.environment] | ||
HUGO_VERSION = "0.119.0" | ||
HUGO_ENV = "production" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting HUGO_ENV
is no longer required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
Anything left to be done here? /cc @thesuperzapper |
[context.branch-deploy.environment] | ||
HUGO_VERSION = "0.119.0" | ||
NODE_VERSION = "18" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chalin Won't removing this prevent the old branches like https://github.com/kubeflow/kubeflow/tree/v1.7-branch, from being deployed, because we achieve this by using a CNAME record from:
v1-7-branch.kubeflow.org
->v1-7-branch--competent-brattain-de2d6d.netlify.app
I don't have access to the Netelify dashboard, so I can't see where those are being deployed from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thesuperzapper - from my understanding of how Netlify works, unless you back port this change to an older v1.x branch, the builds of other branches won't be affected.
For example, v1.7 has it's own netlify.toml
file, https://github.com/kubeflow/website/blob/v1.7-branch/netlify.toml, with it's own env var values and commands:
Lines 1 to 16 in b48a664
[build] | |
publish = "public" | |
command = "cd themes/docsy && git submodule update -f --init && cd ../.. && hugo --gc --minify" | |
[context.deploy-preview.environment] | |
HUGO_VERSION = "0.92.0" | |
NODE_VERSION = "16" | |
[context.production.environment] | |
HUGO_VERSION = "0.92.0" | |
HUGO_ENV = "production" | |
NODE_VERSION = "16" | |
[context.branch-deploy.environment] | |
HUGO_VERSION = "0.92.0" | |
NODE_VERSION = "16" |
But, I could be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't have access to kubeflow.org's Netlify dashboard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@james-jwu or @zijianjoy do you have access to Netelify for the Kubeflow website, so we can confirm how it is configured?
We probably also need to give access in some way to the CNCF for continuity purposes.
command = "npm run build:production" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that using context.production
will still work?
I don't have access to the Netelify dashboard, so I can check, but based on Hugo's docs: https://gohugo.io/hosting-and-deployment/hosting-on-netlify/ they seem to suggest that context.production.environment
is the right heading.
@james-jwu or @zijianjoy probably have access to Netelify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using similar setups for the OTel and gRPC websites, e.g., see https://github.com/open-telemetry/opentelemetry.io/blob/5df8d080fe6997d1ee514b9f50f6880155276e5b/netlify.toml#L1-L6:
[build]
publish = "public"
command = "npm run seq -- build:preview diff:check"
[context.production]
command = "npm run seq -- build:production diff:check"
The .environment
section is for setting environment variables only, not for setting other fields like command
.
@chalin Also, all our PR/historical branches are getting indexed by Google, we should fix that at the same time as this PR. The goals would be:
I believe your changes here achieve 2, because you are setting We need to be careful about 1. Are you 100% confident that not setting To achieve 3, we could set the |
I've created a separate issue to track the full extent of the indexing issue, since more work will need to be done outside of the scope of this PR: |
bebf9e8
to
619d3a1
Compare
Correct.
For reassurance, see https://discourse.gohugo.io/t/what-does-setting-hugo-env-to-production-do/24669/2. Also, since the site uses
I'll answer this in #3645. |
"devDependencies": { | ||
"autoprefixer": "^10.4.0", | ||
"postcss": "^8.4.1", | ||
"hugo-extended": "^0.119.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chalin are you sure that this is the correct way to set the Hugo version on Netelify?
Because the Netelify website suggests using HUGO_VERSION
, which is what we were previously doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what we're using on other sites such as OTel: https://github.com/open-telemetry/opentelemetry.io/blob/299ad7bb24488e39eb17d43393dd05f513321253/package.json#L89
The advantage of using hugo-extended
is that you'll never have to worry again about using the right version of Hugo even if (at some point in the future) you work on branches of older versions of the docs since NPM install and the NPM build commands will naturally use the version of Hugo needed for that specific branch/commit.
I believe what we are doing is now fine (e.g. we already use hugo extended as this is the default for Netlify), please reopen a new PR if there are still issues. /close |
@thesuperzapper: Closed this PR. In response to this:
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. |
This PR contains suggested improvements to the site build scripts and config.
netlify.toml
build commands by using the NPM scripts. E.g., the production build command goes from:netlify.toml
/cc @nate-double-u