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

Dev hw dut #25

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
423f94f
Support for HW DUT
anjan-keysight Nov 28, 2022
54c4c10
User procfs for network plumbing into containers
anjan-keysight Nov 28, 2022
c422b64
Have non-root user as default
anjan-keysight Nov 29, 2022
479db25
Update version
anjan-keysight Nov 29, 2022
ca942ab
Merge branch 'main' into dev-hw-dut
anjan-keysight Nov 30, 2022
703214b
Merge branch 'main' into dev-hw-dut
anjan-keysight Nov 30, 2022
11aba6f
Merge branch 'main' into dev-hw-dut
anjan-keysight Nov 30, 2022
0c563cb
Docker deployment with macvtap and custom args, env
anjan-keysight Dec 9, 2022
415316b
Update version
anjan-keysight Dec 9, 2022
79c8984
Keep server port map optional for hybrid deployment
anjan-keysight Dec 14, 2022
9819a07
Hybrid deployment with optional create macvtap
anjan-keysight Dec 15, 2022
e4e54b5
Update README.md
anjan-keysight Dec 15, 2022
8695f1c
Merged main
anjan-keysight Dec 16, 2022
785f547
Update README.md
anjan-keysight Dec 16, 2022
d0d4a9c
Update README.md
anjan-keysight Dec 16, 2022
77a7043
Publish hybrid mode
anjan-keysight Dec 16, 2022
1ced62a
Merge branch 'dev-hw-dut' of https://github.com/open-traffic-generato…
anjan-keysight Dec 16, 2022
ac3cba8
Update README.md
anjan-keysight Dec 16, 2022
d5c1be0
Update README.md
anjan-keysight Dec 16, 2022
86fd15b
Seat based licensing support for hybrid deployment
anjan-keysight Nov 22, 2023
914ada3
Allow operator release for hybrid
anjan-keysight Nov 22, 2023
f7eefbd
Update version
anjan-keysight Nov 22, 2023
bcdd5c3
small fix
biplamal Nov 22, 2023
d2b4d88
Merge branch 'main' into dev-hw-dut
anjan-keysight Nov 24, 2023
dd5489c
Update README.md
anjan-keysight Nov 24, 2023
b755821
Merge branch 'main' into dev-hw-dut
anjan-keysight Nov 27, 2023
67a8360
Update README.md
anjan-keysight Nov 27, 2023
5c5af35
Update README.md
anjan-keysight Nov 28, 2023
ed195e0
Fix bug when configmap is downloaded
anjan-keysight Dec 6, 2023
c8deee9
Support for UHD deployment
anjan-keysight Apr 29, 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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publishing Artifacts
if: steps.check_tag.outputs.exists == 'false' && steps.get_branch.outputs.branch == 'main'
if: steps.check_tag.outputs.exists == 'false' && steps.get_branch.outputs.branch == 'dev-hw-dut'
run: |
chmod u+x ./ci.sh
TOKEN_GITHUB=${{ secrets.TOKEN_GITHUB }} ./ci.sh publish

- name: Create Release
if: steps.check_tag.outputs.exists == 'false' && steps.get_branch.outputs.branch == 'main'
if: steps.check_tag.outputs.exists == 'false' && steps.get_branch.outputs.branch == 'dev-hw-dut'
uses: ncipollo/release-action@v1
with:
artifacts: "release/*"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Publishing Artifacts
# if: steps.check_tag.outputs.exists == 'false' && steps.get_branch.outputs.branch == 'main'
# run: |
# sudo chmod u+x ./do.sh
# sudo TOKEN_GITHUB=${{ secrets.TOKEN_GITHUB }} ./do.sh cicd_publish
# - name: Publishing Artifacts
# if: steps.check_tag.outputs.exists == 'false' && steps.get_branch.outputs.branch == 'dev-hw-dut'
# run: |
# sudo chmod u+x ./do.sh
# sudo TOKEN_GITHUB=${{ secrets.TOKEN_GITHUB }} ./do.sh cicd_publish

# - name: Create Release
# if: steps.check_tag.outputs.exists == 'false' && steps.get_branch.outputs.branch == 'main'
Expand Down
158 changes: 158 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,164 @@ Please make sure that the setup meets [Deployment Prerequisites](#deployment-pre

- Please make sure you have kubernetes cluster up in your setup.

## Deployment in Hybrid Mode

To test networking hardware devices with Ixia-c software, the operator allows you to deploy Ixia-c software components and required interconnects with host network interfaces. As a minimum user would require a server with sudo permissions, docker and go version 1.18 or later installed.

The following steps outline a simple topology deployment in hybrid mode and run featureprofiles test.
1. Pull the required docker images

```Shell
docker pull ghcr.io/open-traffic-generator/keng-controller:0.1.0-81
docker pull ghcr.io/open-traffic-generator/otg-gnmi-server:1.13.2
docker pull ghcr.io/open-traffic-generator/ixia-c-traffic-engine:1.6.0.100
docker pull ghcr.io/open-traffic-generator/ixia-c-protocol-engine:1.00.0.339
docker pull ghcr.io/open-traffic-generator/keng-hybrid-operator:0.0.4
```


2. Deploy the operator container:

```Shell
docker run -d --name=ixia-c-operator -v /var/run/docker.sock:/var/run/docker.sock --cap-add CAP_NET_ADMIN --net=host --pid=host --user=root ghcr.io/open-traffic-generator/ixia-c-operator:0.3.3 --server-bind-address=:35000
```
The server-bind-address is optional to custom bind to user specified port, default is **30000**.


3. Load the configmap in operator (Optional):

In case there is absence of internet connectivity the operator would require the configmap to be loaded.

```Shell
curl --data-binary @ixiatg-configmap.yaml http://localhost:35000/config
```


4. Apply seat based license in operator (Optional):

Seat based license can be added by loading an updated ixiatg-configmap.yaml as specified in the deployment steps above. Alternatively, the license can also be apply as shown below.

```Shell
curl --data-raw '{"license-address": "<space separated IP addresses>" }' http://localhost:35000/license
```


5. Deploy the topology:

For our example here we will use a port-dut-port deployment configuration file as shown below. Note in this example our two dut ports, *Ethernet1* and *Ethernet2*, are wire connected to our server interface, *enp0s8* and *enp0s9*. For our test we would require otg interface *eth1* and *eth2* to be connected to dut *Ethernet1* and *Ethernet2* respectively.

```Shell
{
"metadata": {
"name": "otg",
"namespace": "ixia-c"
},
"spec": {
"api_endpoint_map": {
"https": {
"in": 8443
},
"grpc": {
"in": 40051
},
"gnmi": {
"in": 50051
}
},
"interfaces": [
{
"name": "eth1",
"peer": "localhost",
"peer_interface": "enp0s8"
},
{
"name": "eth2",
"peer": "localhost",
"peer_interface": "enp0s9"
}
],
"release": "0.0.1-3662"
}
}
```

```Shell
curl -d @port-dut-port http://localhost:35000/create
```


6. Clone FeatureProfiles repository:

```Shell
git clone https://github.com/open-traffic-generator/featureprofiles.git
```


7. Update the binding file:

Update the corresponding binding file for the test, for this example we will update otgdut_2.binding with the correct Controller and DUT addresses. Also ensure the required basic configuration is set on the hardware DUT, examples of these can be found as config files under topologies/kne directory.

```Shell
options {
username: "admin"
password: ""
}

duts {
id: "dut"
name: "172.17.0.2"
gnmi {
target: "172.17.0.2:6030"
}
ports {
id: "port1"
name: "Ethernet1"
}
ports {
id: "port2"
name: "Ethernet2"
}
}

ates {
id: "ate"
name: "172.17.0.5"
otg {
target: "172.17.0.5:40051"
insecure: true
}
gnmi {
target: "172.17.0.5:50051"
skip_verify: true
}
ports {
id: "port1"
name: "eth1"
}
ports {
id: "port2"
name: "eth2"
}
}
```


8. Run FeatureProfile test:

```Shell
go test -v feature/bgp/policybase/otg_tests/route_installation_test/route_installation_test.go -testbed "${PWD}/topologies/atedut_2.testbed" -binding "${PWD}/topologies/otgdut_2.binding" --deviation_interface_enabled --deviation_default_network_instance=default
```


9. Cleanup:

```Shell
curl -d @port-dut-port http://localhost:35000/delete
docker stop ixia-c-operator
docker rm ixia-c-operator
```


## Build

- **Clone this project**
Expand Down
15 changes: 13 additions & 2 deletions api/v1beta1/ixiatg_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ type IxiaTGSvcPort struct {

// IxiaTGSvcPort defines the endpoint ports for network traffic for the OTG node
type IxiaTGIntf struct {
Name string `json:"name"`
Group string `json:"group,omitempty"`
Name string `json:"name"`
Group string `json:"group,omitempty"`
Peer string `json:"peer,omitempty"`
PeerIntf string `json:"peer_interface,omitempty"`
UseRaw bool `json:"use_raw,omitempty"`
Port uint32 `json:"port,omitempty"`
HostPort *uint32 `json:"mapped_host_port,omitempty"`
}

// IxiaTGIntfStatus defines the mapping between endpoint ports and encasing pods
Expand Down Expand Up @@ -72,6 +77,12 @@ type IxiaTGSpec struct {
Interfaces []IxiaTGIntf `json:"interfaces,omitempty"`
// Init container image of the node
InitContainer IxiaTGInitContainer `json:"init_container,omitempty"`
// Type of deployment
Type *string `json:"type,omitempty"`
// Interface to use as trunk interface
TrunkInterface *string `json:"trunk_interface,omitempty"`
// UHD host server
UHDHost *string `json:"uhd_host,omitempty"`
}

// IxiaTGStatus defines the observed state of IxiaTG
Expand Down
4 changes: 2 additions & 2 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GO_VERSION=1.17.9
export DEBIAN_FRONTEND=noninteractive


IXIA_C_OPERATOR_IMAGE=keng-operator
IXIA_C_OPERATOR_IMAGE=keng-hybrid-operator
GO_TARGZ=""

GITHUB_REPO="ghcr.io/open-traffic-generator"
Expand Down Expand Up @@ -168,7 +168,7 @@ gen_operator_artifacts() {
rm -rf ${art}/*.yaml
rm -rf ${art}/*.tar.gz
mv ./ixiatg-operator.yaml ${art}/
docker save ${IXIA_C_OPERATOR_IMAGE}:${version} | gzip > ${art}/keng-operator.tar.gz
docker save ${IXIA_C_OPERATOR_IMAGE}:${version} | gzip > ${art}/${IXIA_C_OPERATOR_IMAGE}.tar.gz
}

build() {
Expand Down
Loading
Loading