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

Added Debian Bullseye environment to CI/CD #164

Merged
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: sc-docker-client-server-bldr
name: sc-client-server-deb10

on:
pull_request:
types: [ opened, synchronize, reopened ]
branches: [ "**" ]
paths:
- '.github/workflows/sc-docker-client-server-bldr.yml'
- '.github/workflows/sc-client-server-deb10.yml'
- 'dockerfiles/buster/Dockerfile.client'
- 'dockerfiles/buster/Dockerfile.saithrift-client'
- 'dockerfiles/buster/Dockerfile.server'
Expand All @@ -29,11 +29,11 @@ jobs:
- uses: actions/checkout@v3
- name: Update submodules
run: git submodule update --init
- name: Build server docker image
run: ./build.sh -i server
- name: Save server docker image
- name: Build server Docker image
run: ./build.sh -i server -o deb10
- name: Save server Docker image
run: docker save sc-server-trident2-saivs > sc-server.tar
- name: Upload server image for run-sc-tests job
- name: Upload server image
uses: actions/upload-artifact@v3
with:
name: Server Image
Expand All @@ -46,13 +46,13 @@ jobs:
- uses: actions/checkout@v3
- name: Update submodules
run: git submodule update --init
- name: Build client docker image
run: ./build.sh -i client
- name: Build client docker image with SAI thrift
run: ./build.sh -i client -s thrift
- name: Save client docker image
- name: Build client Docker image
run: ./build.sh -i client -o deb10
- name: Build client Docker image with SAI thrift
run: ./build.sh -i client -s thrift -o deb10
- name: Save client Docker image
run: docker save sc-client > sc-client.tar
- name: Upload client docker image for run-sc-tests job
- name: Upload client Docker image
uses: actions/upload-artifact@v3
with:
name: Client Image
Expand All @@ -66,13 +66,13 @@ jobs:
- uses: actions/checkout@v3
- name: Update submodules.
run: git submodule update --init
- name: Download client docker image from build-sc-client job
- name: Download client Docker image
uses: actions/download-artifact@v3
with:
name: Client Image
- name: Load client image
run: docker load < sc-client.tar
- name: Download server docker image from build-sc-server job
- name: Download server Docker image
uses: actions/download-artifact@v3
with:
name: Server Image
Expand All @@ -87,11 +87,11 @@ jobs:
with:
name: Server Image
- name: Start SAI-C client
run: ./run.sh -i client
run: ./run.sh -i client -o deb10
- name: Wait for the client to get the IP address first
run: sleep 5s
- name: Start SAI-C server
run: ./run.sh -i server -a trident2 -t saivs
run: ./run.sh -i server -a trident2 -t saivs -o deb10
- name: Create veth links between client and server dockers
run: sudo ./veth-create-host.sh sc-server-trident2-saivs-run sc-client-run
- name: Run functional test cases
Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/sc-client-server-deb11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: sc-client-server-deb11

on:
pull_request:
types: [ opened, synchronize, reopened ]
branches: [ "**" ]
paths:
- '.github/workflows/sc-client-server-deb11.yml'
- 'dockerfiles/bullseye/Dockerfile.client'
- 'dockerfiles/bullseye/Dockerfile.saithrift-client'
- 'dockerfiles/bullseye/Dockerfile.server'
- 'npu/broadcom/BCM56850/saivs/Dockerfile.server'
- 'common/**'
- 'cli/**'
- 'scripts/**'
- 'configs/**'
- 'tests/**'
- 'setup.py'
- 'build.sh'
- 'exec.sh'
- '.dockerignore'
- 'sai.env'

jobs:
build-sc-server:
name: Build SAI Challenger server image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Update submodules
run: git submodule update --init
- name: Build server Docker image
run: ./build.sh -i server -o deb11
- name: Save server Docker image
run: docker save sc-server-trident2-saivs > sc-server.tar
- name: Upload server image
uses: actions/upload-artifact@v3
with:
name: Server Image
path: sc-server.tar

build-sc-client:
name: Build SAI Challenger client image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Update submodules
run: git submodule update --init
- name: Build client Docker image
run: ./build.sh -i client -o deb11
- name: Build client Docker image with SAI thrift
run: ./build.sh -i client -s thrift -o deb11
- name: Save client Docker image
run: docker save sc-client > sc-client.tar
- name: Upload client Docker image
uses: actions/upload-artifact@v3
with:
name: Client Image
path: sc-client.tar

run-sc-tests:
name: Run SAI Challenger tests in client-server mode
needs: [build-sc-client, build-sc-server]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Update submodules.
run: git submodule update --init
- name: Download client Docker image
uses: actions/download-artifact@v3
with:
name: Client Image
- name: Load client image
run: docker load < sc-client.tar
- name: Download server Docker image
uses: actions/download-artifact@v3
with:
name: Server Image
- name: Load server image
run: docker load < sc-server.tar
- name: Delete client image artifact
uses: geekyeggo/delete-artifact@v2
with:
name: Client Image
- name: Delete server image artifact
uses: geekyeggo/delete-artifact@v2
with:
name: Server Image
- name: Start SAI-C client
run: ./run.sh -i client -o deb11
- name: Wait for the client to get the IP address first
run: sleep 5s
- name: Start SAI-C server
run: ./run.sh -i server -a trident2 -t saivs -o deb11
- name: Create veth links between client and server dockers
run: sudo ./veth-create-host.sh sc-server-trident2-saivs-run sc-client-run
- name: Run functional test cases
run: ./exec.sh --no-tty -i client pytest --testbed=saivs_client_server -v -k "test_l2_basic"
- name: Run unit tests
run: ./exec.sh --no-tty -i client pytest --testbed=saivs_client_server -v -k \
"test_acl_ut or test_bridge_ut or (test_switch_ut and not sai_map_list_t) or test_vrf_ut or test_port_ut.py"
- name: Run thift data-driven tests
run: ./exec.sh --no-tty -i client pytest --testbed=saivs_client_server -v test_l2_basic_dd.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: sc-docker-standalone-bldr
name: sc-standalone-deb10

on:
pull_request:
types: [ opened, synchronize, reopened ]
branches: [ "**" ]
paths:
- '.github/workflows/sc-docker-standalone-bldr.yml'
- '.github/workflows/sc-standalone-deb10.yml'
- 'dockerfiles/buster/Dockerfile'
- 'npu/broadcom/BCM56850/saivs/Dockerfile'
- 'npu/broadcom/BCM56850/saivs/Dockerfile.saithrift'
Expand All @@ -29,10 +29,10 @@ jobs:
- uses: actions/checkout@v3
- name: Update submodules
run: git submodule update --init
- name: Build standalone docker image
run: ./build.sh -i standalone
- name: Build standalone Docker image
run: ./build.sh -i standalone -o deb10
- name: Start SAI-C in standalone mode
run: ./run.sh -i standalone
run: ./run.sh -i standalone -o deb10
- name: Run tests
run: ./exec.sh --no-tty pytest --testbed=saivs_standalone -v test_l2_basic.py -v test_vrf.py -v test_dc_t1.py
- name: Run sairedis tests
Expand All @@ -43,9 +43,9 @@ jobs:
- name: Run data-driven tests
run: ./exec.sh --no-tty pytest --testbed=saivs_standalone -v test_l2_basic_dd.py
- name: Build standalone docker image with SAI thrift
run: ./build.sh -i standalone -s thrift
run: ./build.sh -i standalone -s thrift -o deb10
- name: Start SAI-C in standalone mode with SAI thrift
run: ./run.sh -i standalone -s thrift
run: ./run.sh -i standalone -s thrift -o deb10
- name: Run thrift tests
run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v test_l2_basic.py -v test_vrf.py -v test_dc_t1.py
- name: Run thift data-driven tests
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/sc-standalone-deb11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: sc-standalone-deb11

on:
pull_request:
types: [ opened, synchronize, reopened ]
branches: [ "**" ]
paths:
- '.github/workflows/sc-standalone-deb11.yml'
- 'dockerfiles/bullseye/Dockerfile'
- 'npu/broadcom/BCM56850/saivs/Dockerfile'
- 'npu/broadcom/BCM56850/saivs/Dockerfile.saithrift'
- 'common/**'
- 'cli/**'
- 'scripts/**'
- 'configs/**'
- 'tests/**'
- 'setup.py'
- 'build.sh'
- 'run.sh'
- 'exec.sh'
- '.dockerignore'
- 'sai.env'

jobs:
build-sc-stadalone-thrift:
name: Build SAI Challenger standalone image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Update submodules
run: git submodule update --init
- name: Build standalone Docker image
run: ./build.sh -i standalone -o deb11
- name: Start SAI-C in standalone mode
run: ./run.sh -i standalone -o deb11
- name: Run tests
run: ./exec.sh --no-tty pytest --testbed=saivs_standalone -v test_l2_basic.py -v test_vrf.py -v test_dc_t1.py
- name: Run sairedis tests
run: ./exec.sh --no-tty pytest --testbed=saivs_standalone -v -k "test_sairec"
- name: Run unit tests
run: ./exec.sh --no-tty pytest --testbed=saivs_standalone -v -k \
"test_acl_ut or test_bridge_ut or (test_switch_ut and not sai_map_list_t) or test_vrf_ut or test_port_ut.py"
- name: Run data-driven tests
run: ./exec.sh --no-tty pytest --testbed=saivs_standalone -v test_l2_basic_dd.py
- name: Build standalone docker image with SAI thrift
run: ./build.sh -i standalone -s thrift -o deb11
- name: Start SAI-C in standalone mode with SAI thrift
run: ./run.sh -i standalone -s thrift -o deb11
- name: Run thrift tests
run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v test_l2_basic.py -v test_vrf.py -v test_dc_t1.py
- name: Run thift data-driven tests
run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v test_l2_basic_dd.py
- name: Run thrift unit tests
run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v ut/test_vrf_ut.py ut/test_bridge_ut.py ut/test_acl_ut.py
- name: Run thrift sairedis tests
run: ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v -k "test_sairec"
3 changes: 2 additions & 1 deletion common/sai_client/sai_redis_client/sai_redis_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def cleanup(self):
self.r.flushall()
self.loglevel_db.hmset('syncd:syncd', {'LOGLEVEL':self.loglevel, 'LOGOUTPUT':'SYSLOG'})
self.r.shutdown()
time.sleep(2)
time.sleep(1)
self.assert_process_running(self.port, self.server_ip, "Redis server has not restarted yet...")
self.__assert_syncd_running()

def set_loglevel(self, sai_api, loglevel):
Expand Down