Skip to content
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

Frrist/update golang1.23.0 #4332

Merged
merged 12 commits into from
Aug 19, 2024
Merged

Frrist/update golang1.23.0 #4332

merged 12 commits into from
Aug 19, 2024

Conversation

frrist
Copy link
Contributor

@frrist frrist commented Aug 16, 2024

Why

In https://github.com/bacalhau-project/bacalhau/pull/4330/files#diff-77364c74880b2d28d60bdc250c7832430bb2c7d87d2e2359b05146c9f3cb5d6bR111 we are adding migration logic which requires directories to be copied. go 1.23 includes the os.CopyFS method which is helpful for this task, and preferred to writing our own CopyFS implementation.

How

Developers will need to perform the following actions:

  1. download and install go 1.23.0
  2. update golangci-lint: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.1

@frrist frrist self-assigned this Aug 16, 2024
Copy link
Contributor

coderabbitai bot commented Aug 16, 2024

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@frrist
Copy link
Contributor Author

frrist commented Aug 16, 2024

Updating to this version of golang requires we update the linter to match, it appears the buildkite instance lacks sufficient memory to run the liner now (exit code 137 usually means OOM):

2024-08-16 10:39:44 PDT	golangci-lint............................................................Failed
2024-08-16 10:39:44 PDT	- hook id: golangci-lint
2024-08-16 10:39:44 PDT	- exit code: 137
2024-08-16 10:39:44 PDT	
2024-08-16 10:39:44 PDT	/buildkite/builds/4s62es3plflsi-1/expanso/bacalhau-golang/.gitprecommit/golangci-lint.sh: line 3:   450 Killed                  golangci-lint run --allow-parallel-runners --timeout 10m
2024-08-16 10:39:44 PDT	/buildkite/builds/4s62es3plflsi-1/expanso/bacalhau-golang/.gitprecommit/golangci-lint.sh: line 3:   452 Killed                  golangci-lint run --allow-parallel-runners --timeout 10m
2024-08-16 10:39:44 PDT	/buildkite/builds/4s62es3plflsi-1/expanso/bacalhau-golang/.gitprecommit/golangci-lint.sh: line 3:   453 Killed                  golangci-lint run --allow-parallel-runners --timeout 10m
2024-08-16 10:39:44 PDT	/buildkite/builds/4s62es3plflsi-1/expanso/bacalhau-golang/.gitprecommit/golangci-lint.sh: line 3:   454 Killed                  golangci-lint run --allow-parallel-runners --timeout 10m

@frrist frrist requested a review from udsamani August 16, 2024 22:49
@@ -87,7 +81,6 @@ linters:
- gocyclo
- gofmt
- goimports
- gomnd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we enable mnd?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still need to re-declare it here, right? Line 35 is the linter setting, but all linters are disabled except the ones listed here

Copy link
Contributor Author

@frrist frrist Aug 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was initially confused as to why it ran without me setting it - I have modifed the pre-commit script to respect the linter config in the repo: 7404e37 and also included mnd in this list

@@ -8,7 +8,7 @@ source /terraform_node/variables
function install-go() {
echo "Installing Go..."
rm -fr /usr/local/go /usr/local/bin/go
curl --silent --show-error --location --fail https://go.dev/dl/go1.21.8.linux-amd64.tar.gz | sudo tar --extract --gzip --file=- --directory=/usr/local
curl --silent --show-error --location --fail https://go.dev/dl/go1.23.0.linux-amd64.tar.gz | sudo tar --extract --gzip --file=- --directory=/usr/local
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please deploy to staging to verify all is working as expected

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. working as intended on this commit 7404e37:

export BACALHAU_API_HOST=bootstrap.staging.bacalhau.org
~> bacalhau agent version
Bacalhau v1.4.1-rc3-28-g7404e375d
BuildDate 2024-08-18 01:42:44 +0000 UTC
GitCommit 7404e375d09be15015438a2f10d6a17d18b83783

@frrist
Copy link
Contributor Author

frrist commented Aug 18, 2024

This PR is currently block on updating the docker container buildkit uses to build and test bacalhau. I have updated the Dockerfile for the image here: 3c9de72 but need direction from @udsamani on how to make this change take affect.

modules-download-mode: readonly
# Allow multiple parallel golangci-lint instances running.
# If false (default) - golangci-lint acquires file lock on start.
allow-parallel-runners: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you have removed parallel runners from all places would it run serially or parallely ?

Copy link
Contributor

@udsamani udsamani Aug 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO ! We need this golangci/golangci-lint#869 to be true ! This is the root cause failures after updating the golang image to 1.23.0

@frrist frrist merged commit e7c052c into main Aug 19, 2024
4 checks passed
@frrist frrist deleted the frrist/update-golang1.23.0 branch August 19, 2024 18:51
@wdbaruni wdbaruni mentioned this pull request Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants