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 CI for VTop example #16007

Merged
merged 22 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8692bdc
feat: add vtop exmaple ci
GuptaManan100 May 24, 2024
b2043b3
feat: also run CI on changes to yaml file of the workflow
GuptaManan100 May 24, 2024
e4d9a80
test: fix output name for the changes in relevant files step
GuptaManan100 May 24, 2024
7dbeffc
feat: fix docker image building
GuptaManan100 May 27, 2024
5ae9c11
test: print the pod status of vttablet to see what the problem is
GuptaManan100 May 27, 2024
ad82169
Use 64 cores runners
frouioui May 27, 2024
c42e1e9
test: also print the vttablet logs
GuptaManan100 May 28, 2024
acf74bc
feat: fix panic in shutdown
GuptaManan100 May 28, 2024
dd9f22c
test: also print show grants output to debug
GuptaManan100 May 28, 2024
42801f7
test: print more logs
GuptaManan100 May 28, 2024
fb824dd
test: print the cnf files
GuptaManan100 May 28, 2024
d137ec4
Trigger rebuild
rohit-nayak-ps Jun 3, 2024
4776a5d
Merge remote-tracking branch 'upstream/main' into vtop-ci-addition
GuptaManan100 Jul 18, 2024
961eb4d
feat: update kind version and the mysql image to be used
GuptaManan100 Jul 18, 2024
ed1e2b0
Merge remote-tracking branch 'origin/main' into vtop-ci-addition
frouioui Oct 30, 2024
a4b0358
Run the workflow on a self-hosted runner
frouioui Oct 30, 2024
1a15326
Remove non-required steps
frouioui Oct 30, 2024
a7fdc8e
Simplify workflow
frouioui Oct 30, 2024
c5e95f8
add vtctldclient to the workflow
frouioui Oct 30, 2024
e3ef5d7
Self review + remove debug
frouioui Oct 30, 2024
5f0d721
Merge remote-tracking branch 'upstream/main' into vtop-ci-addition
GuptaManan100 Nov 28, 2024
5d12aae
feat: remove debug only lines
GuptaManan100 Nov 28, 2024
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
99 changes: 99 additions & 0 deletions .github/workflows/vtop_example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: vtop_example
on: [push, pull_request]
concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'vtop_example')
cancel-in-progress: true

jobs:
build:
name: VTop Example
runs-on: gh-hosted-runners-16cores-1

steps:
- name: Skip CI
run: |
if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then
echo "skipping CI due to the 'Skip CI' label"
exit 1
fi

- name: Check if workflow needs to be skipped
id: skip-workflow
run: |
skip='false'
if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then
skip='true'
fi
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT

PR_DATA=$(curl -s\
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
draft=$(echo "$PR_DATA" | jq .draft -r)
echo "is_draft=${draft}" >> $GITHUB_OUTPUT

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v4

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: dorny/[email protected]
id: changes
with:
token: ''
filters: |
end_to_end:
- 'go/**/*.go'
- 'test.go'
- 'Makefile'
- 'build.env'
- 'go.[sumod]'
- 'proto/*.proto'
- 'tools/**'
- 'config/**'
- 'bootstrap.sh'
- 'examples/**'
- '.github/workflows/vtop_example.yml'

- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@v5
with:
go-version: 1.22.3

- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
# Install everything we need, and configure
sudo apt-get install -y make unzip g++ etcd curl git wget eatmydata
go mod download

- name: Run make minimaltools
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
make minimaltools

- name: Build
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
make build

- name: Install kubectl & kind
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
make install_kubectl_kind

- name: vtop_example
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 60
run: |
source build.env
eatmydata -- go run test.go -docker=false -skip-build -print-log -follow -retry=1 -timeout=60m vtop_example
2 changes: 1 addition & 1 deletion docker/binaries/vtadmin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ARG DEBIAN_VER=bullseye-slim

FROM vitess/lite:${VT_BASE_VER} AS lite

FROM node:18-${DEBIAN_VER} as node
FROM node:20-${DEBIAN_VER} as node
GuptaManan100 marked this conversation as resolved.
Show resolved Hide resolved

# Prepare directory structure.
RUN mkdir -p /vt/web
Expand Down
11 changes: 11 additions & 0 deletions test/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,17 @@
"RetryMax": 1,
"Tags": []
},
"vtop_example": {
"File": "",
"Args": [],
"Command": [
"test/vtop_example.sh"
],
"Manual": false,
"Shard": "",
"RetryMax": 1,
"Tags": []
},
"vtorc_primary_failure": {
"File": "unused.go",
"Args": ["vitess.io/vitess/go/test/endtoend/vtorc/primaryfailure"],
Expand Down
2 changes: 1 addition & 1 deletion test/vtop_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ EOF
# Build the docker image for vitess/lite using the local code
docker build -f docker/lite/Dockerfile -t vitess/lite:pr .
# Build the docker image for vitess/vtadmin using the local code
docker build -f docker/binaries/vtadmin/Dockerfile --build-arg VT_BASE_VER=pr -t vitess/vtadmin:pr .
docker build -f docker/binaries/vtadmin/Dockerfile --build-arg VT_BASE_VER=pr -t vitess/vtadmin:pr ./docker/binaries/vtadmin

# Print the docker images available
docker image ls
Expand Down
Loading