Skip to content

Commit 9325d7f

Browse files
authored
add support for python3.13 (#73)
1 parent 6ed6d58 commit 9325d7f

File tree

3 files changed

+84
-63
lines changed

3 files changed

+84
-63
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Python Setup
1919
uses: actions/setup-python@v5
2020
with:
21-
python-version: '3.11'
21+
python-version: "3.12"
2222

2323
- name: Lint Checks
2424
run: |
@@ -36,10 +36,11 @@ jobs:
3636
strategy:
3737
matrix:
3838
python:
39-
- '3.9'
40-
- '3.10'
41-
- '3.11'
42-
- '3.12'
39+
- "3.9"
40+
- "3.10"
41+
- "3.11"
42+
- "3.12"
43+
- "3.13"
4344
steps:
4445
- name: Checkout
4546
uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Migrated CLI interface from argparse to click library
55
- Bump pyats version to 25.1
66
- Bump minimal python version to 3.9.2 due to https://github.com/pyca/cryptography/pull/12045
7+
- add support for python 3.13
78

89
# Catalyst SD-WAN Lab 2.0.14 [Aug 2, 2024]
910

README.md

Lines changed: 77 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
[![Tests](https://github.com/cisco-open/sdwan-lab-deployment-tool/actions/workflows/test.yml/badge.svg)](https://github.com/netascode/iac-validate/actions/workflows/test.yml)
2-
![Python Support](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-informational "Python Support: 3.9, 3.10, 3.11, 3.12")
2+
![Python Support](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-informational "Python Support: 3.9, 3.10, 3.11, 3.12", "3.13")
33

44
# Catalyst SD-WAN Lab Deployment Tool for Cisco Modeling Labs
55

66
This tool automates [Cisco Catalyst SD-WAN](https://www.cisco.com/site/us/en/solutions/networking/sdwan/index.html) lab deployment inside [Cisco Modeling Labs (CML)](https://www.cisco.com/c/en/us/products/cloud-systems-management/modeling-labs/index.html).
77

88
The tool will help you automate your CML lab deployments with SD-WAN Manager, Controllers and Validators and up to 20 SD-WAN edges. You can build as pods as your CML platform can host. Please refer to the [Limitations and scale](#limitations-and-scale) for details.
99

10-
11-
1210
## Getting Started
1311

1412
### Prerequisites
15-
Catalyst SD-WAN Lab Deployment Tool requires Linux or macOS system.
13+
14+
Catalyst SD-WAN Lab Deployment Tool requires Linux or macOS system.
1615
To run is on Windows, please use [Linux on Windows with WSL](/README.md#appendix---wsl-installation) or set up Linux VM/container.
1716

1817
Catalyst SD-WAN Lab Deployment Tool requires Python 3.9 or newer. This can be verified by pasting the following to a terminal window:
@@ -28,31 +27,32 @@ This tool requires CML 2.6 or higher.
2827
Demo of the tool and guide on how to use it can be found on this [youtube video](https://www.youtube.com/watch?v=WxiZ5bxlDk8)
2928

3029
### Installing
30+
3131
The recommended way to install is via pip.
3232

3333
Create a directory to store the virtual environment and runtime files:
3434

3535
mkdir csdwan
3636
cd csdwan
37-
37+
3838
Create virtual environment:
3939

4040
python3 -m venv venv
41-
41+
4242
Activate virtual environment:
4343

4444
source venv/bin/activate
45-
45+
4646
- Note that the prompt is updated with the virtual environment name (venv), indicating that the virtual environment is active.
47-
47+
4848
Upgrade initial virtual environment packages:
4949

5050
pip install --upgrade pip setuptools
5151

5252
To install SD-WAN Lab Deployment Tool:
5353

5454
pip install --upgrade catalyst-sdwan-lab
55-
55+
5656
Verify that SD-WAN Lab tool can run:
5757

5858
sdwan-lab --version
@@ -62,34 +62,37 @@ You can also use the following shortcut to run any lab task:
6262
csdwan --version
6363

6464
Notes:
65+
6566
- The virtual environment is deactivated by typing 'deactivate' at the command prompt.
6667
- Before running Catalyst SD-WAN Lab Deployment Tool again, make sure to activate the virtual environment back again (source venv/bin/activate).
6768

6869
## Usage
70+
6971
Simmilar to [Sastre](https://github.com/CiscoDevNet/sastre), the command line is structured as a set of base parameters, the task specification followed by task-specific parameters:
7072

7173
sdwan-lab <base parameters> <task> <task-specific parameters>
7274

7375
Base parameters define global options such as verbosity level, CML credentials, etc.
7476

7577
Task indicates the operation to be performed. The following tasks are currently available:
76-
* [Setup](#setup-task): Setup CML to support Catalyst SD-WAN use cases, upload new software images, and create node and image definitions that are required to run Catalyst SD-WAN lab in the CML.
77-
* [Deploy](#deploy-task): Deploy CML topology with two underlay networks (INET, MPLS), one Manager/Validator/Controller, and one Gateway router. Once topology boots up, configure the control components and create basic templates / configuration groups.
78-
* [Add](#add-task): Add and automatically onboard additional SD-WAN nodes (Validators/Controllers/Edges) to existing lab.
79-
* [Backup](#backup-task): Backup the Catalyst SD-WAN Lab runnning in CML, including the CML topology and all its nodes, SD-WAN device states and templates / configuration groups.
80-
* [Restore](#restore-task): Restore the Catalyst SD-WAN Lab from backup, onboard and confgure control components and create basic feature templates / configuration groups. If there are any WAN Edges, automatically onboard the WAN Edges back to the SD-WAN Manager using the configuration from the backup.
81-
* [Delete](#delete-task): Delete currently running lab from CML and remove all lab data.
82-
* [Sign](#sign-task): Sign Certificate Signing Request (CSR) using SD-WAN Lab Deployment Tool Root CA
78+
79+
- [Setup](#setup-task): Setup CML to support Catalyst SD-WAN use cases, upload new software images, and create node and image definitions that are required to run Catalyst SD-WAN lab in the CML.
80+
- [Deploy](#deploy-task): Deploy CML topology with two underlay networks (INET, MPLS), one Manager/Validator/Controller, and one Gateway router. Once topology boots up, configure the control components and create basic templates / configuration groups.
81+
- [Add](#add-task): Add and automatically onboard additional SD-WAN nodes (Validators/Controllers/Edges) to existing lab.
82+
- [Backup](#backup-task): Backup the Catalyst SD-WAN Lab runnning in CML, including the CML topology and all its nodes, SD-WAN device states and templates / configuration groups.
83+
- [Restore](#restore-task): Restore the Catalyst SD-WAN Lab from backup, onboard and confgure control components and create basic feature templates / configuration groups. If there are any WAN Edges, automatically onboard the WAN Edges back to the SD-WAN Manager using the configuration from the backup.
84+
- [Delete](#delete-task): Delete currently running lab from CML and remove all lab data.
85+
- [Sign](#sign-task): Sign Certificate Signing Request (CSR) using SD-WAN Lab Deployment Tool Root CA
8386

8487
Task-specific parameters are provided after the task argument.
8588

8689
### Base Parameters
8790

8891
sdwan-lab -h
8992
usage: sdwan-lab.py [-h] [-c <cml-ip>] [-u <cml-user>] [-p <cml-password>] [-v] [--version] {setup,deploy,add,backup,restore,delete} ...
90-
93+
9194
Catalyst SD-WAN Lab Deployment Tool - Automation Tool for managing Cisco Catalyst SD-WAN labs inside Cisco Modelling Labs
92-
95+
9396
positional arguments:
9497
{setup,deploy,add,backup,restore,delete}
9598
Task to be performed.
@@ -100,7 +103,7 @@ Task-specific parameters are provided after the task argument.
100103
restore Restore Catalyst SD-WAN POD from backup.
101104
delete Delete the CML lab and all the lab data.
102105
sign Sign CSR using the SD-WAN Lab Deployment Tool Root CA.
103-
106+
104107
optional arguments:
105108
-h, --help show this help message and exit
106109
-c <cml-ip>, --cml <cml-ip>
@@ -113,15 +116,16 @@ Task-specific parameters are provided after the task argument.
113116
--version show program's version number and exit
114117

115118
Most of the parameters can also be provided via environment variables:
116-
* CML_IP
117-
* CML_USER
118-
* CML_PASSWORD
119-
* MANAGER_IP
120-
* MANAGER_USER
121-
* MANAGER_PASSWORD
122-
* MANAGER_MASK
123-
* MANAGER_GATEWAY
124-
* LAB_NAME
119+
120+
- CML_IP
121+
- CML_USER
122+
- CML_PASSWORD
123+
- MANAGER_IP
124+
- MANAGER_USER
125+
- MANAGER_PASSWORD
126+
- MANAGER_MASK
127+
- MANAGER_GATEWAY
128+
- LAB_NAME
125129

126130
For any of the required arguments, user is prompted for a value if they are not provided via the environment variables or command line arguments.
127131

@@ -142,6 +146,7 @@ The easiest way to run the tool is to provide all the lab variables in the rc fi
142146
Note that if password was not defined, the user will be prompted for a password. Also please note we recommend not to use admin user as MANAGER_USER. Instead, configure a different user name to always have a backup user. By default, the MANAGER_PASSWORD will be set for both admin user and the MANAGER_USER that you specify.
143147

144148
Note that MANAGER_IP can be:
149+
145150
- an IP address: SD-WAN Manager will be reachable over this IP address. By default the IP address should come from the same subnet as CML IP, unless custom bridge is specified during deploy task.
146151
- a PATty port in format "pat:<outside-port>": SD-WAN Manager will be reachable over CML IP port <outside-port>. Before using this option, PATTy needs to be enabled on the CML server as per [CML documentation](https://developer.cisco.com/docs/modeling-labs/patty-tool-mapping-configuration/).
147152

@@ -158,38 +163,43 @@ If you want to use PATty the rc file above will change slighty to the following.
158163
% source rc-PATty-example.sh
159164

160165
### Task-specific Parameters
166+
161167
Task-specific parameters and options are defined after the task is provided. Each task has its own set of parameters. Check the task documentation to learn more about task-specific parameters.
162168

163169
### Setup Task
170+
164171
This task makes sure your CML is ready to run Catalyst SD-WAN labs. The task will:
165-
* Create node definitions that are required to run Catalyst SD-WAN lab in the CML: Manager, Validator, Controller and Edge
166-
* Look for new SD-WAN software images in the folder where the script was run. If the image is found, upload the image to CML and create image definition for the right node definition: Manager, Validator, Controller and Edge
172+
173+
- Create node definitions that are required to run Catalyst SD-WAN lab in the CML: Manager, Validator, Controller and Edge
174+
- Look for new SD-WAN software images in the folder where the script was run. If the image is found, upload the image to CML and create image definition for the right node definition: Manager, Validator, Controller and Edge
167175

168176
On each CML server that you want to use, you should run a setup task at least once to create required node and image definitions. You can rerun the setup task each time you want to add a new Catalyst SD-WAN software image to your CML server.
169177

170-
This task have one task-specific argument that allows you to migrate the node and image definitions to new format if you've used SD-WAN Lab 1.x in the past.
178+
This task have one task-specific argument that allows you to migrate the node and image definitions to new format if you've used SD-WAN Lab 1.x in the past.
171179

172180
sdwan-lab setup -h
173181
usage: sdwan-lab.py setup [-h] [--migrate]
174-
182+
175183
optional arguments:
176184
-h, --help show this help message and exit
177185
--migrate Migrate node and image definitions from SD-WAN Lab v1.x to v2.x. This task should be run once if CML server was using SD-WAN LAb Tool v1.x in the past.
178186

179187
### Deploy Task
188+
180189
This task:
190+
181191
1. Defines four/five subnets:
182-
* VPN0 - 172.16.0.0/24
183-
* INET - 172.16.1.0/24
184-
* MPLS - 172.16.2.0/24
185-
* External Connector - in bridge mode, this subnet is defined by task-specific parameters and is used to provide external reachability to SD-WAN Manager.
186-
* Internet Connector - in NAT mode, this subnet provides Internet connectivity for Internet transport and is same as CML subnet
192+
- VPN0 - 172.16.0.0/24
193+
- INET - 172.16.1.0/24
194+
- MPLS - 172.16.2.0/24
195+
- External Connector - in bridge mode, this subnet is defined by task-specific parameters and is used to provide external reachability to SD-WAN Manager.
196+
- Internet Connector - in NAT mode, this subnet provides Internet connectivity for Internet transport and is same as CML subnet
187197
2. Deploys basic SD-WAN topology with:
188-
* two underlay networks (INET, MPLS)
189-
* one Manager
190-
* one Validator
191-
* one Controller
192-
* one Gateway router that connects VPN0 subnet to INET and MPLS subnets
198+
- two underlay networks (INET, MPLS)
199+
- one Manager
200+
- one Validator
201+
- one Controller
202+
- one Gateway router that connects VPN0 subnet to INET and MPLS subnets
193203
3. Once topology boots up, the task configures the control plane (control components, certificates, etc.) and create basic feature templates / configuration groups that can be used for WAN Edge onboarding. It also attaches Controller to device template.
194204
4. At this point you can start creating your custom topology using [Add Task](#add-task) to automatically onboard additional SD-WAN nodes (Validators/Controllers/Edges).
195205

@@ -200,10 +210,10 @@ This task has several task-specific parameters, including software version that
200210
sdwan-lab deploy -h
201211
usage: sdwan-lab.py deploy [-h] [--manager <manager-ip>] [--mmask <manager-mask>] [--mgateway <manager-gateway>] [--muser <manager-user>] [--mpassword <manager-password>] [--bridge <custom-bridge-name>] [--dns <dns-server-ip>]
202212
<software-version>
203-
213+
204214
positional arguments:
205215
<software-version> Software version that will be used on SD-WAN Control Components.
206-
216+
207217
optional arguments:
208218
-h, --help show this help message and exit
209219
--manager <manager-ip>
@@ -224,11 +234,14 @@ This task has several task-specific parameters, including software version that
224234
--retry If for some reason your script lost connectivity during SD-WAN Manager boot, you can add --retry to continue onboarding the lab that is already in CML.
225235

226236
Time to complete the deployment task depends on:
227-
* SD-WAN software version
228-
* CML resources
237+
238+
- SD-WAN software version
239+
- CML resources
229240

230241
### Add Task
242+
231243
This task adds Catalyst SD-WAN nodes (Validators/Controllers/Edges) into existing Catalyst SD-WAN lab. This task will:
244+
232245
1. Add requested number of nodes to the CML topology and boot them with cloud-init configuration
233246
2. Once nodes boot up, automatically onboard them to SD-WAN Manager
234247
3. For Controller/Edge nodes, automatically attach basic device template / configuration group
@@ -238,12 +251,12 @@ This task has several task-specific parameters.
238251

239252
sdwan-lab add -h
240253
usage: sdwan-lab.py add [-h] [--manager <manager-ip>] [--muser <manager-user>] [--mpassword <manager-password>] [--lab <lab_name>] <number-of-devices> <device-type> <software-version>
241-
254+
242255
positional arguments:
243256
<number-of-devices> Number of devices to be added.
244257
<device-type> Type of device/s to be added (e.g. validator, controller, edge, sdrouting).
245258
<software-version> Software version that will be used.
246-
259+
247260
optional arguments:
248261
-h, --help show this help message and exit
249262
--manager <manager-ip>
@@ -262,17 +275,19 @@ Below you will find few examples of add task:
262275
sdwan-lab add 2 sdrouting 17.12.2 --lab vsdwan1
263276

264277
### Backup Task
278+
265279
This task creates a backup of the Catalyst SD-WAN lab running in CML. CML doesn't natively support configuration export from Catalyst SD-WAN nodes, but this script can help you to save your Catalyst SD-WAN configuration. This task will:
280+
266281
1. For Manager, Validator, Controller and WAN Edge nodes (SD-WAN and SD-Routing), create configuration backup.
267282
2. For non-SD-WAN nodes, export the configuration if it's supported by CML.
268283
3. Save the CML topology with exported configuration.
269284
4. Create a backup of SD-WAN Manager templates, policies and configuration groups using [Sastre](https://github.com/CiscoDevNet/sastre).
270285

271286
This task has several task-specific parameters, including working directory where backup is saved.
272287

273-
% sdwan-lab back -h
288+
% sdwan-lab back -h
274289
usage: sdwan-lab.py backup [-h] [--manager <manager-ip>] [--muser <manager-user>] [--mpassword <manager-password>] [--lab <lab_name>] [--workdir <directory>]
275-
290+
276291
optional arguments:
277292
-h, --help show this help message and exit
278293
--manager <manager-ip>
@@ -284,9 +299,11 @@ This task has several task-specific parameters, including working directory wher
284299
--lab <lab_name> CML Lab name, can also be defined via LAB_NAME environment variable. If neither is provided user is prompted for lab name.
285300
--workdir <directory>
286301
Backup destination folder
287-
302+
288303
### Restore Task
304+
289305
This task restores Catalyst SD-WAN lab from a backup. This task will:
306+
290307
1. Import the CML topology from the backup and boot the Catalyst SD-WAN control components first.
291308
2. Once control components are up, configure the control plane (control components, certificates, etc.).
292309
3. Restore SD-WAN Manager templates, policies and configuration groups using [Sastre](https://github.com/CiscoDevNet/sastre).
@@ -297,7 +314,7 @@ This task has several task-specific parameters, including working directory from
297314
% sdwan-lab restore -h
298315
usage: sdwan-lab.py restore [-h] [--manager <manager-ip>] [--mmask <manager-mask>] [--mgateway <manager-gateway>] [--muser <manager-user>] [--mpassword <manager-password>] [--lab <lab_name>]
299316
[--workdir <directory>] [--deleteexisting] [--retry]
300-
317+
301318
optional arguments:
302319
-h, --help show this help message and exit
303320
--manager <manager-ip>
@@ -317,31 +334,34 @@ This task has several task-specific parameters, including working directory from
317334
--retry If for some reason your script lost connectivity during SD-WAN Manager boot, you can add --retry to continue restoring the lab that is already in CML
318335

319336
### Delete Task
337+
320338
This task deletes the CML lab and removes all it's data. Note after this operation, all lab data is lost.
321339

322340
This task has several task-specific parameters.
323341

324342
sdwan-lab delete -h
325343
usage: sdwan-lab.py delete [-h] [--lab <lab_name>] [--force]
326-
344+
327345
optional arguments:
328346
-h, --help show this help message and exit
329347
--lab <lab_name> Lab name
330348
--force Delete the lab without asking for confirmation. Note the all lab data will be lost!
331349

332350
### Sign Task
351+
333352
This tasks reads the Certificate Signing Request (CSR) from a file and signs it using SD-WAN Lab Deployment Tool Root CA.
334353
At the end, the task prints the signed certificate in standard output.
335354

336355
This task has several task-specific parameters.
337356

338357
sdwan-lab delete -h
339358
usage: sdwan-lab.py sign [-h] <csr_file>
340-
359+
341360
positional arguments:
342361
<csr_file> Certificate Signing Request (CSR) File
343362

344363
## Limitations and scale
364+
345365
The tool supports the following scale per CML lab:
346366

347367
- 1 SD-wan Manager instance (Cluster is not yet supported)
@@ -350,8 +370,6 @@ The tool supports the following scale per CML lab:
350370
- 20 SD-WAN Edges
351371
- 10 SD-Routing edges
352372

353-
354-
355373
## Appendix - WSL Installation
356374

357375
To install WSL on your Windows VM or Physical machine. Ensure that the HW Virutalization is enabled in the BIOS or VM Defintion.
@@ -365,20 +383,21 @@ Open PowerShell as Administrator and run:
365383
Install WSL with default distribution (Ubuntu)
366384
Open PowerShell and run
367385

368-
`wsl --install`
386+
`wsl --install`
369387

370388
Once the installation is finished and you have restarted Windows you are able to continue the installation of this tool as described in the [installation section](README.md#installing) of this document.
371389

372390
You can read more about [Linux on Windows with WSL here](https://learn.microsoft.com/en-us/windows/wsl/install).
373391

374-
375392
## Authors
393+
376394
Tomasz Zarski ([email protected])
377395

378396
## License
379397

380398
BSD-3-Clause
381399

382400
## Acknowledgments
401+
383402
- Marcelo Reis and [Sastre](https://github.com/CiscoDevNet/sastre)
384403
- Inigo Alonso

0 commit comments

Comments
 (0)