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 more sanity checks for docker image #1877

Merged
merged 3 commits into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/kvrocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,19 @@ jobs:
tags: kvrocks:ci
outputs: type=docker
- name: Test built image
run: docker run --rm kvrocks:ci -v
Copy link
Member

Choose a reason for hiding this comment

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

I think we still need this one since it is not covered in the new checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When starting kvrocks, the version is output but cannot be seen due to detach.
I have restored this version check to output the version to github action log.

run: |
docker run --rm kvrocks:ci -v
ID="$(docker run --rm -d -p 6666:6666 kvrocks:ci)"
sleep 1m
if [ "$(docker inspect --format='{{.State.Health.Status}}' $ID)" != "healthy" ]; then
echo "The container is not healthy."
exit 1
fi
if [ "$(ss --listening --no-header --tcp '( sport = :6666 )')" == "" ]; then
echo "The container listening port can not be accessed from outside."
exit 1
fi
docker stop $ID

build-and-test-in-container:
name: Build and test in container
Expand Down