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 logic to build image with custom gocql version #143

Closed
wants to merge 1 commit into from

Conversation

sylwiaszunejko
Copy link
Contributor

@sylwiaszunejko sylwiaszunejko commented Sep 16, 2024

As per @dkropachev request I moved logic with building image with custom gocql version to scylla-bench repo to be able to replace:

      - 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
          docker push ${SCYLLA_BENCH_DOCKER_IMAGE}

with

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

in gocql extended CI
scylladb/gocql#260 (comment)

go mod tidy

@echo "Building Docker image with tag ${IMAGE_TAG}"
docker build -f ${DOCKERFILE_PATH} . -t ${IMAGE_TAG} --build-arg version=${SCYLLA_BENCH_VERSION}
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't use docker, run whole thing plain.

Copy link
Contributor

Choose a reason for hiding this comment

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

SCT uses scylla-bench as a docker image.
And the original idea, as I understand, is to run SCT longevities: https://github.com/scylladb/gocql/pull/260/files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure how
Don't I have to use docker build to then run docker push and actually push docker image?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SCT uses scylla-bench as a docker image. And the original idea, as I understand, is to run SCT longevities: https://github.com/scylladb/gocql/pull/260/files

exactly

Makefile Show resolved Hide resolved

# Default variables
DOCKERFILE_PATH ?= Dockerfile
SCYLLA_BENCH_VERSION ?= tags/v0.1.22
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure it is good idea to have a default for the scylla-bench version.
It is easy to get unexpected s-b version in a test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is there a way to get the latest easily?

Copy link
Contributor

Choose a reason for hiding this comment

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

There is no latest tag.
I made this statement assuming this workflow is going to be used with specific PRs.
So, if you are sure that specific PRs won't get problems having this default then ok, keep it as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is going to be used with specific PRs, I just thought that in most cases we want to use the latest tag and it would be easier to update it in one place here than in every place that is going to use this Makefile

Copy link
Contributor

Choose a reason for hiding this comment

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

"master" branch should solve that need, if I understood everything correctly.

@dkropachev
Copy link
Contributor

Implemented in #144

@dkropachev dkropachev closed this Sep 16, 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