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

Start k3d in ci-container and execute e2e test to k8s cluster #2553

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions .github/actions/setup-e2e/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ runs:
if: ${{ inputs.require_libhdf5 == 'true' }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libhdf5-dev
apt-get update
apt-get install -y libhdf5-dev
- name: Setup Go environment
if: ${{ inputs.require_go == 'true' }}
uses: ./.github/actions/setup-go
Expand Down
1 change: 1 addition & 0 deletions .github/actions/setup-k3d/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ runs:
shell: bash
id: k3d_options
run: |
OPTIONS="${OPTIONS} --api-port host.docker.internal:6550"
if [ "${AGENTS}" != 0 ]; then
OPTIONS="${OPTIONS} --agents ${AGENTS}"
fi
Expand Down
36 changes: 25 additions & 11 deletions .github/workflows/e2e-chaos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,29 @@ on:
- "*.*.*-*"
- "v*.*.*-*"
pull_request:
types:
- "labeled"
# types:
# - "labeled"
env:
VALUES: .github/helm/values/values-chaos.yaml
DATASET: fashion-mnist-784-euclidean.hdf5
INGRESS_PORT: 8081
jobs:
dump-contexts-to-log:
if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-chaos'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context
detect-ci-container:
# if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml
agent-failure:
name: "E2E chaos test (Agent failure: to test insert/search works even if one of the agents is failing)"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand All @@ -64,7 +69,7 @@ jobs:
- name: Run Insert and Search operations
run: |
make hack/benchmark/assets/dataset/${{ env.DATASET }}
make E2E_BIND_HOST=localhost \
make E2E_BIND_HOST=host.docker.internal \
E2E_BIND_PORT=8081 \
E2E_PORTFORWARD_ENABLED=false \
E2E_DATASET_NAME=${{ env.DATASET }} \
Expand All @@ -75,9 +80,12 @@ jobs:
e2e/insert/search
random-pod-failure:
name: "E2E chaos test (random Pod failure: to test redundancy)"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand All @@ -102,7 +110,7 @@ jobs:
- name: Run Insert and Search operations
run: |
make hack/benchmark/assets/dataset/${{ env.DATASET }}
make E2E_BIND_HOST=localhost \
make E2E_BIND_HOST=host.docker.internal \
E2E_BIND_PORT=8081 \
E2E_PORTFORWARD_ENABLED=false \
E2E_DATASET_NAME=${{ env.DATASET }} \
Expand All @@ -113,9 +121,12 @@ jobs:
e2e/insert/search
agent-network-partition:
name: "E2E chaos test (agent network partition: to test retries)"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand All @@ -140,7 +151,7 @@ jobs:
- name: Run Insert and Search operations
run: |
make hack/benchmark/assets/dataset/${{ env.DATASET }}
make E2E_BIND_HOST=localhost \
make E2E_BIND_HOST=host.docker.internal \
E2E_BIND_PORT=8081 \
E2E_PORTFORWARD_ENABLED=false \
E2E_DATASET_NAME=${{ env.DATASET }} \
Expand All @@ -151,9 +162,12 @@ jobs:
e2e/insert/search
clusterwide-network-bandwidth:
name: "E2E chaos test (network bandwidth: to test it works properly under bandwidth limitation)"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand All @@ -178,7 +192,7 @@ jobs:
- name: Run Insert and Search operations
run: |
make hack/benchmark/assets/dataset/${{ env.DATASET }}
make E2E_BIND_HOST=localhost \
make E2E_BIND_HOST=host.docker.internal \
E2E_BIND_PORT=8081 \
E2E_PORTFORWARD_ENABLED=false \
E2E_DATASET_NAME=${{ env.DATASET }} \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/e2e-code-bench-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand Down Expand Up @@ -85,6 +86,7 @@ jobs:
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/e2e-max-dim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,21 @@ on:
- "labeled"
jobs:
dump-contexts-to-log:
if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-max-dim'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context
detect-ci-container:
# if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml
Comment on lines +34 to +36
Copy link
Contributor

Choose a reason for hiding this comment

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

Add the if condition for better control.

The if condition is commented out. It should be uncommented to ensure the job runs only under the specified conditions.

-    # if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
+    if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
detect-ci-container:
# if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml
detect-ci-container:
if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml

e2e-max-dimension-insert:
name: "E2E test (Max Dimension Insert: skip strict exist check)"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/e2e-profiling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,21 @@ env:
DATASET: fashion-mnist-784-euclidean.hdf5
jobs:
dump-contexts-to-log:
if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-profiling'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context
detect-ci-container:
# if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml
e2e-profiling:
name: "E2E profiling"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand Down Expand Up @@ -102,8 +107,8 @@ jobs:
restore-keys: ${{ runner.os }}-profiles-main-
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y graphviz
apt update
apt install -y graphviz
- name: Generate graphs
run: |
tag=$(cat profiles-main/VALD_VERSION || echo "unknown")
Expand Down
48 changes: 37 additions & 11 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,27 @@ on:
- "*.*.*-*"
- "v*.*.*-*"
pull_request:
types:
- "labeled"
# types:
# - "labeled"
env:
DATASET: fashion-mnist-784-euclidean.hdf5
jobs:
dump-contexts-to-log:
if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context
detect-ci-container:
# if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml
Comment on lines +35 to +37
Copy link
Contributor

Choose a reason for hiding this comment

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

Add the if condition for better control.

The if condition is commented out. It should be uncommented to ensure the job runs only under the specified conditions.

-    # if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
+    if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
detect-ci-container:
# if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml
detect-ci-container:
if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml

e2e-stream-crud:
name: "E2E test (Stream CRUD)"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand Down Expand Up @@ -73,9 +78,12 @@ jobs:
POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }}
e2e-stream-crud-for-operator:
name: "E2E test (Stream CRUD) for operator"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand Down Expand Up @@ -133,9 +141,12 @@ jobs:
POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }}
e2e-stream-crud-under-index-management-jobs:
name: "E2E test (Stream CRUD) under index management jobs"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand Down Expand Up @@ -175,9 +186,12 @@ jobs:
POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }}
e2e-stream-crud-skip-exist-check:
name: "E2E test (Stream CRUD: skip strict exist check)"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand Down Expand Up @@ -213,9 +227,12 @@ jobs:
POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }}
e2e-multiapis-crud:
name: "E2E test (Multi-APIs CRUD)"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand Down Expand Up @@ -247,9 +264,12 @@ jobs:
POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }}
e2e-jobs:
name: "E2E test (Jobs)"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand Down Expand Up @@ -278,9 +298,12 @@ jobs:
POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }}
e2e-stream-crud-with-readreplica:
name: "E2E test (Stream CRUD) with read replica"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand Down Expand Up @@ -326,9 +349,12 @@ jobs:
POD_NAME: ${{ steps.deploy_vald_readreplica.outputs.POD_NAME }}
e2e-stream-crud-with-mirror:
name: "E2E test (Stream CRUD) with mirror"
needs: [dump-contexts-to-log]
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--privileged --add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/kubernetes/portforward/portforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (p *Portforward) Start() error {
path := fmt.Sprintf("/api/v1/namespaces/%s/pods/%s/portforward",
p.namespace, p.podName)

hostIP := strings.TrimLeft(p.restConfig.Host, "https:/")
hostIP := strings.TrimPrefix(strings.TrimPrefix(p.restConfig.Host, "http://"), "https://")

transport, upgrader, err := spdy.RoundTripperFor(p.restConfig)
if err != nil {
Expand Down
Loading