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

Simply test the built docker image in CI #1617

Merged
merged 8 commits into from
Jul 29, 2023

Conversation

PragmaTwice
Copy link
Member

@PragmaTwice PragmaTwice commented Jul 29, 2023

It closes #1580.

In nightly CI, we have built docker images for kvrocks, but we cannot confirm the built docker image is valid, e.g. the kvrocks may just crash after starting due to some OS environment problems, like shared library missing. We want to add some simple test to confirm the built image is run-able.

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

We can test before release, like https://github.com/korandoru/hawkeye/blob/75da87606f8f303c740d8d8d6738d8271af90d0a/.github/workflows/ci.yml#L94-L119

Or even add the extra test step at -

check-docker:
name: Check Docker image
needs: [precondition, check-and-lint]
if: ${{ needs.precondition.outputs.docs_only != 'true' }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Get core numbers
run: echo "NPROC=$(nproc)" >> $GITHUB_ENV
- uses: docker/build-push-action@v3
with:
context: .
build-args: MORE_BUILD_ARGS=-j${{ env.NPROC }}

So we check before merge.

@PragmaTwice
Copy link
Member Author

PragmaTwice commented Jul 29, 2023

Or even add the extra test step at -

Seems a good idea, but I do not know how to get the docker image in the previous step (docker/build-push-action@v3) since we do not push it.

- uses: docker/build-push-action@v3

@PragmaTwice
Copy link
Member Author

PragmaTwice commented Jul 29, 2023

And, a failed try by me, is that uses: docker://apache/kvrocks:nightly does not work, seems the asf github settings have blocked them.

@tisonkun
Copy link
Member

@PragmaTwice I already link to this snippet which has a step to "Build and load".

      - name: Build and load
        uses: docker/build-push-action@v3
        with:
          context: .
          file: ${{matrix.file}}
          tags: ${{matrix.name}}:ci
          outputs: type=docker
      - name: Sanity check
        run: docker run --rm -v $(pwd):/github/workspace ${{matrix.name}}:ci check

Take care of outputs and the sanity check step we use docker run.

@PragmaTwice
Copy link
Member Author

@PragmaTwice I already link to this snippet which has a step to "Build and load".

      - name: Build and load
        uses: docker/build-push-action@v3
        with:
          context: .
          file: ${{matrix.file}}
          tags: ${{matrix.name}}:ci
          outputs: type=docker
      - name: Sanity check
        run: docker run --rm -v $(pwd):/github/workspace ${{matrix.name}}:ci check

Take care of outputs and the sanity check step we use docker run.

Got it. Done.

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

LGTM. Please update the PR title according to the current change.

@PragmaTwice PragmaTwice changed the title Simply test the built docker image in nightly CI Simply test the built docker image in CI Jul 29, 2023
@PragmaTwice PragmaTwice merged commit e523520 into unstable Jul 29, 2023
50 checks passed
@PragmaTwice PragmaTwice deleted the PragmaTwice/test-docker-image branch July 29, 2023 10:37
p1u3o pushed a commit to p1u3o/incubator-kvrocks that referenced this pull request Aug 1, 2023
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.

Test the built docker image in nightly CI
2 participants