Skip to content

Update vqfx Makefile #289

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

Merged
merged 3 commits into from
Jan 17, 2025
Merged

Update vqfx Makefile #289

merged 3 commits into from
Jan 17, 2025

Conversation

Zegroj
Copy link

@Zegroj Zegroj commented Dec 3, 2024

In the last line is calling the variable $(VR_NAME) but it wasn't defined before so i update the variable NAME to VR_NAME

Zegroj and others added 2 commits December 3, 2024 17:05
In the last line is calling the variable $(VR_NAME) but it wasn't defined before so i update the variable NAME to VR_NAME
vqfx/Makefile Outdated
Comment on lines 28 to 35
# mostly copied from makefile.include, i wish this was easier to change
docker-build-common: docker-clean-build docker-pre-build
@if [ -z "$$IMAGE" ]; then echo "ERROR: No IMAGE specified"; exit 1; fi
@if [ "$(IMAGE)" = "$(VERSION)" ]; then echo "ERROR: Incorrect version string ($(IMAGE)). The regexp for extracting version information is likely incorrect, check the regexp in the Makefile or open an issue at https://github.com/hellt/vrnetlab/issues/new including the image file name you are using."; exit 1; fi
@echo "Building docker image using $(IMAGE) as $(REGISTRY)vr-$(VR_NAME):$(VERSION)"
cp ../common/* docker/
$(MAKE) IMAGE=$$IMAGE docker-build-image-copy
(cd docker; docker build --build-arg http_proxy=$(http_proxy) --build-arg https_proxy=$(https_proxy) --build-arg RE_IMAGE=$(IMAGE) --build-arg PFE_IMAGE=$(PFE_IMAGE) -t $(REGISTRY)vr-$(VR_NAME):$(VERSION) .)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Zegroj

I had a look at the makefile and I wonder if it is time to change it to the common workflow. I pushed over the change, if you do a pull and rerun make I wonder if you will build a bootable system. Thnx

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hellt i re run it with the change you made but didnt allow me to build a bootable system in the vqfx, i tried again with the old version but with this change "the variable NAME to VR_NAME" and worked fine

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I see, I think the PFE image was missing when I removed this overriding build step. I will have a look

@hellt hellt changed the title Update Makefile Update vqfx Makefile Jan 17, 2025
@hellt
Copy link
Owner

hellt commented Jan 17, 2025

did have a chance to dive into the makefile, so I will merge this one as an interim fix

@hellt hellt merged commit 204c132 into hellt:master Jan 17, 2025
1 check passed
@hellt hellt mentioned this pull request Jan 17, 2025
@Zegroj Zegroj deleted the patch-1 branch January 19, 2025 15:54
hellt added a commit that referenced this pull request Jan 25, 2025
* AOS-CX: Update CPU and MEM values for newer versions (#294)

Co-authored-by: Stefano Sasso <stefano.sasso@hpe.com>

* backdoor to reset VR or specific VMs (#285)

* backdoor to reset VR

* option to reset specific VMs

* give ocnos some time to boot in the login routine (#295)

* Fix mgmt route VRF name on cat9kv (#296)

* fix vmx dockerfile

* vJunos-EVO: remove error in init file that prevents loading it (#301)

* Fix routeros  (#302)

* update ubuntu version for routeros

* change base image

---------

Co-authored-by: Félix Gaudin <felix.gaudin@inmanta.com>

* Fix for OcNOS 6.5.2-101 (#300)

* Add Cisco vIOS L2 support (#299)

* update veos for bookworm

* added uv lock/venv and env file for pylance resolve sequence (#303)

* Update Dockerfile to install qemu-utils (#304)

* AOS-CX: Update base image and cpu (#305)

* Update vqfx Makefile (#289)

* Update Makefile

In the last line is calling the variable $(VR_NAME) but it wasn't defined before so i update the variable NAME to VR_NAME

* try vqfx with the common workflow

* Revert "try vqfx with the common workflow"

This reverts commit c1f8866.

---------

Co-authored-by: Roman Dodin <dodin.roman@gmail.com>

* lowercase things

* update vqfx base image

* bump num nics (#308)

---------

Co-authored-by: Stefano Sasso <852093+ssasso@users.noreply.github.com>
Co-authored-by: Stefano Sasso <stefano.sasso@hpe.com>
Co-authored-by: João Machado <63718541+jcpvdm@users.noreply.github.com>
Co-authored-by: Roman Dodin <dodin.roman@gmail.com>
Co-authored-by: FelixGaudin <44848675+FelixGaudin@users.noreply.github.com>
Co-authored-by: Félix Gaudin <felix.gaudin@inmanta.com>
Co-authored-by: Xinyu Wei <xinyuwe@cisco.com>
Co-authored-by: Thomas Balzer <65245605+tjbalzer@users.noreply.github.com>
Co-authored-by: tdebruyn <5540603+tdebruyn@users.noreply.github.com>
Co-authored-by: Voyageur <167977253+Zegroj@users.noreply.github.com>
hellt added a commit that referenced this pull request Jan 25, 2025
* AOS-CX: Update CPU and MEM values for newer versions (#294)

Co-authored-by: Stefano Sasso <stefano.sasso@hpe.com>

* backdoor to reset VR or specific VMs (#285)

* backdoor to reset VR

* option to reset specific VMs

* give ocnos some time to boot in the login routine (#295)

* Fix mgmt route VRF name on cat9kv (#296)

* fix vmx dockerfile

* vJunos-EVO: remove error in init file that prevents loading it (#301)

* Fix routeros  (#302)

* update ubuntu version for routeros

* change base image

---------

Co-authored-by: Félix Gaudin <felix.gaudin@inmanta.com>

* Fix for OcNOS 6.5.2-101 (#300)

* Add Cisco vIOS L2 support (#299)

* update veos for bookworm

* added uv lock/venv and env file for pylance resolve sequence (#303)

* Update Dockerfile to install qemu-utils (#304)

* AOS-CX: Update base image and cpu (#305)

* Update vqfx Makefile (#289)

* Update Makefile

In the last line is calling the variable $(VR_NAME) but it wasn't defined before so i update the variable NAME to VR_NAME

* try vqfx with the common workflow

* Revert "try vqfx with the common workflow"

This reverts commit c1f8866.

---------

Co-authored-by: Roman Dodin <dodin.roman@gmail.com>

* lowercase things

* update vqfx base image

* bump num nics (#308)

* DHCP and static MAC support for management interface  (#310)

* common/vrnetlab.py: added DHCP support for management interface

If CLAB_MGMT_DHCP environment variable is set, we assume that a DHCP client
inside of the VM will take care about setting the management IP and gateway.

From the implementation point of view the IPv4 and IPv6 addresses and gateways
are simply set to 'dhcp', and the platform specific `launch.py` script needs
to check it to decide if the interface needs to be configured manually or to
to enable dhcp (if not enabled by default).

The initial implementation has been tested with Broadcom Enterprise SONiC 4.4.0
using the "dell_sonic" kind (which actually is a rebranded Broadcom SONiC).
The primary focus is the ability to test the Zero Touch Provisioning feature of
SONiC but could also be used for testing PXE boot scenarios of other systems
using containerlab.

Note:
This feature is only working when CLAB_MGMT_PASSTHROUGH is true.

The feature needs to be defined explicitely within the node configuration
like this:
--------------------------------
env:
  CLAB_MGMT_PASSTHROUGH: "true"
  CLAB_MGMT_DHCP: "true"
--------------------------------

* dell_sonic: changed to check if dhcp is enabled for the management interface

Manually set IPv4/IPv6 addresses and gateways only if dhcp is not enabled.

* common/vrnetlab.py: added get_mgmt_mac method to VM class

get_mgmt_mac() checks for the environment variable 'CLAB_MGMT_MAC' which
can be used to provide a static MAC address for the management interface.
If there is no static MAC address set the former behavior is preserved
by calling gen_mac(0) generating a MAC address.

* vrnetlab: Refactor mgmt MAC generation, handle exceptions for CSR1000v/ROS/SROS

* compresss env var based var assignment

---------

Co-authored-by: vista <vista@birb.network>
Co-authored-by: Roman Dodin <dodin.roman@gmail.com>

---------

Co-authored-by: Stefano Sasso <852093+ssasso@users.noreply.github.com>
Co-authored-by: Stefano Sasso <stefano.sasso@hpe.com>
Co-authored-by: João Machado <63718541+jcpvdm@users.noreply.github.com>
Co-authored-by: Roman Dodin <dodin.roman@gmail.com>
Co-authored-by: FelixGaudin <44848675+FelixGaudin@users.noreply.github.com>
Co-authored-by: Félix Gaudin <felix.gaudin@inmanta.com>
Co-authored-by: Xinyu Wei <xinyuwe@cisco.com>
Co-authored-by: Thomas Balzer <65245605+tjbalzer@users.noreply.github.com>
Co-authored-by: tdebruyn <5540603+tdebruyn@users.noreply.github.com>
Co-authored-by: Voyageur <167977253+Zegroj@users.noreply.github.com>
Co-authored-by: Christian Wiese <morfoh@opensde.org>
Co-authored-by: vista <vista@birb.network>
hellt added a commit that referenced this pull request Jan 25, 2025
* Implement Scrapli 'core' and platform migration (#297)

* AOS-CX: Update CPU and MEM values for newer versions (#294)

Co-authored-by: Stefano Sasso <stefano.sasso@hpe.com>

* backdoor to reset VR or specific VMs (#285)

* backdoor to reset VR

* option to reset specific VMs

* give ocnos some time to boot in the login routine (#295)

* Add vrnetlab base image

* Add `cidfile` to gitignore

* Implement Scrapli

- Implement scrapli for telnet console and qemu monitor
- Add scrapli for core funcs (wait_write, read_until, expect)
- Add conditional use of scrapli via 'use_scrapli' var. Default is disabled
- Add colours to logging
- Log env vars
- Log if transparent mgmt intf is in use
- Log if scrapli is in use
- Log overlay image creation
- Log defined SMP and RAM

* cat8kv: Migrate to Scrapli

- Use Scrapli IOSXEDriver for config
- Update install VM var name to 'cat8kv' from 'csr'
- Fix installer class init so overlay image is only created once

* cat9kv: Migrate to Scrapli

- Remove license check
- Send bootstrap config via day0/CVAC config (mounted file to cdrom)
- Send startup config via Scrapli IOSXEDriver

* csr1kv: Migrate to Scrapli

- Use Scrapli IOSXEDriver for sending bootstrap and startup configs

* xrv: Migrate to Scrapli

- Use Scrapli IOSXRDriver to send bootstrap and startup configs

* xrv: Add convert-image target in Makefile

- Converts the qcow2 image into required vmdk format for vrnetlab via qemu-img.

* xrv9k: Migrate to Scrapli

- Use Scrapli IOSXRDriver for bootstrap and startup configs
- Change class names to 'XRv9k' instead of 'XRv'
- Explicitly wait for SDR baking to complete in install process
- Remove call home/LC check

* xrv: Remove env var printing

* n9kv: Migrate to Scrapli

- Use NXOSDriver for bootstrap and startup configs

* nxos: Migrate to Scrapli

- Use NXOSDriver for bootstrap and startup configs

* vios: Migrate to Scrapli

- Use IOSXEDriver for bootstrap and startup configs

* vrnetlab: Support  scrapli qemu monitor option for VM reset

* vrnetlab: Move logging colour config outside of class init method

* cat8kv: Fix logger warning (log.warning -> logger.warning)

* vrnetlab: Remove scrpali logging import

* Cisco devices: Add/tweak configuration saving:

- vios, csr, cat8kv, cat9kv -- add configuration saving
- XRv, XRv9k -- log configuration saving

* xrv, xrv9k: Return to root at end of bootstrap cfg

* vrnetlab: add bool formatter func

* sros: Migrate to Scrapli

- Use scrapli community 'nokia_sros' platform
- Remove wait_write clean_buffer override
- Check if tftpboot conifg exists *before* opening Scrapli connection
- Log command outputs with 'DEBUG_SCRAPLI' env var (defaults to false)

* Use kaelemc/scrapli_community in base image

* Disable eager mode for config saving on Cisco devices

* cat8kv: Migrate to CVAC configuration

* cat8kv: add log message and block while generating cfg ISO

* cat9kv: Migrate startup config to CVAC

* Remove erroneous Scrapli Community submodule

* sros: fix typos for classic CLI

* csr: Migrate to CVAC

* Switch back to scrapli/scrapli-community

* added uv lock/venv and env file for pylance resolve sequence (#303)

* added uv dep for scrapli

* use ruff formatting

* update base image with pinned scrapli community

* close sros driver connection to invoke on_exit commands (quit-config)

* added local deps

* use uv in the base image

* ruff formatting

* use single const for scrapli timeout

* Close the commandeered connection so the on close actions are run

* Connection error log type from info->error

* extracting image edit

* persist bof and config after bootstrap config is applied and close sros con regardless if config was provided or not

* Configure scrapli variant if startup config is classic

If the startup-configuration provided is classic then the default configuration engine will be set to classic mode.

In this case the scrapli device variant should also be set to classic so the scrapli magic can do it's thing with the correct prompt matching.

* Use a global var to determine when to send classic configs

As classic startup configurations are now supported for MD-CLI defaulting versions, the classic CLI will mean the default config engine is classic on node boot. In this commit all logic that determined when to send/not send config for classic versions is now replaced with a single 'classic_cfg' global variable.

Most of the logic across the code had repeated statements checking if the version was <= 22 or magc. 'classic_cfg' is set to True in this case. Else it is False.

* Use explicit `quit-config` and move persistBofAndConfig back to end of bootstrap.

* Don't enforce MD-CLI on versions older than 19.x

---------

Co-authored-by: Stefano Sasso <852093+ssasso@users.noreply.github.com>
Co-authored-by: Stefano Sasso <stefano.sasso@hpe.com>
Co-authored-by: João Machado <63718541+jcpvdm@users.noreply.github.com>
Co-authored-by: Roman Dodin <dodin.roman@gmail.com>

* Resolve merge conflicts for #306 (#311)

* AOS-CX: Update CPU and MEM values for newer versions (#294)

Co-authored-by: Stefano Sasso <stefano.sasso@hpe.com>

* backdoor to reset VR or specific VMs (#285)

* backdoor to reset VR

* option to reset specific VMs

* give ocnos some time to boot in the login routine (#295)

* Fix mgmt route VRF name on cat9kv (#296)

* fix vmx dockerfile

* vJunos-EVO: remove error in init file that prevents loading it (#301)

* Fix routeros  (#302)

* update ubuntu version for routeros

* change base image

---------

Co-authored-by: Félix Gaudin <felix.gaudin@inmanta.com>

* Fix for OcNOS 6.5.2-101 (#300)

* Add Cisco vIOS L2 support (#299)

* update veos for bookworm

* added uv lock/venv and env file for pylance resolve sequence (#303)

* Update Dockerfile to install qemu-utils (#304)

* AOS-CX: Update base image and cpu (#305)

* Update vqfx Makefile (#289)

* Update Makefile

In the last line is calling the variable $(VR_NAME) but it wasn't defined before so i update the variable NAME to VR_NAME

* try vqfx with the common workflow

* Revert "try vqfx with the common workflow"

This reverts commit c1f8866.

---------

Co-authored-by: Roman Dodin <dodin.roman@gmail.com>

* lowercase things

* update vqfx base image

* bump num nics (#308)

---------

Co-authored-by: Stefano Sasso <852093+ssasso@users.noreply.github.com>
Co-authored-by: Stefano Sasso <stefano.sasso@hpe.com>
Co-authored-by: João Machado <63718541+jcpvdm@users.noreply.github.com>
Co-authored-by: Roman Dodin <dodin.roman@gmail.com>
Co-authored-by: FelixGaudin <44848675+FelixGaudin@users.noreply.github.com>
Co-authored-by: Félix Gaudin <felix.gaudin@inmanta.com>
Co-authored-by: Xinyu Wei <xinyuwe@cisco.com>
Co-authored-by: Thomas Balzer <65245605+tjbalzer@users.noreply.github.com>
Co-authored-by: tdebruyn <5540603+tdebruyn@users.noreply.github.com>
Co-authored-by: Voyageur <167977253+Zegroj@users.noreply.github.com>

* Merge conflicts #2 (#313)

* AOS-CX: Update CPU and MEM values for newer versions (#294)

Co-authored-by: Stefano Sasso <stefano.sasso@hpe.com>

* backdoor to reset VR or specific VMs (#285)

* backdoor to reset VR

* option to reset specific VMs

* give ocnos some time to boot in the login routine (#295)

* Fix mgmt route VRF name on cat9kv (#296)

* fix vmx dockerfile

* vJunos-EVO: remove error in init file that prevents loading it (#301)

* Fix routeros  (#302)

* update ubuntu version for routeros

* change base image

---------

Co-authored-by: Félix Gaudin <felix.gaudin@inmanta.com>

* Fix for OcNOS 6.5.2-101 (#300)

* Add Cisco vIOS L2 support (#299)

* update veos for bookworm

* added uv lock/venv and env file for pylance resolve sequence (#303)

* Update Dockerfile to install qemu-utils (#304)

* AOS-CX: Update base image and cpu (#305)

* Update vqfx Makefile (#289)

* Update Makefile

In the last line is calling the variable $(VR_NAME) but it wasn't defined before so i update the variable NAME to VR_NAME

* try vqfx with the common workflow

* Revert "try vqfx with the common workflow"

This reverts commit c1f8866.

---------

Co-authored-by: Roman Dodin <dodin.roman@gmail.com>

* lowercase things

* update vqfx base image

* bump num nics (#308)

* DHCP and static MAC support for management interface  (#310)

* common/vrnetlab.py: added DHCP support for management interface

If CLAB_MGMT_DHCP environment variable is set, we assume that a DHCP client
inside of the VM will take care about setting the management IP and gateway.

From the implementation point of view the IPv4 and IPv6 addresses and gateways
are simply set to 'dhcp', and the platform specific `launch.py` script needs
to check it to decide if the interface needs to be configured manually or to
to enable dhcp (if not enabled by default).

The initial implementation has been tested with Broadcom Enterprise SONiC 4.4.0
using the "dell_sonic" kind (which actually is a rebranded Broadcom SONiC).
The primary focus is the ability to test the Zero Touch Provisioning feature of
SONiC but could also be used for testing PXE boot scenarios of other systems
using containerlab.

Note:
This feature is only working when CLAB_MGMT_PASSTHROUGH is true.

The feature needs to be defined explicitely within the node configuration
like this:
--------------------------------
env:
  CLAB_MGMT_PASSTHROUGH: "true"
  CLAB_MGMT_DHCP: "true"
--------------------------------

* dell_sonic: changed to check if dhcp is enabled for the management interface

Manually set IPv4/IPv6 addresses and gateways only if dhcp is not enabled.

* common/vrnetlab.py: added get_mgmt_mac method to VM class

get_mgmt_mac() checks for the environment variable 'CLAB_MGMT_MAC' which
can be used to provide a static MAC address for the management interface.
If there is no static MAC address set the former behavior is preserved
by calling gen_mac(0) generating a MAC address.

* vrnetlab: Refactor mgmt MAC generation, handle exceptions for CSR1000v/ROS/SROS

* compresss env var based var assignment

---------

Co-authored-by: vista <vista@birb.network>
Co-authored-by: Roman Dodin <dodin.roman@gmail.com>

---------

Co-authored-by: Stefano Sasso <852093+ssasso@users.noreply.github.com>
Co-authored-by: Stefano Sasso <stefano.sasso@hpe.com>
Co-authored-by: João Machado <63718541+jcpvdm@users.noreply.github.com>
Co-authored-by: Roman Dodin <dodin.roman@gmail.com>
Co-authored-by: FelixGaudin <44848675+FelixGaudin@users.noreply.github.com>
Co-authored-by: Félix Gaudin <felix.gaudin@inmanta.com>
Co-authored-by: Xinyu Wei <xinyuwe@cisco.com>
Co-authored-by: Thomas Balzer <65245605+tjbalzer@users.noreply.github.com>
Co-authored-by: tdebruyn <5540603+tdebruyn@users.noreply.github.com>
Co-authored-by: Voyageur <167977253+Zegroj@users.noreply.github.com>
Co-authored-by: Christian Wiese <morfoh@opensde.org>
Co-authored-by: vista <vista@birb.network>

* remove doubled func

---------

Co-authored-by: Kaelem Chandra <kc@kaelem.net>
Co-authored-by: Stefano Sasso <852093+ssasso@users.noreply.github.com>
Co-authored-by: Stefano Sasso <stefano.sasso@hpe.com>
Co-authored-by: João Machado <63718541+jcpvdm@users.noreply.github.com>
Co-authored-by: FelixGaudin <44848675+FelixGaudin@users.noreply.github.com>
Co-authored-by: Félix Gaudin <felix.gaudin@inmanta.com>
Co-authored-by: Xinyu Wei <xinyuwe@cisco.com>
Co-authored-by: Thomas Balzer <65245605+tjbalzer@users.noreply.github.com>
Co-authored-by: tdebruyn <5540603+tdebruyn@users.noreply.github.com>
Co-authored-by: Voyageur <167977253+Zegroj@users.noreply.github.com>
Co-authored-by: Christian Wiese <morfoh@opensde.org>
Co-authored-by: vista <vista@birb.network>
wastrachan added a commit to gamersoutreach/vrnetlab that referenced this pull request Apr 19, 2025
* upstream/master: (184 commits)
  Fix and extend OpenWRT vrnetlab image for Containerlab compatibility (hellt#339)
  Add `DEBUG_SCRAPLI` env var (hellt#325)
  vJunos and vSRX improvements: interface count, base Docker image (hellt#342)
  fix ordering of linecards in distributed mode (hellt#336)
  PAN-OS: Handle version number suffix (hellt#333)
  Check for undefined mgmt IP (hellt#328)
  Implement Spirent vSTC (hellt#324)
  viosl2: add scrapli and new docker image (hellt#323)
  Add support for vJunosEvolved 24.2 and up (hellt#322)
  fix panos dockerfile (hellt#318)
  Copied Dockerfile from xrv9k/docker/Dockerfile to huawei_vrp/docker/Dockerfile which successfull allows the make for Huawei VRP now (hellt#315)
  remove old vrp code
  Implement Scrapli 'core' and platform migration [part 1] (hellt#306)
  DHCP and static MAC support for management interface  (hellt#310)
  bump num nics (hellt#308)
  update vqfx base image
  lowercase things
  Update vqfx Makefile (hellt#289)
  AOS-CX: Update base image and cpu (hellt#305)
  Update Dockerfile to install qemu-utils (hellt#304)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants