Enhance CI workflows for Tai service with Docker socket integration
- Add Docker socket volume mount to the Docker run commands in both `pr-test.yml` and `unit-test.yml`, allowing the Tai K8s container to interact with the host Docker daemon. - Update kubeconfig generation steps to dynamically retrieve the K3D IP address, ensuring accurate configuration for Kubernetes interactions. These changes improve the integration of the Tai service with Kubernetes by enabling better communication with the Docker environment during CI workflows.
This commit is contained in:
parent
b7eb0e81e3
commit
2fd8e02edf
2 changed files with 14 additions and 0 deletions
7
.github/workflows/pr-test.yml
vendored
7
.github/workflows/pr-test.yml
vendored
|
|
@ -1139,6 +1139,7 @@ jobs:
|
|||
docker run -d --name tai-k8s \
|
||||
--network k3d-tai-test \
|
||||
-p 8081:8080 -p 9101:9100 -p 6443:6443 -p 6081:6080 \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
-v /tmp/kubeconfig-tai-k8s.yml:/etc/tai/kubeconfig.yml:ro \
|
||||
-e TAI_K8S_UPSTREAM="tcp://${K3D_IP}:6443" \
|
||||
-e TAI_KUBECONFIG=/etc/tai/kubeconfig.yml \
|
||||
|
|
@ -1981,7 +1982,10 @@ jobs:
|
|||
docker run -d --name tai-k8s \
|
||||
--network k3d-tai-test \
|
||||
-p 8081:8080 -p 9101:9100 -p 6443:6443 -p 6081:6080 \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
-v /tmp/kubeconfig-tai-k8s.yml:/etc/tai/kubeconfig.yml:ro \
|
||||
-e TAI_K8S_UPSTREAM="tcp://${K3D_IP}:6443" \
|
||||
-e TAI_KUBECONFIG=/etc/tai/kubeconfig.yml \
|
||||
yaoapp/tai:latest
|
||||
|
||||
for i in $(seq 1 30); do
|
||||
|
|
@ -2006,7 +2010,10 @@ jobs:
|
|||
|
||||
- name: Generate kubeconfig for benchmarks
|
||||
run: |
|
||||
K3D_IP=$(docker inspect k3d-tai-test-server-0 | jq -r '.[0].NetworkSettings.Networks["k3d-tai-test"].IPAddress')
|
||||
k3d kubeconfig get tai-test > /tmp/kubeconfig-k3d.yml
|
||||
sed "s|server: .*|server: https://${K3D_IP}:6443|" /tmp/kubeconfig-k3d.yml \
|
||||
> /tmp/kubeconfig-tai-k8s.yml
|
||||
sed 's|server: .*|server: https://127.0.0.1:6443|' /tmp/kubeconfig-k3d.yml \
|
||||
> ${{ runner.temp }}/kubeconfig-tai.yml
|
||||
|
||||
|
|
|
|||
7
.github/workflows/unit-test.yml
vendored
7
.github/workflows/unit-test.yml
vendored
|
|
@ -847,6 +847,7 @@ jobs:
|
|||
docker run -d --name tai-k8s \
|
||||
--network k3d-tai-test \
|
||||
-p 8081:8080 -p 9101:9100 -p 6443:6443 -p 6081:6080 \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
-v /tmp/kubeconfig-tai-k8s.yml:/etc/tai/kubeconfig.yml:ro \
|
||||
-e TAI_K8S_UPSTREAM="tcp://${K3D_IP}:6443" \
|
||||
-e TAI_KUBECONFIG=/etc/tai/kubeconfig.yml \
|
||||
|
|
@ -1487,7 +1488,10 @@ jobs:
|
|||
docker run -d --name tai-k8s \
|
||||
--network k3d-tai-test \
|
||||
-p 8081:8080 -p 9101:9100 -p 6443:6443 -p 6081:6080 \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
-v /tmp/kubeconfig-tai-k8s.yml:/etc/tai/kubeconfig.yml:ro \
|
||||
-e TAI_K8S_UPSTREAM="tcp://${K3D_IP}:6443" \
|
||||
-e TAI_KUBECONFIG=/etc/tai/kubeconfig.yml \
|
||||
yaoapp/tai:latest
|
||||
|
||||
for i in $(seq 1 30); do
|
||||
|
|
@ -1512,7 +1516,10 @@ jobs:
|
|||
|
||||
- name: Generate kubeconfig for benchmarks
|
||||
run: |
|
||||
K3D_IP=$(docker inspect k3d-tai-test-server-0 | jq -r '.[0].NetworkSettings.Networks["k3d-tai-test"].IPAddress')
|
||||
k3d kubeconfig get tai-test > /tmp/kubeconfig-k3d.yml
|
||||
sed "s|server: .*|server: https://${K3D_IP}:6443|" /tmp/kubeconfig-k3d.yml \
|
||||
> /tmp/kubeconfig-tai-k8s.yml
|
||||
sed 's|server: .*|server: https://127.0.0.1:6443|' /tmp/kubeconfig-k3d.yml \
|
||||
> ${{ runner.temp }}/kubeconfig-tai.yml
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue