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

Add github workflow running jenkins job #260

Closed

Conversation

sylwiaszunejko
Copy link
Collaborator

This workflow pushes scylla-bench docker image using gocql version from the PR and triggers jenkins job that uses this image of scylla-bench.

@sylwiaszunejko
Copy link
Collaborator Author

sylwiaszunejko commented Sep 13, 2024

New workflow won't be running in CI in this PR, because it uses pull_request_target event. In this PR we can see how it behaves: #255.

Things to be changed:

  • change jenkins_client fork to scylladb
  • change user from me to some official jenkins user
  • move jenkins job to official location

To check if the authorize part work correctly for the PRs from external users (forks) we would need to merge this PR and than check. That isn't perfect solution but right now I can't see other way.

Comment on lines +41 to +53
- name: Replace gocql with the PR version
run: |
cd scylla-bench
go mod edit -replace github.com/gocql/gocql=../gocql
go mod tidy

- name: Build and push Scylla-bench Docker Image
run: |
cd scylla-bench
export SCYLLA_BENCH_VERSION=tags/v0.1.22
export NAME="${{ github.event.pull_request.head.ref }}"
export SCYLLA_BENCH_DOCKER_IMAGE=scylladb/gocql-extended-ci:scylla-bench-${NAME}
docker build -f ../gocql/.github/workflows/Dockerfile . -t ${SCYLLA_BENCH_DOCKER_IMAGE} --build-arg version=$SCYLLA_BENCH_VERSION
Copy link
Collaborator

@dkropachev dkropachev Sep 13, 2024

Choose a reason for hiding this comment

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

Let's move this logic to scylla-bench repo.
So that here it would look like:

      - name: Build and push scylla-bench image
        run: |
           cd scylla-bench
           GOCQL_COMMIT_ID="${{ github.event.pull_request.head.ref }}" IMAGE_TAG="scylladb/gocql-extended-ci:scylla-bench-${NAME}" make build-image-with-custom-gocql-commit
           docker push "scylladb/gocql-extended-ci:scylla-bench-${NAME}"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines +37 to +38
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't it default ? can't you just use path: gocql ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it seems to be not, look: https://github.com/scylladb/gocql/pull/255/checks
Or do you mean I should add path: gocql in some other place?

@sylwiaszunejko sylwiaszunejko changed the base branch from master to advanced_ci September 16, 2024 12:50
This workflow pushes scylla-bench docker image using gocql
version from the PR and triggers jenkins job that uses this
image of scylla-bench.
@sylwiaszunejko
Copy link
Collaborator Author

I went with @Lorak-mmk advice #204 (comment)
Now the changes are here: #255 and here we can see the new workflow running: #263
Please move to these two PR with all discussions

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.

2 participants