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

Develop backend module for iCAIR Arista 100g switch with EOS4. #30

Draft
wants to merge 55 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
bfba36c
Arista EOS 4.x backend based on OpenNSA backend
hanstrompert Jun 30, 2023
cfc7e61
catch problems with privte key
hanstrompert Jul 3, 2023
a34e2db
Adapt paristaEOS4 backend module for Arista cEOS4.
Aug 23, 2023
95d1dc8
Adapt mock for cEOS4 testing on clab.
Aug 23, 2023
8a22d9c
Fix ReleaseJob.
Aug 24, 2023
336c8b3
Clean up debug messages.
Aug 29, 2023
d147d6b
Create folder for containerlab testing topologies.
Aug 29, 2023
020244f
Env file finding and description for sw cli.
Sep 2, 2023
8052209
Add pytest.ini for ignoring test_data in pytest.
Sep 2, 2023
3d733b3
Update Dockerfile and docker-compose.yml.
Feb 6, 2024
4e69d64
Add .dockerignore file to exclude test_data directory for building im…
Feb 6, 2024
b29bbad
Update log level and add debug logs in ActivateJob.
Feb 6, 2024
08fb7f7
Implement topology function for clab_aristaCEOS4 backend.
Feb 26, 2024
f6e78ce
Merge branch 'workfloworchestrator:master' into containerlab-cEOS4
CsCdanNyx Feb 27, 2024
cf0797c
Exclude pytest target that requires a backend device for Github actions.
Feb 27, 2024
f7066cb
Under Development - Backend VLAN test for all vlans and ports on Aris…
Mar 15, 2024
e0b4b19
Ignore tests/nrm pytest in github actions.
Mar 15, 2024
c553c2c
PolyNSI debug on.
Mar 15, 2024
6a5839b
Fix isort Linting Tests in Github actions.
Mar 15, 2024
5f63ec0
Fix dependencies for pyyaml used in the clab-ceos4 backend within the…
Mar 16, 2024
9956da9
Fix dependencies for pyyaml used in the clab-ceos4 backend within the…
Mar 16, 2024
06a57cd
Merge branch 'containerlab-cEOS4' of https://github.com/CsCdanNyx/SuP…
Mar 16, 2024
a8c698e
Add logging statements in clab_aristaCEOS4 NRM.
Mar 26, 2024
fa04cce
Add logging for unimplemented functions in clab_aristaCEOS4 backend.
Mar 26, 2024
1d7c500
Fix missing ssh_hostname of backend clab_aristaCEOS4.env .
Mar 21, 2024
4bd7167
Update the pre-commit flake8 repo to github.
Mar 26, 2024
796c7db
Fix polynsi application.properties not loaded.
Mar 21, 2024
cf38b1e
move dependabot.yml to correct folder
hanstrompert Mar 27, 2024
4516244
update grpc and protobuf dependencies (#31)
hanstrompert Mar 27, 2024
ab0de19
Arista EOS 4.x backend based on OpenNSA backend
hanstrompert Jun 30, 2023
29b3d51
catch problems with privte key
hanstrompert Jul 3, 2023
d5b3419
Adapt paristaEOS4 backend module for Arista cEOS4.
Aug 23, 2023
ae9f09d
Adapt mock for cEOS4 testing on clab.
Aug 23, 2023
fa4923f
Fix ReleaseJob.
Aug 24, 2023
3ebd27e
Clean up debug messages.
Aug 29, 2023
6bb2848
Create folder for containerlab testing topologies.
Aug 29, 2023
cf4220f
Env file finding and description for sw cli.
Sep 2, 2023
a8cde51
Add pytest.ini for ignoring test_data in pytest.
Sep 2, 2023
f09a18b
Update Dockerfile and docker-compose.yml.
Feb 6, 2024
40c1ef9
Add .dockerignore file to exclude test_data directory for building im…
Feb 6, 2024
6ee9e3a
Update log level and add debug logs in ActivateJob.
Feb 6, 2024
764f234
Implement topology function for clab_aristaCEOS4 backend.
Feb 26, 2024
3778b51
Exclude pytest target that requires a backend device for Github actions.
Feb 27, 2024
5dd8049
Under Development - Backend VLAN test for all vlans and ports on Aris…
Mar 15, 2024
ec4ac41
Ignore tests/nrm pytest in github actions.
Mar 15, 2024
ec74b0f
PolyNSI debug on.
Mar 15, 2024
b0659b5
Fix isort Linting Tests in Github actions.
Mar 15, 2024
c783a3f
Fix dependencies for pyyaml used in the clab-ceos4 backend within the…
Mar 16, 2024
33fcbe3
Fix dependencies for pyyaml used in the clab-ceos4 backend within the…
Mar 16, 2024
c24cd42
Add logging statements in clab_aristaCEOS4 NRM.
Mar 26, 2024
b8bb940
Add logging for unimplemented functions in clab_aristaCEOS4 backend.
Mar 26, 2024
0a2deea
Fix missing ssh_hostname of backend clab_aristaCEOS4.env .
Mar 21, 2024
8fde932
Update the pre-commit flake8 repo to github.
Mar 26, 2024
ceedeea
Fix polynsi application.properties not loaded.
Mar 21, 2024
e8ba951
Merge branch 'containerlab-cEOS4' of https://github.com/CsCdanNyx/SuP…
Mar 27, 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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test_data
File renamed without changes.
3 changes: 3 additions & 0 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
python setup.py gen_code
- name: Run Unit tests
run: pytest --cov-report term-missing --cov-report=xml --cov=src tests
-k "not activate_job_end_date and not activate_job_no_end_date and not deactivate_job and not release_job_release_confirmed_auto_end"
--ignore=tests/nrm/
# Exclude test targets in "test_dataplane.py" and "test_provision.py" that require a backend device when calling backend's de/activate().
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: flake8
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ RUN pip install -U pip wheel
RUN pip install -e .
RUN python setup.py gen_code
RUN python setup.py install
EXPOSE 8080/tcp 50051/tcp
EXPOSE 4321/tcp 8080/tcp 50051/tcp
ENV PYTHONPATH=$PYTHONPATH:/usr/local/etc/supa:$BASEDIR/src/supa/nrm/backends
CMD supa serve
2 changes: 1 addition & 1 deletion docker/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# PolyNSI application properties
#
debug=false
debug=true
#logging.config=file:/usr/local/etc/polynsi/logback-spring.xml
#
# SOAP provider configuration
Expand Down
13 changes: 7 additions & 6 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ services:
# SuPA
#
supa:
image: "ghcr.io/workfloworchestrator/supa:latest"
# image: "ghcr.io/workfloworchestrator/supa:latest"
image: "supa:clab-ceos4"
configs:
- source: supa.env
target: /usr/local/etc/supa/supa.env
Expand All @@ -23,17 +24,17 @@ services:
# PolyNSI
#
polynsi:
#image: "ghcr.io/workfloworchestrator/polynsi:latest"
image: polynsi:test
image: "ghcr.io/workfloworchestrator/polynsi:latest"
#image: polynsi:test
ports:
- "8443:8443"
configs:
- source: application.properties
target: /usr/local/polynsi/application.properties
target: /usr/local/src/polynsi/application.properties
- source: polynsi-keystore.jks
target: /usr/local/polynsi/polynsi-keystore.jks
target: /usr/local/src/polynsi/polynsi-keystore.jks
- source: polynsi-truststore.jks
target: /usr/local/polynsi/polynsi-truststore.jks
target: /usr/local/src/polynsi/polynsi-truststore.jks
#
# create SuPA database folder
#
Expand Down
2 changes: 1 addition & 1 deletion docker/supa.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
log_level=INFO
log_level=DEBUG
grpc_server_insecure_host=0.0.0.0
grpc_client_insecure_host=polynsi
document_server_host=0.0.0.0
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# should match that of `grpcio` in `setup.cfg`. Actual code generation is done from within `setup.py` in a custom
# Command class.
requires = [
"setuptools>=47.3.1",
"setuptools>=65.5.0",
"wheel",
"grpcio-tools~=1.42.0",
"grpcio-tools~=1.62.0",
"mypy-protobuf",
"bandit==1.7.2",
]
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
addopts = --ignore=SuPA/test_data
12 changes: 7 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ package_dir = = src
include_package_data = true
python_requires = >= 3.8.3
install_requires =
grpcio ~= 1.42.0 # version number should match that of `grpcio-tools` in `pyproject.toml`
grpcio-tools ~= 1.42.0 # version number should match that of `grpcio-tools` in `pyproject.toml`
grpcio ~= 1.62.0 # version number should match that of `grpcio-tools` in `pyproject.toml`
grpcio-tools ~= 1.62.0 # version number should match that of `grpcio-tools` in `pyproject.toml`
mypy-protobuf ~= 3.2.0
structlog ~= 20.1.0
colorama ~= 0.4.3
Expand All @@ -40,12 +40,14 @@ install_requires =
APScheduler ~= 3.6.3
tabulate ~= 0.8.9
more_itertools ~= 8.5.0
protobuf ~= 3.19.1
protobuf ~= 4.21.6
requests ~= 2.0
lxml ~= 4.0
lxml-stubs ~= 0.4.0
cherrypy ~= 18.0
htmlgen ~= 2.0.0
paramiko >= 3.0.0
pyyaml >= 6.0.1

[options.extras_require]
dev =
Expand All @@ -61,8 +63,8 @@ dev =
flake8-print
flake8-rst # Allows run flake8 on code snippets in docstrings or rst files
flake8-string-format
grpcio-tools ~= 1.42.0 # version number should match that of `grpcio-tools` in `pyproject.toml`
grpc-stubs >= 1.24.7
grpcio-tools ~= 1.62.0 # version number should match that of `grpcio-tools` in `pyproject.toml`
grpc-stubs >= 1.53.0
pytest-grpc
isort
mypy >= 0.930, <= 1.0.1
Expand Down
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Distutils/setuptools packaging information file."""

import operator
import shutil
import sys
from distutils.command.clean import clean # type: ignore
from distutils.command.clean import clean
from fileinput import FileInput
from pathlib import Path
from typing import List, Optional, Tuple
Expand Down Expand Up @@ -123,7 +124,7 @@ def run(self) -> None: # noqa: D102
class DevelopCommand(develop):
"""Support Python code generation during 'editable' package installation."""

def run(self) -> None: # noqa: D102
def run(self) -> None: # type: ignore[override] # noqa: D102
self.run_command("gen_code")
super().run()

Expand All @@ -142,5 +143,10 @@ def run(self) -> None: # noqa: D102
# to generate Python code from protobuf/gRPC definitions during installation.
setuptools.setup(
name="supa",
cmdclass={"gen_code": GenCode, "install": InstallCommand, "develop": DevelopCommand, "clean": CleanCommand},
cmdclass={
"gen_code": GenCode,
"install": InstallCommand,
"develop": DevelopCommand,
"clean": CleanCommand, # type: ignore[dict-item]
},
)
6 changes: 3 additions & 3 deletions src/supa/connection/provider/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ def Reserve(self, pb_reserve_request: ReserveRequest, context: ServicerContext)
requester_nsa=pb_header.requester_nsa,
provider_nsa=pb_header.provider_nsa,
reply_to=pb_header.reply_to if pb_header.reply_to else None,
session_security_attributes=pb_header.session_security_attributes
if pb_header.session_security_attributes
else None,
session_security_attributes=(
pb_header.session_security_attributes if pb_header.session_security_attributes else None
),
global_reservation_id=pb_reserve_request.global_reservation_id,
description=pb_reserve_request.description if pb_reserve_request.description else None,
version=pb_criteria.version,
Expand Down
3 changes: 3 additions & 0 deletions src/supa/job/dataplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def __call__(self) -> None:
connection = session.query(Connection).filter(Connection.connection_id == self.connection_id).one()
dpsm = DataPlaneStateMachine(reservation, state_field="data_plane_state")
try:
self.log.debug("reservation in db_session(): %r", reservation)
self.log.debug("connection in db_session(): %r", connection)
self.log.debug("connection_to_dict(connection): %r", connection_to_dict(connection))
if circuit_id := backend.activate(**connection_to_dict(connection)):
connection.circuit_id = circuit_id
except NsiException as nsi_exc:
Expand Down
Loading
Loading