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

ci: running buildkite builds locally #3286

Closed
karampok opened this issue Oct 28, 2019 · 2 comments
Closed

ci: running buildkite builds locally #3286

karampok opened this issue Oct 28, 2019 · 2 comments
Assignees
Labels
feature New feature or request i/devops Everything related to CI/Bazel/building

Comments

@karampok
Copy link
Contributor

karampok commented Oct 28, 2019

During development, it would be great to be able to run a ci pipeline locally.
What does it :

  1. given a pipeline yaml file and a documentation
  2. do a local command bk run /path/to/pipeline.yml as documented
  3. see that the local buildkite-agent runs the build same as in CI

where the pipeline.yaml to be the default pipeline (e.g. unit-tests) and the acceptance pipeline.

@karampok
Copy link
Contributor Author

From my research, as long as we do not try to push images somewhere but use the local registry, it should be easy.

#!/bin/bash

# documentation
# https://buildkite.com/docs/agent/v3/cli-pipeline

#https://github.com/buildkite/cli/
#https://github.com/buildkite/agent/releases/download/v3.16.0/buildkite-agent-linux-arm64-3.16.0.tar.gz

export BUILDKITE_BUILD_PULL_REQUEST=localPR
export BUILDKITE_BUILD_NUMBER=localXYZ
export BUILDKITE_ORGANIZATION_SLUG=localSlug
export REGISTRY=myprivate.io

temp=/tmp/pipeline.yml
.buildkite/pipeline.sh > $temp
sed -i '/docker push/d' $temp
set -x
bk run --dry-run --prompt --env LOGNAME=$(whoami) $temp
```

@lukedirtwalker
Copy link
Collaborator

With the new pipeline we are closer to run it locally. Steps involved:
install bk
install buildkite-agent
.builkite/pipeline2.sh > full-pipeline.yml
bk local run --env LOGNAME=$USER full-pipeline.yml
But some steps are still failing.

@lukedirtwalker lukedirtwalker added i/devops Everything related to CI/Bazel/building feature New feature or request labels Jan 8, 2020
lukedirtwalker added a commit that referenced this issue Jan 9, 2020
Running the new pipeline locally is not yet fully supported. The steps required currently are:
* install [bk](https://github.com/buildkite/cli)
* install [buildkite-agent](https://github.com/buildkite/agent)
* `.builkite/pipeline2.sh > full-pipeline.yml`
* `bk local run --env LOGNAME=$USER full-pipeline.yml`
More information about local running: #3286

Fixes #3574
Fixes #3568
karampok added a commit that referenced this issue Jan 9, 2020
This PR adds timestamps in bazel and hardcodes the test-artifact folder in order to
enable local run. Now everything runs locally apart from acceptance test that require
some sudo interactive action.

Contributes #3286
@oncilla oncilla closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request i/devops Everything related to CI/Bazel/building
Projects
None yet
Development

No branches or pull requests

3 participants