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

Integration for Buildkite #4294

Merged
merged 38 commits into from
Aug 8, 2024
Merged

Integration for Buildkite #4294

merged 38 commits into from
Aug 8, 2024

Conversation

udsamani
Copy link
Collaborator

@udsamani udsamani commented Jul 31, 2024

This PR aims at the following

  • Create a buildkite-hosted-agent for bacalhau
  • Create a bacalhau-golang pipeline
  • Add buildkite scripts for different components

closes #4297

Copy link

coderabbitai bot commented Jul 31, 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.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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.

@udsamani udsamani self-assigned this Jul 31, 2024
@udsamani udsamani added build/go A label to indicate buildkite to trigger golang builds for this PR and removed build-ready labels Jul 31, 2024
@udsamani udsamani requested a review from wdbaruni July 31, 2024 06:39
Comment on lines +7 to +8
make build-webui
make test-and-report
Copy link
Member

Choose a reason for hiding this comment

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

do we need to build the webui with each test?

@@ -0,0 +1,43 @@
FROM buildkite/hosted-agent-base
Copy link
Member

Choose a reason for hiding this comment

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

Nice. Much cleaner that circleci setup. Can we put everything related to buildkite under /buidlkite directory, including this Dockerfile?

Comment on lines +1 to +7
cache:
paths:
- "/golangci-lint-cache"
- "/vendor-cache"
- "/node-modules-cache"
size: 20g
name: "vendor-module-cache"
Copy link
Member

Choose a reason for hiding this comment

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

how is this cache used? We also want to make sure we build once, and then use the builds in later phases, such as running unit tests, integration tests, and releasing them if this build includes a release

Copy link
Member

Choose a reason for hiding this comment

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

also do we pull the code once, or every step in the pipeline pulls the code again?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Every step in pipeline unfortunately pulls code :( But we use git mirroring which fastens up.

If you want to do just once. You cant take advantage of parallel builds.

Circle CI was the same too.

Comment on lines +16 to +27
- group: ":package: Build Tarball"
key: "build-tarball"
steps:
- label: ":golang: Build linux amd64"
command: "./buildkite/scripts/build_tarball.sh linux amd64"
agents:
queue: "buildkite-hosted-linux-small"

- label: ":golang: Build linux arm64"
command: "./buildkite/scripts/build_tarball.sh linux arm64"
agents:
queue: "buildkite-hosted-linux-small"
Copy link
Member

Choose a reason for hiding this comment

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

how are steps in the same group executed? Do each require spinning up their own container, which means slower start and cost, or are they run within the same agent/container? I am double checking because we define the agents in each step, which implies they run on separate environments

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They are on different agents. Spinning up the agent is pretty fast. It stays in queue for max 5-6s. Group step only helps seeing things visually !

Comment on lines +54 to +64
- label: ":testengine: Unit Test"
command: "./buildkite/scripts/test.sh unit"
key: "unit-test"
agents:
queue: "buildkite-hosted-linux-large"

- label: ":testengine: Integration Test"
command: "./buildkite/scripts/test.sh integration"
key: "integration-test"
agents:
queue: "buildkite-hosted-linux-large"
Copy link
Member

Choose a reason for hiding this comment

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

eventually we want to run on different environments, including windows, linux arm, linux amd, and darwin.

Also, separating unit and integration tests into separate steps was done before because of consistent failures in integration tests and to be able to retry only the failed steps in circleci instead of the whole tests again. We can continue to do the same here as well if it makes sense, but we should re-evaluate if this is adding unnecessary cost

Comment on lines 1 to 3
#!/bin/bash

GOOS=$1 GOARCH=$2 make build-bacalhau-tgz
Copy link
Member

Choose a reason for hiding this comment

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

I looked at the build logs https://buildkite.com/expanso/bacalhau-golang/builds/291#01910786-63c9-4a7e-b38d-d12c63b50496

some observations:

  • It seems we are building the webui everytime. This is an issue with make target setup
  • I see some failures at the end related to signing the builds because of missing /tmp/private.pem. Check
    name: Build tarball
    on how we were doing things with circleci

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yess ! I want to have at least one green build with buildkite before I merge this. I am debugging those.

@udsamani udsamani requested a review from wdbaruni August 2, 2024 12:19
@@ -381,6 +384,7 @@ func (s *ExecutorTestSuite) TestDockerNetworkingFiltersHTTP() {
}

func (s *ExecutorTestSuite) TestDockerNetworkingFiltersHTTPS() {
s.T().Skip("Skipping the test until buildkite is fixed.")
Copy link
Member

Choose a reason for hiding this comment

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

nit: will be nice to only skip in buildkite and let them run when testing locally. Env variables can help with that

Comment on lines 32 to 37
# Apply rate limits to the outbound connections. We just do this for all
# interfaces rather than working out which is our Internet connection.
while IFS= read -r IFACE; do
tc qdisc add dev "${IFACE}" root tbf rate 10mbit burst 32kbit latency 10sec
done < <(ip --json address show | jq -rc '.[] | .ifname')

Copy link
Member

Choose a reason for hiding this comment

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

do we need to remove these even if we are skipping the tests? If yes, then please add an issue to make sure we fix this way before 1.5

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. We don't need to remove this. So reverted it.

@udsamani udsamani merged commit a3dcc8f into main Aug 8, 2024
9 of 11 checks passed
@udsamani udsamani deleted the buildkite branch August 8, 2024 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build/go A label to indicate buildkite to trigger golang builds for this PR build/python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get a basic build pipeline running for golang
2 participants