From 35ffd694885cdfdb3fa0df43f118d8a21a27964d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 6 Jan 2025 18:23:28 +0530 Subject: [PATCH 001/324] container action --- .github/workflows/pull-request-container.yml | 108 +++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 .github/workflows/pull-request-container.yml diff --git a/.github/workflows/pull-request-container.yml b/.github/workflows/pull-request-container.yml new file mode 100644 index 00000000000..7cb39a61285 --- /dev/null +++ b/.github/workflows/pull-request-container.yml @@ -0,0 +1,108 @@ +name: "Collection code testing" + +"on": pull_request + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +env: + # Set -vvv is ACTIONS_STEP_DEBUG is set + # Apparently it is set in secrets when running with debug + ANSIBLE_VERBOSITY: ${{ secrets.ACTIONS_STEP_DEBUG && 3 || 0 }} + AVD_NEVER_RUN_FROM_SOURCE: 1 + PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions + ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions + +jobs: + file-changes: + runs-on: ubuntu-latest + outputs: + eos_design: ${{ steps.filter.outputs.eos_design }} + config_gen: ${{ steps.filter.outputs.config_gen }} + cloudvision: ${{ steps.filter.outputs.cloudvision }} + dhcp: ${{ steps.filter.outputs.dhcp }} + plugins: ${{ steps.filter.outputs.plugins }} + requirements: ${{ steps.filter.outputs.requirements }} + docs: ${{ steps.filter.outputs.docs }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + eos_design: + - 'ansible_collections/arista/avd/roles/eos_designs/*' + - 'ansible_collections/arista/avd/roles/eos_designs/**/*' + - '.github/workflows/pull-request-management.yml' + - 'ansible_collections/arista/avd/molecule/*' + - 'ansible_collections/arista/avd/molecule/**/*' + - 'python-avd/pyavd/_eos_designs/*' + - 'python-avd/pyavd/_eos_designs/**/*' + - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' + - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' + - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' + - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' + config_gen: + - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' + - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' + - '.github/workflows/pull-request-management.yml' + - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/*' + - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/**/*' + - 'python-avd/pyavd/_eos_cli_config_gen/*' + - 'python-avd/pyavd/_eos_cli_config_gen/**/*' + validate_state: + - 'ansible_collections/arista/avd/roles/eos_validate_state/*' + - 'ansible_collections/arista/avd/roles/eos_validate_state/**/*' + cloudvision: + - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' + - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' + - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' + - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' + - '.github/workflows/pull-request-management.yml' + dhcp: + - 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' + - 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' + - '.github/workflows/pull-request-management.yml' + plugins: + - 'ansible_collections/arista/avd/plugins/filter/**' + - 'ansible_collections/arista/avd/plugins/test/**' + requirements: + - 'ansible_collections/arista/avd/requirements.txt' + - 'ansible_collections/arista/avd/requirements-dev.txt' + - 'ansible_collections/arista/avd/meta/runtime.yml' + - '.github/requirements-ci.txt' + - '.github/workflows/pull-request-management.yml' + docs: + - '.github/workflows/pull-request-management.yml' + - 'mkdocs.yml' + - 'ansible_collections/arista/avd/docs/**' + - 'ansible_collections/arista/avd/roles/**/*.md' + - 'ansible_collections/arista/avd/**/*.md' + - 'ansible_collections/arista/avd/README.md' + - 'ansible_collections/arista/avd/**/*.schema.yml' + pyavd: + - 'python_avd/*' + - 'python_avd/**/*' + container-job: + # Containers must run in Linux based operating systems + runs-on: ubuntu-latest + # Docker Hub image that `container-job` executes in + container: + image: ubuntu:latest + options: --cpus 1 + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Set up Python 3 + uses: actions/setup-python@v5 + with: + python-version: | + 3.10 + 3.11 + 3.12 + 3.13 + - name: Install dependencies + run: | + pip install -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade From 8b8f2411f10763c27e0bf5b39218ef8db181cb79 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 6 Jan 2025 18:27:55 +0530 Subject: [PATCH 002/324] container action --- .github/workflows/pull-request-container.yml | 108 ----- .github/workflows/pull-request-management.yml | 379 +----------------- 2 files changed, 9 insertions(+), 478 deletions(-) delete mode 100644 .github/workflows/pull-request-container.yml diff --git a/.github/workflows/pull-request-container.yml b/.github/workflows/pull-request-container.yml deleted file mode 100644 index 7cb39a61285..00000000000 --- a/.github/workflows/pull-request-container.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: "Collection code testing" - -"on": pull_request - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -env: - # Set -vvv is ACTIONS_STEP_DEBUG is set - # Apparently it is set in secrets when running with debug - ANSIBLE_VERBOSITY: ${{ secrets.ACTIONS_STEP_DEBUG && 3 || 0 }} - AVD_NEVER_RUN_FROM_SOURCE: 1 - PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions - ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions - -jobs: - file-changes: - runs-on: ubuntu-latest - outputs: - eos_design: ${{ steps.filter.outputs.eos_design }} - config_gen: ${{ steps.filter.outputs.config_gen }} - cloudvision: ${{ steps.filter.outputs.cloudvision }} - dhcp: ${{ steps.filter.outputs.dhcp }} - plugins: ${{ steps.filter.outputs.plugins }} - requirements: ${{ steps.filter.outputs.requirements }} - docs: ${{ steps.filter.outputs.docs }} - steps: - - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - eos_design: - - 'ansible_collections/arista/avd/roles/eos_designs/*' - - 'ansible_collections/arista/avd/roles/eos_designs/**/*' - - '.github/workflows/pull-request-management.yml' - - 'ansible_collections/arista/avd/molecule/*' - - 'ansible_collections/arista/avd/molecule/**/*' - - 'python-avd/pyavd/_eos_designs/*' - - 'python-avd/pyavd/_eos_designs/**/*' - - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' - - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' - - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' - - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' - config_gen: - - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' - - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' - - '.github/workflows/pull-request-management.yml' - - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/*' - - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/**/*' - - 'python-avd/pyavd/_eos_cli_config_gen/*' - - 'python-avd/pyavd/_eos_cli_config_gen/**/*' - validate_state: - - 'ansible_collections/arista/avd/roles/eos_validate_state/*' - - 'ansible_collections/arista/avd/roles/eos_validate_state/**/*' - cloudvision: - - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' - - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' - - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' - - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' - - '.github/workflows/pull-request-management.yml' - dhcp: - - 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' - - 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' - - '.github/workflows/pull-request-management.yml' - plugins: - - 'ansible_collections/arista/avd/plugins/filter/**' - - 'ansible_collections/arista/avd/plugins/test/**' - requirements: - - 'ansible_collections/arista/avd/requirements.txt' - - 'ansible_collections/arista/avd/requirements-dev.txt' - - 'ansible_collections/arista/avd/meta/runtime.yml' - - '.github/requirements-ci.txt' - - '.github/workflows/pull-request-management.yml' - docs: - - '.github/workflows/pull-request-management.yml' - - 'mkdocs.yml' - - 'ansible_collections/arista/avd/docs/**' - - 'ansible_collections/arista/avd/roles/**/*.md' - - 'ansible_collections/arista/avd/**/*.md' - - 'ansible_collections/arista/avd/README.md' - - 'ansible_collections/arista/avd/**/*.schema.yml' - pyavd: - - 'python_avd/*' - - 'python_avd/**/*' - container-job: - # Containers must run in Linux based operating systems - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in - container: - image: ubuntu:latest - options: --cpus 1 - - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Set up Python 3 - uses: actions/setup-python@v5 - with: - python-version: | - 3.10 - 3.11 - 3.12 - 3.13 - - name: Install dependencies - run: | - pip install -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 732279618b8..7cb39a61285 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -1,4 +1,3 @@ ---- name: "Collection code testing" "on": pull_request @@ -85,312 +84,17 @@ jobs: pyavd: - 'python_avd/*' - 'python_avd/**/*' - - # ----------------------------------- # - # Test Requirements - # ----------------------------------- # - python_requirements: - name: Test Python requirements installation - runs-on: ubuntu-latest - needs: [ file-changes ] - if: needs.file-changes.outputs.requirements == 'true' - strategy: - fail-fast: true - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3 - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python_version }} - - name: 'Install Python requirements' - run: | - pip install -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - - # ----------------------------------- # - # EOS CLI CONFIG GEN MOLECULE - # ----------------------------------- # - molecule_eos_cli_config_gen: - name: Validate eos_cli_config_gen - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - avd_scenario: - - 'eos_cli_config_gen' - - 'eos_cli_config_gen_deprecated_vars' - - 'eos_cli_config_gen_negative_unit_tests' - ansible_version: - - 'ansible-core<2.19.0 --upgrade' - # Also test minimum ansible version for one scenario. - include: - - avd_scenario: 'eos_cli_config_gen' - ansible_version: 'ansible-core==2.15.0' - needs: [ file-changes ] - if: needs.file-changes.outputs.config_gen == 'true' - steps: - - uses: actions/checkout@v4 - - name: Run molecule action - uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - with: - molecule_parentdir: 'ansible_collections/arista/avd' - molecule_command: 'test' - molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - pip_file: .github/requirements-ci.txt - galaxy_file: "ansible_collections/arista/avd/collections.yml" - ansible: ${{ matrix.ansible_version }} - check_git: true - check_git_enforced: true - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - - # ----------------------------------- # - # DHCP PROVISIONNER MOLECULE - # ----------------------------------- # - molecule_dhcp_provisionner: - name: Validate DHCP configuration - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - avd_scenario: ['dhcp_configuration', 'dhcp_provisioning'] - ansible_version: ['ansible-core<2.19.0 --upgrade'] - needs: [ file-changes ] - if: needs.file-changes.outputs.dhcp == 'true' - steps: - - uses: actions/checkout@v4 - - name: Run molecule action - uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - with: - molecule_parentdir: 'ansible_collections/arista/avd' - molecule_command: 'test' - molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - pip_file: .github/requirements-ci.txt - galaxy_file: "ansible_collections/arista/avd/collections.yml" - ansible: ${{ matrix.ansible_version }} - check_git: true - check_git_enforced: true - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - - # ----------------------------------- # - # EOS Design MOLECULE - # ----------------------------------- # - molecule_eos_designs: - name: Validate eos_designs - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - avd_scenario: - - 'eos_designs_deprecated_vars' - - 'eos_designs-l2ls' - - 'eos_designs-mpls-isis-sr-ldp' - - 'eos_designs_negative_unit_tests' - - 'eos_designs-twodc-5stage-clos' - - 'eos_designs_unit_tests' - - 'evpn_underlay_ebgp_overlay_ebgp' - - 'evpn_underlay_isis_overlay_ibgp' - - 'evpn_underlay_ospf_overlay_ebgp' - - 'evpn_underlay_rfc5549_overlay_ebgp' - - 'example-campus-fabric' - - 'example-dual-dc-l3ls' - - 'example-isis-ldp-ipvpn' - - 'example-l2ls-fabric' - - 'example-single-dc-l3ls' - - 'example-cv-pathfinder' - ansible_version: - # Testing all scenario with 2.16.x, due to bug with in 2.17.0 with and the way we test eos_designs_negative_unit_tests https://github.com/ansible/ansible/issues/83292 - - 'ansible-core>=2.16.0,<2.17.0 --upgrade' - pip_requirements: - - '.github/requirements-ci.txt' - # Also test minimum ansible version for one scenario. - include: - - avd_scenario: 'eos_designs_unit_tests' - ansible_version: 'ansible-core==2.15.0' - pip_requirements: 'tmp-requirements-minimum.txt' - - avd_scenario: 'eos_designs_unit_tests' - ansible_version: 'ansible-core>=2.15.0,<2.16.0 --upgrade' - pip_requirements: '.github/requirements-ci.txt' - - avd_scenario: 'eos_designs_unit_tests' - ansible_version: 'ansible-core<2.18.0 --upgrade' - pip_requirements: '.github/requirements-ci.txt' - - avd_scenario: 'eos_designs_unit_tests' - ansible_version: 'ansible-core<2.19.0 --upgrade' - pip_requirements: '.github/requirements-ci.txt' - needs: [ file-changes ] - if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' - steps: - - uses: actions/checkout@v4 - - name: Build minimum requirements - run: | - pip install uv - uv pip compile .github/requirements-ci.txt --resolution=lowest-direct > ${{ matrix.pip_requirements }} - cat ${{ matrix.pip_requirements }} - if: matrix.pip_requirements == 'tmp-requirements-minimum.txt' - - name: Run molecule action - uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - with: - molecule_parentdir: 'ansible_collections/arista/avd' - molecule_command: 'test' - molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - pip_file: ${{ matrix.pip_requirements }} - galaxy_file: "ansible_collections/arista/avd/collections.yml" - ansible: ${{ matrix.ansible_version }} - check_git: true - check_git_enforced: true - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - # ----------------------------------- # - # Cloudvision MOLECULE - # ----------------------------------- # - molecule_cloudvision: - name: Validate cvp_collection - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - avd_scenario: - - 'eos_config_deploy_cvp' - ansible_version: - - 'ansible-core<2.19.0 --upgrade' - include: - - avd_scenario: 'eos_config_deploy_cvp' - ansible_version: 'ansible-core==2.15.0' - needs: [ file-changes ] - if: needs.file-changes.outputs.cloudvision == 'true' || needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' - - steps: - - uses: actions/checkout@v4 - - name: Run molecule action - uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - with: - molecule_parentdir: 'ansible_collections/arista/avd' - molecule_command: 'test' - molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - pip_file: .github/requirements-ci.txt - galaxy_file: "ansible_collections/arista/avd/collections.yml" - ansible: ${{ matrix.ansible_version }} - check_git: true - check_git_enforced: true - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - # - # ----------------------------------- # - # EOS Validate State MOLECULE - # ----------------------------------- # - molecule_eos_validate_state: - name: Validate eos_validate_state - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - avd_scenario: - - 'eos_validate_state' - ansible_version: - - 'ansible-core<2.19.0 --upgrade' - include: - - avd_scenario: 'eos_validate_state' - ansible_version: 'ansible-core==2.15.0' - needs: [ file-changes ] - if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.validate_state == 'true' - steps: - - uses: actions/checkout@v4 - - name: Run molecule action - uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - with: - molecule_parentdir: 'ansible_collections/arista/avd' - molecule_command: 'test' - molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - pip_file: .github/requirements-ci.txt - galaxy_file: "ansible_collections/arista/avd/collections.yml" - ansible: ${{ matrix.ansible_version }} - check_git: true - check_git_enforced: true - - # ----------------------------------- # - # Ansible tests - # ----------------------------------- # - ansible_test_sanity: - name: Run ansible-test sanity validation - runs-on: ubuntu-latest - needs: [ file-changes ] - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3 - uses: actions/setup-python@v5 - with: - python-version: | - 3.10 - 3.11 - 3.12 - 3.13 - - name: 'Install Python requirements' - run: | - pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade - - name: 'Run ansible-test sanity' - run: | - cd ansible_collections/arista/avd/ - ansible-test sanity --color yes -v - - ansible_test_units: - name: Run ansible-test units test cases + container-job: + # Containers must run in Linux based operating systems runs-on: ubuntu-latest - needs: [ file-changes ] - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3 - uses: actions/setup-python@v5 - with: - python-version: | - 3.12 - - name: 'Install Python requirements' - run: | - pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade - - name: 'Run ansible-test units test cases' - run: | - cd ansible_collections/arista/avd/ - ansible-test units -vv + # Docker Hub image that `container-job` executes in + container: + image: ubuntu:latest + options: --cpus 1 - ansible_test_integration: - name: Run ansible-test integration test cases - runs-on: ubuntu-latest - needs: [ file-changes ] steps: - - uses: actions/checkout@v4 - - name: Set up Python 3 - uses: actions/setup-python@v5 - with: - python-version: | - 3.12 - 3.13 - - name: 'Install Python requirements' - run: | - pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade - - name: 'Run ansible-test integration test cases' - run: | - cd ansible_collections/arista/avd/ - ansible-test integration -vv - - ansible_lint: - name: Run ansible-lint test case - runs-on: ubuntu-latest - needs: [ file-changes ] - steps: - - uses: actions/checkout@v4 + - name: Check out repository code + uses: actions/checkout@v4 - name: Set up Python 3 uses: actions/setup-python@v5 with: @@ -399,71 +103,6 @@ jobs: 3.11 3.12 3.13 - - name: 'Install Python & Ansible requirements' + - name: Install dependencies run: | pip install -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - ansible-galaxy collection install -r ansible_collections/arista/avd/collections.yml - - name: 'Run ansible-test integration test cases' - run: | - cd ansible_collections/arista/avd/ - ansible-lint --force-color --strict -v - # ----------------------------------- # - # Galaxy Importer - # ----------------------------------- # - galaxy_importer: - name: Test galaxy-importer - runs-on: ubuntu-20.04 # Older version to be compatible with old python - env: - GALAXY_IMPORTER_CONFIG: galaxy-importer/galaxy-importer.cfg - steps: - - uses: actions/setup-python@v5 - with: - python-version: | - 3.10 - - uses: actions/checkout@v4 - - name: 'Install Python & Ansible requirements' - run: | - pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade - ansible-galaxy collection install -r ansible_collections/arista/avd/collections.yml - - name: Install galaxy-importer - # Install the specific version of galaxy-importer used on galaxy.ansible.com - # The version conflicts with our requirements, - # so we let the galaxy-importer version resolve remaining requirements. - run: | - pip install "galaxy-importer==0.4.26" - - name: 'Build ansible package' - run: make collection-build - - name: 'Run galaxy-importer checks' - run: python -m galaxy_importer.main *.tar.gz - - uses: actions/upload-artifact@v4 - with: - name: importer-logs - path: ./importer_result.json - - # ----------------------------------- # - # Test of pyavd - # ----------------------------------- # - pyavd: - name: Test pyavd - runs-on: ubuntu-latest - needs: [file-changes] - if: | - needs.file-changes.outputs.eos_design == 'true' || - needs.file-changes.outputs.config_gen == 'true' || - needs.file-changes.outputs.pyavd == 'true' - strategy: - matrix: - python: ["3.10", "3.11", "3.12", "3.13"] - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3 - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - - name: 'Install tox' - run: | - pip install tox tox-gh-actions --upgrade - - name: "Run pytest via tox for ${{ matrix.python }}" - working-directory: python-avd - run: | - tox From e2758069b5b3cd4b44158d46c05f2744f996596d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 6 Jan 2025 21:16:30 +0530 Subject: [PATCH 003/324] installing req-dev.txt only --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 7cb39a61285..01c5be246ca 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -105,4 +105,4 @@ jobs: 3.13 - name: Install dependencies run: | - pip install -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade From 80f9710a033562f429d3d97a73b01263f430388d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 6 Jan 2025 21:33:00 +0530 Subject: [PATCH 004/324] reuse the container --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 01c5be246ca..021d0c4a0ea 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -90,7 +90,7 @@ jobs: # Docker Hub image that `container-job` executes in container: image: ubuntu:latest - options: --cpus 1 + options: --reuse steps: - name: Check out repository code From 49cd94e10cec561cd78387a7253246f81240d98f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 6 Jan 2025 21:49:09 +0530 Subject: [PATCH 005/324] second job --- .github/workflows/pull-request-management.yml | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 021d0c4a0ea..9d0d0825999 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -90,7 +90,7 @@ jobs: # Docker Hub image that `container-job` executes in container: image: ubuntu:latest - options: --reuse + options: --cpus 1 steps: - name: Check out repository code @@ -106,3 +106,42 @@ jobs: - name: Install dependencies run: | pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Container + uses: docker/build-push-action@v5 + with: + tags: project-image + context: . + push: false + outputs: type=docker,dest=/tmp/project.tar + build-args: | + KEY=value + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: project + path: /tmp/project.tar + + reuse-container-job: + name: reuse first job + runs-on: ubuntu-latest + needs: [ container-job ] + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: project + path: /tmp + + - name: Load image + run: docker load --input /tmp/project.tar + + - name: Run + uses: addnab/docker-run-action@v3 + with: + image: project-image + run: | + pip list From 4c8a03b47be9f1b272d47156bcfe950051c5f9ee Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 7 Jan 2025 12:39:26 +0530 Subject: [PATCH 006/324] commit image from container --- .github/workflows/pull-request-management.yml | 63 +++++++++---------- 1 file changed, 29 insertions(+), 34 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 9d0d0825999..c8565dbdbba 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -89,7 +89,7 @@ jobs: runs-on: ubuntu-latest # Docker Hub image that `container-job` executes in container: - image: ubuntu:latest + image: docker:latest options: --cpus 1 steps: @@ -106,42 +106,37 @@ jobs: - name: Install dependencies run: | pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 - - name: Build Container - uses: docker/build-push-action@v5 - with: - tags: project-image - context: . - push: false - outputs: type=docker,dest=/tmp/project.tar - build-args: | - KEY=value - - - name: Upload artifact + - name: Commit the container changes to an image + run: | + CONTAINER_ID=$(docker ps -aqf "name=github-actions-job") + docker commit -m "Added Python and dependencies" -a "GitHub Actions" $CONTAINER_ID my-python-app:latest + + - name: Save image as artifact uses: actions/upload-artifact@v3 with: - name: project - path: /tmp/project.tar + name: python-app-image + path: ${{ github.workspace }}/.docker/my-python-app:latest.tar - reuse-container-job: - name: reuse first job - runs-on: ubuntu-latest - needs: [ container-job ] - steps: - - name: Download artifact - uses: actions/download-artifact@v3 - with: - name: project - path: /tmp + # reuse-container-job: + # name: reuse first job + # runs-on: ubuntu-latest + # needs: [ container-job ] + # steps: + # - name: Download artifact + # uses: actions/download-artifact@v3 + # with: + # name: project + # path: /tmp - - name: Load image - run: docker load --input /tmp/project.tar + # - name: Load image + # run: docker load --input /tmp/project.tar - - name: Run - uses: addnab/docker-run-action@v3 - with: - image: project-image - run: | - pip list + # - name: Run + # uses: addnab/docker-run-action@v3 + # with: + # image: project-image + # run: | + # pip list From e64873715d0cb2b96e1c0af20243c7c5df73196f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 7 Jan 2025 12:44:09 +0530 Subject: [PATCH 007/324] build image --- .github/workflows/pull-request-management.yml | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index c8565dbdbba..3a931f56790 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -89,7 +89,7 @@ jobs: runs-on: ubuntu-latest # Docker Hub image that `container-job` executes in container: - image: docker:latest + image: ubuntu:latest options: --cpus 1 steps: @@ -106,19 +106,26 @@ jobs: - name: Install dependencies run: | pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + + - name: Build the Docker image + uses: docker/build-push-action@v3 + with: + context: . + push: false + tags: my-python-app:latest # - name: Set up Docker Buildx # uses: docker/setup-buildx-action@v3 - - name: Commit the container changes to an image - run: | - CONTAINER_ID=$(docker ps -aqf "name=github-actions-job") - docker commit -m "Added Python and dependencies" -a "GitHub Actions" $CONTAINER_ID my-python-app:latest + # - name: Commit the container changes to an image + # run: | + # CONTAINER_ID=$(docker ps -aqf "name=github-actions-job") + # docker commit -m "Added Python and dependencies" -a "GitHub Actions" $CONTAINER_ID my-python-app:latest - - name: Save image as artifact - uses: actions/upload-artifact@v3 - with: - name: python-app-image - path: ${{ github.workspace }}/.docker/my-python-app:latest.tar + # - name: Save image as artifact + # uses: actions/upload-artifact@v3 + # with: + # name: python-app-image + # path: ${{ github.workspace }}/.docker/my-python-app:latest.tar # reuse-container-job: # name: reuse first job From d76b2fb9d367f56fa50a1f00e9cc6698e0521fe7 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 7 Jan 2025 12:47:04 +0530 Subject: [PATCH 008/324] build image --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 3a931f56790..648444fb58d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -107,6 +107,8 @@ jobs: run: | pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Build the Docker image uses: docker/build-push-action@v3 with: From 7166b1b1ee42440e04020198f55dcb76e3c770c8 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 7 Jan 2025 12:55:39 +0530 Subject: [PATCH 009/324] commit image --- .github/workflows/pull-request-management.yml | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 648444fb58d..2fa790c8396 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -89,7 +89,7 @@ jobs: runs-on: ubuntu-latest # Docker Hub image that `container-job` executes in container: - image: ubuntu:latest + image: docker:latest options: --cpus 1 steps: @@ -100,21 +100,32 @@ jobs: with: python-version: | 3.10 - 3.11 - 3.12 - 3.13 - name: Install dependencies run: | pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build the Docker image - uses: docker/build-push-action@v3 + - name: Get container ID + id: container-info + run: echo "::set-output name=id::$(docker ps -aqf 'name=github-actions-job')" + + - name: Commit the container changes to an image + run: | + docker commit -m "Added Python and dependencies" -a "GitHub Actions" ${{ steps.container-info.outputs.id }} my-python-app:latest + + - name: Save image as artifact + uses: actions/upload-artifact@v3 with: - context: . - push: false - tags: my-python-app:latest + name: python-app-image + path: ${{ github.workspace }}/.docker/my-python-app:latest.tar + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + # - name: Build the Docker image + # uses: docker/build-push-action@v3 + # with: + # context: . + # push: false + # tags: my-python-app:latest # - name: Set up Docker Buildx # uses: docker/setup-buildx-action@v3 From 79d79e0fe24809a8cbd812ae9edafe965f57da1f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 7 Jan 2025 12:59:35 +0530 Subject: [PATCH 010/324] ensure pip --- .github/workflows/pull-request-management.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 2fa790c8396..0888436dc85 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -102,6 +102,7 @@ jobs: 3.10 - name: Install dependencies run: | + python -m ensurepip pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - name: Get container ID From 6539ad3ac4d378aad11db70dc98b527236a39b5a Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 7 Jan 2025 15:20:27 +0530 Subject: [PATCH 011/324] install pyavd --- .github/workflows/pull-request-management.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 0888436dc85..24b7e0ea3cd 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -89,7 +89,7 @@ jobs: runs-on: ubuntu-latest # Docker Hub image that `container-job` executes in container: - image: docker:latest + image: ubuntu:latest options: --cpus 1 steps: @@ -100,11 +100,13 @@ jobs: with: python-version: | 3.10 + 3.11 + 3.12 + 3.13 - name: Install dependencies run: | - python -m ensurepip - pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - + pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade + - name: Get container ID id: container-info run: echo "::set-output name=id::$(docker ps -aqf 'name=github-actions-job')" From 5482878ced27f55c42ccdabb2e22d5b53bdf0adb Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Tue, 7 Jan 2025 18:34:40 +0530 Subject: [PATCH 012/324] apt-get update --- .github/workflows/pull-request-management.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 24b7e0ea3cd..1ec87089ebd 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -105,6 +105,9 @@ jobs: 3.13 - name: Install dependencies run: | + sudo apt-get update + sudo apt-get install -y make build-essential python3-dev + python -m pip install --upgrade pip setuptools wheel pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade - name: Get container ID From faa19ccc55722ef258db688d819e5082670e2260 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Tue, 7 Jan 2025 18:54:24 +0530 Subject: [PATCH 013/324] remove sudo --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 1ec87089ebd..3e833c2473e 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -105,8 +105,8 @@ jobs: 3.13 - name: Install dependencies run: | - sudo apt-get update - sudo apt-get install -y make build-essential python3-dev + apt-get update + pt-get install -y make build-essential python3-dev python -m pip install --upgrade pip setuptools wheel pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade From d6f9fecc39d2959945b84380309e792cdbefb3af Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Tue, 7 Jan 2025 18:55:36 +0530 Subject: [PATCH 014/324] fix the wrong command --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 3e833c2473e..b9f07f6f9e5 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -106,7 +106,7 @@ jobs: - name: Install dependencies run: | apt-get update - pt-get install -y make build-essential python3-dev + apt-get install -y make build-essential python3-dev python -m pip install --upgrade pip setuptools wheel pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade From ee3b6f72cf29d8cef436e663d13d1eb198992871 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Tue, 7 Jan 2025 19:02:03 +0530 Subject: [PATCH 015/324] Creating docker image with dependencies and push to ghcr --- .github/workflows/pull-request-management.yml | 78 ++++++++++++++----- 1 file changed, 58 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index b9f07f6f9e5..b3fe48e1901 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -13,7 +13,9 @@ env: AVD_NEVER_RUN_FROM_SOURCE: 1 PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions - +permissions: + contents: read # Allows read access to the repository's contents (code) + packages: write jobs: file-changes: runs-on: ubuntu-latest @@ -87,6 +89,9 @@ jobs: container-job: # Containers must run in Linux based operating systems runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.11, 3.12, 3.13] # Python versions # Docker Hub image that `container-job` executes in container: image: ubuntu:latest @@ -95,28 +100,61 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 - - name: Set up Python 3 - uses: actions/setup-python@v5 - with: - python-version: | - 3.10 - 3.11 - 3.12 - 3.13 - - name: Install dependencies + - name: Set up Docker run: | apt-get update - apt-get install -y make build-essential python3-dev - python -m pip install --upgrade pip setuptools wheel - pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade - - - name: Get container ID - id: container-info - run: echo "::set-output name=id::$(docker ps -aqf 'name=github-actions-job')" - - - name: Commit the container changes to an image + apt-get install -y docker.io + + - id: string + uses: vishalmamidi/lowercase-action@v1 + with: + string: ${{ github.repository_owner }} + + - name: log lowercase repo name + run: echo ${{ steps.string.outputs.lowercase }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.string.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + env: + DOCKER_CLI_EXPERIMENTAL: enabled + + # Step 4: Dynamically create Dockerfile + - name: Create Dockerfile dynamically + run: | + echo "Creating Dockerfile..." + cat < Dockerfile + ARG PYTHON_VERSION + FROM python:\${PYTHON_VERSION}-slim + + # Install Git to clone the repo + RUN apt-get update && apt-get install -y git make + + # Clone the repository in the Docker image + RUN git clone https://github.com/${{ github.repository }} /avd + + WORKDIR /avd + + # Ensure to copy the requirements-ci.txt file from the correct location + COPY .github/requirements-ci.txt /avd/.github/requirements-ci.txt + + # Install the requirements directly + RUN pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade + + CMD ["python"] + EOF + echo "Dockerfile created successfully." + + - name: Build Docker Image + run: | + docker build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:${{ matrix.python-version }} \ + --build-arg PYTHON_VERSION=${{ matrix.python-version }} . + + - name: Push Docker Image run: | - docker commit -m "Added Python and dependencies" -a "GitHub Actions" ${{ steps.container-info.outputs.id }} my-python-app:latest + docker push ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:${{ matrix.python-version }} - name: Save image as artifact uses: actions/upload-artifact@v3 From 423b66149ecdbff448cf6fe948026b812526a2cd Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 9 Jan 2025 12:30:57 +0530 Subject: [PATCH 016/324] Adding job to reuse image from ghcr --- .github/workflows/pull-request-management.yml | 97 +++++++++---------- 1 file changed, 46 insertions(+), 51 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index b3fe48e1901..d2a9690df9e 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -13,9 +13,7 @@ env: AVD_NEVER_RUN_FROM_SOURCE: 1 PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions -permissions: - contents: read # Allows read access to the repository's contents (code) - packages: write + jobs: file-changes: runs-on: ubuntu-latest @@ -91,7 +89,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.11, 3.12, 3.13] # Python versions + python-version: [3.12] # Python versions # Docker Hub image that `container-job` executes in container: image: ubuntu:latest @@ -112,6 +110,7 @@ jobs: - name: log lowercase repo name run: echo ${{ steps.string.outputs.lowercase }} + - name: Log in to GitHub Container Registry uses: docker/login-action@v2 with: @@ -141,7 +140,7 @@ jobs: COPY .github/requirements-ci.txt /avd/.github/requirements-ci.txt # Install the requirements directly - RUN pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade + RUN pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade CMD ["python"] EOF @@ -156,51 +155,47 @@ jobs: run: | docker push ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:${{ matrix.python-version }} - - name: Save image as artifact - uses: actions/upload-artifact@v3 + reuse-ghcr-image: + name: reuse first job + runs-on: ubuntu-latest + needs: [ container-job ] + steps: + - name: Check out repository code + uses: actions/checkout@v4 + # - name: Set up Docker + # run: | + # sudo apt-get update + # sudo apt-get install -y docker.io + + - id: string + uses: vishalmamidi/lowercase-action@v1 with: - name: python-app-image - path: ${{ github.workspace }}/.docker/my-python-app:latest.tar - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 - # - name: Build the Docker image - # uses: docker/build-push-action@v3 - # with: - # context: . - # push: false - # tags: my-python-app:latest - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 - - # - name: Commit the container changes to an image + string: ${{ github.repository_owner }} + + - name: log lowercase repo name + run: echo ${{ steps.string.outputs.lowercase }} + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.string.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + + # - name: Pull docker image from ghcr # run: | - # CONTAINER_ID=$(docker ps -aqf "name=github-actions-job") - # docker commit -m "Added Python and dependencies" -a "GitHub Actions" $CONTAINER_ID my-python-app:latest - - # - name: Save image as artifact - # uses: actions/upload-artifact@v3 - # with: - # name: python-app-image - # path: ${{ github.workspace }}/.docker/my-python-app:latest.tar - - # reuse-container-job: - # name: reuse first job - # runs-on: ubuntu-latest - # needs: [ container-job ] - # steps: - # - name: Download artifact - # uses: actions/download-artifact@v3 - # with: - # name: project - # path: /tmp - - # - name: Load image - # run: docker load --input /tmp/project.tar - - # - name: Run - # uses: addnab/docker-run-action@v3 - # with: - # image: project-image - # run: | - # pip list + # docker pull ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:3.12 + + - name: Run Docker Container + run: | + docker run -dit --name avd-python-container ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:3.12 bash + + - name: Execute Command Inside Container + run: | + docker exec avd-python-container bash -c "cd ansible_collections/arista/avd && ansible-test units -vv" + + - name: Stop and Remove Docker Container + run: | + docker stop avd-python-container + docker rm avd-python-container + From e95794f26723cd1bf258a6a89b99a1c58f405f0d Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Thu, 9 Jan 2025 12:44:09 +0530 Subject: [PATCH 017/324] Creating venev with different python versions --- .github/workflows/pull-request-management.yml | 69 ++++++++++++++----- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d2a9690df9e..37985da138e 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -87,9 +87,9 @@ jobs: container-job: # Containers must run in Linux based operating systems runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.12] # Python versions + # strategy: + # matrix: + # python-version: [3.12] # Python versions # Docker Hub image that `container-job` executes in container: image: ubuntu:latest @@ -125,22 +125,40 @@ jobs: run: | echo "Creating Dockerfile..." cat < Dockerfile - ARG PYTHON_VERSION - FROM python:\${PYTHON_VERSION}-slim + FROM ubuntu:latest # Install Git to clone the repo - RUN apt-get update && apt-get install -y git make + RUN apt-get update && apt-get install -y git make python3-pip python3.12 + + # Install UV + RUN pip install uv --break-system-packages + + # Install python versions + RUN uv python install 3.10 3.11 3.12 3.13 + # Clone the repository in the Docker image - RUN git clone https://github.com/${{ github.repository }} /avd + RUN git clone https://github.com/${{ github.repository }} WORKDIR /avd - # Ensure to copy the requirements-ci.txt file from the correct location - COPY .github/requirements-ci.txt /avd/.github/requirements-ci.txt - - # Install the requirements directly - RUN pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # Create virtual env + RUN uv venv --python 3.10 UV3.10 && \ + UV3.10/bin/python -m ensurepip --upgrade + RUN uv venv --python 3.11 UV3.11 && \ + UV3.11/bin/python -m ensurepip --upgrade + RUN uv venv --python 3.12 UV3.12 && \ + UV3.12/bin/python -m ensurepip --upgrade + RUN uv venv --python 3.13 UV3.13 && \ + UV3.13/bin/python -m ensurepip --upgrade + + # Activate virtual env + RUN . UV3.12/bin/activate && \ + UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # WORKDIR /avd + + # # # Install the requirements directly + # # RUN pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade CMD ["python"] EOF @@ -148,12 +166,11 @@ jobs: - name: Build Docker Image run: | - docker build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:${{ matrix.python-version }} \ - --build-arg PYTHON_VERSION=${{ matrix.python-version }} . + docker build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 . - name: Push Docker Image run: | - docker push ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:${{ matrix.python-version }} + docker push ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 reuse-ghcr-image: name: reuse first job @@ -188,12 +205,26 @@ jobs: - name: Run Docker Container run: | - docker run -dit --name avd-python-container ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:3.12 bash + docker run -dit --name avd-python-container ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 bash - - name: Execute Command Inside Container + # - name: Execute Ansible unit tests + # run: | + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" + + # - name: Execute Ansible integration tests + # run: | + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + + # - name: Execute Ansible sanity tests + # run: | + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + + - name: Execute Ansible lint tests run: | - docker exec avd-python-container bash -c "cd ansible_collections/arista/avd && ansible-test units -vv" - + docker exec avd-python-container bash -c "cd ansible_collections/arista/avd && ansible-test integration -vv" + - name: Stop and Remove Docker Container run: | docker stop avd-python-container From 1da04a0472e71ed2ade5d63854bd4e8fb635c800 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 9 Jan 2025 17:52:52 +0530 Subject: [PATCH 018/324] venv1 --- .github/workflows/pull-request-management.yml | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 37985da138e..29fd3866c4e 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -152,10 +152,21 @@ jobs: RUN uv venv --python 3.13 UV3.13 && \ UV3.13/bin/python -m ensurepip --upgrade + # Activate virtual env + RUN . UV3.10/bin/activate && \ + UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + + # Activate virtual env + RUN . UV3.11/bin/activate && \ + UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # Activate virtual env RUN . UV3.12/bin/activate && \ UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - # WORKDIR /avd + + # Activate virtual env + RUN . UV3.13/bin/activate && \ + UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade # # # Install the requirements directly # # RUN pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade @@ -207,23 +218,23 @@ jobs: run: | docker run -dit --name avd-python-container ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 bash - # - name: Execute Ansible unit tests - # run: | - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" + - name: Execute Ansible unit tests + run: | + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" - # - name: Execute Ansible integration tests - # run: | - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + - name: Execute Ansible integration tests + run: | + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - # - name: Execute Ansible sanity tests - # run: | - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - - - name: Execute Ansible lint tests + - name: Execute Ansible sanity tests run: | - docker exec avd-python-container bash -c "cd ansible_collections/arista/avd && ansible-test integration -vv" + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + + # - name: Execute Ansible lint tests + # run: | + # docker exec avd-python-container bash -c "cd ansible_collections/arista/avd && ansible-test integration -vv" - name: Stop and Remove Docker Container run: | From 5e02f30d4b39ae253eded0b478917be7392231e9 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 9 Jan 2025 18:39:08 +0530 Subject: [PATCH 019/324] trying container attribute1 --- .github/workflows/pull-request-management.yml | 104 ++++++++++-------- 1 file changed, 61 insertions(+), 43 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 29fd3866c4e..45c34ae6c5f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -183,61 +183,79 @@ jobs: run: | docker push ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 - reuse-ghcr-image: - name: reuse first job + reuse_container_image: + name: Reuse image with ghcr credentials runs-on: ubuntu-latest - needs: [ container-job ] + needs: [container-job] + container: + image: ghcr.io/shivani-gslab/avd/python:0.0.1 + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} steps: - name: Check out repository code uses: actions/checkout@v4 - # - name: Set up Docker - # run: | - # sudo apt-get update - # sudo apt-get install -y docker.io + - name: run tests + run: | + source UV3.12/bin/activate + cd ansible_collections/arista/avd + ansible-test units -vv + + # reuse-ghcr-image: + # name: reuse first job + # runs-on: ubuntu-latest + # needs: [ container-job ] + # steps: + # - name: Check out repository code + # uses: actions/checkout@v4 + # # - name: Set up Docker + # # run: | + # # sudo apt-get update + # # sudo apt-get install -y docker.io - - id: string - uses: vishalmamidi/lowercase-action@v1 - with: - string: ${{ github.repository_owner }} + # - id: string + # uses: vishalmamidi/lowercase-action@v1 + # with: + # string: ${{ github.repository_owner }} - - name: log lowercase repo name - run: echo ${{ steps.string.outputs.lowercase }} + # - name: log lowercase repo name + # run: echo ${{ steps.string.outputs.lowercase }} - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.string.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v2 + # with: + # registry: ghcr.io + # username: ${{ steps.string.outputs.lowercase }} + # password: ${{ secrets.GITHUB_TOKEN }} - # - name: Pull docker image from ghcr - # run: | - # docker pull ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:3.12 + # # - name: Pull docker image from ghcr + # # run: | + # # docker pull ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:3.12 - - name: Run Docker Container - run: | - docker run -dit --name avd-python-container ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 bash + # - name: Run Docker Container + # run: | + # docker run -dit --name avd-python-container ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 bash - - name: Execute Ansible unit tests - run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" + # - name: Execute Ansible unit tests + # run: | + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" - - name: Execute Ansible integration tests - run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + # - name: Execute Ansible integration tests + # run: | + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - - name: Execute Ansible sanity tests - run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # - name: Execute Ansible sanity tests + # run: | + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # - name: Execute Ansible lint tests - # run: | - # docker exec avd-python-container bash -c "cd ansible_collections/arista/avd && ansible-test integration -vv" + # # - name: Execute Ansible lint tests + # # run: | + # # docker exec avd-python-container bash -c "cd ansible_collections/arista/avd && ansible-test integration -vv" - - name: Stop and Remove Docker Container - run: | - docker stop avd-python-container - docker rm avd-python-container + # - name: Stop and Remove Docker Container + # run: | + # docker stop avd-python-container + # docker rm avd-python-container From b961a7fc3bebf36495ba6b0a4588ad6b800414d6 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 9 Jan 2025 18:52:07 +0530 Subject: [PATCH 020/324] shell bash --- .github/workflows/pull-request-management.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 45c34ae6c5f..3e44ac33fa5 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -196,6 +196,7 @@ jobs: - name: Check out repository code uses: actions/checkout@v4 - name: run tests + shell: bash run: | source UV3.12/bin/activate cd ansible_collections/arista/avd From 2061603c074208ce8ff062b9ec6d9c294c81d9cc Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 9 Jan 2025 19:02:44 +0530 Subject: [PATCH 021/324] shell bash --- .github/workflows/pull-request-management.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 3e44ac33fa5..cc4c1932634 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -198,6 +198,7 @@ jobs: - name: run tests shell: bash run: | + cd avd/ source UV3.12/bin/activate cd ansible_collections/arista/avd ansible-test units -vv From a2cdae3770f1da7aff9eca3c6e38c0c913296ce9 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Thu, 9 Jan 2025 19:16:13 +0530 Subject: [PATCH 022/324] uvchanges41 --- .github/workflows/pull-request-management.yml | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index cc4c1932634..8d5d45c75b4 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -152,22 +152,17 @@ jobs: RUN uv venv --python 3.13 UV3.13 && \ UV3.13/bin/python -m ensurepip --upgrade - # Activate virtual env - RUN . UV3.10/bin/activate && \ - UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - - # Activate virtual env - RUN . UV3.11/bin/activate && \ - UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - - # Activate virtual env - RUN . UV3.12/bin/activate && \ - UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - - # Activate virtual env - RUN . UV3.13/bin/activate && \ - UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - + # Activate and install requirements in parallel + RUN ( \ + . UV3.10/bin/activate && UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade \ + ) & ( \ + . UV3.11/bin/activate && UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade \ + ) & ( \ + . UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade \ + ) & ( \ + . UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade \ + ) && wait + # # # Install the requirements directly # # RUN pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade @@ -198,6 +193,8 @@ jobs: - name: run tests shell: bash run: | + pwd + ls -l cd avd/ source UV3.12/bin/activate cd ansible_collections/arista/avd From ca5d17f286657cb5b5a13399654ca592b561870a Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Thu, 9 Jan 2025 19:21:10 +0530 Subject: [PATCH 023/324] uvchanges42 --- .github/workflows/pull-request-management.yml | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 8d5d45c75b4..def6b2f13a4 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -152,17 +152,22 @@ jobs: RUN uv venv --python 3.13 UV3.13 && \ UV3.13/bin/python -m ensurepip --upgrade - # Activate and install requirements in parallel - RUN ( \ - . UV3.10/bin/activate && UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade \ - ) & ( \ - . UV3.11/bin/activate && UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade \ - ) & ( \ - . UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade \ - ) & ( \ - . UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade \ - ) && wait - + # # Activate virtual env + # RUN . UV3.10/bin/activate && \ + # UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + + # # Activate virtual env + # RUN . UV3.11/bin/activate && \ + # UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + + # Activate virtual env + RUN . UV3.12/bin/activate && \ + UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + + # # Activate virtual env + # RUN . UV3.13/bin/activate && \ + # UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # # # Install the requirements directly # # RUN pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade @@ -195,7 +200,6 @@ jobs: run: | pwd ls -l - cd avd/ source UV3.12/bin/activate cd ansible_collections/arista/avd ansible-test units -vv From e5ffbd84869a829a904ffb640d051fd6decd8091 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Thu, 9 Jan 2025 19:30:01 +0530 Subject: [PATCH 024/324] uvchanges43 --- .github/workflows/pull-request-management.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index def6b2f13a4..350859096a8 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -200,6 +200,7 @@ jobs: run: | pwd ls -l + ls -l /__w/avd/ source UV3.12/bin/activate cd ansible_collections/arista/avd ansible-test units -vv From 616d68a1d4cc57ed546caa86956d267711fe08fc Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Thu, 9 Jan 2025 19:30:32 +0530 Subject: [PATCH 025/324] uvchanges44 --- .github/workflows/pull-request-management.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 350859096a8..1247512e924 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -160,9 +160,9 @@ jobs: # RUN . UV3.11/bin/activate && \ # UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - # Activate virtual env - RUN . UV3.12/bin/activate && \ - UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # # Activate virtual env + # RUN . UV3.12/bin/activate && \ + # UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade # # Activate virtual env # RUN . UV3.13/bin/activate && \ From e3031c3a4c37cc5c3c6c93bf5848dbd5a5cb8c56 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Thu, 9 Jan 2025 19:37:34 +0530 Subject: [PATCH 026/324] uvchanges45 --- .github/workflows/pull-request-management.yml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 1247512e924..18b49ed48ef 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -143,14 +143,14 @@ jobs: WORKDIR /avd # Create virtual env - RUN uv venv --python 3.10 UV3.10 && \ - UV3.10/bin/python -m ensurepip --upgrade - RUN uv venv --python 3.11 UV3.11 && \ - UV3.11/bin/python -m ensurepip --upgrade + # RUN uv venv --python 3.10 UV3.10 && \ + # UV3.10/bin/python -m ensurepip --upgrade + # RUN uv venv --python 3.11 UV3.11 && \ + # UV3.11/bin/python -m ensurepip --upgrade RUN uv venv --python 3.12 UV3.12 && \ UV3.12/bin/python -m ensurepip --upgrade - RUN uv venv --python 3.13 UV3.13 && \ - UV3.13/bin/python -m ensurepip --upgrade + # RUN uv venv --python 3.13 UV3.13 && \ + # UV3.13/bin/python -m ensurepip --upgrade # # Activate virtual env # RUN . UV3.10/bin/activate && \ @@ -160,9 +160,9 @@ jobs: # RUN . UV3.11/bin/activate && \ # UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - # # Activate virtual env - # RUN . UV3.12/bin/activate && \ - # UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # Activate virtual env + RUN . UV3.12/bin/activate && \ + UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade # # Activate virtual env # RUN . UV3.13/bin/activate && \ @@ -170,7 +170,7 @@ jobs: # # # Install the requirements directly # # RUN pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - + RUN ls -l CMD ["python"] EOF echo "Dockerfile created successfully." From 4667e5deae28d0ab020fa77888376ffb22b4bc60 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Thu, 9 Jan 2025 19:49:39 +0530 Subject: [PATCH 027/324] uvchanges46 --- .github/workflows/pull-request-management.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 18b49ed48ef..fae5d94248a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -171,6 +171,7 @@ jobs: # # # Install the requirements directly # # RUN pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade RUN ls -l + RUN pwd CMD ["python"] EOF echo "Dockerfile created successfully." @@ -199,7 +200,7 @@ jobs: shell: bash run: | pwd - ls -l + ls -al ls -l /__w/avd/ source UV3.12/bin/activate cd ansible_collections/arista/avd From 774ea9e7df01b388f31d9f4a8d7460a3d1710b9e Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Thu, 9 Jan 2025 22:03:49 +0530 Subject: [PATCH 028/324] uvchanges47 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index fae5d94248a..0602003da93 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -191,7 +191,7 @@ jobs: container: image: ghcr.io/shivani-gslab/avd/python:0.0.1 credentials: - username: ${{ github.actor }} + username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} steps: - name: Check out repository code From fadb08332ff75929cb967980b6e247fb05511157 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Thu, 9 Jan 2025 22:13:52 +0530 Subject: [PATCH 029/324] uvchanges48 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 0602003da93..c54d5a0e282 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -178,7 +178,7 @@ jobs: - name: Build Docker Image run: | - docker build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 . + docker build --no-cache -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 . - name: Push Docker Image run: | From 6f27def8513c34c5b6d50a51b48807a575fa07ac Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Thu, 9 Jan 2025 22:19:17 +0530 Subject: [PATCH 030/324] uvchanges49 --- .github/workflows/pull-request-management.yml | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index c54d5a0e282..87337d4f90c 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -178,72 +178,72 @@ jobs: - name: Build Docker Image run: | - docker build --no-cache -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 . + docker build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 . - name: Push Docker Image run: | docker push ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 - reuse_container_image: - name: Reuse image with ghcr credentials - runs-on: ubuntu-latest - needs: [container-job] - container: - image: ghcr.io/shivani-gslab/avd/python:0.0.1 - credentials: - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: run tests - shell: bash - run: | - pwd - ls -al - ls -l /__w/avd/ - source UV3.12/bin/activate - cd ansible_collections/arista/avd - ansible-test units -vv - - # reuse-ghcr-image: - # name: reuse first job + # reuse_container_image: + # name: Reuse image with ghcr credentials # runs-on: ubuntu-latest - # needs: [ container-job ] + # needs: [container-job] + # container: + # image: ghcr.io/shivani-gslab/avd/python:0.0.1 + # credentials: + # username: ${{ github.repository_owner }} + # password: ${{ secrets.GITHUB_TOKEN }} # steps: # - name: Check out repository code # uses: actions/checkout@v4 - # # - name: Set up Docker - # # run: | - # # sudo apt-get update - # # sudo apt-get install -y docker.io + # - name: run tests + # shell: bash + # run: | + # pwd + # ls -al + # ls -l /__w/avd/ + # source UV3.12/bin/activate + # cd ansible_collections/arista/avd + # ansible-test units -vv + + reuse-ghcr-image: + name: reuse first job + runs-on: ubuntu-latest + needs: [ container-job ] + steps: + - name: Check out repository code + uses: actions/checkout@v4 + # - name: Set up Docker + # run: | + # sudo apt-get update + # sudo apt-get install -y docker.io - # - id: string - # uses: vishalmamidi/lowercase-action@v1 - # with: - # string: ${{ github.repository_owner }} + - id: string + uses: vishalmamidi/lowercase-action@v1 + with: + string: ${{ github.repository_owner }} - # - name: log lowercase repo name - # run: echo ${{ steps.string.outputs.lowercase }} + - name: log lowercase repo name + run: echo ${{ steps.string.outputs.lowercase }} - # - name: Log in to GitHub Container Registry - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ steps.string.outputs.lowercase }} - # password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.string.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} - # # - name: Pull docker image from ghcr - # # run: | - # # docker pull ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:3.12 + # - name: Pull docker image from ghcr + # run: | + # docker pull ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:3.12 - # - name: Run Docker Container - # run: | - # docker run -dit --name avd-python-container ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 bash + - name: Run Docker Container + run: | + docker run -dit --name avd-python-container ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 bash - # - name: Execute Ansible unit tests - # run: | - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" + - name: Execute Ansible unit tests + run: | + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" # - name: Execute Ansible integration tests # run: | From bd4910801bcfc315edc4e171c057f75c14fe0107 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 11:51:33 +0530 Subject: [PATCH 031/324] trying parallel venv 1 --- .github/workflows/pull-request-management.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 87337d4f90c..6f4e01c90c9 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -161,17 +161,17 @@ jobs: # UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade # Activate virtual env - RUN . UV3.12/bin/activate && \ - UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # RUN . UV3.12/bin/activate && \ + # UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - # # Activate virtual env + RUN parallel --link --tag 'bash -c' ::: \ + "UV3.12/bin/pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade pip" \ + "UV3.13/bin/pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade pip" + + # # Activate virtual env # RUN . UV3.13/bin/activate && \ # UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - - # # # Install the requirements directly - # # RUN pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - RUN ls -l - RUN pwd + CMD ["python"] EOF echo "Dockerfile created successfully." From 5c3243054c80e64a141147edac5b8d87151599f3 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 12:00:32 +0530 Subject: [PATCH 032/324] trying parallel venv 2 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6f4e01c90c9..86da358e976 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -128,7 +128,7 @@ jobs: FROM ubuntu:latest # Install Git to clone the repo - RUN apt-get update && apt-get install -y git make python3-pip python3.12 + RUN apt-get update && apt-get install -y git parallel make python3-pip python3.12 # Install UV RUN pip install uv --break-system-packages From 00298d34df56d931e7324d8e1a1a81f43166103e Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 12:04:58 +0530 Subject: [PATCH 033/324] trying parallel venv 3 --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 86da358e976..d71478bb96c 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -165,8 +165,8 @@ jobs: # UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade RUN parallel --link --tag 'bash -c' ::: \ - "UV3.12/bin/pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade pip" \ - "UV3.13/bin/pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade pip" + ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ + ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" # # Activate virtual env # RUN . UV3.13/bin/activate && \ From 73951ce6a774e26b3f314815e69e0bdffc4aec1d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 12:11:27 +0530 Subject: [PATCH 034/324] trying parallel venv 4 --- .github/workflows/pull-request-management.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d71478bb96c..616a418e6fa 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -164,10 +164,10 @@ jobs: # RUN . UV3.12/bin/activate && \ # UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - RUN parallel --link --tag 'bash -c' ::: \ - ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ - ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" - + RUN parallel --link --tag 'sh -c' ::: \ + ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ + ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" + # # Activate virtual env # RUN . UV3.13/bin/activate && \ # UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade From 164e7e87f67260a47de8059be23b1bfbba27ffbd Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 12:28:01 +0530 Subject: [PATCH 035/324] trying parallel venv 5 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 616a418e6fa..592408642ba 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -164,7 +164,7 @@ jobs: # RUN . UV3.12/bin/activate && \ # UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - RUN parallel --link --tag 'sh -c' ::: \ + RUN parallel --link --tag 'bash -c' ::: \ ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" From fb86f2ebed33fe94c53d56b99be27e9bcfdc2048 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 12:32:27 +0530 Subject: [PATCH 036/324] container 1 --- .github/workflows/pull-request-management.yml | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 592408642ba..f9a5fe89f2f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -160,15 +160,15 @@ jobs: # RUN . UV3.11/bin/activate && \ # UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - # Activate virtual env - # RUN . UV3.12/bin/activate && \ - # UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + Activate virtual env + RUN . UV3.12/bin/activate && \ + UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - RUN parallel --link --tag 'bash -c' ::: \ - ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ - ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" + # RUN parallel --link --tag 'bash -c' ::: \ + # ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ + # ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" - # # Activate virtual env + # # Activate virtual env # RUN . UV3.13/bin/activate && \ # UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade @@ -184,27 +184,27 @@ jobs: run: | docker push ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 - # reuse_container_image: - # name: Reuse image with ghcr credentials - # runs-on: ubuntu-latest - # needs: [container-job] - # container: - # image: ghcr.io/shivani-gslab/avd/python:0.0.1 - # credentials: - # username: ${{ github.repository_owner }} - # password: ${{ secrets.GITHUB_TOKEN }} - # steps: - # - name: Check out repository code - # uses: actions/checkout@v4 - # - name: run tests - # shell: bash - # run: | - # pwd - # ls -al - # ls -l /__w/avd/ - # source UV3.12/bin/activate - # cd ansible_collections/arista/avd - # ansible-test units -vv + reuse_container_image: + name: Reuse image with ghcr credentials + runs-on: ubuntu-latest + needs: [container-job] + container: + image: ghcr.io/shivani-gslab/avd/python:0.0.1 + credentials: + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: run tests + shell: bash + run: | + pwd + ls -al + ls -l /__w/avd/ + source UV3.12/bin/activate + cd ansible_collections/arista/avd + ansible-test units -vv reuse-ghcr-image: name: reuse first job From 0d2814cdebaeaed276baf8d81806f90229a79b23 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 12:39:15 +0530 Subject: [PATCH 037/324] container 2 --- .github/workflows/pull-request-management.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index f9a5fe89f2f..7ac11b6bb34 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -178,7 +178,9 @@ jobs: - name: Build Docker Image run: | - docker build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 . + docker buildx install + docker buildx create --use + docker buildx build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 . - name: Push Docker Image run: | From 0e16cbb5b46a5992a7d04053378946d01883d71f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 12:41:21 +0530 Subject: [PATCH 038/324] container 2 --- .github/workflows/pull-request-management.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 7ac11b6bb34..3136d1f0667 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -175,11 +175,12 @@ jobs: CMD ["python"] EOF echo "Dockerfile created successfully." + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Build Docker Image run: | - docker buildx install - docker buildx create --use docker buildx build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 . - name: Push Docker Image From 3917a5f6d3f6c1376e4075b593f63d8e36b4bbb4 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 12:46:27 +0530 Subject: [PATCH 039/324] container 4 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 3136d1f0667..b6f9cd80918 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -160,7 +160,7 @@ jobs: # RUN . UV3.11/bin/activate && \ # UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - Activate virtual env + # Activate virtual env RUN . UV3.12/bin/activate && \ UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade From 9ffd67dd22840327d664e291b4054ca1153181a5 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 14:56:13 +0530 Subject: [PATCH 040/324] container 5 --- .github/workflows/pull-request-management.yml | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index b6f9cd80918..c1e0a164c85 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -143,22 +143,22 @@ jobs: WORKDIR /avd # Create virtual env - # RUN uv venv --python 3.10 UV3.10 && \ - # UV3.10/bin/python -m ensurepip --upgrade - # RUN uv venv --python 3.11 UV3.11 && \ - # UV3.11/bin/python -m ensurepip --upgrade + RUN uv venv --python 3.10 UV3.10 && \ + UV3.10/bin/python -m ensurepip --upgrade + RUN uv venv --python 3.11 UV3.11 && \ + UV3.11/bin/python -m ensurepip --upgrade RUN uv venv --python 3.12 UV3.12 && \ UV3.12/bin/python -m ensurepip --upgrade - # RUN uv venv --python 3.13 UV3.13 && \ - # UV3.13/bin/python -m ensurepip --upgrade + RUN uv venv --python 3.13 UV3.13 && \ + UV3.13/bin/python -m ensurepip --upgrade - # # Activate virtual env - # RUN . UV3.10/bin/activate && \ - # UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # Activate virtual env + RUN . UV3.10/bin/activate && \ + UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - # # Activate virtual env - # RUN . UV3.11/bin/activate && \ - # UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # Activate virtual env + RUN . UV3.11/bin/activate && \ + UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade # Activate virtual env RUN . UV3.12/bin/activate && \ @@ -168,20 +168,17 @@ jobs: # ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ # ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" - # # Activate virtual env - # RUN . UV3.13/bin/activate && \ - # UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # Activate virtual env + RUN . UV3.13/bin/activate && \ + UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade CMD ["python"] EOF echo "Dockerfile created successfully." - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - name: Build Docker Image run: | - docker buildx build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 . + docker build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 . - name: Push Docker Image run: | From 61af208136865a0ad037533ea55e6823592c0cfc Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 15:07:05 +0530 Subject: [PATCH 041/324] container 6 --- .github/workflows/pull-request-management.yml | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index c1e0a164c85..6f2a2f16654 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -143,22 +143,22 @@ jobs: WORKDIR /avd # Create virtual env - RUN uv venv --python 3.10 UV3.10 && \ - UV3.10/bin/python -m ensurepip --upgrade - RUN uv venv --python 3.11 UV3.11 && \ - UV3.11/bin/python -m ensurepip --upgrade + # RUN uv venv --python 3.10 UV3.10 && \ + # UV3.10/bin/python -m ensurepip --upgrade + # RUN uv venv --python 3.11 UV3.11 && \ + # UV3.11/bin/python -m ensurepip --upgrade RUN uv venv --python 3.12 UV3.12 && \ UV3.12/bin/python -m ensurepip --upgrade - RUN uv venv --python 3.13 UV3.13 && \ - UV3.13/bin/python -m ensurepip --upgrade + # RUN uv venv --python 3.13 UV3.13 && \ + # UV3.13/bin/python -m ensurepip --upgrade - # Activate virtual env - RUN . UV3.10/bin/activate && \ - UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # # Activate virtual env + # RUN . UV3.10/bin/activate && \ + # UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - # Activate virtual env - RUN . UV3.11/bin/activate && \ - UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # # Activate virtual env + # RUN . UV3.11/bin/activate && \ + # UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade # Activate virtual env RUN . UV3.12/bin/activate && \ @@ -168,9 +168,9 @@ jobs: # ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ # ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" - # Activate virtual env - RUN . UV3.13/bin/activate && \ - UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # # Activate virtual env + # RUN . UV3.13/bin/activate && \ + # UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade CMD ["python"] EOF @@ -194,8 +194,6 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} steps: - - name: Check out repository code - uses: actions/checkout@v4 - name: run tests shell: bash run: | From c682221c440df201c62f72b444f657a6de60fd56 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 15:36:30 +0530 Subject: [PATCH 042/324] container 7 --- .github/workflows/pull-request-management.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6f2a2f16654..6efa9c8973e 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -120,14 +120,14 @@ jobs: env: DOCKER_CLI_EXPERIMENTAL: enabled - # Step 4: Dynamically create Dockerfile + # Dynamically create Dockerfile - name: Create Dockerfile dynamically run: | echo "Creating Dockerfile..." cat < Dockerfile FROM ubuntu:latest - # Install Git to clone the repo + # Install pre-requisites RUN apt-get update && apt-get install -y git parallel make python3-pip python3.12 # Install UV @@ -178,22 +178,24 @@ jobs: - name: Build Docker Image run: | - docker build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 . + docker build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python_avd:0.0.1 . - name: Push Docker Image run: | - docker push ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 + docker push ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python_avd:0.0.1 reuse_container_image: name: Reuse image with ghcr credentials runs-on: ubuntu-latest needs: [container-job] container: - image: ghcr.io/shivani-gslab/avd/python:0.0.1 + image: ghcr.io/shivani-gslab/avd/python_avd credentials: username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} steps: + - name: Check for dockerenv file + run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) - name: run tests shell: bash run: | @@ -237,7 +239,7 @@ jobs: - name: Run Docker Container run: | - docker run -dit --name avd-python-container ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:0.0.1 bash + docker run -dit --name avd-python-container ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python_avd:0.0.1 bash - name: Execute Ansible unit tests run: | From cc468137443ad5e5f897a43197c8b6bcac005cd4 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 15:45:10 +0530 Subject: [PATCH 043/324] container 8 --- .github/workflows/pull-request-management.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6efa9c8973e..b6ca50b7c8b 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -189,7 +189,7 @@ jobs: runs-on: ubuntu-latest needs: [container-job] container: - image: ghcr.io/shivani-gslab/avd/python_avd + image: ghcr.io/shivani-gslab/avd/python_avd:0.0.1 credentials: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} @@ -200,9 +200,8 @@ jobs: shell: bash run: | pwd - ls -al - ls -l /__w/avd/ - source UV3.12/bin/activate + ls + # source UV3.12/bin/activate cd ansible_collections/arista/avd ansible-test units -vv From 82ab11894f2449c522138a92fa6c8c8d183d67f8 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 15:59:48 +0530 Subject: [PATCH 044/324] container 9 --- .github/workflows/pull-request-management.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index b6ca50b7c8b..e32d7296756 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -196,13 +196,16 @@ jobs: steps: - name: Check for dockerenv file run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) + - name: Check out repository code + uses: actions/checkout@v4 - name: run tests shell: bash run: | pwd - ls + ls -al + ls -l /__w/avd/ # source UV3.12/bin/activate - cd ansible_collections/arista/avd + cd __w/avd/avd/ansible_collections/arista/avd ansible-test units -vv reuse-ghcr-image: From 1080af0e17f663e90bb699cb2dff28f93bb381b4 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 16:12:38 +0530 Subject: [PATCH 045/324] container 10 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index e32d7296756..93c0a130fda 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -205,7 +205,7 @@ jobs: ls -al ls -l /__w/avd/ # source UV3.12/bin/activate - cd __w/avd/avd/ansible_collections/arista/avd + cd ansible_collections/arista/avd ansible-test units -vv reuse-ghcr-image: From 2b73bed304aa9b1cac582f11d6e763ffe36f1907 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 16:33:03 +0530 Subject: [PATCH 046/324] container 11 --- .github/workflows/pull-request-management.yml | 76 +++++++++---------- 1 file changed, 36 insertions(+), 40 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 93c0a130fda..daa1e71c823 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -184,37 +184,37 @@ jobs: run: | docker push ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python_avd:0.0.1 - reuse_container_image: - name: Reuse image with ghcr credentials - runs-on: ubuntu-latest - needs: [container-job] - container: - image: ghcr.io/shivani-gslab/avd/python_avd:0.0.1 - credentials: - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: Check for dockerenv file - run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) - - name: Check out repository code - uses: actions/checkout@v4 - - name: run tests - shell: bash - run: | - pwd - ls -al - ls -l /__w/avd/ - # source UV3.12/bin/activate - cd ansible_collections/arista/avd - ansible-test units -vv + # reuse_container_image: + # name: Reuse image with ghcr credentials + # runs-on: ubuntu-latest + # needs: [container-job] + # container: + # image: ghcr.io/shivani-gslab/avd/python_avd:0.0.1 + # credentials: + # username: ${{ github.repository_owner }} + # password: ${{ secrets.GITHUB_TOKEN }} + # steps: + # - name: Check for dockerenv file + # run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) + # - name: Check out repository code + # uses: actions/checkout@v4 + # - name: run tests + # shell: bash + # run: | + # pwd + # ls -al + # ls -l /__w/avd/ + # # source UV3.12/bin/activate + # cd ansible_collections/arista/avd + # ansible-test units -vv reuse-ghcr-image: - name: reuse first job + name: Reuse first job runs-on: ubuntu-latest needs: [ container-job ] steps: - - name: Check out repository code - uses: actions/checkout@v4 + # - name: Check out repository code + # uses: actions/checkout@v4 # - name: Set up Docker # run: | # sudo apt-get update @@ -247,22 +247,18 @@ jobs: run: | docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" - # - name: Execute Ansible integration tests - # run: | - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + - name: Execute Ansible integration tests + run: | + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - # - name: Execute Ansible sanity tests - # run: | - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + - name: Execute Ansible sanity tests + run: | + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # # - name: Execute Ansible lint tests - # # run: | - # # docker exec avd-python-container bash -c "cd ansible_collections/arista/avd && ansible-test integration -vv" - - # - name: Stop and Remove Docker Container - # run: | - # docker stop avd-python-container - # docker rm avd-python-container + - name: Stop and Remove Docker Container + run: | + docker stop avd-python-container + docker rm avd-python-container From 702c728981f7c51492314369e92ef29940a7c6d8 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 10 Jan 2025 18:16:58 +0530 Subject: [PATCH 047/324] running with 2 python versions 3.12 & 3.13 --- .github/workflows/pull-request-management.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index daa1e71c823..4bd827dcf00 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -149,8 +149,8 @@ jobs: # UV3.11/bin/python -m ensurepip --upgrade RUN uv venv --python 3.12 UV3.12 && \ UV3.12/bin/python -m ensurepip --upgrade - # RUN uv venv --python 3.13 UV3.13 && \ - # UV3.13/bin/python -m ensurepip --upgrade + RUN uv venv --python 3.13 UV3.13 && \ + UV3.13/bin/python -m ensurepip --upgrade # # Activate virtual env # RUN . UV3.10/bin/activate && \ @@ -168,9 +168,9 @@ jobs: # ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ # ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" - # # Activate virtual env - # RUN . UV3.13/bin/activate && \ - # UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # Activate virtual env + RUN . UV3.13/bin/activate && \ + UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade CMD ["python"] EOF @@ -250,12 +250,12 @@ jobs: - name: Execute Ansible integration tests run: | docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - name: Execute Ansible sanity tests run: | docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - name: Stop and Remove Docker Container run: | From c8df772960114a6bcf28fd18e00da3955801c295 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 13 Jan 2025 12:34:51 +0530 Subject: [PATCH 048/324] using container attribute --- .github/workflows/pull-request-management.yml | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 4bd827dcf00..bffe459ef88 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -184,29 +184,29 @@ jobs: run: | docker push ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python_avd:0.0.1 - # reuse_container_image: - # name: Reuse image with ghcr credentials - # runs-on: ubuntu-latest - # needs: [container-job] - # container: - # image: ghcr.io/shivani-gslab/avd/python_avd:0.0.1 - # credentials: - # username: ${{ github.repository_owner }} - # password: ${{ secrets.GITHUB_TOKEN }} - # steps: - # - name: Check for dockerenv file - # run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) - # - name: Check out repository code - # uses: actions/checkout@v4 - # - name: run tests - # shell: bash - # run: | - # pwd - # ls -al - # ls -l /__w/avd/ - # # source UV3.12/bin/activate - # cd ansible_collections/arista/avd - # ansible-test units -vv + reuse_container_image: + name: Reuse image with ghcr credentials + runs-on: ubuntu-latest + needs: [container-job] + container: + image: ghcr.io/shivani-gslab/avd/python_avd:0.0.1 + credentials: + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Check for dockerenv file + run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) + - name: Check out repository code + uses: actions/checkout@v4 + - name: run tests + shell: bash + run: | + pwd + ls -al + ls -l /__w/avd/ + # source UV3.12/bin/activate + cd ansible_collections/arista/avd + ansible-test units -vv reuse-ghcr-image: name: Reuse first job From 87130260dcea73d4cb03d9be4083c271edbf9795 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 13 Jan 2025 12:52:32 +0530 Subject: [PATCH 049/324] trying new way for lowercase --- .github/workflows/pull-request-management.yml | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index bffe459ef88..df8ff27560d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -220,19 +220,25 @@ jobs: # sudo apt-get update # sudo apt-get install -y docker.io - - id: string - uses: vishalmamidi/lowercase-action@v1 - with: - string: ${{ github.repository_owner }} + # - id: string + # uses: vishalmamidi/lowercase-action@v1 + # with: + # string: ${{ github.repository_owner }} - - name: log lowercase repo name - run: echo ${{ steps.string.outputs.lowercase }} + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]' > lowercase_username.txt + echo "::set-output name=lowercase::$(cat lowercase_username.txt)" + + - name: log lowercase repo owner name + run: echo ${{ steps.lowercase.outputs.lowercase }} - name: Log in to GitHub Container Registry uses: docker/login-action@v2 with: registry: ghcr.io - username: ${{ steps.string.outputs.lowercase }} + username: ${{ steps.lowercase.outputs.lowercase }} password: ${{ secrets.GITHUB_TOKEN }} # - name: Pull docker image from ghcr @@ -241,7 +247,7 @@ jobs: - name: Run Docker Container run: | - docker run -dit --name avd-python-container ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python_avd:0.0.1 bash + docker run -dit --name avd-python-container ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 bash - name: Execute Ansible unit tests run: | From 6082a4f6807f967b72b996a3925d071a102d4949 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 13 Jan 2025 17:30:36 +0530 Subject: [PATCH 050/324] built wheel package in specific directory --- .github/workflows/pull-request-management.yml | 217 ++++++++---------- 1 file changed, 102 insertions(+), 115 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index df8ff27560d..a46872b21b2 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -103,22 +103,17 @@ jobs: apt-get update apt-get install -y docker.io - - id: string - uses: vishalmamidi/lowercase-action@v1 - with: - string: ${{ github.repository_owner }} - - - name: log lowercase repo name - run: echo ${{ steps.string.outputs.lowercase }} + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - name: Log in to GitHub Container Registry uses: docker/login-action@v2 with: registry: ghcr.io - username: ${{ steps.string.outputs.lowercase }} + username: ${{ steps.lowercase.outputs.lowercase }} password: ${{ secrets.GITHUB_TOKEN }} - env: - DOCKER_CLI_EXPERIMENTAL: enabled # Dynamically create Dockerfile - name: Create Dockerfile dynamically @@ -142,129 +137,121 @@ jobs: WORKDIR /avd - # Create virtual env - # RUN uv venv --python 3.10 UV3.10 && \ - # UV3.10/bin/python -m ensurepip --upgrade - # RUN uv venv --python 3.11 UV3.11 && \ - # UV3.11/bin/python -m ensurepip --upgrade - RUN uv venv --python 3.12 UV3.12 && \ - UV3.12/bin/python -m ensurepip --upgrade - RUN uv venv --python 3.13 UV3.13 && \ - UV3.13/bin/python -m ensurepip --upgrade + # Build the wheel package + RUN pip install -r .github/requirements-ci.txt --upgrade && \ + mkdir -p /wheels && \ + find / -name "pyavd*.whl" -exec mv {} /wheels/ \; && \ + echo "Wheel packages moved to /wheels:" && \ + ls -al /wheels && \ + test "$(ls -A /wheels)" || (echo "No wheel package found in /wheels!" && exit 1) - # # Activate virtual env - # RUN . UV3.10/bin/activate && \ - # UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # # Create virtual env + # # RUN uv venv --python 3.10 UV3.10 && \ + # # UV3.10/bin/python -m ensurepip --upgrade + # # RUN uv venv --python 3.11 UV3.11 && \ + # # UV3.11/bin/python -m ensurepip --upgrade + # RUN uv venv --python 3.12 UV3.12 && \ + # UV3.12/bin/python -m ensurepip --upgrade + # RUN uv venv --python 3.13 UV3.13 && \ + # UV3.13/bin/python -m ensurepip --upgrade + + # # # Activate virtual env + # # RUN . UV3.10/bin/activate && \ + # # UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - # # Activate virtual env - # RUN . UV3.11/bin/activate && \ - # UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # # # Activate virtual env + # # RUN . UV3.11/bin/activate && \ + # # UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - # Activate virtual env - RUN . UV3.12/bin/activate && \ - UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # # Activate virtual env + # RUN . UV3.12/bin/activate && \ + # UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - # RUN parallel --link --tag 'bash -c' ::: \ - # ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ - # ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" + # # RUN parallel --link --tag 'bash -c' ::: \ + # # ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ + # # ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" - # Activate virtual env - RUN . UV3.13/bin/activate && \ - UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # # Activate virtual env + # RUN . UV3.13/bin/activate && \ + # UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade CMD ["python"] EOF echo "Dockerfile created successfully." - - name: Build Docker Image - run: | - docker build -t ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python_avd:0.0.1 . - - - name: Push Docker Image - run: | - docker push ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python_avd:0.0.1 - - reuse_container_image: - name: Reuse image with ghcr credentials - runs-on: ubuntu-latest - needs: [container-job] - container: - image: ghcr.io/shivani-gslab/avd/python_avd:0.0.1 - credentials: - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: Check for dockerenv file - run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) - - name: Check out repository code - uses: actions/checkout@v4 - - name: run tests - shell: bash - run: | - pwd - ls -al - ls -l /__w/avd/ - # source UV3.12/bin/activate - cd ansible_collections/arista/avd - ansible-test units -vv + # - name: Build Docker Image + # run: | + # docker build -t ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 . - reuse-ghcr-image: - name: Reuse first job - runs-on: ubuntu-latest - needs: [ container-job ] - steps: - # - name: Check out repository code - # uses: actions/checkout@v4 - # - name: Set up Docker + # - name: Push Docker Image # run: | - # sudo apt-get update - # sudo apt-get install -y docker.io - - # - id: string - # uses: vishalmamidi/lowercase-action@v1 - # with: - # string: ${{ github.repository_owner }} - - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]' > lowercase_username.txt - echo "::set-output name=lowercase::$(cat lowercase_username.txt)" + # docker push ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 - - name: log lowercase repo owner name - run: echo ${{ steps.lowercase.outputs.lowercase }} + # reuse_container_image: + # name: Reuse image with ghcr credentials + # runs-on: ubuntu-latest + # needs: [container-job] + # container: + # image: ghcr.io/shivani-gslab/avd/python_avd:0.0.1 + # credentials: + # username: ${{ github.repository_owner }} + # password: ${{ secrets.GITHUB_TOKEN }} + # steps: + # - name: Check for dockerenv file + # run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) + # - name: Check out repository code + # uses: actions/checkout@v4 + # - name: run tests + # shell: bash + # run: | + # pwd + # ls -al + # ls -l /__w/avd/ + # # source UV3.12/bin/activate + # cd ansible_collections/arista/avd + # ansible-test units -vv - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} + # reuse-ghcr-image: + # name: Reuse first job + # runs-on: ubuntu-latest + # needs: [ container-job ] + # steps: + # - name: Convert GitHub username to lowercase + # id: lowercase + # run: | + # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - # - name: Pull docker image from ghcr - # run: | - # docker pull ghcr.io/${{ steps.string.outputs.lowercase }}/avd/python:3.12 + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v2 + # with: + # registry: ghcr.io + # username: ${{ steps.lowercase.outputs.lowercase }} + # password: ${{ secrets.GITHUB_TOKEN }} - - name: Run Docker Container - run: | - docker run -dit --name avd-python-container ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 bash + # # - name: Pull docker image from ghcr + # # run: | + # # docker pull ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python:3.12 + + # - name: Run Docker Container + # run: | + # docker run -dit --name avd-python-container ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 bash - - name: Execute Ansible unit tests - run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" + # - name: Execute Ansible unit tests + # run: | + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" - - name: Execute Ansible integration tests - run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + # - name: Execute Ansible integration tests + # run: | + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - - name: Execute Ansible sanity tests - run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # - name: Execute Ansible sanity tests + # run: | + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - - name: Stop and Remove Docker Container - run: | - docker stop avd-python-container - docker rm avd-python-container + # - name: Stop and Remove Docker Container + # run: | + # docker stop avd-python-container + # docker rm avd-python-container From efc9405fceb963cc8c8ae26e60f79f5199900d5f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 13 Jan 2025 18:05:01 +0530 Subject: [PATCH 051/324] build wheel --- .github/workflows/pull-request-management.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index a46872b21b2..174544f418b 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -138,12 +138,10 @@ jobs: WORKDIR /avd # Build the wheel package - RUN pip install -r .github/requirements-ci.txt --upgrade && \ - mkdir -p /wheels && \ - find / -name "pyavd*.whl" -exec mv {} /wheels/ \; && \ - echo "Wheel packages moved to /wheels:" && \ - ls -al /wheels && \ - test "$(ls -A /wheels)" || (echo "No wheel package found in /wheels!" && exit 1) + RUN cd python-avd && \ + pip3 install build + python3 -m build --wheel + # # Create virtual env # # RUN uv venv --python 3.10 UV3.10 && \ @@ -179,9 +177,9 @@ jobs: EOF echo "Dockerfile created successfully." - # - name: Build Docker Image - # run: | - # docker build -t ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 . + - name: Build Docker Image + run: | + docker build -t ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 . # - name: Push Docker Image # run: | From 8577f2af3754c9eb52f3b7f4253611aa165efcf9 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 13 Jan 2025 18:06:28 +0530 Subject: [PATCH 052/324] build wheel --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 174544f418b..773fe9c9ae8 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -139,8 +139,8 @@ jobs: # Build the wheel package RUN cd python-avd && \ - pip3 install build - python3 -m build --wheel + pip install build + python -m build --wheel # # Create virtual env From e2900e92ef92568b4027c12380924d662a4933ef Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 13 Jan 2025 18:13:46 +0530 Subject: [PATCH 053/324] build wheel --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 773fe9c9ae8..6e121cd7407 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -140,7 +140,7 @@ jobs: # Build the wheel package RUN cd python-avd && \ pip install build - python -m build --wheel + python3.12 -m build --wheel # # Create virtual env From 785838683a0f8bd92583801e9bc52024aaead5e1 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 13:28:05 +0530 Subject: [PATCH 054/324] install wheel package --- .github/workflows/pull-request-management.yml | 123 +++++++++--------- 1 file changed, 63 insertions(+), 60 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6e121cd7407..c63487c72a8 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -139,19 +139,19 @@ jobs: # Build the wheel package RUN cd python-avd && \ - pip install build - python3.12 -m build --wheel - - - # # Create virtual env - # # RUN uv venv --python 3.10 UV3.10 && \ - # # UV3.10/bin/python -m ensurepip --upgrade - # # RUN uv venv --python 3.11 UV3.11 && \ - # # UV3.11/bin/python -m ensurepip --upgrade - # RUN uv venv --python 3.12 UV3.12 && \ - # UV3.12/bin/python -m ensurepip --upgrade - # RUN uv venv --python 3.13 UV3.13 && \ - # UV3.13/bin/python -m ensurepip --upgrade + python3 -m pip install --break-system-packages build && \ + python3 -m build --wheel --outdir /tmp/wheels + + WORKDIR / + # Create virtual env + # RUN uv venv --python 3.10 UV3.10 && \ + # UV3.10/bin/python -m ensurepip --upgrade + # RUN uv venv --python 3.11 UV3.11 && \ + # UV3.11/bin/python -m ensurepip --upgrade + RUN uv venv --python 3.12 UV3.12 && \ + UV3.12/bin/python -m ensurepip --upgrade + RUN uv venv --python 3.13 UV3.13 && \ + UV3.13/bin/python -m ensurepip --upgrade # # # Activate virtual env # # RUN . UV3.10/bin/activate && \ @@ -161,18 +161,21 @@ jobs: # # RUN . UV3.11/bin/activate && \ # # UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - # # Activate virtual env - # RUN . UV3.12/bin/activate && \ - # UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - + # Activate virtual env + RUN . UV3.12/bin/activate && \ + cd avd/ && \ + ../UV3.12/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + # # RUN parallel --link --tag 'bash -c' ::: \ # # ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ # # ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" - # # Activate virtual env - # RUN . UV3.13/bin/activate && \ - # UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - + # Activate virtual env + RUN . UV3.13/bin/activate && \ + cd avd/ && \ + ../UV3.13/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + -r ansible_collections/arista/avd/requirements-dev.txt --upgrade CMD ["python"] EOF echo "Dockerfile created successfully." @@ -181,9 +184,9 @@ jobs: run: | docker build -t ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 . - # - name: Push Docker Image - # run: | - # docker push ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 + - name: Push Docker Image + run: | + docker push ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 # reuse_container_image: # name: Reuse image with ghcr credentials @@ -209,47 +212,47 @@ jobs: # cd ansible_collections/arista/avd # ansible-test units -vv - # reuse-ghcr-image: - # name: Reuse first job - # runs-on: ubuntu-latest - # needs: [ container-job ] - # steps: - # - name: Convert GitHub username to lowercase - # id: lowercase - # run: | - # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + reuse-ghcr-image: + name: Reuse first job + runs-on: ubuntu-latest + needs: [ container-job ] + steps: + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - # - name: Log in to GitHub Container Registry - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ steps.lowercase.outputs.lowercase }} - # password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} - # # - name: Pull docker image from ghcr - # # run: | - # # docker pull ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python:3.12 + # - name: Pull docker image from ghcr + # run: | + # docker pull ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python:3.12 - # - name: Run Docker Container - # run: | - # docker run -dit --name avd-python-container ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 bash + - name: Run Docker Container + run: | + docker run -dit --name avd-python-container ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 bash - # - name: Execute Ansible unit tests - # run: | - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" + - name: Execute Ansible unit tests + run: | + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" - # - name: Execute Ansible integration tests - # run: | - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + - name: Execute Ansible integration tests + run: | + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - # - name: Execute Ansible sanity tests - # run: | - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + - name: Execute Ansible sanity tests + run: | + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # - name: Stop and Remove Docker Container - # run: | - # docker stop avd-python-container - # docker rm avd-python-container + - name: Stop and Remove Docker Container + run: | + docker stop avd-python-container + docker rm avd-python-container From 004c8e5c3c8280e5351a009094bb2dea0d90184b Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 13:44:12 +0530 Subject: [PATCH 055/324] run reuse job --- .github/workflows/pull-request-management.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index c63487c72a8..80eb4e5fafa 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -239,17 +239,17 @@ jobs: - name: Execute Ansible unit tests run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test units -vv" + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test units -vv" - name: Execute Ansible integration tests run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" + docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" - name: Execute Ansible sanity tests run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - name: Stop and Remove Docker Container run: | From eebb584551f7691194a34a8cc99fdba45bff1960 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 13:46:08 +0530 Subject: [PATCH 056/324] cache dir --- .github/workflows/pull-request-management.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 80eb4e5fafa..68451717278 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -131,6 +131,9 @@ jobs: # Install python versions RUN uv python install 3.10 3.11 3.12 3.13 + # Create a directory to store cached dependencies + ENV PIP_CACHE_DIR=/cache + RUN mkdir -p /cache # Clone the repository in the Docker image RUN git clone https://github.com/${{ github.repository }} @@ -164,7 +167,7 @@ jobs: # Activate virtual env RUN . UV3.12/bin/activate && \ cd avd/ && \ - ../UV3.12/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + ../UV3.12/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR /tmp/wheels/*.whl mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ -r ansible_collections/arista/avd/requirements-dev.txt --upgrade # # RUN parallel --link --tag 'bash -c' ::: \ @@ -174,7 +177,7 @@ jobs: # Activate virtual env RUN . UV3.13/bin/activate && \ cd avd/ && \ - ../UV3.13/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + ../UV3.13/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR /tmp/wheels/*.whl mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ -r ansible_collections/arista/avd/requirements-dev.txt --upgrade CMD ["python"] EOF From d04631e4f9776c16e93d884e2468a79707eeefc8 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 14:29:29 +0530 Subject: [PATCH 057/324] installing pyavd later --- .github/workflows/pull-request-management.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 68451717278..399fced11e1 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -167,8 +167,8 @@ jobs: # Activate virtual env RUN . UV3.12/bin/activate && \ cd avd/ && \ - ../UV3.12/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR /tmp/wheels/*.whl mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + ../UV3.12/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + -r ansible_collections/arista/avd/requirements-dev.txt /tmp/wheels/*.whl --upgrade # # RUN parallel --link --tag 'bash -c' ::: \ # # ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ @@ -177,8 +177,8 @@ jobs: # Activate virtual env RUN . UV3.13/bin/activate && \ cd avd/ && \ - ../UV3.13/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR /tmp/wheels/*.whl mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + ../UV3.13/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + -r ansible_collections/arista/avd/requirements-dev.txt /tmp/wheels/*.whl --upgrade CMD ["python"] EOF echo "Dockerfile created successfully." From ef29941d496799e41a290132363ccbd4d0eec641 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 14:37:41 +0530 Subject: [PATCH 058/324] install pyavd from python-avd --- .github/workflows/pull-request-management.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 399fced11e1..38a6424a025 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -143,7 +143,8 @@ jobs: # Build the wheel package RUN cd python-avd && \ python3 -m pip install --break-system-packages build && \ - python3 -m build --wheel --outdir /tmp/wheels + python3 -m build --wheel + # python3 -m build --wheel --outdir /tmp/wheels WORKDIR / # Create virtual env @@ -168,7 +169,7 @@ jobs: RUN . UV3.12/bin/activate && \ cd avd/ && \ ../UV3.12/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r ansible_collections/arista/avd/requirements-dev.txt /tmp/wheels/*.whl --upgrade + -r ansible_collections/arista/avd/requirements-dev.txt python-avd/dist/*.whl --upgrade # # RUN parallel --link --tag 'bash -c' ::: \ # # ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ @@ -178,7 +179,7 @@ jobs: RUN . UV3.13/bin/activate && \ cd avd/ && \ ../UV3.13/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r ansible_collections/arista/avd/requirements-dev.txt /tmp/wheels/*.whl --upgrade + -r ansible_collections/arista/avd/requirements-dev.txt python-avd/dist/*.whl --upgrade CMD ["python"] EOF echo "Dockerfile created successfully." From 283613e12c3ca8f3f90967a00b4577b7997a25c3 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 14:47:17 +0530 Subject: [PATCH 059/324] install pyavd2 --- .github/workflows/pull-request-management.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 38a6424a025..2ff7273eb0c 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -92,7 +92,7 @@ jobs: # python-version: [3.12] # Python versions # Docker Hub image that `container-job` executes in container: - image: ubuntu:latest + image: ubuntu:20.04-slim options: --cpus 1 steps: @@ -120,10 +120,10 @@ jobs: run: | echo "Creating Dockerfile..." cat < Dockerfile - FROM ubuntu:latest + FROM ubuntu:20.04-slim # Install pre-requisites - RUN apt-get update && apt-get install -y git parallel make python3-pip python3.12 + RUN apt-get update && apt-get install -y --no-install-recommends git make python3-pip # Install UV RUN pip install uv --break-system-packages @@ -169,7 +169,8 @@ jobs: RUN . UV3.12/bin/activate && \ cd avd/ && \ ../UV3.12/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r ansible_collections/arista/avd/requirements-dev.txt python-avd/dist/*.whl --upgrade + -r ansible_collections/arista/avd/requirements-dev.txt python-avd/dist/*.whl --upgrade && \ + ../UV3.13/bin/python -m pip install python-avd/dist/*.whl # # RUN parallel --link --tag 'bash -c' ::: \ # # ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ @@ -179,7 +180,9 @@ jobs: RUN . UV3.13/bin/activate && \ cd avd/ && \ ../UV3.13/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r ansible_collections/arista/avd/requirements-dev.txt python-avd/dist/*.whl --upgrade + -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ + ../UV3.13/bin/python -m pip installpython-avd/dist/*.whl + CMD ["python"] EOF echo "Dockerfile created successfully." From b828f3b322615cb738d487354cc95ea882a3b369 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 14:53:04 +0530 Subject: [PATCH 060/324] install pyavd3 --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 2ff7273eb0c..c3a8a9a58c2 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -92,7 +92,7 @@ jobs: # python-version: [3.12] # Python versions # Docker Hub image that `container-job` executes in container: - image: ubuntu:20.04-slim + image: ubuntu:latest options: --cpus 1 steps: @@ -120,7 +120,7 @@ jobs: run: | echo "Creating Dockerfile..." cat < Dockerfile - FROM ubuntu:20.04-slim + FROM ubuntu:latest # Install pre-requisites RUN apt-get update && apt-get install -y --no-install-recommends git make python3-pip From 136d67e19b9391d6a0b5bed57cdb132c942b6a35 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 14:59:41 +0530 Subject: [PATCH 061/324] install pyavd4 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index c3a8a9a58c2..ae7aa04546f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -181,7 +181,7 @@ jobs: cd avd/ && \ ../UV3.13/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - ../UV3.13/bin/python -m pip installpython-avd/dist/*.whl + ../UV3.13/bin/python -m pip install python-avd/dist/*.whl CMD ["python"] EOF From 50618d638924178482f7a4eec3dad10bf0b0934f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 15:56:52 +0530 Subject: [PATCH 062/324] install pyavd5 --- .github/workflows/pull-request-management.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index ae7aa04546f..6f31c73e3f8 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -143,7 +143,7 @@ jobs: # Build the wheel package RUN cd python-avd && \ python3 -m pip install --break-system-packages build && \ - python3 -m build --wheel + python3 -m build --wheel --outdir /tmp/wheels # python3 -m build --wheel --outdir /tmp/wheels WORKDIR / @@ -170,7 +170,7 @@ jobs: cd avd/ && \ ../UV3.12/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ -r ansible_collections/arista/avd/requirements-dev.txt python-avd/dist/*.whl --upgrade && \ - ../UV3.13/bin/python -m pip install python-avd/dist/*.whl + ../UV3.13/bin/python -m pip install /tmp/wheels/*.whl # # RUN parallel --link --tag 'bash -c' ::: \ # # ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ @@ -181,7 +181,7 @@ jobs: cd avd/ && \ ../UV3.13/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - ../UV3.13/bin/python -m pip install python-avd/dist/*.whl + ../UV3.13/bin/python -m pip install /tmp/wheels/*.whl CMD ["python"] EOF From 2db8af46b7243423e56fa2b9dcf18e6a904a08a5 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 16:06:16 +0530 Subject: [PATCH 063/324] install pyavd6 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6f31c73e3f8..01226f09ae3 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -169,7 +169,7 @@ jobs: RUN . UV3.12/bin/activate && \ cd avd/ && \ ../UV3.12/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r ansible_collections/arista/avd/requirements-dev.txt python-avd/dist/*.whl --upgrade && \ + -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ ../UV3.13/bin/python -m pip install /tmp/wheels/*.whl # # RUN parallel --link --tag 'bash -c' ::: \ From ac0d8217fbd353afac3956d2262eae785c91323d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 16:16:11 +0530 Subject: [PATCH 064/324] install pyavd7 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 01226f09ae3..fb7eebbb307 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -123,7 +123,7 @@ jobs: FROM ubuntu:latest # Install pre-requisites - RUN apt-get update && apt-get install -y --no-install-recommends git make python3-pip + RUN apt-get update && apt-get install -y --no-install-recommends openssh-client git make python3-pip # Install UV RUN pip install uv --break-system-packages From a20a1d7429a8becd42268aa24bd9e2c04c507eb6 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 16:34:19 +0530 Subject: [PATCH 065/324] install pyavd8 --- .github/workflows/pull-request-management.yml | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index fb7eebbb307..9b144660dcf 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -144,37 +144,38 @@ jobs: RUN cd python-avd && \ python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels - # python3 -m build --wheel --outdir /tmp/wheels WORKDIR / # Create virtual env - # RUN uv venv --python 3.10 UV3.10 && \ - # UV3.10/bin/python -m ensurepip --upgrade - # RUN uv venv --python 3.11 UV3.11 && \ - # UV3.11/bin/python -m ensurepip --upgrade + RUN uv venv --python 3.10 UV3.10 && \ + UV3.10/bin/python -m ensurepip --upgrade + RUN uv venv --python 3.11 UV3.11 && \ + UV3.11/bin/python -m ensurepip --upgrade RUN uv venv --python 3.12 UV3.12 && \ UV3.12/bin/python -m ensurepip --upgrade RUN uv venv --python 3.13 UV3.13 && \ UV3.13/bin/python -m ensurepip --upgrade - # # # Activate virtual env - # # RUN . UV3.10/bin/activate && \ - # # UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - - # # # Activate virtual env - # # RUN . UV3.11/bin/activate && \ - # # UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - + # # Activate virtual env + RUN . UV3.12/bin/activate && \ + cd avd/ && \ + ../UV3.10/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ + ../UV3.10/bin/python -m pip install /tmp/wheels/*.whl + + # # Activate virtual env + RUN . UV3.12/bin/activate && \ + cd avd/ && \ + ../UV3.11/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ + ../UV3.11/bin/python -m pip install /tmp/wheels/*.whl + # Activate virtual env RUN . UV3.12/bin/activate && \ cd avd/ && \ ../UV3.12/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - ../UV3.13/bin/python -m pip install /tmp/wheels/*.whl - - # # RUN parallel --link --tag 'bash -c' ::: \ - # # ". UV3.12/bin/activate && UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" \ - # # ". UV3.13/bin/activate && UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml 'ansible-core<2.19.0' -r .github/requirements-ci.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade" + ../UV3.12/bin/python -m pip install /tmp/wheels/*.whl # Activate virtual env RUN . UV3.13/bin/activate && \ From 73f5227a0bc2f578e0a6ce6884cc347ca1cc13b3 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 16:35:35 +0530 Subject: [PATCH 066/324] install pyavd9 --- .github/workflows/pull-request-management.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 9b144660dcf..5900437aa8d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -245,18 +245,24 @@ jobs: run: | docker run -dit --name avd-python-container ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 bash - - name: Execute Ansible unit tests + - name: Execute Ansible unit tests 3.12 run: | docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test units -vv" - - name: Execute Ansible integration tests + - name: Execute Ansible integration tests 3.12 run: | docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" + + - name: Execute Ansible integration tests 3.13 + run: | docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" - - name: Execute Ansible sanity tests + - name: Execute Ansible sanity tests 3.12 run: | docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + + - name: Execute Ansible sanity tests 3.13 + run: | docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - name: Stop and Remove Docker Container From 5d902fba710d34523059cd4f6522815c0ec704f2 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 14 Jan 2025 16:57:42 +0530 Subject: [PATCH 067/324] install pyavd10 --- .github/workflows/pull-request-management.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 5900437aa8d..f4e15818848 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -123,7 +123,7 @@ jobs: FROM ubuntu:latest # Install pre-requisites - RUN apt-get update && apt-get install -y --no-install-recommends openssh-client git make python3-pip + RUN apt-get update && apt-get install -y --no-install-recommends openssh-client git make python3-pip && apt-get clean # Install UV RUN pip install uv --break-system-packages @@ -159,14 +159,14 @@ jobs: # # Activate virtual env RUN . UV3.12/bin/activate && \ cd avd/ && \ - ../UV3.10/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + ../UV3.10/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR "ansible-core<2.19.0" \ -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ ../UV3.10/bin/python -m pip install /tmp/wheels/*.whl # # Activate virtual env RUN . UV3.12/bin/activate && \ cd avd/ && \ - ../UV3.11/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + ../UV3.11/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR "ansible-core<2.19.0" \ -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ ../UV3.11/bin/python -m pip install /tmp/wheels/*.whl @@ -180,7 +180,7 @@ jobs: # Activate virtual env RUN . UV3.13/bin/activate && \ cd avd/ && \ - ../UV3.13/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + ../UV3.13/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR "ansible-core<2.19.0" \ -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ ../UV3.13/bin/python -m pip install /tmp/wheels/*.whl From 6c06ca320d5ffdfdeacae6be4aa0323aaeae7a62 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 12:42:33 +0530 Subject: [PATCH 068/324] python image --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index f4e15818848..142f4932dc8 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -120,7 +120,7 @@ jobs: run: | echo "Creating Dockerfile..." cat < Dockerfile - FROM ubuntu:latest + FROM python:3.11-slim # Install pre-requisites RUN apt-get update && apt-get install -y --no-install-recommends openssh-client git make python3-pip && apt-get clean From 841199a026e900d972d3d9a83ec6044ceadd8ea3 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 13:06:09 +0530 Subject: [PATCH 069/324] python image 1 --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 142f4932dc8..4c4b6dcdae2 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -120,7 +120,7 @@ jobs: run: | echo "Creating Dockerfile..." cat < Dockerfile - FROM python:3.11-slim + FROM python:3.13-slim # Install pre-requisites RUN apt-get update && apt-get install -y --no-install-recommends openssh-client git make python3-pip && apt-get clean @@ -222,7 +222,7 @@ jobs: reuse-ghcr-image: name: Reuse first job - runs-on: ubuntu-latest + runs-on: python:3.13-slim needs: [ container-job ] steps: - name: Convert GitHub username to lowercase From 1e5b9669030c9113f935682ade15b811888f7332 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 15:18:18 +0530 Subject: [PATCH 070/324] python image 2 --- .github/workflows/pull-request-management.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 4c4b6dcdae2..5471dc452d3 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -245,21 +245,21 @@ jobs: run: | docker run -dit --name avd-python-container ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 bash - - name: Execute Ansible unit tests 3.12 - run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test units -vv" + # - name: Execute Ansible unit tests 3.12 + # run: | + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test units -vv" - - name: Execute Ansible integration tests 3.12 - run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" + # - name: Execute Ansible integration tests 3.12 + # run: | + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" - name: Execute Ansible integration tests 3.13 run: | docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" - - name: Execute Ansible sanity tests 3.12 - run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # - name: Execute Ansible sanity tests 3.12 + # run: | + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - name: Execute Ansible sanity tests 3.13 run: | From a7be6b94535eb675fddd9b6552f5bc6580d7ed8f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 16:55:06 +0530 Subject: [PATCH 071/324] python image 3 --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 5471dc452d3..7b356978239 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -120,7 +120,7 @@ jobs: run: | echo "Creating Dockerfile..." cat < Dockerfile - FROM python:3.13-slim + FROM ubuntu:latest # Install pre-requisites RUN apt-get update && apt-get install -y --no-install-recommends openssh-client git make python3-pip && apt-get clean @@ -222,7 +222,7 @@ jobs: reuse-ghcr-image: name: Reuse first job - runs-on: python:3.13-slim + runs-on: ubuntu-latest needs: [ container-job ] steps: - name: Convert GitHub username to lowercase From 50f0a46957ed34155b38de77e62f3adef6fee446 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 17:02:19 +0530 Subject: [PATCH 072/324] python image 4 --- .github/workflows/pull-request-management.yml | 82 ++++++++++--------- 1 file changed, 45 insertions(+), 37 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 7b356978239..310b6669c4d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -123,7 +123,7 @@ jobs: FROM ubuntu:latest # Install pre-requisites - RUN apt-get update && apt-get install -y --no-install-recommends openssh-client git make python3-pip && apt-get clean + RUN apt-get update && apt-get install -y --no-install-recommends openssh-client git make python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* # Install UV RUN pip install uv --break-system-packages @@ -138,51 +138,59 @@ jobs: # Clone the repository in the Docker image RUN git clone https://github.com/${{ github.repository }} - WORKDIR /avd + WORKDIR /avd/python-avd # Build the wheel package - RUN cd python-avd && \ - python3 -m pip install --break-system-packages build && \ + RUN python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels WORKDIR / - # Create virtual env - RUN uv venv --python 3.10 UV3.10 && \ - UV3.10/bin/python -m ensurepip --upgrade - RUN uv venv --python 3.11 UV3.11 && \ - UV3.11/bin/python -m ensurepip --upgrade - RUN uv venv --python 3.12 UV3.12 && \ - UV3.12/bin/python -m ensurepip --upgrade - RUN uv venv --python 3.13 UV3.13 && \ - UV3.13/bin/python -m ensurepip --upgrade - # # Activate virtual env - RUN . UV3.12/bin/activate && \ - cd avd/ && \ - ../UV3.10/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR "ansible-core<2.19.0" \ - -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - ../UV3.10/bin/python -m pip install /tmp/wheels/*.whl + RUN for PYVER in 3.10 3.11 3.12 3.13; do \ + uv venv --python \$PYVER /venvs/UV\$PYVER && \ + /venvs/UV\$PYVER/bin/python -m ensurepip --upgrade && \ + /venvs/UV\$PYVER/bin/python -m pip install --cache-dir=\${PIP_CACHE_DIR} \ + mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + -r /avd/ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ + /venvs/UV\$PYVER/bin/python -m pip install --cache-dir=\${PIP_CACHE_DIR} /tmp/wheels/*.whl; \ + done + # # Create virtual env + # RUN uv venv --python 3.10 UV3.10 && \ + # UV3.10/bin/python -m ensurepip --upgrade + # RUN uv venv --python 3.11 UV3.11 && \ + # UV3.11/bin/python -m ensurepip --upgrade + # RUN uv venv --python 3.12 UV3.12 && \ + # UV3.12/bin/python -m ensurepip --upgrade + # RUN uv venv --python 3.13 UV3.13 && \ + # UV3.13/bin/python -m ensurepip --upgrade - # # Activate virtual env - RUN . UV3.12/bin/activate && \ - cd avd/ && \ - ../UV3.11/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR "ansible-core<2.19.0" \ - -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - ../UV3.11/bin/python -m pip install /tmp/wheels/*.whl + # # # Activate virtual env + # RUN . UV3.12/bin/activate && \ + # cd avd/ && \ + # ../UV3.10/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR "ansible-core<2.19.0" \ + # -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ + # ../UV3.10/bin/python -m pip install /tmp/wheels/*.whl - # Activate virtual env - RUN . UV3.12/bin/activate && \ - cd avd/ && \ - ../UV3.12/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - ../UV3.12/bin/python -m pip install /tmp/wheels/*.whl + # # # Activate virtual env + # RUN . UV3.12/bin/activate && \ + # cd avd/ && \ + # ../UV3.11/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR "ansible-core<2.19.0" \ + # -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ + # ../UV3.11/bin/python -m pip install /tmp/wheels/*.whl - # Activate virtual env - RUN . UV3.13/bin/activate && \ - cd avd/ && \ - ../UV3.13/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR "ansible-core<2.19.0" \ - -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - ../UV3.13/bin/python -m pip install /tmp/wheels/*.whl + # # Activate virtual env + # RUN . UV3.12/bin/activate && \ + # cd avd/ && \ + # ../UV3.12/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + # -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ + # ../UV3.12/bin/python -m pip install /tmp/wheels/*.whl + + # # Activate virtual env + # RUN . UV3.13/bin/activate && \ + # cd avd/ && \ + # ../UV3.13/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR "ansible-core<2.19.0" \ + # -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ + # ../UV3.13/bin/python -m pip install /tmp/wheels/*.whl CMD ["python"] EOF From 3e01110f8589c0802f4403005834c0182eae13e2 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 17:10:16 +0530 Subject: [PATCH 073/324] python image 5 --- .github/workflows/pull-request-management.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 310b6669c4d..f8cae10bf08 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -260,7 +260,11 @@ jobs: # - name: Execute Ansible integration tests 3.12 # run: | # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" - + - name: print pwd + run: | + pwd + ls + - name: Execute Ansible integration tests 3.13 run: | docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" From 10374d42277c800d395f4b2ebeee8b1a81d2dd21 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 17:11:14 +0530 Subject: [PATCH 074/324] python image 6 --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index f8cae10bf08..993b2015be3 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -146,7 +146,7 @@ jobs: WORKDIR / - RUN for PYVER in 3.10 3.11 3.12 3.13; do \ + RUN for PYVER in 3.12 3.13; do \ uv venv --python \$PYVER /venvs/UV\$PYVER && \ /venvs/UV\$PYVER/bin/python -m ensurepip --upgrade && \ /venvs/UV\$PYVER/bin/python -m pip install --cache-dir=\${PIP_CACHE_DIR} \ @@ -264,7 +264,7 @@ jobs: run: | pwd ls - + - name: Execute Ansible integration tests 3.13 run: | docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" From cff86fd17531f643286e183496b399a0dad845d6 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 17:17:08 +0530 Subject: [PATCH 075/324] python image 7 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 993b2015be3..c6551655be9 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -267,7 +267,7 @@ jobs: - name: Execute Ansible integration tests 3.13 run: | - docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" + docker exec avd-python-container bash -c "source ../UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" # - name: Execute Ansible sanity tests 3.12 # run: | From 00dc58fccc6f4e2cfd13b55ffb919430142c99aa Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 17:26:36 +0530 Subject: [PATCH 076/324] python image 8 --- .github/workflows/pull-request-management.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index c6551655be9..08ad4583976 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -147,12 +147,12 @@ jobs: WORKDIR / RUN for PYVER in 3.12 3.13; do \ - uv venv --python \$PYVER /venvs/UV\$PYVER && \ - /venvs/UV\$PYVER/bin/python -m ensurepip --upgrade && \ - /venvs/UV\$PYVER/bin/python -m pip install --cache-dir=\${PIP_CACHE_DIR} \ + uv venv --python \$PYVER UV\$PYVER && \ + UV\$PYVER/bin/python -m ensurepip --upgrade && \ + UV\$PYVER/bin/python -m pip install --cache-dir=\${PIP_CACHE_DIR} \ mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ -r /avd/ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - /venvs/UV\$PYVER/bin/python -m pip install --cache-dir=\${PIP_CACHE_DIR} /tmp/wheels/*.whl; \ + UV\$PYVER/bin/python -m pip install --cache-dir=\${PIP_CACHE_DIR} /tmp/wheels/*.whl; \ done # # Create virtual env # RUN uv venv --python 3.10 UV3.10 && \ @@ -267,15 +267,15 @@ jobs: - name: Execute Ansible integration tests 3.13 run: | - docker exec avd-python-container bash -c "source ../UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" # - name: Execute Ansible sanity tests 3.12 # run: | # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - - name: Execute Ansible sanity tests 3.13 - run: | - docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # - name: Execute Ansible sanity tests 3.13 + # run: | + # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - name: Stop and Remove Docker Container run: | From 7a2c2325dd920007b6d696144abb4925fcbfd522 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 19:32:49 +0530 Subject: [PATCH 077/324] python image 9 --- .github/workflows/pull-request-management.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 08ad4583976..f3319e04fcf 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -260,15 +260,15 @@ jobs: # - name: Execute Ansible integration tests 3.12 # run: | # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" - - name: print pwd - run: | - pwd - ls - name: Execute Ansible integration tests 3.13 run: | docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" + - name: Molecule eos_cli_config_gen + run: | + docker exec avd-python-container bash -c "molecule converge -s eos_cli_config_gen" + # - name: Execute Ansible sanity tests 3.12 # run: | # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" From a0c800516f5101401cea6a1e9abc15ec0a1e6ae2 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 19:37:45 +0530 Subject: [PATCH 078/324] python image 10 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index f3319e04fcf..5d763c3f08c 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -267,7 +267,7 @@ jobs: - name: Molecule eos_cli_config_gen run: | - docker exec avd-python-container bash -c "molecule converge -s eos_cli_config_gen" + docker exec avd-python-container bash -c "source UV3.11/bin/activate && molecule converge -s eos_cli_config_gen" # - name: Execute Ansible sanity tests 3.12 # run: | From 12d57046d5f63a70885670a840b21cff0f8c5b95 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 19:44:35 +0530 Subject: [PATCH 079/324] python image 11 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 5d763c3f08c..ebd4d2f8cc3 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -267,7 +267,7 @@ jobs: - name: Molecule eos_cli_config_gen run: | - docker exec avd-python-container bash -c "source UV3.11/bin/activate && molecule converge -s eos_cli_config_gen" + docker exec avd-python-container bash -c "source UV3.12/bin/activate && molecule converge -s eos_cli_config_gen" # - name: Execute Ansible sanity tests 3.12 # run: | From fac2a1e8a310bc18d4201c25721d6dcf43e20064 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 20:46:01 +0530 Subject: [PATCH 080/324] python image 12 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index ebd4d2f8cc3..8588df0bc44 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -267,7 +267,7 @@ jobs: - name: Molecule eos_cli_config_gen run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && molecule converge -s eos_cli_config_gen" + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ && molecule converge -s eos_cli_config_gen" # - name: Execute Ansible sanity tests 3.12 # run: | From 0e710fb79e9a391b4838ec8d09608fdbb99c899e Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 15 Jan 2025 21:07:19 +0530 Subject: [PATCH 081/324] python image 13 --- .github/workflows/pull-request-management.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 8588df0bc44..b5b1f27b49f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -266,7 +266,8 @@ jobs: docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" - name: Molecule eos_cli_config_gen - run: | + run: | + pwd docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ && molecule converge -s eos_cli_config_gen" # - name: Execute Ansible sanity tests 3.12 From 242f535479459be8f049ed990503702dbe816036 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 16 Jan 2025 12:14:56 +0530 Subject: [PATCH 082/324] molecule run --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index b5b1f27b49f..49173b7a208 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -268,7 +268,7 @@ jobs: - name: Molecule eos_cli_config_gen run: | pwd - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ && molecule converge -s eos_cli_config_gen" + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && molecule converge -s eos_cli_config_gen" # - name: Execute Ansible sanity tests 3.12 # run: | From c4141567715a47d7309183e379d632c3e6a470a1 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 16 Jan 2025 13:14:15 +0530 Subject: [PATCH 083/324] molecule run2 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index f64953e2910..062ff99dcbd 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -267,7 +267,7 @@ jobs: - name: Molecule eos_cli_config_gen run: | pwd - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && molecule converge -s eos_cli_config_gen" + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-galaxy collection install -r collections.yml && molecule converge -s eos_cli_config_gen" # - name: Execute Ansible sanity tests 3.12 # run: | From 29beba45284872ddff72fbb48db88b796e0b74f5 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 16 Jan 2025 15:20:12 +0530 Subject: [PATCH 084/324] container 1 --- .github/workflows/pull-request-management.yml | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 062ff99dcbd..f596302c874 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -197,11 +197,11 @@ jobs: - name: Build Docker Image run: | - docker build -t ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 . + docker build -t ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:${{ github.event.pull_request.head.sha }} . - name: Push Docker Image run: | - docker push ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 + docker push ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:${{ github.event.pull_request.head.sha }} # reuse_container_image: # name: Reuse image with ghcr credentials @@ -231,6 +231,8 @@ jobs: name: Reuse first job runs-on: ubuntu-latest needs: [ container-job ] + container: + image: ghcr.io/shivani-gslab/avd/python_avd:${{ github.event.pull_request.head.sha }} steps: - name: Convert GitHub username to lowercase id: lowercase @@ -248,26 +250,26 @@ jobs: # run: | # docker pull ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python:3.12 - - name: Run Docker Container - run: | - docker run -dit --name avd-python-container ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 bash - - # - name: Execute Ansible unit tests 3.12 + # - name: Run Docker Container # run: | - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test units -vv" + # docker run -dit --name avd-python-container ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 bash + + - name: Execute Ansible unit tests 3.12 + run: | + docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test units -vv" # - name: Execute Ansible integration tests 3.12 # run: | # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" - - name: Execute Ansible integration tests 3.13 - run: | - docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" + # - name: Execute Ansible integration tests 3.13 + # run: | + # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" - - name: Molecule eos_cli_config_gen - run: | - pwd - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-galaxy collection install -r collections.yml && molecule converge -s eos_cli_config_gen" + # - name: Molecule eos_cli_config_gen + # run: | + # pwd + # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-galaxy collection install -r collections.yml && molecule converge -s eos_cli_config_gen" # - name: Execute Ansible sanity tests 3.12 # run: | @@ -277,8 +279,8 @@ jobs: # run: | # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - - name: Stop and Remove Docker Container - run: | - docker stop avd-python-container - docker rm avd-python-container + # - name: Stop and Remove Docker Container + # run: | + # docker stop avd-python-container + # docker rm avd-python-container From f0f7e6b3c2ec6de6a5d376e15b4546c65d16c97a Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 16 Jan 2025 15:30:54 +0530 Subject: [PATCH 085/324] container 2 --- .github/workflows/pull-request-management.yml | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index f596302c874..d9d3a1e570f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -145,7 +145,7 @@ jobs: WORKDIR / - RUN for PYVER in 3.12 3.13; do \ + RUN for PYVER in 3.12; do \ uv venv --python \$PYVER UV\$PYVER && \ UV\$PYVER/bin/python -m ensurepip --upgrade && \ UV\$PYVER/bin/python -m pip install --cache-dir=\${PIP_CACHE_DIR} \ @@ -233,18 +233,19 @@ jobs: needs: [ container-job ] container: image: ghcr.io/shivani-gslab/avd/python_avd:${{ github.event.pull_request.head.sha }} + options: --cpus 1 steps: - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + # - name: Convert GitHub username to lowercase + # id: lowercase + # run: | + # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v2 + # with: + # registry: ghcr.io + # username: ${{ steps.lowercase.outputs.lowercase }} + # password: ${{ secrets.GITHUB_TOKEN }} # - name: Pull docker image from ghcr # run: | From 857b00a537c637c98253058b3df84224fb7203ed Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 16 Jan 2025 15:32:23 +0530 Subject: [PATCH 086/324] container 3 --- .github/workflows/pull-request-management.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d9d3a1e570f..8b120a55adc 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -234,6 +234,9 @@ jobs: container: image: ghcr.io/shivani-gslab/avd/python_avd:${{ github.event.pull_request.head.sha }} options: --cpus 1 + credentials: + username: shivani-gslab + password: ${{ secrets.github_token }} steps: # - name: Convert GitHub username to lowercase # id: lowercase From 3f86ecda04dac098378a8887941d69cb5a40787c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 16 Jan 2025 15:46:15 +0530 Subject: [PATCH 087/324] container 4 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 8b120a55adc..656d9e27410 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -122,7 +122,7 @@ jobs: FROM ubuntu:latest # Install pre-requisites - RUN apt-get update && apt-get install -y --no-install-recommends openssh-client git make python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* + RUN apt-get update && apt-get install -y --no-install-recommends openssh-client git make python3-pip # Install UV RUN pip install uv --break-system-packages From 3c3d2b2bc63790db2479e6eb3861333b69ad2fc9 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 15:20:57 +0530 Subject: [PATCH 088/324] checkout 1 --- .github/workflows/pull-request-management.yml | 284 ++++++++---------- 1 file changed, 131 insertions(+), 153 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 656d9e27410..3c2d472c20a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -84,24 +84,19 @@ jobs: pyavd: - 'python_avd/*' - 'python_avd/**/*' - container-job: - # Containers must run in Linux based operating systems + container-job-1: runs-on: ubuntu-latest - # strategy: - # matrix: - # python-version: [3.12] # Python versions - # Docker Hub image that `container-job` executes in container: - image: ubuntu:latest + image: ghcr.io/shivani-gslab/avd-slim-test:0.1 options: --cpus 1 + + outputs: + image_tag: ${{ steps.build-image.outputs.image_tag }} + steps: - name: Check out repository code uses: actions/checkout@v4 - - name: Set up Docker - run: | - apt-get update - apt-get install -y docker.io - + - name: Convert GitHub username to lowercase id: lowercase run: | @@ -114,177 +109,160 @@ jobs: username: ${{ steps.lowercase.outputs.lowercase }} password: ${{ secrets.GITHUB_TOKEN }} - # Dynamically create Dockerfile - name: Create Dockerfile dynamically run: | echo "Creating Dockerfile..." cat < Dockerfile - FROM ubuntu:latest - - # Install pre-requisites - RUN apt-get update && apt-get install -y --no-install-recommends openssh-client git make python3-pip - - # Install UV - RUN pip install uv --break-system-packages - - # Install python versions - RUN uv python install 3.10 3.11 3.12 3.13 - - # Create a directory to store cached dependencies + # Base image + FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 ENV PIP_CACHE_DIR=/cache + ARG PYTHON_VERSIONS="3.10 3.11 3.12 3.13" + RUN pwd \ + ls RUN mkdir -p /cache + WORKDIR /avd - # Clone the repository in the Docker image - RUN git clone https://github.com/${{ github.repository }} + RUN apt-get update && apt-get install -y --no-install-recommends \ + openssh-client git make python3-pip python3-dev docker.io && \ + pip install --cache-dir=$PIP_CACHE_DIR uv --break-system-packages && \ + uv python install 3.10 3.11 3.12 3.13 - WORKDIR /avd/python-avd + # RUN if [ -d ".git" ]; then \ + # echo "Repository exists, pulling latest changes..."; \ + # git pull; \ + # else \ + # echo "Cloning repository..."; \ + # git clone https://github.com/${{ github.repository }}; \ + # fi - # Build the wheel package - RUN python3 -m pip install --break-system-packages build && \ - python3 -m build --wheel --outdir /tmp/wheels - WORKDIR / - - RUN for PYVER in 3.12; do \ - uv venv --python \$PYVER UV\$PYVER && \ - UV\$PYVER/bin/python -m ensurepip --upgrade && \ - UV\$PYVER/bin/python -m pip install --cache-dir=\${PIP_CACHE_DIR} \ + RUN for version in 3.10 3.11 3.12 3.13; do \ + echo "Checking if virtual environment for Python \$version exists..." && \ + if [ ! -d "UV\$version" ]; then \ + echo "Virtual environment for Python \$version does not exist. Creating it..." && \ + uv venv --python \$version UV\$version && \ + UV\$version/bin/python -m ensurepip --upgrade && \ + echo "Virtual environment UV\$version created and pip upgraded."; \ + else \ + echo "Virtual environment for Python \$version already exists, skipping creation..."; \ + fi && \ + UV\$version/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR \ mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ -r /avd/ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - UV\$PYVER/bin/python -m pip install --cache-dir=\${PIP_CACHE_DIR} /tmp/wheels/*.whl; \ - done - # # Create virtual env - # RUN uv venv --python 3.10 UV3.10 && \ - # UV3.10/bin/python -m ensurepip --upgrade - # RUN uv venv --python 3.11 UV3.11 && \ - # UV3.11/bin/python -m ensurepip --upgrade - # RUN uv venv --python 3.12 UV3.12 && \ - # UV3.12/bin/python -m ensurepip --upgrade - # RUN uv venv --python 3.13 UV3.13 && \ - # UV3.13/bin/python -m ensurepip --upgrade - - # # # Activate virtual env - # RUN . UV3.12/bin/activate && \ - # cd avd/ && \ - # ../UV3.10/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR "ansible-core<2.19.0" \ - # -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - # ../UV3.10/bin/python -m pip install /tmp/wheels/*.whl + echo "Dependencies installed for Python \$version in virtual environment UV\$version."; \ + done - # # # Activate virtual env - # RUN . UV3.12/bin/activate && \ - # cd avd/ && \ - # ../UV3.11/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR "ansible-core<2.19.0" \ - # -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - # ../UV3.11/bin/python -m pip install /tmp/wheels/*.whl - - # # Activate virtual env - # RUN . UV3.12/bin/activate && \ - # cd avd/ && \ - # ../UV3.12/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - # -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - # ../UV3.12/bin/python -m pip install /tmp/wheels/*.whl - - # # Activate virtual env - # RUN . UV3.13/bin/activate && \ - # cd avd/ && \ - # ../UV3.13/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR "ansible-core<2.19.0" \ - # -r ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - # ../UV3.13/bin/python -m pip install /tmp/wheels/*.whl + RUN apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* CMD ["python"] EOF echo "Dockerfile created successfully." - name: Build Docker Image + id: build-image run: | - docker build -t ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:${{ github.event.pull_request.head.sha }} . + SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-8) + IMAGE_TAG=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-slim-test:${{ github.run_number }}-$SHORT_SHA + docker build -t $IMAGE_TAG . + docker push $IMAGE_TAG + echo "::set-output name=image_tag::$IMAGE_TAG" - - name: Push Docker Image - run: | - docker push ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:${{ github.event.pull_request.head.sha }} - - # reuse_container_image: - # name: Reuse image with ghcr credentials + # container-job-2: + # needs: container-job-1 # runs-on: ubuntu-latest - # needs: [container-job] # container: - # image: ghcr.io/shivani-gslab/avd/python_avd:0.0.1 - # credentials: - # username: ${{ github.repository_owner }} - # password: ${{ secrets.GITHUB_TOKEN }} + # image: ${{ needs.container-job-1.outputs.image_tag }} + # #image: ghcr.io/shivani-gslab/avd/python:497-92985fc8 + # options: --cpus 1 + # # credentials: + # # username: shivani-gslab + # # password: ${{ secrets.github_token }} + # outputs: + # image_tag: ${{ steps.wheel-image-tag.outputs.wheel_image_tag }} # steps: - # - name: Check for dockerenv file - # run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) - # - name: Check out repository code - # uses: actions/checkout@v4 - # - name: run tests - # shell: bash + # # - name: Check out repository code + # # uses: actions/checkout@v4 + # - name: Convert GitHub username to lowercase + # id: lowercase # run: | - # pwd - # ls -al - # ls -l /__w/avd/ - # # source UV3.12/bin/activate - # cd ansible_collections/arista/avd - # ansible-test units -vv + # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - reuse-ghcr-image: - name: Reuse first job - runs-on: ubuntu-latest - needs: [ container-job ] - container: - image: ghcr.io/shivani-gslab/avd/python_avd:${{ github.event.pull_request.head.sha }} - options: --cpus 1 - credentials: - username: shivani-gslab - password: ${{ secrets.github_token }} - steps: - # - name: Convert GitHub username to lowercase - # id: lowercase - # run: | - # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v2 + # with: + # registry: ghcr.io + # username: ${{ steps.lowercase.outputs.lowercase }} + # password: ${{ secrets.GITHUB_TOKEN }} - # - name: Log in to GitHub Container Registry - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ steps.lowercase.outputs.lowercase }} - # password: ${{ secrets.GITHUB_TOKEN }} - - # - name: Pull docker image from ghcr - # run: | - # docker pull ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python:3.12 + # - name: Additional Task in Second Container + # id: wheel-image-tag + # run: | + # cd /avd/python-avd - # - name: Run Docker Container - # run: | - # docker run -dit --name avd-python-container ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python_avd:0.0.1 bash - - - name: Execute Ansible unit tests 3.12 - run: | - docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test units -vv" - - # - name: Execute Ansible integration tests 3.12 - # run: | - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" + # # Build the wheel package + # echo "Building the wheel package..." + # python3 -m pip install --break-system-packages build + # python3 -m build --wheel --outdir /tmp/wheels + # # Install pyavd + # /UV3.10/bin/python -m pip install /tmp/wheels/*.whl + # /UV3.11/bin/python -m pip install /tmp/wheels/*.whl + # /UV3.12/bin/python -m pip install /tmp/wheels/*.whl + # /UV3.13/bin/python -m pip install /tmp/wheels/*.whl + + # # Generate a unique tag using run number and truncated commit SHA + # WHEEL_IMAGE_TAG=${{ needs.container-job-1.outputs.image_tag }}-2 + # # docker build -t $WHEEL_IMAGE_TAG . + # # docker push $WHEEL_IMAGE_TAG + # # Build the updated image from the current container state + # docker commit $(docker ps -q --filter ancestor=${{ needs.container-job-1.outputs.image_tag }}) $WHEEL_IMAGE_TAG - # - name: Execute Ansible integration tests 3.13 - # run: | - # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test integration -vv" - - # - name: Molecule eos_cli_config_gen - # run: | - # pwd - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-galaxy collection install -r collections.yml && molecule converge -s eos_cli_config_gen" + # # Push the updated image to GitHub Container Registry + # docker push $WHEEL_IMAGE_TAG + # echo "::set-output name=wheel_image_tag::$WHEEL_IMAGE_TAG" + - # - name: Execute Ansible sanity tests 3.12 - # run: | - # docker exec avd-python-container bash -c "source UV3.12/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # reuse-ghcr-image: + # name: reuse first job + # needs: container-job-2 + # runs-on: ubuntu-latest + # container: + # #image: ghcr.io/shivani-gslab/avd-slim-test:latest + # image: ${{ needs.container-job-2.outputs.image_tag }} + # #image: ghcr.io/shivani-gslab/avd/python:529-7c8454ae-2 + # options: --cpus 1 - # - name: Execute Ansible sanity tests 3.13 - # run: | - # docker exec avd-python-container bash -c "source UV3.13/bin/activate && cd avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # - name: Stop and Remove Docker Container - # run: | - # docker stop avd-python-container - # docker rm avd-python-container + # strategy: + # matrix: + # task: + # - name: Execute Ansible unit tests 3.12 + # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + # - name: Execute Ansible integration tests 3.12 + # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + # - name: Execute Ansible integration tests 3.13 + # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + # - name: Execute Ansible sanity tests 3.13 + # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # - name: Execute Ansible sanity tests 3.12 + # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # - name: Execute Ansible lint tests 3.11 + # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + # steps: + # # - name: Check out repository code + # # uses: actions/checkout@v4 + # - name: Convert GitHub username to lowercase + # id: lowercase + # run: | + # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v2 + # with: + # registry: ghcr.io + # username: ${{ steps.lowercase.outputs.lowercase }} + # password: ${{ secrets.GITHUB_TOKEN }} + # - name: Run Task - ${{ matrix.task.name }} + # run: | + # git config --global --add safe.directory /__w/avd/avd + # ${{ matrix.task.command }} \ No newline at end of file From 2acea59f4e6aa28b7aada2a94c132d74b1cd9128 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 15:26:16 +0530 Subject: [PATCH 089/324] checkout 2 --- .github/workflows/pull-request-management.yml | 184 +++++++++--------- 1 file changed, 88 insertions(+), 96 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 3c2d472c20a..4b4a5c7674b 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -127,14 +127,6 @@ jobs: pip install --cache-dir=$PIP_CACHE_DIR uv --break-system-packages && \ uv python install 3.10 3.11 3.12 3.13 - # RUN if [ -d ".git" ]; then \ - # echo "Repository exists, pulling latest changes..."; \ - # git pull; \ - # else \ - # echo "Cloning repository..."; \ - # git clone https://github.com/${{ github.repository }}; \ - # fi - WORKDIR / RUN for version in 3.10 3.11 3.12 3.13; do \ echo "Checking if virtual environment for Python \$version exists..." && \ @@ -168,101 +160,101 @@ jobs: docker push $IMAGE_TAG echo "::set-output name=image_tag::$IMAGE_TAG" - # container-job-2: - # needs: container-job-1 - # runs-on: ubuntu-latest - # container: - # image: ${{ needs.container-job-1.outputs.image_tag }} - # #image: ghcr.io/shivani-gslab/avd/python:497-92985fc8 - # options: --cpus 1 - # # credentials: - # # username: shivani-gslab - # # password: ${{ secrets.github_token }} - # outputs: - # image_tag: ${{ steps.wheel-image-tag.outputs.wheel_image_tag }} - # steps: - # # - name: Check out repository code - # # uses: actions/checkout@v4 - # - name: Convert GitHub username to lowercase - # id: lowercase - # run: | - # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + container-job-2: + needs: container-job-1 + runs-on: ubuntu-latest + container: + image: ${{ needs.container-job-1.outputs.image_tag }} + #image: ghcr.io/shivani-gslab/avd/python:497-92985fc8 + options: --cpus 1 + # credentials: + # username: shivani-gslab + # password: ${{ secrets.github_token }} + outputs: + image_tag: ${{ steps.wheel-image-tag.outputs.wheel_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - # - name: Log in to GitHub Container Registry - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ steps.lowercase.outputs.lowercase }} - # password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} - # - name: Additional Task in Second Container - # id: wheel-image-tag - # run: | - # cd /avd/python-avd + - name: Additional Task in Second Container + id: wheel-image-tag + run: | + cd python-avd - # # Build the wheel package - # echo "Building the wheel package..." - # python3 -m pip install --break-system-packages build - # python3 -m build --wheel --outdir /tmp/wheels - # # Install pyavd - # /UV3.10/bin/python -m pip install /tmp/wheels/*.whl - # /UV3.11/bin/python -m pip install /tmp/wheels/*.whl - # /UV3.12/bin/python -m pip install /tmp/wheels/*.whl - # /UV3.13/bin/python -m pip install /tmp/wheels/*.whl + # Build the wheel package + echo "Building the wheel package..." + python3 -m pip install --break-system-packages build + python3 -m build --wheel --outdir /tmp/wheels + # Install pyavd + /UV3.10/bin/python -m pip install /tmp/wheels/*.whl + /UV3.11/bin/python -m pip install /tmp/wheels/*.whl + /UV3.12/bin/python -m pip install /tmp/wheels/*.whl + /UV3.13/bin/python -m pip install /tmp/wheels/*.whl - # # Generate a unique tag using run number and truncated commit SHA - # WHEEL_IMAGE_TAG=${{ needs.container-job-1.outputs.image_tag }}-2 - # # docker build -t $WHEEL_IMAGE_TAG . - # # docker push $WHEEL_IMAGE_TAG - # # Build the updated image from the current container state - # docker commit $(docker ps -q --filter ancestor=${{ needs.container-job-1.outputs.image_tag }}) $WHEEL_IMAGE_TAG + # Generate a unique tag using run number and truncated commit SHA + WHEEL_IMAGE_TAG=${{ needs.container-job-1.outputs.image_tag }}-2 + # docker build -t $WHEEL_IMAGE_TAG . + # docker push $WHEEL_IMAGE_TAG + # Build the updated image from the current container state + docker commit $(docker ps -q --filter ancestor=${{ needs.container-job-1.outputs.image_tag }}) $WHEEL_IMAGE_TAG - # # Push the updated image to GitHub Container Registry - # docker push $WHEEL_IMAGE_TAG - # echo "::set-output name=wheel_image_tag::$WHEEL_IMAGE_TAG" + # Push the updated image to GitHub Container Registry + docker push $WHEEL_IMAGE_TAG + echo "::set-output name=wheel_image_tag::$WHEEL_IMAGE_TAG" - # reuse-ghcr-image: - # name: reuse first job - # needs: container-job-2 - # runs-on: ubuntu-latest - # container: - # #image: ghcr.io/shivani-gslab/avd-slim-test:latest - # image: ${{ needs.container-job-2.outputs.image_tag }} - # #image: ghcr.io/shivani-gslab/avd/python:529-7c8454ae-2 - # options: --cpus 1 + reuse-ghcr-image: + name: reuse first job + needs: container-job-2 + runs-on: ubuntu-latest + container: + #image: ghcr.io/shivani-gslab/avd-slim-test:latest + image: ${{ needs.container-job-2.outputs.image_tag }} + #image: ghcr.io/shivani-gslab/avd/python:529-7c8454ae-2 + options: --cpus 1 - # strategy: - # matrix: - # task: - # - name: Execute Ansible unit tests 3.12 - # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" - # - name: Execute Ansible integration tests 3.12 - # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - # - name: Execute Ansible integration tests 3.13 - # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - # - name: Execute Ansible sanity tests 3.13 - # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # - name: Execute Ansible sanity tests 3.12 - # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # - name: Execute Ansible lint tests 3.11 - # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" - # steps: - # # - name: Check out repository code - # # uses: actions/checkout@v4 - # - name: Convert GitHub username to lowercase - # id: lowercase - # run: | - # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + strategy: + matrix: + task: + - name: Execute Ansible unit tests 3.12 + command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + - name: Execute Ansible integration tests 3.12 + command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + - name: Execute Ansible integration tests 3.13 + command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + - name: Execute Ansible sanity tests 3.13 + command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + - name: Execute Ansible sanity tests 3.12 + command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + - name: Execute Ansible lint tests 3.11 + command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + steps: + # - name: Check out repository code + # uses: actions/checkout@v4 + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - # - name: Log in to GitHub Container Registry - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ steps.lowercase.outputs.lowercase }} - # password: ${{ secrets.GITHUB_TOKEN }} - # - name: Run Task - ${{ matrix.task.name }} - # run: | - # git config --global --add safe.directory /__w/avd/avd - # ${{ matrix.task.command }} \ No newline at end of file + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Run Task - ${{ matrix.task.name }} + run: | + git config --global --add safe.directory /__w/avd/avd + ${{ matrix.task.command }} \ No newline at end of file From de2dd7dac75568142325a8cc3c3d26d87466100d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 15:38:44 +0530 Subject: [PATCH 090/324] checkout 3 --- .github/workflows/pull-request-management.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 4b4a5c7674b..6f52d8900e3 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -207,6 +207,7 @@ jobs: # docker build -t $WHEEL_IMAGE_TAG . # docker push $WHEEL_IMAGE_TAG # Build the updated image from the current container state + ls /avd/python-avd/pyavd/_schema/ docker commit $(docker ps -q --filter ancestor=${{ needs.container-job-1.outputs.image_tag }}) $WHEEL_IMAGE_TAG # Push the updated image to GitHub Container Registry @@ -231,15 +232,15 @@ jobs: - name: Execute Ansible unit tests 3.12 command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" - name: Execute Ansible integration tests 3.12 - command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - - name: Execute Ansible integration tests 3.13 - command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - - name: Execute Ansible sanity tests 3.13 - command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - - name: Execute Ansible sanity tests 3.12 - command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - - name: Execute Ansible lint tests 3.11 - command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + command: "pwd && ls /avd/python-avd/pyavd/_schema/ && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + # - name: Execute Ansible integration tests 3.13 + # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + # - name: Execute Ansible sanity tests 3.13 + # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # - name: Execute Ansible sanity tests 3.12 + # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # - name: Execute Ansible lint tests 3.11 + # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" steps: # - name: Check out repository code # uses: actions/checkout@v4 From b05b905898d81e35a9d6a6428fd811315607ddd5 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 15:59:29 +0530 Subject: [PATCH 091/324] checkout 4 --- .github/workflows/pull-request-management.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6f52d8900e3..d355d1e679a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -87,7 +87,7 @@ jobs: container-job-1: runs-on: ubuntu-latest container: - image: ghcr.io/shivani-gslab/avd-slim-test:0.1 + image: ubuntu:latest options: --cpus 1 outputs: @@ -97,6 +97,11 @@ jobs: - name: Check out repository code uses: actions/checkout@v4 + - name: Set up Docker + run: | + apt-get update + apt-get install -y docker.io + - name: Convert GitHub username to lowercase id: lowercase run: | @@ -114,7 +119,8 @@ jobs: echo "Creating Dockerfile..." cat < Dockerfile # Base image - FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 + # FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 + FROM unbuntu:latest ENV PIP_CACHE_DIR=/cache ARG PYTHON_VERSIONS="3.10 3.11 3.12 3.13" RUN pwd \ @@ -207,7 +213,7 @@ jobs: # docker build -t $WHEEL_IMAGE_TAG . # docker push $WHEEL_IMAGE_TAG # Build the updated image from the current container state - ls /avd/python-avd/pyavd/_schema/ + ls -al /avd/python-avd/pyavd/_schema/ docker commit $(docker ps -q --filter ancestor=${{ needs.container-job-1.outputs.image_tag }}) $WHEEL_IMAGE_TAG # Push the updated image to GitHub Container Registry From 8e6713eecb62e6b3a900dfac828a0db649a5a329 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 16:00:35 +0530 Subject: [PATCH 092/324] checkout 5 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d355d1e679a..1abaaf2f047 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -120,7 +120,7 @@ jobs: cat < Dockerfile # Base image # FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 - FROM unbuntu:latest + FROM ubuntu:latest ENV PIP_CACHE_DIR=/cache ARG PYTHON_VERSIONS="3.10 3.11 3.12 3.13" RUN pwd \ From 3342c1dfacab447e0af79c2955815f42702b6fde Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 16:04:55 +0530 Subject: [PATCH 093/324] checkout 6 --- .github/workflows/pull-request-management.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 1abaaf2f047..a14ef7e9a04 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -123,11 +123,10 @@ jobs: FROM ubuntu:latest ENV PIP_CACHE_DIR=/cache ARG PYTHON_VERSIONS="3.10 3.11 3.12 3.13" - RUN pwd \ - ls + RUN mkdir -p /cache WORKDIR /avd - + RUN pwd && ls -l RUN apt-get update && apt-get install -y --no-install-recommends \ openssh-client git make python3-pip python3-dev docker.io && \ pip install --cache-dir=$PIP_CACHE_DIR uv --break-system-packages && \ From 22fbe1b6c9a5c07dcc6f0436ce814837234c4d86 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 16:13:16 +0530 Subject: [PATCH 094/324] checkout 7 --- .github/workflows/pull-request-management.yml | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index a14ef7e9a04..054e8962663 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -87,7 +87,7 @@ jobs: container-job-1: runs-on: ubuntu-latest container: - image: ubuntu:latest + image: ghcr.io/shivani-gslab/avd-slim-test:0.1 options: --cpus 1 outputs: @@ -97,11 +97,6 @@ jobs: - name: Check out repository code uses: actions/checkout@v4 - - name: Set up Docker - run: | - apt-get update - apt-get install -y docker.io - - name: Convert GitHub username to lowercase id: lowercase run: | @@ -119,14 +114,16 @@ jobs: echo "Creating Dockerfile..." cat < Dockerfile # Base image - # FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 - FROM ubuntu:latest + FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 ENV PIP_CACHE_DIR=/cache ARG PYTHON_VERSIONS="3.10 3.11 3.12 3.13" - + RUN pwd \ + ls RUN mkdir -p /cache + COPY . /avd + WORKDIR /avd - RUN pwd && ls -l + RUN apt-get update && apt-get install -y --no-install-recommends \ openssh-client git make python3-pip python3-dev docker.io && \ pip install --cache-dir=$PIP_CACHE_DIR uv --break-system-packages && \ @@ -196,7 +193,7 @@ jobs: id: wheel-image-tag run: | cd python-avd - + # Build the wheel package echo "Building the wheel package..." python3 -m pip install --break-system-packages build @@ -212,7 +209,8 @@ jobs: # docker build -t $WHEEL_IMAGE_TAG . # docker push $WHEEL_IMAGE_TAG # Build the updated image from the current container state - ls -al /avd/python-avd/pyavd/_schema/ + pwd + ls -al pyavd/_schema/ docker commit $(docker ps -q --filter ancestor=${{ needs.container-job-1.outputs.image_tag }}) $WHEEL_IMAGE_TAG # Push the updated image to GitHub Container Registry @@ -237,7 +235,7 @@ jobs: - name: Execute Ansible unit tests 3.12 command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" - name: Execute Ansible integration tests 3.12 - command: "pwd && ls /avd/python-avd/pyavd/_schema/ && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" # - name: Execute Ansible integration tests 3.13 # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" # - name: Execute Ansible sanity tests 3.13 From 1a9fad16916125883a3be452ec479a8c3ef9bd4c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 16:17:00 +0530 Subject: [PATCH 095/324] checkout 8 --- .github/workflows/pull-request-management.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 054e8962663..47f144d6f5a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -87,7 +87,7 @@ jobs: container-job-1: runs-on: ubuntu-latest container: - image: ghcr.io/shivani-gslab/avd-slim-test:0.1 + image: ubuntu:latest options: --cpus 1 outputs: @@ -114,7 +114,8 @@ jobs: echo "Creating Dockerfile..." cat < Dockerfile # Base image - FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 + # FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 + FROM ubuntu:latest ENV PIP_CACHE_DIR=/cache ARG PYTHON_VERSIONS="3.10 3.11 3.12 3.13" RUN pwd \ From 9740d474c836300beac8d54d3032152e58af87dc Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 16:18:22 +0530 Subject: [PATCH 096/324] checkout 9 --- .github/workflows/pull-request-management.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 47f144d6f5a..79168235cce 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -97,6 +97,11 @@ jobs: - name: Check out repository code uses: actions/checkout@v4 + - name: Set up Docker + run: | + apt-get update + apt-get install -y docker.io + - name: Convert GitHub username to lowercase id: lowercase run: | From 76eaabb03e1dc05dd99fc24d5405f30dbcadbf69 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 16:31:01 +0530 Subject: [PATCH 097/324] checkout 10 --- .github/workflows/pull-request-management.yml | 249 +++++++++--------- 1 file changed, 124 insertions(+), 125 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 79168235cce..6a7c8e80c10 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -84,154 +84,153 @@ jobs: pyavd: - 'python_avd/*' - 'python_avd/**/*' - container-job-1: - runs-on: ubuntu-latest - container: - image: ubuntu:latest - options: --cpus 1 + # container-job-1: + # runs-on: ubuntu-latest + # container: + # image: ubuntu:latest + # options: --cpus 1 - outputs: - image_tag: ${{ steps.build-image.outputs.image_tag }} + # outputs: + # image_tag: ${{ steps.build-image.outputs.image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 + # steps: + # - name: Check out repository code + # uses: actions/checkout@v4 - - name: Set up Docker - run: | - apt-get update - apt-get install -y docker.io + # - name: Set up Docker + # run: | + # apt-get update + # apt-get install -y docker.io - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + # - name: Convert GitHub username to lowercase + # id: lowercase + # run: | + # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v2 + # with: + # registry: ghcr.io + # username: ${{ steps.lowercase.outputs.lowercase }} + # password: ${{ secrets.GITHUB_TOKEN }} - - name: Create Dockerfile dynamically - run: | - echo "Creating Dockerfile..." - cat < Dockerfile - # Base image - # FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 - FROM ubuntu:latest - ENV PIP_CACHE_DIR=/cache - ARG PYTHON_VERSIONS="3.10 3.11 3.12 3.13" - RUN pwd \ - ls - RUN mkdir -p /cache - COPY . /avd + # - name: Create Dockerfile dynamically + # run: | + # echo "Creating Dockerfile..." + # cat < Dockerfile + # # Base image + # # FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 + # FROM ubuntu:latest + # ENV PIP_CACHE_DIR=/cache + # ARG PYTHON_VERSIONS="3.10 3.11 3.12 3.13" - WORKDIR /avd + # RUN mkdir -p /cache + # COPY . /avd - RUN apt-get update && apt-get install -y --no-install-recommends \ - openssh-client git make python3-pip python3-dev docker.io && \ - pip install --cache-dir=$PIP_CACHE_DIR uv --break-system-packages && \ - uv python install 3.10 3.11 3.12 3.13 + # WORKDIR /avd + # RUN pwd && ls -l + # RUN apt-get update && apt-get install -y --no-install-recommends \ + # openssh-client git make python3-pip python3-dev docker.io && \ + # pip install --cache-dir=$PIP_CACHE_DIR uv --break-system-packages && \ + # uv python install 3.10 3.11 3.12 3.13 - WORKDIR / - RUN for version in 3.10 3.11 3.12 3.13; do \ - echo "Checking if virtual environment for Python \$version exists..." && \ - if [ ! -d "UV\$version" ]; then \ - echo "Virtual environment for Python \$version does not exist. Creating it..." && \ - uv venv --python \$version UV\$version && \ - UV\$version/bin/python -m ensurepip --upgrade && \ - echo "Virtual environment UV\$version created and pip upgraded."; \ - else \ - echo "Virtual environment for Python \$version already exists, skipping creation..."; \ - fi && \ - UV\$version/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR \ - mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r /avd/ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - echo "Dependencies installed for Python \$version in virtual environment UV\$version."; \ - done + # WORKDIR / + # RUN for version in 3.10 3.11 3.12 3.13; do \ + # echo "Checking if virtual environment for Python \$version exists..." && \ + # if [ ! -d "UV\$version" ]; then \ + # echo "Virtual environment for Python \$version does not exist. Creating it..." && \ + # uv venv --python \$version UV\$version && \ + # UV\$version/bin/python -m ensurepip --upgrade && \ + # echo "Virtual environment UV\$version created and pip upgraded."; \ + # else \ + # echo "Virtual environment for Python \$version already exists, skipping creation..."; \ + # fi && \ + # UV\$version/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR \ + # mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + # -r /avd/ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ + # echo "Dependencies installed for Python \$version in virtual environment UV\$version."; \ + # done - RUN apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + # RUN apt-get clean && \ + # rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - CMD ["python"] - EOF - echo "Dockerfile created successfully." + # CMD ["python"] + # EOF + # echo "Dockerfile created successfully." - - name: Build Docker Image - id: build-image - run: | - SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-8) - IMAGE_TAG=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-slim-test:${{ github.run_number }}-$SHORT_SHA - docker build -t $IMAGE_TAG . - docker push $IMAGE_TAG - echo "::set-output name=image_tag::$IMAGE_TAG" + # - name: Build Docker Image + # id: build-image + # run: | + # SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-8) + # IMAGE_TAG=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-slim-test:${{ github.run_number }}-$SHORT_SHA + # docker build -t $IMAGE_TAG . + # docker push $IMAGE_TAG + # echo "::set-output name=image_tag::$IMAGE_TAG" - container-job-2: - needs: container-job-1 - runs-on: ubuntu-latest - container: - image: ${{ needs.container-job-1.outputs.image_tag }} - #image: ghcr.io/shivani-gslab/avd/python:497-92985fc8 - options: --cpus 1 - # credentials: - # username: shivani-gslab - # password: ${{ secrets.github_token }} - outputs: - image_tag: ${{ steps.wheel-image-tag.outputs.wheel_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + # container-job-2: + # needs: container-job-1 + # runs-on: ubuntu-latest + # container: + # image: ${{ needs.container-job-1.outputs.image_tag }} + # #image: ghcr.io/shivani-gslab/avd/python:497-92985fc8 + # options: --cpus 1 + # # credentials: + # # username: shivani-gslab + # # password: ${{ secrets.github_token }} + # outputs: + # image_tag: ${{ steps.wheel-image-tag.outputs.wheel_image_tag }} + # steps: + # - name: Check out repository code + # uses: actions/checkout@v4 + # - name: Convert GitHub username to lowercase + # id: lowercase + # run: | + # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v2 + # with: + # registry: ghcr.io + # username: ${{ steps.lowercase.outputs.lowercase }} + # password: ${{ secrets.GITHUB_TOKEN }} - - name: Additional Task in Second Container - id: wheel-image-tag - run: | - cd python-avd + # - name: Additional Task in Second Container + # id: wheel-image-tag + # run: | + # cd python-avd - # Build the wheel package - echo "Building the wheel package..." - python3 -m pip install --break-system-packages build - python3 -m build --wheel --outdir /tmp/wheels - # Install pyavd - /UV3.10/bin/python -m pip install /tmp/wheels/*.whl - /UV3.11/bin/python -m pip install /tmp/wheels/*.whl - /UV3.12/bin/python -m pip install /tmp/wheels/*.whl - /UV3.13/bin/python -m pip install /tmp/wheels/*.whl + # # Build the wheel package + # echo "Building the wheel package..." + # python3 -m pip install --break-system-packages build + # python3 -m build --wheel --outdir /tmp/wheels + # # Install pyavd + # /UV3.10/bin/python -m pip install /tmp/wheels/*.whl + # /UV3.11/bin/python -m pip install /tmp/wheels/*.whl + # /UV3.12/bin/python -m pip install /tmp/wheels/*.whl + # /UV3.13/bin/python -m pip install /tmp/wheels/*.whl - # Generate a unique tag using run number and truncated commit SHA - WHEEL_IMAGE_TAG=${{ needs.container-job-1.outputs.image_tag }}-2 - # docker build -t $WHEEL_IMAGE_TAG . - # docker push $WHEEL_IMAGE_TAG - # Build the updated image from the current container state - pwd - ls -al pyavd/_schema/ - docker commit $(docker ps -q --filter ancestor=${{ needs.container-job-1.outputs.image_tag }}) $WHEEL_IMAGE_TAG + # # Generate a unique tag using run number and truncated commit SHA + # WHEEL_IMAGE_TAG=${{ needs.container-job-1.outputs.image_tag }}-2 + # # docker build -t $WHEEL_IMAGE_TAG . + # # docker push $WHEEL_IMAGE_TAG + # # Build the updated image from the current container state + # pwd + # ls -al pyavd/_schema/ + # docker commit $(docker ps -q --filter ancestor=${{ needs.container-job-1.outputs.image_tag }}) $WHEEL_IMAGE_TAG - # Push the updated image to GitHub Container Registry - docker push $WHEEL_IMAGE_TAG - echo "::set-output name=wheel_image_tag::$WHEEL_IMAGE_TAG" + # # Push the updated image to GitHub Container Registry + # docker push $WHEEL_IMAGE_TAG + # echo "::set-output name=wheel_image_tag::$WHEEL_IMAGE_TAG" reuse-ghcr-image: name: reuse first job - needs: container-job-2 + # needs: container-job-2 runs-on: ubuntu-latest container: #image: ghcr.io/shivani-gslab/avd-slim-test:latest - image: ${{ needs.container-job-2.outputs.image_tag }} - #image: ghcr.io/shivani-gslab/avd/python:529-7c8454ae-2 + # image: ${{ needs.container-job-2.outputs.image_tag }} + image: ghcr.io/shivani-gslab/avd-slim-test:554-ebeea5fd-2 options: --cpus 1 @@ -239,9 +238,9 @@ jobs: matrix: task: - name: Execute Ansible unit tests 3.12 - command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + command: ". /UV3.12/bin/activate && cd /__w/avd/avd/ansible_collections/arista/avd && ansible-test units -vv" - name: Execute Ansible integration tests 3.12 - command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + command: ". /UV3.12/bin/activate && cd /__w/avd/avd/ansible_collections/arista/avd && ansible-test integration -vv" # - name: Execute Ansible integration tests 3.13 # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" # - name: Execute Ansible sanity tests 3.13 From 9e9c0a57e585d3743ee0aa8a7fd7d38a17d37db3 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 16:34:32 +0530 Subject: [PATCH 098/324] checkout 11 --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6a7c8e80c10..db990c5ecd0 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -238,9 +238,9 @@ jobs: matrix: task: - name: Execute Ansible unit tests 3.12 - command: ". /UV3.12/bin/activate && cd /__w/avd/avd/ansible_collections/arista/avd && ansible-test units -vv" + command: "pwd && ls -al /avd/python-avd/pyavd/_schema && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" - name: Execute Ansible integration tests 3.12 - command: ". /UV3.12/bin/activate && cd /__w/avd/avd/ansible_collections/arista/avd && ansible-test integration -vv" + command: "pwd && ls -al /avd/python-avd/pyavd/_schema && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" # - name: Execute Ansible integration tests 3.13 # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" # - name: Execute Ansible sanity tests 3.13 From 433f4a54d80f34ed8598e74e0df61e6bb7142256 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 16:38:39 +0530 Subject: [PATCH 099/324] checkout 12 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index db990c5ecd0..24536134c76 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -238,7 +238,7 @@ jobs: matrix: task: - name: Execute Ansible unit tests 3.12 - command: "pwd && ls -al /avd/python-avd/pyavd/_schema && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + command: "ls -al /avd/python-avd/pyavd/_schema && find / -type f -name '*.pickle' && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" - name: Execute Ansible integration tests 3.12 command: "pwd && ls -al /avd/python-avd/pyavd/_schema && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" # - name: Execute Ansible integration tests 3.13 From 18bedce0c3f96bc58a5e022b1568af75426f5aef Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 16:57:18 +0530 Subject: [PATCH 100/324] checkout 13 --- .github/workflows/pull-request-management.yml | 249 +++++++++--------- 1 file changed, 126 insertions(+), 123 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 24536134c76..ee3b306152a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -84,153 +84,156 @@ jobs: pyavd: - 'python_avd/*' - 'python_avd/**/*' - # container-job-1: - # runs-on: ubuntu-latest - # container: - # image: ubuntu:latest - # options: --cpus 1 + container-job-1: + runs-on: ubuntu-latest + container: + image: ubuntu:latest + options: --cpus 1 - # outputs: - # image_tag: ${{ steps.build-image.outputs.image_tag }} + outputs: + image_tag: ${{ steps.build-image.outputs.image_tag }} - # steps: - # - name: Check out repository code - # uses: actions/checkout@v4 + steps: + - name: Check out repository code + uses: actions/checkout@v4 - # - name: Set up Docker - # run: | - # apt-get update - # apt-get install -y docker.io + - name: Set up Docker + run: | + apt-get update + apt-get install -y docker.io - # - name: Convert GitHub username to lowercase - # id: lowercase - # run: | - # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - # - name: Log in to GitHub Container Registry - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ steps.lowercase.outputs.lowercase }} - # password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} - # - name: Create Dockerfile dynamically - # run: | - # echo "Creating Dockerfile..." - # cat < Dockerfile - # # Base image - # # FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 - # FROM ubuntu:latest - # ENV PIP_CACHE_DIR=/cache - # ARG PYTHON_VERSIONS="3.10 3.11 3.12 3.13" + - name: Create Dockerfile dynamically + run: | + echo "Creating Dockerfile..." + cat < Dockerfile + # Base image + # FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 + FROM ubuntu:latest + ENV PIP_CACHE_DIR=/cache + ARG PYTHON_VERSIONS="3.10 3.11 3.12 3.13" - # RUN mkdir -p /cache - # COPY . /avd + RUN mkdir -p /cache + COPY . /avd - # WORKDIR /avd - # RUN pwd && ls -l - # RUN apt-get update && apt-get install -y --no-install-recommends \ - # openssh-client git make python3-pip python3-dev docker.io && \ - # pip install --cache-dir=$PIP_CACHE_DIR uv --break-system-packages && \ - # uv python install 3.10 3.11 3.12 3.13 + WORKDIR /avd + RUN pwd && ls -l + RUN apt-get update && apt-get install -y --no-install-recommends \ + openssh-client git make python3-pip python3-dev docker.io && \ + pip install --cache-dir=$PIP_CACHE_DIR uv --break-system-packages && \ + uv python install 3.10 3.11 3.12 3.13 - # WORKDIR / - # RUN for version in 3.10 3.11 3.12 3.13; do \ - # echo "Checking if virtual environment for Python \$version exists..." && \ - # if [ ! -d "UV\$version" ]; then \ - # echo "Virtual environment for Python \$version does not exist. Creating it..." && \ - # uv venv --python \$version UV\$version && \ - # UV\$version/bin/python -m ensurepip --upgrade && \ - # echo "Virtual environment UV\$version created and pip upgraded."; \ - # else \ - # echo "Virtual environment for Python \$version already exists, skipping creation..."; \ - # fi && \ - # UV\$version/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR \ - # mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - # -r /avd/ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - # echo "Dependencies installed for Python \$version in virtual environment UV\$version."; \ - # done + WORKDIR / + RUN for version in 3.10 3.11 3.12 3.13; do \ + echo "Checking if virtual environment for Python \$version exists..." && \ + if [ ! -d "UV\$version" ]; then \ + echo "Virtual environment for Python \$version does not exist. Creating it..." && \ + uv venv --python \$version UV\$version && \ + UV\$version/bin/python -m ensurepip --upgrade && \ + echo "Virtual environment UV\$version created and pip upgraded."; \ + else \ + echo "Virtual environment for Python \$version already exists, skipping creation..."; \ + fi && \ + UV\$version/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR \ + mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + -r /avd/ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ + echo "Dependencies installed for Python \$version in virtual environment UV\$version."; \ + done - # RUN apt-get clean && \ - # rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + RUN apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - # CMD ["python"] - # EOF - # echo "Dockerfile created successfully." + CMD ["python"] + EOF + echo "Dockerfile created successfully." - # - name: Build Docker Image - # id: build-image - # run: | - # SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-8) - # IMAGE_TAG=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-slim-test:${{ github.run_number }}-$SHORT_SHA - # docker build -t $IMAGE_TAG . - # docker push $IMAGE_TAG - # echo "::set-output name=image_tag::$IMAGE_TAG" + - name: Build Docker Image + id: build-image + run: | + SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-8) + IMAGE_TAG=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-slim-test:${{ github.run_number }}-$SHORT_SHA + docker build -t $IMAGE_TAG . + docker push $IMAGE_TAG + echo "::set-output name=image_tag::$IMAGE_TAG" - # container-job-2: - # needs: container-job-1 - # runs-on: ubuntu-latest - # container: - # image: ${{ needs.container-job-1.outputs.image_tag }} - # #image: ghcr.io/shivani-gslab/avd/python:497-92985fc8 - # options: --cpus 1 - # # credentials: - # # username: shivani-gslab - # # password: ${{ secrets.github_token }} - # outputs: - # image_tag: ${{ steps.wheel-image-tag.outputs.wheel_image_tag }} - # steps: - # - name: Check out repository code - # uses: actions/checkout@v4 - # - name: Convert GitHub username to lowercase - # id: lowercase - # run: | - # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + container-job-2: + needs: container-job-1 + runs-on: ubuntu-latest + container: + image: ${{ needs.container-job-1.outputs.image_tag }} + #image: ghcr.io/shivani-gslab/avd/python:497-92985fc8 + options: --cpus 1 + # credentials: + # username: shivani-gslab + # password: ${{ secrets.github_token }} + outputs: + image_tag: ${{ steps.wheel-image-tag.outputs.wheel_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - # - name: Log in to GitHub Container Registry - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ steps.lowercase.outputs.lowercase }} - # password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} - # - name: Additional Task in Second Container - # id: wheel-image-tag - # run: | - # cd python-avd - - # # Build the wheel package - # echo "Building the wheel package..." - # python3 -m pip install --break-system-packages build - # python3 -m build --wheel --outdir /tmp/wheels - # # Install pyavd - # /UV3.10/bin/python -m pip install /tmp/wheels/*.whl - # /UV3.11/bin/python -m pip install /tmp/wheels/*.whl - # /UV3.12/bin/python -m pip install /tmp/wheels/*.whl - # /UV3.13/bin/python -m pip install /tmp/wheels/*.whl + - name: Additional Task in Second Container + id: wheel-image-tag + run: | + cd python-avd - # # Generate a unique tag using run number and truncated commit SHA - # WHEEL_IMAGE_TAG=${{ needs.container-job-1.outputs.image_tag }}-2 - # # docker build -t $WHEEL_IMAGE_TAG . - # # docker push $WHEEL_IMAGE_TAG - # # Build the updated image from the current container state - # pwd - # ls -al pyavd/_schema/ - # docker commit $(docker ps -q --filter ancestor=${{ needs.container-job-1.outputs.image_tag }}) $WHEEL_IMAGE_TAG + # Build the wheel package + echo "Building the wheel package..." + python3 -m pip install --break-system-packages build + python3 -m build --wheel --outdir /tmp/wheels + # Install pyavd + /UV3.10/bin/python -m pip install /tmp/wheels/*.whl + /UV3.11/bin/python -m pip install /tmp/wheels/*.whl + /UV3.12/bin/python -m pip install /tmp/wheels/*.whl + /UV3.13/bin/python -m pip install /tmp/wheels/*.whl + + cd ../.. + # Generate a unique tag using run number and truncated commit SHA + WHEEL_IMAGE_TAG=${{ needs.container-job-1.outputs.image_tag }}-2 + # docker build -t $WHEEL_IMAGE_TAG . + # docker push $WHEEL_IMAGE_TAG + # Build the updated image from the current container state + + cp -r avd/ /avd + pwd + ls -al /avd/python-avd/pyavd/_schema/ + docker commit $(docker ps -q --filter ancestor=${{ needs.container-job-1.outputs.image_tag }}) $WHEEL_IMAGE_TAG - # # Push the updated image to GitHub Container Registry - # docker push $WHEEL_IMAGE_TAG - # echo "::set-output name=wheel_image_tag::$WHEEL_IMAGE_TAG" + # Push the updated image to GitHub Container Registry + docker push $WHEEL_IMAGE_TAG + echo "::set-output name=wheel_image_tag::$WHEEL_IMAGE_TAG" reuse-ghcr-image: name: reuse first job - # needs: container-job-2 + needs: container-job-2 runs-on: ubuntu-latest container: #image: ghcr.io/shivani-gslab/avd-slim-test:latest - # image: ${{ needs.container-job-2.outputs.image_tag }} - image: ghcr.io/shivani-gslab/avd-slim-test:554-ebeea5fd-2 + image: ${{ needs.container-job-2.outputs.image_tag }} + # image: ghcr.io/shivani-gslab/avd-slim-test:554-ebeea5fd-2 options: --cpus 1 From 1158a5a4717525138bd2ca743c31a9561a7184e1 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 17 Jan 2025 17:14:54 +0530 Subject: [PATCH 101/324] checkout 14 --- .github/workflows/pull-request-management.yml | 127 +++++++++++------- 1 file changed, 82 insertions(+), 45 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index ee3b306152a..9d75e338117 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -209,16 +209,17 @@ jobs: /UV3.12/bin/python -m pip install /tmp/wheels/*.whl /UV3.13/bin/python -m pip install /tmp/wheels/*.whl - cd ../.. + # cd ../.. # Generate a unique tag using run number and truncated commit SHA WHEEL_IMAGE_TAG=${{ needs.container-job-1.outputs.image_tag }}-2 + # docker build -t $WHEEL_IMAGE_TAG . # docker push $WHEEL_IMAGE_TAG # Build the updated image from the current container state - cp -r avd/ /avd - pwd - ls -al /avd/python-avd/pyavd/_schema/ + # cp -r avd/ /avd + # pwd + # ls -al /avd/python-avd/pyavd/_schema/ docker commit $(docker ps -q --filter ancestor=${{ needs.container-job-1.outputs.image_tag }}) $WHEEL_IMAGE_TAG # Push the updated image to GitHub Container Registry @@ -226,47 +227,83 @@ jobs: echo "::set-output name=wheel_image_tag::$WHEEL_IMAGE_TAG" - reuse-ghcr-image: - name: reuse first job - needs: container-job-2 - runs-on: ubuntu-latest - container: - #image: ghcr.io/shivani-gslab/avd-slim-test:latest - image: ${{ needs.container-job-2.outputs.image_tag }} - # image: ghcr.io/shivani-gslab/avd-slim-test:554-ebeea5fd-2 - options: --cpus 1 + # reuse-ghcr-image: + # name: reuse first job + # needs: container-job-2 + # runs-on: ubuntu-latest + # container: + # #image: ghcr.io/shivani-gslab/avd-slim-test:latest + # image: ${{ needs.container-job-2.outputs.image_tag }} + # # image: ghcr.io/shivani-gslab/avd-slim-test:554-ebeea5fd-2 + # options: --cpus 1 - strategy: - matrix: - task: - - name: Execute Ansible unit tests 3.12 - command: "ls -al /avd/python-avd/pyavd/_schema && find / -type f -name '*.pickle' && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" - - name: Execute Ansible integration tests 3.12 - command: "pwd && ls -al /avd/python-avd/pyavd/_schema && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - # - name: Execute Ansible integration tests 3.13 - # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - # - name: Execute Ansible sanity tests 3.13 - # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # - name: Execute Ansible sanity tests 3.12 - # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # - name: Execute Ansible lint tests 3.11 - # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" - steps: - # - name: Check out repository code - # uses: actions/checkout@v4 - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + # strategy: + # matrix: + # task: + # - name: Execute Ansible unit tests 3.12 + # command: "ls -al /avd/python-avd/pyavd/_schema && find / -type f -name '*.pickle' && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + # - name: Execute Ansible integration tests 3.12 + # command: "pwd && ls -al /avd/python-avd/pyavd/_schema && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + # # - name: Execute Ansible integration tests 3.13 + # # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + # # - name: Execute Ansible sanity tests 3.13 + # # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # # - name: Execute Ansible sanity tests 3.12 + # # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # # - name: Execute Ansible lint tests 3.11 + # # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + # steps: + # # - name: Check out repository code + # # uses: actions/checkout@v4 + # - name: Convert GitHub username to lowercase + # id: lowercase + # run: | + # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Run Task - ${{ matrix.task.name }} - run: | - git config --global --add safe.directory /__w/avd/avd - ${{ matrix.task.command }} \ No newline at end of file + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v2 + # with: + # registry: ghcr.io + # username: ${{ steps.lowercase.outputs.lowercase }} + # password: ${{ secrets.GITHUB_TOKEN }} + # - name: Run Task - ${{ matrix.task.name }} + # run: | + # git config --global --add safe.directory /__w/avd/avd + # ${{ matrix.task.command }} + + + reuse-ghcr-image2: + name: Reuse first job + runs-on: ubuntu-latest + needs: [ container-job-2 ] + # container: + # image: ghcr.io/shivani-gslab/avd/python_avd:${{ github.event.pull_request.head.sha }} + steps: + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + + # - name: Pull docker image from ghcr + # run: | + # docker pull ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python:3.12 + + - name: Run Docker Container + run: | + docker run -dit --name avd-python-container ${{ needs.container-job-2.outputs.image_tag }} bash + + - name: Execute Ansible unit tests 3.12 + run: | + pwd + ls -l + + docker exec avd-python-container bash -c "source /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + \ No newline at end of file From 9d36f87a3ce484bbad27cb99960f0ce714a17c86 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 12:00:51 +0530 Subject: [PATCH 102/324] container base and run image --- .github/Dockerfile | 7 + .github/DockerfileBase | 37 + .github/DockerfilePyavd | 9 + .github/workflows/pull-request-management.yml | 833 +++++++++++------- 4 files changed, 590 insertions(+), 296 deletions(-) create mode 100644 .github/Dockerfile create mode 100644 .github/DockerfileBase create mode 100644 .github/DockerfilePyavd diff --git a/.github/Dockerfile b/.github/Dockerfile new file mode 100644 index 00000000000..508be2fce45 --- /dev/null +++ b/.github/Dockerfile @@ -0,0 +1,7 @@ +FROM ghcr.io/maheshgslab/avd-slim-test1:0.1 +COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt +RUN uv python install 3.10 3.11 3.12 3.13 && \ + /UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r /requirements-dev.txt --upgrade && \ + /UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r /requirements-dev.txt --upgrade && \ + /UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r /requirements-dev.txt --upgrade && \ + /UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r /requirements-dev.txt --upgrade diff --git a/.github/DockerfileBase b/.github/DockerfileBase new file mode 100644 index 00000000000..68b9a0f483c --- /dev/null +++ b/.github/DockerfileBase @@ -0,0 +1,37 @@ +FROM ubuntu:latest AS base +#LABEL stage=base +# Install essential packages and UV +RUN apt-get update && apt-get install -y --no-install-recommends \ + openssh-client git make python3-pip python3-dev docker.io && \ + pip install uv --break-system-packages && \ + apt-get clean && rm -rf /var/lib/apt/lists + +# Copy requirements file after installing essential tools +COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt +# Install Python versions and dependencies in a single step +RUN uv python install 3.10 3.11 3.12 3.13 && \ + for VERSION in 3.10 3.11 3.12 3.13; do \ + uv venv --python $VERSION /UV$VERSION && \ + /UV$VERSION/bin/python -m ensurepip --upgrade && \ + /UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + -r /requirements-dev.txt --upgrade; \ + done + +FROM base AS build +LABEL stage=build +COPY . /avd +WORKDIR /avd/python-avd +RUN python3 -m pip install --break-system-packages build && \ + python3 -m build --wheel --outdir /tmp/wheels && \ + for VERSION in 3.10 3.11 3.12 3.13; do \ + /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ + done + +FROM base AS run +LABEL stage=run +# Copy virtual environments from the build stage +COPY --from=build /UV3.10 /UV3.10 +COPY --from=build /UV3.11 /UV3.11 +COPY --from=build /UV3.12 /UV3.12 +COPY --from=build /UV3.13 /UV3.13 +COPY --from=build /avd /avd diff --git a/.github/DockerfilePyavd b/.github/DockerfilePyavd new file mode 100644 index 00000000000..cf80cc4b9e0 --- /dev/null +++ b/.github/DockerfilePyavd @@ -0,0 +1,9 @@ +ARG BASE_IMAGE_TAG +FROM $BASE_IMAGE_TAG +COPY . /avd +WORKDIR /avd/python-avd +RUN python3 -m pip install --break-system-packages build && \ + python3 -m build --wheel --outdir /tmp/wheels +RUN for VERSION in UV3.10 UV3.11 UV3.12 UV3.13; do \ + /$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ + done diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 9d75e338117..49e1c1d6ae7 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -1,309 +1,550 @@ -name: "Collection code testing" - -"on": pull_request - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -env: - # Set -vvv is ACTIONS_STEP_DEBUG is set - # Apparently it is set in secrets when running with debug - ANSIBLE_VERBOSITY: ${{ secrets.ACTIONS_STEP_DEBUG && 3 || 0 }} - AVD_NEVER_RUN_FROM_SOURCE: 1 - PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions - ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions - -jobs: - file-changes: - runs-on: ubuntu-latest - outputs: - eos_design: ${{ steps.filter.outputs.eos_design }} - config_gen: ${{ steps.filter.outputs.config_gen }} - cloudvision: ${{ steps.filter.outputs.cloudvision }} - dhcp: ${{ steps.filter.outputs.dhcp }} - plugins: ${{ steps.filter.outputs.plugins }} - requirements: ${{ steps.filter.outputs.requirements }} - docs: ${{ steps.filter.outputs.docs }} - steps: - - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - eos_design: - - 'ansible_collections/arista/avd/roles/eos_designs/*' - - 'ansible_collections/arista/avd/roles/eos_designs/**/*' - - '.github/workflows/pull-request-management.yml' - - 'ansible_collections/arista/avd/molecule/*' - - 'ansible_collections/arista/avd/molecule/**/*' - - 'python-avd/pyavd/_eos_designs/*' - - 'python-avd/pyavd/_eos_designs/**/*' - - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' - - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' - - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' - - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' - config_gen: - - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' - - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' - - '.github/workflows/pull-request-management.yml' - - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/*' - - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/**/*' - - 'python-avd/pyavd/_eos_cli_config_gen/*' - - 'python-avd/pyavd/_eos_cli_config_gen/**/*' - validate_state: - - 'ansible_collections/arista/avd/roles/eos_validate_state/*' - - 'ansible_collections/arista/avd/roles/eos_validate_state/**/*' - cloudvision: - - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' - - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' - - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' - - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' - - '.github/workflows/pull-request-management.yml' - dhcp: - - 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' - - 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' - - '.github/workflows/pull-request-management.yml' - plugins: - - 'ansible_collections/arista/avd/plugins/filter/**' - - 'ansible_collections/arista/avd/plugins/test/**' - requirements: - - 'ansible_collections/arista/avd/requirements.txt' - - 'ansible_collections/arista/avd/requirements-dev.txt' - - 'ansible_collections/arista/avd/meta/runtime.yml' - - '.github/requirements-ci.txt' - - '.github/workflows/pull-request-management.yml' - docs: - - '.github/workflows/pull-request-management.yml' - - 'mkdocs.yml' - - 'ansible_collections/arista/avd/docs/**' - - 'ansible_collections/arista/avd/roles/**/*.md' - - 'ansible_collections/arista/avd/**/*.md' - - 'ansible_collections/arista/avd/README.md' - - 'ansible_collections/arista/avd/**/*.schema.yml' - pyavd: - - 'python_avd/*' - - 'python_avd/**/*' - container-job-1: - runs-on: ubuntu-latest - container: - image: ubuntu:latest - options: --cpus 1 - - outputs: - image_tag: ${{ steps.build-image.outputs.image_tag }} - - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - - name: Set up Docker - run: | - apt-get update - apt-get install -y docker.io - - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Create Dockerfile dynamically - run: | - echo "Creating Dockerfile..." - cat < Dockerfile - # Base image - # FROM ghcr.io/shivani-gslab/avd-slim-test:0.1 - FROM ubuntu:latest - ENV PIP_CACHE_DIR=/cache - ARG PYTHON_VERSIONS="3.10 3.11 3.12 3.13" - - RUN mkdir -p /cache - COPY . /avd - - WORKDIR /avd - RUN pwd && ls -l - RUN apt-get update && apt-get install -y --no-install-recommends \ - openssh-client git make python3-pip python3-dev docker.io && \ - pip install --cache-dir=$PIP_CACHE_DIR uv --break-system-packages && \ - uv python install 3.10 3.11 3.12 3.13 - - WORKDIR / - RUN for version in 3.10 3.11 3.12 3.13; do \ - echo "Checking if virtual environment for Python \$version exists..." && \ - if [ ! -d "UV\$version" ]; then \ - echo "Virtual environment for Python \$version does not exist. Creating it..." && \ - uv venv --python \$version UV\$version && \ - UV\$version/bin/python -m ensurepip --upgrade && \ - echo "Virtual environment UV\$version created and pip upgraded."; \ - else \ - echo "Virtual environment for Python \$version already exists, skipping creation..."; \ - fi && \ - UV\$version/bin/python -m pip install --cache-dir=$PIP_CACHE_DIR \ - mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r /avd/ansible_collections/arista/avd/requirements-dev.txt --upgrade && \ - echo "Dependencies installed for Python \$version in virtual environment UV\$version."; \ - done - - RUN apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - - CMD ["python"] - EOF - echo "Dockerfile created successfully." - - - name: Build Docker Image - id: build-image - run: | - SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-8) - IMAGE_TAG=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-slim-test:${{ github.run_number }}-$SHORT_SHA - docker build -t $IMAGE_TAG . - docker push $IMAGE_TAG - echo "::set-output name=image_tag::$IMAGE_TAG" - - container-job-2: - needs: container-job-1 - runs-on: ubuntu-latest - container: - image: ${{ needs.container-job-1.outputs.image_tag }} - #image: ghcr.io/shivani-gslab/avd/python:497-92985fc8 - options: --cpus 1 - # credentials: - # username: shivani-gslab - # password: ${{ secrets.github_token }} - outputs: - image_tag: ${{ steps.wheel-image-tag.outputs.wheel_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Additional Task in Second Container - id: wheel-image-tag - run: | - cd python-avd - - # Build the wheel package - echo "Building the wheel package..." - python3 -m pip install --break-system-packages build - python3 -m build --wheel --outdir /tmp/wheels - # Install pyavd - /UV3.10/bin/python -m pip install /tmp/wheels/*.whl - /UV3.11/bin/python -m pip install /tmp/wheels/*.whl - /UV3.12/bin/python -m pip install /tmp/wheels/*.whl - /UV3.13/bin/python -m pip install /tmp/wheels/*.whl - - # cd ../.. - # Generate a unique tag using run number and truncated commit SHA - WHEEL_IMAGE_TAG=${{ needs.container-job-1.outputs.image_tag }}-2 - - # docker build -t $WHEEL_IMAGE_TAG . - # docker push $WHEEL_IMAGE_TAG - # Build the updated image from the current container state - - # cp -r avd/ /avd - # pwd - # ls -al /avd/python-avd/pyavd/_schema/ - docker commit $(docker ps -q --filter ancestor=${{ needs.container-job-1.outputs.image_tag }}) $WHEEL_IMAGE_TAG - - # Push the updated image to GitHub Container Registry - docker push $WHEEL_IMAGE_TAG - echo "::set-output name=wheel_image_tag::$WHEEL_IMAGE_TAG" - - - # reuse-ghcr-image: - # name: reuse first job - # needs: container-job-2 - # runs-on: ubuntu-latest - # container: - # #image: ghcr.io/shivani-gslab/avd-slim-test:latest - # image: ${{ needs.container-job-2.outputs.image_tag }} - # # image: ghcr.io/shivani-gslab/avd-slim-test:554-ebeea5fd-2 - # options: --cpus 1 - - - # strategy: - # matrix: - # task: - # - name: Execute Ansible unit tests 3.12 - # command: "ls -al /avd/python-avd/pyavd/_schema && find / -type f -name '*.pickle' && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" - # - name: Execute Ansible integration tests 3.12 - # command: "pwd && ls -al /avd/python-avd/pyavd/_schema && . /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - # # - name: Execute Ansible integration tests 3.13 - # # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - # # - name: Execute Ansible sanity tests 3.13 - # # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # # - name: Execute Ansible sanity tests 3.12 - # # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # # - name: Execute Ansible lint tests 3.11 - # # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" - # steps: - # # - name: Check out repository code - # # uses: actions/checkout@v4 - # - name: Convert GitHub username to lowercase - # id: lowercase - # run: | - # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - # - name: Log in to GitHub Container Registry - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ steps.lowercase.outputs.lowercase }} - # password: ${{ secrets.GITHUB_TOKEN }} - # - name: Run Task - ${{ matrix.task.name }} - # run: | - # git config --global --add safe.directory /__w/avd/avd - # ${{ matrix.task.command }} - - - reuse-ghcr-image2: - name: Reuse first job +--- + name: "Collection code testing" + + "on": pull_request + + concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + + env: + # Set -vvv is ACTIONS_STEP_DEBUG is set + # Apparently it is set in secrets when running with debug + ANSIBLE_VERBOSITY: ${{ secrets.ACTIONS_STEP_DEBUG && 3 || 0 }} + AVD_NEVER_RUN_FROM_SOURCE: 1 + PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions + ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions + + jobs: + file-changes: runs-on: ubuntu-latest - needs: [ container-job-2 ] - # container: - # image: ghcr.io/shivani-gslab/avd/python_avd:${{ github.event.pull_request.head.sha }} - steps: + outputs: + eos_design: ${{ steps.filter.outputs.eos_design }} + config_gen: ${{ steps.filter.outputs.config_gen }} + cloudvision: ${{ steps.filter.outputs.cloudvision }} + dhcp: ${{ steps.filter.outputs.dhcp }} + plugins: ${{ steps.filter.outputs.plugins }} + requirements: ${{ steps.filter.outputs.requirements }} + docs: ${{ steps.filter.outputs.docs }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + eos_design: + - 'ansible_collections/arista/avd/roles/eos_designs/*' + - 'ansible_collections/arista/avd/roles/eos_designs/**/*' + - '.github/workflows/pull-request-management.yml' + - 'ansible_collections/arista/avd/molecule/*' + - 'ansible_collections/arista/avd/molecule/**/*' + - 'python-avd/pyavd/_eos_designs/*' + - 'python-avd/pyavd/_eos_designs/**/*' + - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' + - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' + - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' + - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' + config_gen: + - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' + - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' + - '.github/workflows/pull-request-management.yml' + - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/*' + - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/**/*' + - 'python-avd/pyavd/_eos_cli_config_gen/*' + - 'python-avd/pyavd/_eos_cli_config_gen/**/*' + validate_state: + - 'ansible_collections/arista/avd/roles/eos_validate_state/*' + - 'ansible_collections/arista/avd/roles/eos_validate_state/**/*' + cloudvision: + - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' + - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' + - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' + - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' + - '.github/workflows/pull-request-management.yml' + dhcp: + - 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' + - 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' + - '.github/workflows/pull-request-management.yml' + plugins: + - 'ansible_collections/arista/avd/plugins/filter/**' + - 'ansible_collections/arista/avd/plugins/test/**' + requirements: + - 'ansible_collections/arista/avd/requirements.txt' + - 'ansible_collections/arista/avd/requirements-dev.txt' + - 'ansible_collections/arista/avd/meta/runtime.yml' + - '.github/requirements-ci.txt' + docs: + - '.github/workflows/pull-request-management.yml' + - 'mkdocs.yml' + - 'ansible_collections/arista/avd/docs/**' + - 'ansible_collections/arista/avd/roles/**/*.md' + - 'ansible_collections/arista/avd/**/*.md' + - 'ansible_collections/arista/avd/README.md' + - 'ansible_collections/arista/avd/**/*.schema.yml' + pyavd: + - 'python_avd/*' + - 'python_avd/**/*' + avd-base-image: + runs-on: ubuntu-latest + container: + image: ubuntu:latest + options: --cpus 1 + outputs: + base_image_tag: ${{ steps.set-base-tag.outputs.base_image_tag }} + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Calculate Hash of Requirements + id: hash-reqs + run: | + HASH_OF_REQS=$(sha256sum ansible_collections/arista/avd/requirements-dev.txt | cut -d' ' -f1) + echo "Hash of requirements: $HASH_OF_REQS" + echo "::set-output name=hash_of_reqs::$HASH_OF_REQS" - name: Convert GitHub username to lowercase id: lowercase run: | echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - + - name: Set Base Image Tag + id: set-base-tag + run: | + BASE_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ steps.hash-reqs.outputs.hash_of_reqs }}" + echo "::set-output name=base_image_tag::$BASE_IMAGE_TAG" + - name: Set up Docker + run: | + apt-get update + apt-get install -y docker.io + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Check if image exists + id: check-base-image + run: | + if docker manifest inspect ${{ steps.set-base-tag.outputs.base_image_tag }} > /dev/null 2>&1; then + echo "Base image exists." + echo "::set-output name=image_exists::true" + else + echo "Base image does not exist." + echo "::set-output name=image_exists::false" + fi + + - name: Set up Docker Buildx + if: steps.check-base-image.outputs.image_exists == 'false' + uses: docker/setup-buildx-action@v3 + + - name: Build and push + if: steps.check-base-image.outputs.image_exists == 'false' + uses: docker/build-push-action@v6 + with: + file: .github/DockerfileBase + target: base + push: true + tags: ${{ steps.set-base-tag.outputs.base_image_tag }} + cache-from: type=gha + cache-to: type=gha,mode=max + + build-pyavd: + name: Install pyavd and Build Image + needs: [avd-base-image] + runs-on: ubuntu-latest + outputs: + build_image_tag: ${{ steps.set-build-tag.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + - name: Set Build Image Tag + id: set-build-tag + run: | + SHORT_SHA=$(git rev-parse --short HEAD) + BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" + echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" - name: Log in to GitHub Container Registry uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ steps.lowercase.outputs.lowercase }} password: ${{ secrets.GITHUB_TOKEN }} - - # - name: Pull docker image from ghcr - # run: | - # docker pull ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd/python:3.12 - - - name: Run Docker Container + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v6 + with: + file: .github/DockerfileBase + push: true + target: run + tags: ${{ steps.set-build-tag.outputs.build_image_tag }} + cache-from: type=gha + cache-to: type=gha,mode=max + # build-args: | + # BASE_IMAGE_TAG: ${{ needs.setup-avd.outputs.image_tag }} + run-container: + name: Run All Tests + needs: [build-pyavd] + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + options: --cpus 1 + strategy: + matrix: + task: + - name: Ansible Unit Tests 3.12 + command: | + ". /UV3.12/bin/activate" + "cd /avd/ansible_collections/arista/avd" + "ansible-test units -vv" + - name: Ansible Integration Tests 3.12 + command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + - name: Ansible Integration Tests 3.13 + command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + - name: Ansible Sanity Tests 3.13 + command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + - name: Ansible Sanity Tests 3.12 + command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + - name: Ansible Lint Tests 3.11 + command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + # - name: Molecule(eos_cli_config_gen) Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && molecule test --scenario-name eos_cli_config_gen" + # - name: Molecule(eos_cli_config_gen_deprecated_vars) Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install ansible-core<2.19.0' --upgrade && molecule test --scenario-name eos_cli_config_gen_deprecated_vars" + # - name: Molecule(eos_cli_config_gen_negative_unit_tests) Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && molecule test --scenario-name eos_cli_config_gen_negative_unit_tests" + # - name: Molecule(eos_cli_config_gen) with Minimum Ansible Version Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' && molecule test --scenario-name eos_cli_config_gen" + # - name: Molecule:- eos_designs_deprecated_vars Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs_deprecated_vars" + # - name: Molecule:- eos_designs-l2ls Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs-l2ls" + # - name: Molecule:- eos_designs-mpls-isis-sr-ldp Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs-mpls-isis-sr-ldp" + # - name: Molecule:- eos_designs_negative_unit_tests Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs_negative_unit_tests" + # - name: Molecule:- eos_designs-twodc-5stage-clos Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs-twodc-5stage-clos" + # - name: Molecule:- eos_designs_unit_tests Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs_unit_tests" + # - name: Molecule:- evpn_underlay_ebgp_overlay_ebgp Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_ebgp_overlay_ebgp" + # - name: Molecule:- evpn_underlay_isis_overlay_ibgp Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_isis_overlay_ibgp" + # - name: Molecule:- evpn_underlay_ospf_overlay_ebgp Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_ospf_overlay_ebgp" + # - name: Molecule:- evpn_underlay_rfc5549_overlay_ebgp Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_rfc5549_overlay_ebgp" + # - name: Molecule:- example-campus-fabric Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-campus-fabric" + # - name: Molecule:- example-dual-dc-l3ls Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-dual-dc-l3ls" + # - name: Molecule:- example-isis-ldp-ipvpn Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-isis-ldp-ipvpn" + # - name: Molecule:- example-l2ls-fabric Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-l2ls-fabric" + # - name: Molecule:- example-single-dc-l3ls Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-single-dc-l3ls" + # - name: Molecule:- example-cv-pathfinder Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-cv-pathfinder" + # - name: Molecule:- eos_designs_unit_tests ansible-core==2.16.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' --upgrade && test --scenario-name eos_designs_unit_tests" + # - name: Molecule:- eos_designs_unit_tests ansible-core<2.18.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.18.0' --upgrade && test --scenario-name eos_designs_unit_tests" + # - name: Molecule:- eos_designs_unit_tests ansible-core<2.19.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && test --scenario-name eos_designs_unit_tests" + # - name: Molecule:- eos_config_deploy_cvp ansible-core<2.19.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && test --scenario-name eos_config_deploy_cvp" + # - name: Molecule:- eos_config_deploy_cvp ansible-core==2.16.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' && test --scenario-name eos_config_deploy_cvp" + # - name: Molecule:- eos_validate_state ansible-core<2.19.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && test --scenario-name eos_validate_state" + # - name: Molecule:- eos_config_deploy_cvp ansible-core==2.16.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' && test --scenario-name eos_validate_state" + steps: + - name: Convert GitHub username to lowercase + id: lowercase run: | - docker run -dit --name avd-python-container ${{ needs.container-job-2.outputs.image_tag }} bash - - - name: Execute Ansible unit tests 3.12 + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Run Task - ${{ matrix.task.name }} run: | - pwd - ls -l - - docker exec avd-python-container bash -c "source /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" - \ No newline at end of file + ${{ matrix.task.command }} + + # # ----------------------------------- # + # # EOS CLI CONFIG GEN MOLECULE + # # ----------------------------------- # + # molecule_eos_cli_config_gen: + # name: Validate eos_cli_config_gen + # runs-on: ubuntu-latest + # strategy: + # fail-fast: true + # matrix: + # avd_scenario: + # - 'eos_cli_config_gen' + # - 'eos_cli_config_gen_deprecated_vars' + # - 'eos_cli_config_gen_negative_unit_tests' + # ansible_version: + # - 'ansible-core<2.19.0 --upgrade' + # # Also test minimum ansible version for one scenario. + # include: + # - avd_scenario: 'eos_cli_config_gen' + # ansible_version: 'ansible-core==2.15.0' + # needs: [ file-changes ] + # if: needs.file-changes.outputs.config_gen == 'true' + # steps: + # - uses: actions/checkout@v4 + # - name: Run molecule action + # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 + # with: + # molecule_parentdir: 'ansible_collections/arista/avd' + # molecule_command: 'test' + # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' + # pip_file: .github/requirements-ci.txt + # galaxy_file: "ansible_collections/arista/avd/collections.yml" + # ansible: ${{ matrix.ansible_version }} + # check_git: true + # check_git_enforced: true + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + + # # ----------------------------------- # + # # DHCP PROVISIONNER MOLECULE + # # ----------------------------------- # + # molecule_dhcp_provisionner: + # name: Validate DHCP configuration + # runs-on: ubuntu-latest + # strategy: + # fail-fast: true + # matrix: + # avd_scenario: ['dhcp_configuration', 'dhcp_provisioning'] + # ansible_version: ['ansible-core<2.19.0 --upgrade'] + # needs: [ file-changes ] + # if: needs.file-changes.outputs.dhcp == 'true' + # steps: + # - uses: actions/checkout@v4 + # - name: Run molecule action + # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 + # with: + # molecule_parentdir: 'ansible_collections/arista/avd' + # molecule_command: 'test' + # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' + # pip_file: .github/requirements-ci.txt + # galaxy_file: "ansible_collections/arista/avd/collections.yml" + # ansible: ${{ matrix.ansible_version }} + # check_git: true + # check_git_enforced: true + # # - uses: actions/upload-artifact@v4 + # # with: + # # name: molecule-${{ matrix.avd_scenario }}-artifacts + # # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + + # # ----------------------------------- # + # # EOS Design MOLECULE + # # ----------------------------------- # + # molecule_eos_designs: + # name: Validate eos_designs + # runs-on: ubuntu-latest + # strategy: + # fail-fast: true + # matrix: + # avd_scenario: + # - 'eos_designs_deprecated_vars' + # - 'eos_designs-l2ls' + # - 'eos_designs-mpls-isis-sr-ldp' + # - 'eos_designs_negative_unit_tests' + # - 'eos_designs-twodc-5stage-clos' + # - 'eos_designs_unit_tests' + # - 'evpn_underlay_ebgp_overlay_ebgp' + # - 'evpn_underlay_isis_overlay_ibgp' + # - 'evpn_underlay_ospf_overlay_ebgp' + # - 'evpn_underlay_rfc5549_overlay_ebgp' + # - 'example-campus-fabric' + # - 'example-dual-dc-l3ls' + # - 'example-isis-ldp-ipvpn' + # - 'example-l2ls-fabric' + # - 'example-single-dc-l3ls' + # - 'example-cv-pathfinder' + # ansible_version: + # # Testing all scenario with 2.16.x, due to bug with in 2.17.0 with and the way we test eos_designs_negative_unit_tests https://github.com/ansible/ansible/issues/83292 + # - 'ansible-core>=2.16.0,<2.17.0 --upgrade' + # pip_requirements: + # - '.github/requirements-ci.txt' + # # Also test minimum ansible version for one scenario. + # include: + # - avd_scenario: 'eos_designs_unit_tests' + # ansible_version: 'ansible-core==2.15.0' + # pip_requirements: 'tmp-requirements-minimum.txt' + # - avd_scenario: 'eos_designs_unit_tests' + # ansible_version: 'ansible-core>=2.15.0,<2.16.0 --upgrade' + # pip_requirements: '.github/requirements-ci.txt' + # - avd_scenario: 'eos_designs_unit_tests' + # ansible_version: 'ansible-core<2.18.0 --upgrade' + # pip_requirements: '.github/requirements-ci.txt' + # - avd_scenario: 'eos_designs_unit_tests' + # ansible_version: 'ansible-core<2.19.0 --upgrade' + # pip_requirements: '.github/requirements-ci.txt' + # needs: [ file-changes ] + # if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' + # steps: + # - uses: actions/checkout@v4 + # - name: Build minimum requirements + # run: | + # pip install uv + # uv pip compile .github/requirements-ci.txt --resolution=lowest-direct > ${{ matrix.pip_requirements }} + # cat ${{ matrix.pip_requirements }} + # if: matrix.pip_requirements == 'tmp-requirements-minimum.txt' + # - name: Run molecule action + # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 + # with: + # molecule_parentdir: 'ansible_collections/arista/avd' + # molecule_command: 'test' + # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' + # pip_file: ${{ matrix.pip_requirements }} + # galaxy_file: "ansible_collections/arista/avd/collections.yml" + # ansible: ${{ matrix.ansible_version }} + # check_git: true + # check_git_enforced: true + # # - uses: actions/upload-artifact@v4 + # # with: + # # name: molecule-${{ matrix.avd_scenario }}-artifacts + # # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + # # ----------------------------------- # + # # Cloudvision MOLECULE + # # ----------------------------------- # + # molecule_cloudvision: + # name: Validate cvp_collection + # runs-on: ubuntu-latest + # strategy: + # fail-fast: true + # matrix: + # avd_scenario: + # - 'eos_config_deploy_cvp' + # ansible_version: + # - 'ansible-core<2.19.0 --upgrade' + # include: + # - avd_scenario: 'eos_config_deploy_cvp' + # ansible_version: 'ansible-core==2.15.0' + # needs: [ file-changes ] + # if: needs.file-changes.outputs.cloudvision == 'true' || needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' + + # steps: + # - uses: actions/checkout@v4 + # - name: Run molecule action + # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 + # with: + # molecule_parentdir: 'ansible_collections/arista/avd' + # molecule_command: 'test' + # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' + # pip_file: .github/requirements-ci.txt + # galaxy_file: "ansible_collections/arista/avd/collections.yml" + # ansible: ${{ matrix.ansible_version }} + # check_git: true + # check_git_enforced: true + # # - uses: actions/upload-artifact@v4 + # # with: + # # name: molecule-${{ matrix.avd_scenario }}-artifacts + # # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + # # + # # ----------------------------------- # + # # EOS Validate State MOLECULE + # # ----------------------------------- # + # molecule_eos_validate_state: + # name: Validate eos_validate_state + # runs-on: ubuntu-latest + # strategy: + # fail-fast: true + # matrix: + # avd_scenario: + # - 'eos_validate_state' + # ansible_version: + # - 'ansible-core<2.19.0 --upgrade' + # include: + # - avd_scenario: 'eos_validate_state' + # ansible_version: 'ansible-core==2.15.0' + # needs: [ file-changes ] + # if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.validate_state == 'true' + # steps: + # - uses: actions/checkout@v4 + # - name: Run molecule action + # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 + # with: + # molecule_parentdir: 'ansible_collections/arista/avd' + # molecule_command: 'test' + # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' + # pip_file: .github/requirements-ci.txt + # galaxy_file: "ansible_collections/arista/avd/collections.yml" + # ansible: ${{ matrix.ansible_version }} + # check_git: true + # check_git_enforced: true + + # # ----------------------------------- # + # # Galaxy Importer + # # ----------------------------------- # + # galaxy_importer: + # name: Test galaxy-importer + # runs-on: ubuntu-20.04 # Older version to be compatible with old python + # env: + # GALAXY_IMPORTER_CONFIG: galaxy-importer/galaxy-importer.cfg + # steps: + # - uses: actions/setup-python@v5 + # with: + # python-version: | + # 3.10 + # - uses: actions/checkout@v4 + # - name: 'Install Python & Ansible requirements' + # run: | + # pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade + # ansible-galaxy collection install -r ansible_collections/arista/avd/collections.yml + # - name: Install galaxy-importer + # # Install the specific version of galaxy-importer used on galaxy.ansible.com + # # The version conflicts with our requirements, + # # so we let the galaxy-importer version resolve remaining requirements. + # run: | + # pip install "galaxy-importer==0.4.26" + # - name: 'Build ansible package' + # run: make collection-build + # - name: 'Run galaxy-importer checks' + # run: python -m galaxy_importer.main *.tar.gz + # - uses: actions/upload-artifact@v4 + # with: + # name: importer-logs + # path: ./importer_result.json + + # # ----------------------------------- # + # # Test of pyavd + # # ----------------------------------- # + # pyavd: + # name: Test pyavd + # runs-on: ubuntu-latest + # needs: [file-changes] + # if: | + # needs.file-changes.outputs.eos_design == 'true' || + # needs.file-changes.outputs.config_gen == 'true' || + # needs.file-changes.outputs.pyavd == 'true' + # strategy: + # matrix: + # python: ["3.10", "3.11", "3.12", "3.13"] + # steps: + # - uses: actions/checkout@v4 + # - name: Set up Python 3 + # uses: actions/setup-python@v5 + # with: + # python-version: ${{ matrix.python }} + # - name: 'Install tox' + # run: | + # pip install tox tox-gh-actions --upgrade + # - name: "Run pytest via tox for ${{ matrix.python }}" + # working-directory: python-avd + # run: | + # tox \ No newline at end of file From 8f44486d064b2fcac7c7230715da76b6eb477a3e Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 12:09:27 +0530 Subject: [PATCH 103/324] container base and run 2 --- .github/workflows/pull-request-management.yml | 1098 ++++++++--------- 1 file changed, 549 insertions(+), 549 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 49e1c1d6ae7..eeff30f72fd 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -1,550 +1,550 @@ --- - name: "Collection code testing" - - "on": pull_request - - concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - - env: - # Set -vvv is ACTIONS_STEP_DEBUG is set - # Apparently it is set in secrets when running with debug - ANSIBLE_VERBOSITY: ${{ secrets.ACTIONS_STEP_DEBUG && 3 || 0 }} - AVD_NEVER_RUN_FROM_SOURCE: 1 - PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions - ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions - - jobs: - file-changes: - runs-on: ubuntu-latest - outputs: - eos_design: ${{ steps.filter.outputs.eos_design }} - config_gen: ${{ steps.filter.outputs.config_gen }} - cloudvision: ${{ steps.filter.outputs.cloudvision }} - dhcp: ${{ steps.filter.outputs.dhcp }} - plugins: ${{ steps.filter.outputs.plugins }} - requirements: ${{ steps.filter.outputs.requirements }} - docs: ${{ steps.filter.outputs.docs }} - steps: - - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - eos_design: - - 'ansible_collections/arista/avd/roles/eos_designs/*' - - 'ansible_collections/arista/avd/roles/eos_designs/**/*' - - '.github/workflows/pull-request-management.yml' - - 'ansible_collections/arista/avd/molecule/*' - - 'ansible_collections/arista/avd/molecule/**/*' - - 'python-avd/pyavd/_eos_designs/*' - - 'python-avd/pyavd/_eos_designs/**/*' - - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' - - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' - - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' - - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' - config_gen: - - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' - - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' - - '.github/workflows/pull-request-management.yml' - - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/*' - - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/**/*' - - 'python-avd/pyavd/_eos_cli_config_gen/*' - - 'python-avd/pyavd/_eos_cli_config_gen/**/*' - validate_state: - - 'ansible_collections/arista/avd/roles/eos_validate_state/*' - - 'ansible_collections/arista/avd/roles/eos_validate_state/**/*' - cloudvision: - - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' - - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' - - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' - - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' - - '.github/workflows/pull-request-management.yml' - dhcp: - - 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' - - 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' - - '.github/workflows/pull-request-management.yml' - plugins: - - 'ansible_collections/arista/avd/plugins/filter/**' - - 'ansible_collections/arista/avd/plugins/test/**' - requirements: - - 'ansible_collections/arista/avd/requirements.txt' - - 'ansible_collections/arista/avd/requirements-dev.txt' - - 'ansible_collections/arista/avd/meta/runtime.yml' - - '.github/requirements-ci.txt' - docs: - - '.github/workflows/pull-request-management.yml' - - 'mkdocs.yml' - - 'ansible_collections/arista/avd/docs/**' - - 'ansible_collections/arista/avd/roles/**/*.md' - - 'ansible_collections/arista/avd/**/*.md' - - 'ansible_collections/arista/avd/README.md' - - 'ansible_collections/arista/avd/**/*.schema.yml' - pyavd: - - 'python_avd/*' - - 'python_avd/**/*' - avd-base-image: - runs-on: ubuntu-latest - container: - image: ubuntu:latest - options: --cpus 1 - outputs: - base_image_tag: ${{ steps.set-base-tag.outputs.base_image_tag }} - steps: - - name: Check out repository - uses: actions/checkout@v4 - - - name: Calculate Hash of Requirements - id: hash-reqs - run: | - HASH_OF_REQS=$(sha256sum ansible_collections/arista/avd/requirements-dev.txt | cut -d' ' -f1) - echo "Hash of requirements: $HASH_OF_REQS" - echo "::set-output name=hash_of_reqs::$HASH_OF_REQS" - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - name: Set Base Image Tag - id: set-base-tag - run: | - BASE_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ steps.hash-reqs.outputs.hash_of_reqs }}" - echo "::set-output name=base_image_tag::$BASE_IMAGE_TAG" - - name: Set up Docker - run: | - apt-get update - apt-get install -y docker.io - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Check if image exists - id: check-base-image - run: | - if docker manifest inspect ${{ steps.set-base-tag.outputs.base_image_tag }} > /dev/null 2>&1; then - echo "Base image exists." - echo "::set-output name=image_exists::true" - else - echo "Base image does not exist." - echo "::set-output name=image_exists::false" - fi - - - name: Set up Docker Buildx - if: steps.check-base-image.outputs.image_exists == 'false' - uses: docker/setup-buildx-action@v3 - - - name: Build and push - if: steps.check-base-image.outputs.image_exists == 'false' - uses: docker/build-push-action@v6 - with: - file: .github/DockerfileBase - target: base - push: true - tags: ${{ steps.set-base-tag.outputs.base_image_tag }} - cache-from: type=gha - cache-to: type=gha,mode=max - - build-pyavd: - name: Install pyavd and Build Image - needs: [avd-base-image] - runs-on: ubuntu-latest - outputs: - build_image_tag: ${{ steps.set-build-tag.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - name: Set Build Image Tag - id: set-build-tag - run: | - SHORT_SHA=$(git rev-parse --short HEAD) - BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" - echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v6 - with: - file: .github/DockerfileBase - push: true - target: run - tags: ${{ steps.set-build-tag.outputs.build_image_tag }} - cache-from: type=gha - cache-to: type=gha,mode=max - # build-args: | - # BASE_IMAGE_TAG: ${{ needs.setup-avd.outputs.image_tag }} - run-container: - name: Run All Tests - needs: [build-pyavd] - runs-on: ubuntu-latest - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - options: --cpus 1 - strategy: - matrix: - task: - - name: Ansible Unit Tests 3.12 - command: | - ". /UV3.12/bin/activate" - "cd /avd/ansible_collections/arista/avd" - "ansible-test units -vv" - - name: Ansible Integration Tests 3.12 - command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - - name: Ansible Integration Tests 3.13 - command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - - name: Ansible Sanity Tests 3.13 - command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - - name: Ansible Sanity Tests 3.12 - command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - - name: Ansible Lint Tests 3.11 - command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" - # - name: Molecule(eos_cli_config_gen) Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && molecule test --scenario-name eos_cli_config_gen" - # - name: Molecule(eos_cli_config_gen_deprecated_vars) Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install ansible-core<2.19.0' --upgrade && molecule test --scenario-name eos_cli_config_gen_deprecated_vars" - # - name: Molecule(eos_cli_config_gen_negative_unit_tests) Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && molecule test --scenario-name eos_cli_config_gen_negative_unit_tests" - # - name: Molecule(eos_cli_config_gen) with Minimum Ansible Version Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' && molecule test --scenario-name eos_cli_config_gen" - # - name: Molecule:- eos_designs_deprecated_vars Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs_deprecated_vars" - # - name: Molecule:- eos_designs-l2ls Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs-l2ls" - # - name: Molecule:- eos_designs-mpls-isis-sr-ldp Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs-mpls-isis-sr-ldp" - # - name: Molecule:- eos_designs_negative_unit_tests Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs_negative_unit_tests" - # - name: Molecule:- eos_designs-twodc-5stage-clos Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs-twodc-5stage-clos" - # - name: Molecule:- eos_designs_unit_tests Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs_unit_tests" - # - name: Molecule:- evpn_underlay_ebgp_overlay_ebgp Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_ebgp_overlay_ebgp" - # - name: Molecule:- evpn_underlay_isis_overlay_ibgp Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_isis_overlay_ibgp" - # - name: Molecule:- evpn_underlay_ospf_overlay_ebgp Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_ospf_overlay_ebgp" - # - name: Molecule:- evpn_underlay_rfc5549_overlay_ebgp Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_rfc5549_overlay_ebgp" - # - name: Molecule:- example-campus-fabric Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-campus-fabric" - # - name: Molecule:- example-dual-dc-l3ls Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-dual-dc-l3ls" - # - name: Molecule:- example-isis-ldp-ipvpn Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-isis-ldp-ipvpn" - # - name: Molecule:- example-l2ls-fabric Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-l2ls-fabric" - # - name: Molecule:- example-single-dc-l3ls Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-single-dc-l3ls" - # - name: Molecule:- example-cv-pathfinder Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-cv-pathfinder" - # - name: Molecule:- eos_designs_unit_tests ansible-core==2.16.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' --upgrade && test --scenario-name eos_designs_unit_tests" - # - name: Molecule:- eos_designs_unit_tests ansible-core<2.18.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.18.0' --upgrade && test --scenario-name eos_designs_unit_tests" - # - name: Molecule:- eos_designs_unit_tests ansible-core<2.19.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && test --scenario-name eos_designs_unit_tests" - # - name: Molecule:- eos_config_deploy_cvp ansible-core<2.19.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && test --scenario-name eos_config_deploy_cvp" - # - name: Molecule:- eos_config_deploy_cvp ansible-core==2.16.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' && test --scenario-name eos_config_deploy_cvp" - # - name: Molecule:- eos_validate_state ansible-core<2.19.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && test --scenario-name eos_validate_state" - # - name: Molecule:- eos_config_deploy_cvp ansible-core==2.16.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' && test --scenario-name eos_validate_state" - steps: - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Run Task - ${{ matrix.task.name }} - run: | - ${{ matrix.task.command }} - - # # ----------------------------------- # - # # EOS CLI CONFIG GEN MOLECULE - # # ----------------------------------- # - # molecule_eos_cli_config_gen: - # name: Validate eos_cli_config_gen - # runs-on: ubuntu-latest - # strategy: - # fail-fast: true - # matrix: - # avd_scenario: - # - 'eos_cli_config_gen' - # - 'eos_cli_config_gen_deprecated_vars' - # - 'eos_cli_config_gen_negative_unit_tests' - # ansible_version: - # - 'ansible-core<2.19.0 --upgrade' - # # Also test minimum ansible version for one scenario. - # include: - # - avd_scenario: 'eos_cli_config_gen' - # ansible_version: 'ansible-core==2.15.0' - # needs: [ file-changes ] - # if: needs.file-changes.outputs.config_gen == 'true' - # steps: - # - uses: actions/checkout@v4 - # - name: Run molecule action - # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - # with: - # molecule_parentdir: 'ansible_collections/arista/avd' - # molecule_command: 'test' - # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - # pip_file: .github/requirements-ci.txt - # galaxy_file: "ansible_collections/arista/avd/collections.yml" - # ansible: ${{ matrix.ansible_version }} - # check_git: true - # check_git_enforced: true - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - - # # ----------------------------------- # - # # DHCP PROVISIONNER MOLECULE - # # ----------------------------------- # - # molecule_dhcp_provisionner: - # name: Validate DHCP configuration - # runs-on: ubuntu-latest - # strategy: - # fail-fast: true - # matrix: - # avd_scenario: ['dhcp_configuration', 'dhcp_provisioning'] - # ansible_version: ['ansible-core<2.19.0 --upgrade'] - # needs: [ file-changes ] - # if: needs.file-changes.outputs.dhcp == 'true' - # steps: - # - uses: actions/checkout@v4 - # - name: Run molecule action - # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - # with: - # molecule_parentdir: 'ansible_collections/arista/avd' - # molecule_command: 'test' - # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - # pip_file: .github/requirements-ci.txt - # galaxy_file: "ansible_collections/arista/avd/collections.yml" - # ansible: ${{ matrix.ansible_version }} - # check_git: true - # check_git_enforced: true - # # - uses: actions/upload-artifact@v4 - # # with: - # # name: molecule-${{ matrix.avd_scenario }}-artifacts - # # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - - # # ----------------------------------- # - # # EOS Design MOLECULE - # # ----------------------------------- # - # molecule_eos_designs: - # name: Validate eos_designs - # runs-on: ubuntu-latest - # strategy: - # fail-fast: true - # matrix: - # avd_scenario: - # - 'eos_designs_deprecated_vars' - # - 'eos_designs-l2ls' - # - 'eos_designs-mpls-isis-sr-ldp' - # - 'eos_designs_negative_unit_tests' - # - 'eos_designs-twodc-5stage-clos' - # - 'eos_designs_unit_tests' - # - 'evpn_underlay_ebgp_overlay_ebgp' - # - 'evpn_underlay_isis_overlay_ibgp' - # - 'evpn_underlay_ospf_overlay_ebgp' - # - 'evpn_underlay_rfc5549_overlay_ebgp' - # - 'example-campus-fabric' - # - 'example-dual-dc-l3ls' - # - 'example-isis-ldp-ipvpn' - # - 'example-l2ls-fabric' - # - 'example-single-dc-l3ls' - # - 'example-cv-pathfinder' - # ansible_version: - # # Testing all scenario with 2.16.x, due to bug with in 2.17.0 with and the way we test eos_designs_negative_unit_tests https://github.com/ansible/ansible/issues/83292 - # - 'ansible-core>=2.16.0,<2.17.0 --upgrade' - # pip_requirements: - # - '.github/requirements-ci.txt' - # # Also test minimum ansible version for one scenario. - # include: - # - avd_scenario: 'eos_designs_unit_tests' - # ansible_version: 'ansible-core==2.15.0' - # pip_requirements: 'tmp-requirements-minimum.txt' - # - avd_scenario: 'eos_designs_unit_tests' - # ansible_version: 'ansible-core>=2.15.0,<2.16.0 --upgrade' - # pip_requirements: '.github/requirements-ci.txt' - # - avd_scenario: 'eos_designs_unit_tests' - # ansible_version: 'ansible-core<2.18.0 --upgrade' - # pip_requirements: '.github/requirements-ci.txt' - # - avd_scenario: 'eos_designs_unit_tests' - # ansible_version: 'ansible-core<2.19.0 --upgrade' - # pip_requirements: '.github/requirements-ci.txt' - # needs: [ file-changes ] - # if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' - # steps: - # - uses: actions/checkout@v4 - # - name: Build minimum requirements - # run: | - # pip install uv - # uv pip compile .github/requirements-ci.txt --resolution=lowest-direct > ${{ matrix.pip_requirements }} - # cat ${{ matrix.pip_requirements }} - # if: matrix.pip_requirements == 'tmp-requirements-minimum.txt' - # - name: Run molecule action - # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - # with: - # molecule_parentdir: 'ansible_collections/arista/avd' - # molecule_command: 'test' - # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - # pip_file: ${{ matrix.pip_requirements }} - # galaxy_file: "ansible_collections/arista/avd/collections.yml" - # ansible: ${{ matrix.ansible_version }} - # check_git: true - # check_git_enforced: true - # # - uses: actions/upload-artifact@v4 - # # with: - # # name: molecule-${{ matrix.avd_scenario }}-artifacts - # # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - # # ----------------------------------- # - # # Cloudvision MOLECULE - # # ----------------------------------- # - # molecule_cloudvision: - # name: Validate cvp_collection - # runs-on: ubuntu-latest - # strategy: - # fail-fast: true - # matrix: - # avd_scenario: - # - 'eos_config_deploy_cvp' - # ansible_version: - # - 'ansible-core<2.19.0 --upgrade' - # include: - # - avd_scenario: 'eos_config_deploy_cvp' - # ansible_version: 'ansible-core==2.15.0' - # needs: [ file-changes ] - # if: needs.file-changes.outputs.cloudvision == 'true' || needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' - - # steps: - # - uses: actions/checkout@v4 - # - name: Run molecule action - # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - # with: - # molecule_parentdir: 'ansible_collections/arista/avd' - # molecule_command: 'test' - # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - # pip_file: .github/requirements-ci.txt - # galaxy_file: "ansible_collections/arista/avd/collections.yml" - # ansible: ${{ matrix.ansible_version }} - # check_git: true - # check_git_enforced: true - # # - uses: actions/upload-artifact@v4 - # # with: - # # name: molecule-${{ matrix.avd_scenario }}-artifacts - # # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - # # - # # ----------------------------------- # - # # EOS Validate State MOLECULE - # # ----------------------------------- # - # molecule_eos_validate_state: - # name: Validate eos_validate_state - # runs-on: ubuntu-latest - # strategy: - # fail-fast: true - # matrix: - # avd_scenario: - # - 'eos_validate_state' - # ansible_version: - # - 'ansible-core<2.19.0 --upgrade' - # include: - # - avd_scenario: 'eos_validate_state' - # ansible_version: 'ansible-core==2.15.0' - # needs: [ file-changes ] - # if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.validate_state == 'true' - # steps: - # - uses: actions/checkout@v4 - # - name: Run molecule action - # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - # with: - # molecule_parentdir: 'ansible_collections/arista/avd' - # molecule_command: 'test' - # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - # pip_file: .github/requirements-ci.txt - # galaxy_file: "ansible_collections/arista/avd/collections.yml" - # ansible: ${{ matrix.ansible_version }} - # check_git: true - # check_git_enforced: true - - # # ----------------------------------- # - # # Galaxy Importer - # # ----------------------------------- # - # galaxy_importer: - # name: Test galaxy-importer - # runs-on: ubuntu-20.04 # Older version to be compatible with old python - # env: - # GALAXY_IMPORTER_CONFIG: galaxy-importer/galaxy-importer.cfg - # steps: - # - uses: actions/setup-python@v5 - # with: - # python-version: | - # 3.10 - # - uses: actions/checkout@v4 - # - name: 'Install Python & Ansible requirements' - # run: | - # pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade - # ansible-galaxy collection install -r ansible_collections/arista/avd/collections.yml - # - name: Install galaxy-importer - # # Install the specific version of galaxy-importer used on galaxy.ansible.com - # # The version conflicts with our requirements, - # # so we let the galaxy-importer version resolve remaining requirements. - # run: | - # pip install "galaxy-importer==0.4.26" - # - name: 'Build ansible package' - # run: make collection-build - # - name: 'Run galaxy-importer checks' - # run: python -m galaxy_importer.main *.tar.gz - # - uses: actions/upload-artifact@v4 - # with: - # name: importer-logs - # path: ./importer_result.json - - # # ----------------------------------- # - # # Test of pyavd - # # ----------------------------------- # - # pyavd: - # name: Test pyavd - # runs-on: ubuntu-latest - # needs: [file-changes] - # if: | - # needs.file-changes.outputs.eos_design == 'true' || - # needs.file-changes.outputs.config_gen == 'true' || - # needs.file-changes.outputs.pyavd == 'true' - # strategy: - # matrix: - # python: ["3.10", "3.11", "3.12", "3.13"] - # steps: - # - uses: actions/checkout@v4 - # - name: Set up Python 3 - # uses: actions/setup-python@v5 - # with: - # python-version: ${{ matrix.python }} - # - name: 'Install tox' - # run: | - # pip install tox tox-gh-actions --upgrade - # - name: "Run pytest via tox for ${{ matrix.python }}" - # working-directory: python-avd - # run: | - # tox \ No newline at end of file +name: "Collection code testing" + +"on": pull_request + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +env: + # Set -vvv is ACTIONS_STEP_DEBUG is set + # Apparently it is set in secrets when running with debug + ANSIBLE_VERBOSITY: ${{ secrets.ACTIONS_STEP_DEBUG && 3 || 0 }} + AVD_NEVER_RUN_FROM_SOURCE: 1 + PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions + ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions + +jobs: + file-changes: + runs-on: ubuntu-latest + outputs: + eos_design: ${{ steps.filter.outputs.eos_design }} + config_gen: ${{ steps.filter.outputs.config_gen }} + cloudvision: ${{ steps.filter.outputs.cloudvision }} + dhcp: ${{ steps.filter.outputs.dhcp }} + plugins: ${{ steps.filter.outputs.plugins }} + requirements: ${{ steps.filter.outputs.requirements }} + docs: ${{ steps.filter.outputs.docs }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + eos_design: + - 'ansible_collections/arista/avd/roles/eos_designs/*' + - 'ansible_collections/arista/avd/roles/eos_designs/**/*' + - '.github/workflows/pull-request-management.yml' + - 'ansible_collections/arista/avd/molecule/*' + - 'ansible_collections/arista/avd/molecule/**/*' + - 'python-avd/pyavd/_eos_designs/*' + - 'python-avd/pyavd/_eos_designs/**/*' + - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' + - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' + - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' + - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' + config_gen: + - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' + - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' + - '.github/workflows/pull-request-management.yml' + - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/*' + - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/**/*' + - 'python-avd/pyavd/_eos_cli_config_gen/*' + - 'python-avd/pyavd/_eos_cli_config_gen/**/*' + validate_state: + - 'ansible_collections/arista/avd/roles/eos_validate_state/*' + - 'ansible_collections/arista/avd/roles/eos_validate_state/**/*' + cloudvision: + - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' + - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' + - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' + - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' + - '.github/workflows/pull-request-management.yml' + dhcp: + - 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' + - 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' + - '.github/workflows/pull-request-management.yml' + plugins: + - 'ansible_collections/arista/avd/plugins/filter/**' + - 'ansible_collections/arista/avd/plugins/test/**' + requirements: + - 'ansible_collections/arista/avd/requirements.txt' + - 'ansible_collections/arista/avd/requirements-dev.txt' + - 'ansible_collections/arista/avd/meta/runtime.yml' + - '.github/requirements-ci.txt' + docs: + - '.github/workflows/pull-request-management.yml' + - 'mkdocs.yml' + - 'ansible_collections/arista/avd/docs/**' + - 'ansible_collections/arista/avd/roles/**/*.md' + - 'ansible_collections/arista/avd/**/*.md' + - 'ansible_collections/arista/avd/README.md' + - 'ansible_collections/arista/avd/**/*.schema.yml' + pyavd: + - 'python_avd/*' + - 'python_avd/**/*' + avd-base-image: + runs-on: ubuntu-latest + container: + image: ubuntu:latest + options: --cpus 1 + outputs: + base_image_tag: ${{ steps.set-base-tag.outputs.base_image_tag }} + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Calculate Hash of Requirements + id: hash-reqs + run: | + HASH_OF_REQS=$(sha256sum ansible_collections/arista/avd/requirements-dev.txt | cut -d' ' -f1) + echo "Hash of requirements: $HASH_OF_REQS" + echo "::set-output name=hash_of_reqs::$HASH_OF_REQS" + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + - name: Set Base Image Tag + id: set-base-tag + run: | + BASE_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ steps.hash-reqs.outputs.hash_of_reqs }}" + echo "::set-output name=base_image_tag::$BASE_IMAGE_TAG" + - name: Set up Docker + run: | + apt-get update + apt-get install -y docker.io + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Check if image exists + id: check-base-image + run: | + if docker manifest inspect ${{ steps.set-base-tag.outputs.base_image_tag }} > /dev/null 2>&1; then + echo "Base image exists." + echo "::set-output name=image_exists::true" + else + echo "Base image does not exist." + echo "::set-output name=image_exists::false" + fi + + - name: Set up Docker Buildx + if: steps.check-base-image.outputs.image_exists == 'false' + uses: docker/setup-buildx-action@v3 + + - name: Build and push + if: steps.check-base-image.outputs.image_exists == 'false' + uses: docker/build-push-action@v6 + with: + file: .github/DockerfileBase + target: base + push: true + tags: ${{ steps.set-base-tag.outputs.base_image_tag }} + cache-from: type=gha + cache-to: type=gha,mode=max + + build-pyavd: + name: Install pyavd and Build Image + needs: [avd-base-image] + runs-on: ubuntu-latest + outputs: + build_image_tag: ${{ steps.set-build-tag.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + - name: Set Build Image Tag + id: set-build-tag + run: | + SHORT_SHA=$(git rev-parse --short HEAD) + BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" + echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v6 + with: + file: .github/DockerfileBase + push: true + target: run + tags: ${{ steps.set-build-tag.outputs.build_image_tag }} + cache-from: type=gha + cache-to: type=gha,mode=max + # build-args: | + # BASE_IMAGE_TAG: ${{ needs.setup-avd.outputs.image_tag }} + run-container: + name: Run All Tests + needs: [build-pyavd] + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + options: --cpus 1 + strategy: + matrix: + task: + - name: Ansible Unit Tests 3.12 + command: | + ". /UV3.12/bin/activate" + "cd /avd/ansible_collections/arista/avd" + "ansible-test units -vv" + - name: Ansible Integration Tests 3.12 + command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + - name: Ansible Integration Tests 3.13 + command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + - name: Ansible Sanity Tests 3.13 + command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + - name: Ansible Sanity Tests 3.12 + command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + - name: Ansible Lint Tests 3.11 + command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + # - name: Molecule(eos_cli_config_gen) Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && molecule test --scenario-name eos_cli_config_gen" + # - name: Molecule(eos_cli_config_gen_deprecated_vars) Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install ansible-core<2.19.0' --upgrade && molecule test --scenario-name eos_cli_config_gen_deprecated_vars" + # - name: Molecule(eos_cli_config_gen_negative_unit_tests) Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && molecule test --scenario-name eos_cli_config_gen_negative_unit_tests" + # - name: Molecule(eos_cli_config_gen) with Minimum Ansible Version Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' && molecule test --scenario-name eos_cli_config_gen" + # - name: Molecule:- eos_designs_deprecated_vars Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs_deprecated_vars" + # - name: Molecule:- eos_designs-l2ls Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs-l2ls" + # - name: Molecule:- eos_designs-mpls-isis-sr-ldp Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs-mpls-isis-sr-ldp" + # - name: Molecule:- eos_designs_negative_unit_tests Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs_negative_unit_tests" + # - name: Molecule:- eos_designs-twodc-5stage-clos Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs-twodc-5stage-clos" + # - name: Molecule:- eos_designs_unit_tests Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs_unit_tests" + # - name: Molecule:- evpn_underlay_ebgp_overlay_ebgp Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_ebgp_overlay_ebgp" + # - name: Molecule:- evpn_underlay_isis_overlay_ibgp Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_isis_overlay_ibgp" + # - name: Molecule:- evpn_underlay_ospf_overlay_ebgp Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_ospf_overlay_ebgp" + # - name: Molecule:- evpn_underlay_rfc5549_overlay_ebgp Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_rfc5549_overlay_ebgp" + # - name: Molecule:- example-campus-fabric Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-campus-fabric" + # - name: Molecule:- example-dual-dc-l3ls Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-dual-dc-l3ls" + # - name: Molecule:- example-isis-ldp-ipvpn Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-isis-ldp-ipvpn" + # - name: Molecule:- example-l2ls-fabric Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-l2ls-fabric" + # - name: Molecule:- example-single-dc-l3ls Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-single-dc-l3ls" + # - name: Molecule:- example-cv-pathfinder Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-cv-pathfinder" + # - name: Molecule:- eos_designs_unit_tests ansible-core==2.16.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' --upgrade && test --scenario-name eos_designs_unit_tests" + # - name: Molecule:- eos_designs_unit_tests ansible-core<2.18.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.18.0' --upgrade && test --scenario-name eos_designs_unit_tests" + # - name: Molecule:- eos_designs_unit_tests ansible-core<2.19.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && test --scenario-name eos_designs_unit_tests" + # - name: Molecule:- eos_config_deploy_cvp ansible-core<2.19.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && test --scenario-name eos_config_deploy_cvp" + # - name: Molecule:- eos_config_deploy_cvp ansible-core==2.16.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' && test --scenario-name eos_config_deploy_cvp" + # - name: Molecule:- eos_validate_state ansible-core<2.19.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && test --scenario-name eos_validate_state" + # - name: Molecule:- eos_config_deploy_cvp ansible-core==2.16.0 Tests 3.11 + # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' && test --scenario-name eos_validate_state" + steps: + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Run Task - ${{ matrix.task.name }} + run: | + ${{ matrix.task.command }} + + # # ----------------------------------- # + # # EOS CLI CONFIG GEN MOLECULE + # # ----------------------------------- # + # molecule_eos_cli_config_gen: + # name: Validate eos_cli_config_gen + # runs-on: ubuntu-latest + # strategy: + # fail-fast: true + # matrix: + # avd_scenario: + # - 'eos_cli_config_gen' + # - 'eos_cli_config_gen_deprecated_vars' + # - 'eos_cli_config_gen_negative_unit_tests' + # ansible_version: + # - 'ansible-core<2.19.0 --upgrade' + # # Also test minimum ansible version for one scenario. + # include: + # - avd_scenario: 'eos_cli_config_gen' + # ansible_version: 'ansible-core==2.15.0' + # needs: [ file-changes ] + # if: needs.file-changes.outputs.config_gen == 'true' + # steps: + # - uses: actions/checkout@v4 + # - name: Run molecule action + # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 + # with: + # molecule_parentdir: 'ansible_collections/arista/avd' + # molecule_command: 'test' + # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' + # pip_file: .github/requirements-ci.txt + # galaxy_file: "ansible_collections/arista/avd/collections.yml" + # ansible: ${{ matrix.ansible_version }} + # check_git: true + # check_git_enforced: true + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + + # # ----------------------------------- # + # # DHCP PROVISIONNER MOLECULE + # # ----------------------------------- # + # molecule_dhcp_provisionner: + # name: Validate DHCP configuration + # runs-on: ubuntu-latest + # strategy: + # fail-fast: true + # matrix: + # avd_scenario: ['dhcp_configuration', 'dhcp_provisioning'] + # ansible_version: ['ansible-core<2.19.0 --upgrade'] + # needs: [ file-changes ] + # if: needs.file-changes.outputs.dhcp == 'true' + # steps: + # - uses: actions/checkout@v4 + # - name: Run molecule action + # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 + # with: + # molecule_parentdir: 'ansible_collections/arista/avd' + # molecule_command: 'test' + # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' + # pip_file: .github/requirements-ci.txt + # galaxy_file: "ansible_collections/arista/avd/collections.yml" + # ansible: ${{ matrix.ansible_version }} + # check_git: true + # check_git_enforced: true + # # - uses: actions/upload-artifact@v4 + # # with: + # # name: molecule-${{ matrix.avd_scenario }}-artifacts + # # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + + # # ----------------------------------- # + # # EOS Design MOLECULE + # # ----------------------------------- # + # molecule_eos_designs: + # name: Validate eos_designs + # runs-on: ubuntu-latest + # strategy: + # fail-fast: true + # matrix: + # avd_scenario: + # - 'eos_designs_deprecated_vars' + # - 'eos_designs-l2ls' + # - 'eos_designs-mpls-isis-sr-ldp' + # - 'eos_designs_negative_unit_tests' + # - 'eos_designs-twodc-5stage-clos' + # - 'eos_designs_unit_tests' + # - 'evpn_underlay_ebgp_overlay_ebgp' + # - 'evpn_underlay_isis_overlay_ibgp' + # - 'evpn_underlay_ospf_overlay_ebgp' + # - 'evpn_underlay_rfc5549_overlay_ebgp' + # - 'example-campus-fabric' + # - 'example-dual-dc-l3ls' + # - 'example-isis-ldp-ipvpn' + # - 'example-l2ls-fabric' + # - 'example-single-dc-l3ls' + # - 'example-cv-pathfinder' + # ansible_version: + # # Testing all scenario with 2.16.x, due to bug with in 2.17.0 with and the way we test eos_designs_negative_unit_tests https://github.com/ansible/ansible/issues/83292 + # - 'ansible-core>=2.16.0,<2.17.0 --upgrade' + # pip_requirements: + # - '.github/requirements-ci.txt' + # # Also test minimum ansible version for one scenario. + # include: + # - avd_scenario: 'eos_designs_unit_tests' + # ansible_version: 'ansible-core==2.15.0' + # pip_requirements: 'tmp-requirements-minimum.txt' + # - avd_scenario: 'eos_designs_unit_tests' + # ansible_version: 'ansible-core>=2.15.0,<2.16.0 --upgrade' + # pip_requirements: '.github/requirements-ci.txt' + # - avd_scenario: 'eos_designs_unit_tests' + # ansible_version: 'ansible-core<2.18.0 --upgrade' + # pip_requirements: '.github/requirements-ci.txt' + # - avd_scenario: 'eos_designs_unit_tests' + # ansible_version: 'ansible-core<2.19.0 --upgrade' + # pip_requirements: '.github/requirements-ci.txt' + # needs: [ file-changes ] + # if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' + # steps: + # - uses: actions/checkout@v4 + # - name: Build minimum requirements + # run: | + # pip install uv + # uv pip compile .github/requirements-ci.txt --resolution=lowest-direct > ${{ matrix.pip_requirements }} + # cat ${{ matrix.pip_requirements }} + # if: matrix.pip_requirements == 'tmp-requirements-minimum.txt' + # - name: Run molecule action + # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 + # with: + # molecule_parentdir: 'ansible_collections/arista/avd' + # molecule_command: 'test' + # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' + # pip_file: ${{ matrix.pip_requirements }} + # galaxy_file: "ansible_collections/arista/avd/collections.yml" + # ansible: ${{ matrix.ansible_version }} + # check_git: true + # check_git_enforced: true + # # - uses: actions/upload-artifact@v4 + # # with: + # # name: molecule-${{ matrix.avd_scenario }}-artifacts + # # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + # # ----------------------------------- # + # # Cloudvision MOLECULE + # # ----------------------------------- # + # molecule_cloudvision: + # name: Validate cvp_collection + # runs-on: ubuntu-latest + # strategy: + # fail-fast: true + # matrix: + # avd_scenario: + # - 'eos_config_deploy_cvp' + # ansible_version: + # - 'ansible-core<2.19.0 --upgrade' + # include: + # - avd_scenario: 'eos_config_deploy_cvp' + # ansible_version: 'ansible-core==2.15.0' + # needs: [ file-changes ] + # if: needs.file-changes.outputs.cloudvision == 'true' || needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' + + # steps: + # - uses: actions/checkout@v4 + # - name: Run molecule action + # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 + # with: + # molecule_parentdir: 'ansible_collections/arista/avd' + # molecule_command: 'test' + # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' + # pip_file: .github/requirements-ci.txt + # galaxy_file: "ansible_collections/arista/avd/collections.yml" + # ansible: ${{ matrix.ansible_version }} + # check_git: true + # check_git_enforced: true + # # - uses: actions/upload-artifact@v4 + # # with: + # # name: molecule-${{ matrix.avd_scenario }}-artifacts + # # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + # # + # # ----------------------------------- # + # # EOS Validate State MOLECULE + # # ----------------------------------- # + # molecule_eos_validate_state: + # name: Validate eos_validate_state + # runs-on: ubuntu-latest + # strategy: + # fail-fast: true + # matrix: + # avd_scenario: + # - 'eos_validate_state' + # ansible_version: + # - 'ansible-core<2.19.0 --upgrade' + # include: + # - avd_scenario: 'eos_validate_state' + # ansible_version: 'ansible-core==2.15.0' + # needs: [ file-changes ] + # if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.validate_state == 'true' + # steps: + # - uses: actions/checkout@v4 + # - name: Run molecule action + # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 + # with: + # molecule_parentdir: 'ansible_collections/arista/avd' + # molecule_command: 'test' + # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' + # pip_file: .github/requirements-ci.txt + # galaxy_file: "ansible_collections/arista/avd/collections.yml" + # ansible: ${{ matrix.ansible_version }} + # check_git: true + # check_git_enforced: true + + # # ----------------------------------- # + # # Galaxy Importer + # # ----------------------------------- # + # galaxy_importer: + # name: Test galaxy-importer + # runs-on: ubuntu-20.04 # Older version to be compatible with old python + # env: + # GALAXY_IMPORTER_CONFIG: galaxy-importer/galaxy-importer.cfg + # steps: + # - uses: actions/setup-python@v5 + # with: + # python-version: | + # 3.10 + # - uses: actions/checkout@v4 + # - name: 'Install Python & Ansible requirements' + # run: | + # pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade + # ansible-galaxy collection install -r ansible_collections/arista/avd/collections.yml + # - name: Install galaxy-importer + # # Install the specific version of galaxy-importer used on galaxy.ansible.com + # # The version conflicts with our requirements, + # # so we let the galaxy-importer version resolve remaining requirements. + # run: | + # pip install "galaxy-importer==0.4.26" + # - name: 'Build ansible package' + # run: make collection-build + # - name: 'Run galaxy-importer checks' + # run: python -m galaxy_importer.main *.tar.gz + # - uses: actions/upload-artifact@v4 + # with: + # name: importer-logs + # path: ./importer_result.json + + # # ----------------------------------- # + # # Test of pyavd + # # ----------------------------------- # + # pyavd: + # name: Test pyavd + # runs-on: ubuntu-latest + # needs: [file-changes] + # if: | + # needs.file-changes.outputs.eos_design == 'true' || + # needs.file-changes.outputs.config_gen == 'true' || + # needs.file-changes.outputs.pyavd == 'true' + # strategy: + # matrix: + # python: ["3.10", "3.11", "3.12", "3.13"] + # steps: + # - uses: actions/checkout@v4 + # - name: Set up Python 3 + # uses: actions/setup-python@v5 + # with: + # python-version: ${{ matrix.python }} + # - name: 'Install tox' + # run: | + # pip install tox tox-gh-actions --upgrade + # - name: "Run pytest via tox for ${{ matrix.python }}" + # working-directory: python-avd + # run: | + # tox From 396ebf53ecddfc0b40df3e94def15abaa44c1aeb Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 12:28:52 +0530 Subject: [PATCH 104/324] container base and run 3 --- .github/workflows/pull-request-management.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index eeff30f72fd..1fd490b5de5 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -195,10 +195,12 @@ jobs: matrix: task: - name: Ansible Unit Tests 3.12 - command: | - ". /UV3.12/bin/activate" - "cd /avd/ansible_collections/arista/avd" - "ansible-test units -vv" + command: > + bash -c " + . /UV3.12/bin/activate && + cd /avd/ansible_collections/arista/avd && + ansible-test units -vv + " - name: Ansible Integration Tests 3.12 command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - name: Ansible Integration Tests 3.13 From a5409f92a7ed77f6602975a4fcac3d99a2065b34 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 12:45:40 +0530 Subject: [PATCH 105/324] container base and run 4 --- .github/DockerfileBase | 1 - .github/workflows/pull-request-management.yml | 57 +------------------ 2 files changed, 3 insertions(+), 55 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 68b9a0f483c..e75440593ac 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -34,4 +34,3 @@ COPY --from=build /UV3.10 /UV3.10 COPY --from=build /UV3.11 /UV3.11 COPY --from=build /UV3.12 /UV3.12 COPY --from=build /UV3.13 /UV3.13 -COPY --from=build /avd /avd diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 1fd490b5de5..bb3074b0960 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -211,61 +211,10 @@ jobs: command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - name: Ansible Lint Tests 3.11 command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" - # - name: Molecule(eos_cli_config_gen) Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && molecule test --scenario-name eos_cli_config_gen" - # - name: Molecule(eos_cli_config_gen_deprecated_vars) Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install ansible-core<2.19.0' --upgrade && molecule test --scenario-name eos_cli_config_gen_deprecated_vars" - # - name: Molecule(eos_cli_config_gen_negative_unit_tests) Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && molecule test --scenario-name eos_cli_config_gen_negative_unit_tests" - # - name: Molecule(eos_cli_config_gen) with Minimum Ansible Version Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' && molecule test --scenario-name eos_cli_config_gen" - # - name: Molecule:- eos_designs_deprecated_vars Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs_deprecated_vars" - # - name: Molecule:- eos_designs-l2ls Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs-l2ls" - # - name: Molecule:- eos_designs-mpls-isis-sr-ldp Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs-mpls-isis-sr-ldp" - # - name: Molecule:- eos_designs_negative_unit_tests Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs_negative_unit_tests" - # - name: Molecule:- eos_designs-twodc-5stage-clos Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs-twodc-5stage-clos" - # - name: Molecule:- eos_designs_unit_tests Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name eos_designs_unit_tests" - # - name: Molecule:- evpn_underlay_ebgp_overlay_ebgp Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_ebgp_overlay_ebgp" - # - name: Molecule:- evpn_underlay_isis_overlay_ibgp Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_isis_overlay_ibgp" - # - name: Molecule:- evpn_underlay_ospf_overlay_ebgp Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_ospf_overlay_ebgp" - # - name: Molecule:- evpn_underlay_rfc5549_overlay_ebgp Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name evpn_underlay_rfc5549_overlay_ebgp" - # - name: Molecule:- example-campus-fabric Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-campus-fabric" - # - name: Molecule:- example-dual-dc-l3ls Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-dual-dc-l3ls" - # - name: Molecule:- example-isis-ldp-ipvpn Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-isis-ldp-ipvpn" - # - name: Molecule:- example-l2ls-fabric Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-l2ls-fabric" - # - name: Molecule:- example-single-dc-l3ls Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-single-dc-l3ls" - # - name: Molecule:- example-cv-pathfinder Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core>=2.16.0,<2.17.0' --upgrade && test --scenario-name example-cv-pathfinder" - # - name: Molecule:- eos_designs_unit_tests ansible-core==2.16.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' --upgrade && test --scenario-name eos_designs_unit_tests" - # - name: Molecule:- eos_designs_unit_tests ansible-core<2.18.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.18.0' --upgrade && test --scenario-name eos_designs_unit_tests" - # - name: Molecule:- eos_designs_unit_tests ansible-core<2.19.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && test --scenario-name eos_designs_unit_tests" - # - name: Molecule:- eos_config_deploy_cvp ansible-core<2.19.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && test --scenario-name eos_config_deploy_cvp" - # - name: Molecule:- eos_config_deploy_cvp ansible-core==2.16.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' && test --scenario-name eos_config_deploy_cvp" - # - name: Molecule:- eos_validate_state ansible-core<2.19.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core<2.19.0' --upgrade && test --scenario-name eos_validate_state" - # - name: Molecule:- eos_config_deploy_cvp ansible-core==2.16.0 Tests 3.11 - # command: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && pip install 'ansible-core==2.16.0' && test --scenario-name eos_validate_state" + steps: + - name: Check out repository code + uses: actions/checkout@v4 - name: Convert GitHub username to lowercase id: lowercase run: | From 83318ae07e68d2320ca09406c6c2f1a1ae0fb8f8 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 12:54:57 +0530 Subject: [PATCH 106/324] container base and run 5 --- .github/DockerfileBase | 1 + .github/workflows/pull-request-management.yml | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index e75440593ac..666115ac34a 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -26,6 +26,7 @@ RUN python3 -m pip install --break-system-packages build && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done +RUN rm -rf /avd FROM base AS run LABEL stage=run diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index bb3074b0960..780274f8f9f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -202,7 +202,11 @@ jobs: ansible-test units -vv " - name: Ansible Integration Tests 3.12 - command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + command: > + bash -c " + . /UV3.12/bin/activate && + ansible-test integration -vv + " - name: Ansible Integration Tests 3.13 command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - name: Ansible Sanity Tests 3.13 From a8e153029e0e325591dc29563aff7277f611ac2f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 13:01:26 +0530 Subject: [PATCH 107/324] container base and run 6 --- .github/workflows/pull-request-management.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 780274f8f9f..2a5e92c69d1 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -194,13 +194,13 @@ jobs: strategy: matrix: task: - - name: Ansible Unit Tests 3.12 - command: > - bash -c " - . /UV3.12/bin/activate && - cd /avd/ansible_collections/arista/avd && - ansible-test units -vv - " + # - name: Ansible Unit Tests 3.12 + # command: > + # bash -c " + # . /UV3.12/bin/activate && + # cd /avd/ansible_collections/arista/avd && + # ansible-test units -vv + # " - name: Ansible Integration Tests 3.12 command: > bash -c " From 0d1aae205b8af6d8639480038f266e801b0eff8d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 16:27:24 +0530 Subject: [PATCH 108/324] container base and run 7 --- .github/DockerfileBase | 1 + .github/workflows/pull-request-management.yml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 666115ac34a..81825842928 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -35,3 +35,4 @@ COPY --from=build /UV3.10 /UV3.10 COPY --from=build /UV3.11 /UV3.11 COPY --from=build /UV3.12 /UV3.12 COPY --from=build /UV3.13 /UV3.13 +Workdir /avd diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 2a5e92c69d1..6e7397c3fa9 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -207,14 +207,14 @@ jobs: . /UV3.12/bin/activate && ansible-test integration -vv " - - name: Ansible Integration Tests 3.13 - command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - - name: Ansible Sanity Tests 3.13 - command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - - name: Ansible Sanity Tests 3.12 - command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - - name: Ansible Lint Tests 3.11 - command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + # - name: Ansible Integration Tests 3.13 + # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + # - name: Ansible Sanity Tests 3.13 + # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # - name: Ansible Sanity Tests 3.12 + # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # - name: Ansible Lint Tests 3.11 + # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" steps: - name: Check out repository code From f57e7a180a67f57a559a144f53f5844b7a803192 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 16:33:06 +0530 Subject: [PATCH 109/324] container base and run 8 --- .github/workflows/pull-request-management.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6e7397c3fa9..8f5957ac97a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -205,6 +205,7 @@ jobs: command: > bash -c " . /UV3.12/bin/activate && + cd ansible_collections/arista/avd && ansible-test integration -vv " # - name: Ansible Integration Tests 3.13 From 35ca18e4212e6a2c3442eb54be3669f38a8149bd Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 16:41:31 +0530 Subject: [PATCH 110/324] container base and run 9 --- .github/workflows/pull-request-management.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 8f5957ac97a..d3756ad8498 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -233,6 +233,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Run Task - ${{ matrix.task.name }} run: | + git config --global --add safe.directory /__w/avd/avd ${{ matrix.task.command }} # # ----------------------------------- # From 2ab7f17350aff13065510a1f45604e800fd85fbd Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 17:19:26 +0530 Subject: [PATCH 111/324] container base and run 10 --- .github/workflows/pull-request-management.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d3756ad8498..7140ce497dc 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -216,7 +216,8 @@ jobs: # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" # - name: Ansible Lint Tests 3.11 # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" - + env: + AVD_NEVER_RUN_FROM_SOURCE: 1 steps: - name: Check out repository code uses: actions/checkout@v4 From 07d2c06316ba4ed3d8cdfb40572d1506c1101631 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 17:29:34 +0530 Subject: [PATCH 112/324] container base and run 11 --- ansible_collections/arista/avd/plugins/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible_collections/arista/avd/plugins/__init__.py b/ansible_collections/arista/avd/plugins/__init__.py index 0c4cfe2e70f..e12c3151606 100644 --- a/ansible_collections/arista/avd/plugins/__init__.py +++ b/ansible_collections/arista/avd/plugins/__init__.py @@ -9,7 +9,7 @@ PYTHON_AVD_PATH = Path(__file__).parents[4] / "python-avd" RUNNING_FROM_SOURCE_PATH = PYTHON_AVD_PATH / "pyavd/running_from_src.txt" -RUNNING_FROM_SOURCE = RUNNING_FROM_SOURCE_PATH.exists() and not environ.get("AVD_NEVER_RUN_FROM_SOURCE") +RUNNING_FROM_SOURCE = RUNNING_FROM_SOURCE_PATH.exists() and environ.get("AVD_NEVER_RUN_FROM_SOURCE") if RUNNING_FROM_SOURCE: import sys From c19e167866fb72aca4c12d56503287aa370bcd46 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 17:37:10 +0530 Subject: [PATCH 113/324] container base and run 12 --- .github/workflows/pull-request-management.yml | 2 ++ ansible_collections/arista/avd/plugins/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 7140ce497dc..ffc0c876a2e 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -233,6 +233,8 @@ jobs: username: ${{ steps.lowercase.outputs.lowercase }} password: ${{ secrets.GITHUB_TOKEN }} - name: Run Task - ${{ matrix.task.name }} + env: + AVD_NEVER_RUN_FROM_SOURCE: 1 run: | git config --global --add safe.directory /__w/avd/avd ${{ matrix.task.command }} diff --git a/ansible_collections/arista/avd/plugins/__init__.py b/ansible_collections/arista/avd/plugins/__init__.py index e12c3151606..0c4cfe2e70f 100644 --- a/ansible_collections/arista/avd/plugins/__init__.py +++ b/ansible_collections/arista/avd/plugins/__init__.py @@ -9,7 +9,7 @@ PYTHON_AVD_PATH = Path(__file__).parents[4] / "python-avd" RUNNING_FROM_SOURCE_PATH = PYTHON_AVD_PATH / "pyavd/running_from_src.txt" -RUNNING_FROM_SOURCE = RUNNING_FROM_SOURCE_PATH.exists() and environ.get("AVD_NEVER_RUN_FROM_SOURCE") +RUNNING_FROM_SOURCE = RUNNING_FROM_SOURCE_PATH.exists() and not environ.get("AVD_NEVER_RUN_FROM_SOURCE") if RUNNING_FROM_SOURCE: import sys From f63e2fab132ad2c43414df31ead41ad1d0ade833 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 17:38:44 +0530 Subject: [PATCH 114/324] container base and run 13 --- .github/workflows/pull-request-management.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index ffc0c876a2e..da1a64b6a7d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -236,6 +236,7 @@ jobs: env: AVD_NEVER_RUN_FROM_SOURCE: 1 run: | + echo "$AVD_NEVER_RUN_FROM_SOURCE" git config --global --add safe.directory /__w/avd/avd ${{ matrix.task.command }} From c3ee757f872918dffd7cf344c59711dfef6897a0 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 17:46:32 +0530 Subject: [PATCH 115/324] container base and run 14 --- .github/workflows/pull-request-management.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index da1a64b6a7d..580968f03e6 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -206,7 +206,7 @@ jobs: bash -c " . /UV3.12/bin/activate && cd ansible_collections/arista/avd && - ansible-test integration -vv + ansible-test integration -vv --venv-system-site-packages " # - name: Ansible Integration Tests 3.13 # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" @@ -236,7 +236,6 @@ jobs: env: AVD_NEVER_RUN_FROM_SOURCE: 1 run: | - echo "$AVD_NEVER_RUN_FROM_SOURCE" git config --global --add safe.directory /__w/avd/avd ${{ matrix.task.command }} From 8fc4c2fec0255eaa9672af5844a59b2f6b85445d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 17:56:22 +0530 Subject: [PATCH 116/324] container base and run 15 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 580968f03e6..ec3f0338e20 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -206,7 +206,7 @@ jobs: bash -c " . /UV3.12/bin/activate && cd ansible_collections/arista/avd && - ansible-test integration -vv --venv-system-site-packages + ansible-test integration --venv -vv " # - name: Ansible Integration Tests 3.13 # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" From 6a949ecc32d90c3e2338c109781335c710213f84 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 18:21:41 +0530 Subject: [PATCH 117/324] container base and run 16 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index ec3f0338e20..31ce14c09f5 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -206,7 +206,7 @@ jobs: bash -c " . /UV3.12/bin/activate && cd ansible_collections/arista/avd && - ansible-test integration --venv -vv + ANSIBLE_TEST_ANSIBLE_LIB_ROOT='/UV3.12/lib/python3.12/site-packages/ansible' ansible-test integration --venv -vv " # - name: Ansible Integration Tests 3.13 # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" From 02f20168817c246e5af68e87f836543cac772a1f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 18:28:02 +0530 Subject: [PATCH 118/324] container base and run 17 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 31ce14c09f5..6cb55f37dd3 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -206,7 +206,7 @@ jobs: bash -c " . /UV3.12/bin/activate && cd ansible_collections/arista/avd && - ANSIBLE_TEST_ANSIBLE_LIB_ROOT='/UV3.12/lib/python3.12/site-packages/ansible' ansible-test integration --venv -vv + ANSIBLE_TEST_ANSIBLE_LIB_ROOT=/UV3.12/lib/python3.12/site-packages/ansible ANSIBLE_TEST_PYTHON_INTERPRETER=/UV3.12/bin/python ansible-test integration --venv -vv " # - name: Ansible Integration Tests 3.13 # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" From cac3e3e596c8bb45e1290c9f19184fb5ed830d07 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 18:42:20 +0530 Subject: [PATCH 119/324] container base and run 18 --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6cb55f37dd3..f01b3266488 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -206,7 +206,7 @@ jobs: bash -c " . /UV3.12/bin/activate && cd ansible_collections/arista/avd && - ANSIBLE_TEST_ANSIBLE_LIB_ROOT=/UV3.12/lib/python3.12/site-packages/ansible ANSIBLE_TEST_PYTHON_INTERPRETER=/UV3.12/bin/python ansible-test integration --venv -vv + ansible-test integration --venv -vv " # - name: Ansible Integration Tests 3.13 # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" @@ -217,7 +217,7 @@ jobs: # - name: Ansible Lint Tests 3.11 # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" env: - AVD_NEVER_RUN_FROM_SOURCE: 1 + PYTHONPATH: $(python -c "import site; print(site.getsitepackages()[0])") steps: - name: Check out repository code uses: actions/checkout@v4 From 88c80da7038377e674e3207e35cf9fe74417db49 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 18:50:15 +0530 Subject: [PATCH 120/324] container base and run 19 --- .github/workflows/pull-request-management.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index f01b3266488..143644b0f88 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -206,7 +206,7 @@ jobs: bash -c " . /UV3.12/bin/activate && cd ansible_collections/arista/avd && - ansible-test integration --venv -vv + ansible-test integration --venv -vv --python-interpreter /UV3.12/bin/python " # - name: Ansible Integration Tests 3.13 # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" @@ -215,9 +215,7 @@ jobs: # - name: Ansible Sanity Tests 3.12 # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" # - name: Ansible Lint Tests 3.11 - # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" - env: - PYTHONPATH: $(python -c "import site; print(site.getsitepackages()[0])") + # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" steps: - name: Check out repository code uses: actions/checkout@v4 From 5f137b8fc03d2f6ce3f7ddf8ead03c1ce003a060 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 18:55:27 +0530 Subject: [PATCH 121/324] container base and run 20 --- .github/workflows/pull-request-management.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 143644b0f88..2da1a0296a4 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -204,9 +204,10 @@ jobs: - name: Ansible Integration Tests 3.12 command: > bash -c " + export AVD_NEVER_RUN_FROM_SOURCE=1 . /UV3.12/bin/activate && cd ansible_collections/arista/avd && - ansible-test integration --venv -vv --python-interpreter /UV3.12/bin/python + ansible-test integration -vv " # - name: Ansible Integration Tests 3.13 # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" From feb8a39a2af554b21ba8588c5299f1cdcb34f15a Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 24 Jan 2025 19:00:08 +0530 Subject: [PATCH 122/324] container base and run 21 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 2da1a0296a4..7a3d278af2e 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -204,7 +204,7 @@ jobs: - name: Ansible Integration Tests 3.12 command: > bash -c " - export AVD_NEVER_RUN_FROM_SOURCE=1 + export AVD_NEVER_RUN_FROM_SOURCE=1 && . /UV3.12/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv From 4a71e251b2a25c6b852225d8f865a9876d41574b Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 27 Jan 2025 11:21:22 +0530 Subject: [PATCH 123/324] container base and run 22 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 7a3d278af2e..6ae2895ded1 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -207,7 +207,7 @@ jobs: export AVD_NEVER_RUN_FROM_SOURCE=1 && . /UV3.12/bin/activate && cd ansible_collections/arista/avd && - ansible-test integration -vv + ansible-test integration --python-interpreter /UV3.12/bin/python -vv " # - name: Ansible Integration Tests 3.13 # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" From 2f8beb74910c0eb494f5f19699401d0d5683fa48 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 11:22:58 +0530 Subject: [PATCH 124/324] updated workflow --- .github/workflows/pull-request-management.yml | 992 +++++++++--------- 1 file changed, 484 insertions(+), 508 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6ae2895ded1..bcc29c57e6d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -1,509 +1,485 @@ --- -name: "Collection code testing" - -"on": pull_request - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -env: - # Set -vvv is ACTIONS_STEP_DEBUG is set - # Apparently it is set in secrets when running with debug - ANSIBLE_VERBOSITY: ${{ secrets.ACTIONS_STEP_DEBUG && 3 || 0 }} - AVD_NEVER_RUN_FROM_SOURCE: 1 - PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions - ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions - -jobs: - file-changes: - runs-on: ubuntu-latest - outputs: - eos_design: ${{ steps.filter.outputs.eos_design }} - config_gen: ${{ steps.filter.outputs.config_gen }} - cloudvision: ${{ steps.filter.outputs.cloudvision }} - dhcp: ${{ steps.filter.outputs.dhcp }} - plugins: ${{ steps.filter.outputs.plugins }} - requirements: ${{ steps.filter.outputs.requirements }} - docs: ${{ steps.filter.outputs.docs }} - steps: - - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - eos_design: - - 'ansible_collections/arista/avd/roles/eos_designs/*' - - 'ansible_collections/arista/avd/roles/eos_designs/**/*' - - '.github/workflows/pull-request-management.yml' - - 'ansible_collections/arista/avd/molecule/*' - - 'ansible_collections/arista/avd/molecule/**/*' - - 'python-avd/pyavd/_eos_designs/*' - - 'python-avd/pyavd/_eos_designs/**/*' - - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' - - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' - - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' - - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' - config_gen: - - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' - - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' - - '.github/workflows/pull-request-management.yml' - - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/*' - - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/**/*' - - 'python-avd/pyavd/_eos_cli_config_gen/*' - - 'python-avd/pyavd/_eos_cli_config_gen/**/*' - validate_state: - - 'ansible_collections/arista/avd/roles/eos_validate_state/*' - - 'ansible_collections/arista/avd/roles/eos_validate_state/**/*' - cloudvision: - - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' - - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' - - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' - - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' - - '.github/workflows/pull-request-management.yml' - dhcp: - - 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' - - 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' - - '.github/workflows/pull-request-management.yml' - plugins: - - 'ansible_collections/arista/avd/plugins/filter/**' - - 'ansible_collections/arista/avd/plugins/test/**' - requirements: - - 'ansible_collections/arista/avd/requirements.txt' - - 'ansible_collections/arista/avd/requirements-dev.txt' - - 'ansible_collections/arista/avd/meta/runtime.yml' - - '.github/requirements-ci.txt' - docs: - - '.github/workflows/pull-request-management.yml' - - 'mkdocs.yml' - - 'ansible_collections/arista/avd/docs/**' - - 'ansible_collections/arista/avd/roles/**/*.md' - - 'ansible_collections/arista/avd/**/*.md' - - 'ansible_collections/arista/avd/README.md' - - 'ansible_collections/arista/avd/**/*.schema.yml' - pyavd: - - 'python_avd/*' - - 'python_avd/**/*' - avd-base-image: - runs-on: ubuntu-latest - container: - image: ubuntu:latest - options: --cpus 1 - outputs: - base_image_tag: ${{ steps.set-base-tag.outputs.base_image_tag }} - steps: - - name: Check out repository - uses: actions/checkout@v4 - - - name: Calculate Hash of Requirements - id: hash-reqs - run: | - HASH_OF_REQS=$(sha256sum ansible_collections/arista/avd/requirements-dev.txt | cut -d' ' -f1) - echo "Hash of requirements: $HASH_OF_REQS" - echo "::set-output name=hash_of_reqs::$HASH_OF_REQS" - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - name: Set Base Image Tag - id: set-base-tag - run: | - BASE_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ steps.hash-reqs.outputs.hash_of_reqs }}" - echo "::set-output name=base_image_tag::$BASE_IMAGE_TAG" - - name: Set up Docker - run: | - apt-get update - apt-get install -y docker.io - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Check if image exists - id: check-base-image - run: | - if docker manifest inspect ${{ steps.set-base-tag.outputs.base_image_tag }} > /dev/null 2>&1; then - echo "Base image exists." - echo "::set-output name=image_exists::true" - else - echo "Base image does not exist." - echo "::set-output name=image_exists::false" - fi - - - name: Set up Docker Buildx - if: steps.check-base-image.outputs.image_exists == 'false' - uses: docker/setup-buildx-action@v3 - - - name: Build and push - if: steps.check-base-image.outputs.image_exists == 'false' - uses: docker/build-push-action@v6 - with: - file: .github/DockerfileBase - target: base - push: true - tags: ${{ steps.set-base-tag.outputs.base_image_tag }} - cache-from: type=gha - cache-to: type=gha,mode=max - - build-pyavd: - name: Install pyavd and Build Image - needs: [avd-base-image] - runs-on: ubuntu-latest - outputs: - build_image_tag: ${{ steps.set-build-tag.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - name: Set Build Image Tag - id: set-build-tag - run: | - SHORT_SHA=$(git rev-parse --short HEAD) - BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" - echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v6 - with: - file: .github/DockerfileBase - push: true - target: run - tags: ${{ steps.set-build-tag.outputs.build_image_tag }} - cache-from: type=gha - cache-to: type=gha,mode=max - # build-args: | - # BASE_IMAGE_TAG: ${{ needs.setup-avd.outputs.image_tag }} - run-container: - name: Run All Tests - needs: [build-pyavd] - runs-on: ubuntu-latest - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - options: --cpus 1 - strategy: - matrix: - task: - # - name: Ansible Unit Tests 3.12 - # command: > - # bash -c " - # . /UV3.12/bin/activate && - # cd /avd/ansible_collections/arista/avd && - # ansible-test units -vv - # " - - name: Ansible Integration Tests 3.12 - command: > - bash -c " - export AVD_NEVER_RUN_FROM_SOURCE=1 && - . /UV3.12/bin/activate && - cd ansible_collections/arista/avd && - ansible-test integration --python-interpreter /UV3.12/bin/python -vv - " - # - name: Ansible Integration Tests 3.13 - # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - # - name: Ansible Sanity Tests 3.13 - # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # - name: Ansible Sanity Tests 3.12 - # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # - name: Ansible Lint Tests 3.11 - # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Run Task - ${{ matrix.task.name }} - env: - AVD_NEVER_RUN_FROM_SOURCE: 1 - run: | - git config --global --add safe.directory /__w/avd/avd - ${{ matrix.task.command }} - - # # ----------------------------------- # - # # EOS CLI CONFIG GEN MOLECULE - # # ----------------------------------- # - # molecule_eos_cli_config_gen: - # name: Validate eos_cli_config_gen - # runs-on: ubuntu-latest - # strategy: - # fail-fast: true - # matrix: - # avd_scenario: - # - 'eos_cli_config_gen' - # - 'eos_cli_config_gen_deprecated_vars' - # - 'eos_cli_config_gen_negative_unit_tests' - # ansible_version: - # - 'ansible-core<2.19.0 --upgrade' - # # Also test minimum ansible version for one scenario. - # include: - # - avd_scenario: 'eos_cli_config_gen' - # ansible_version: 'ansible-core==2.15.0' - # needs: [ file-changes ] - # if: needs.file-changes.outputs.config_gen == 'true' - # steps: - # - uses: actions/checkout@v4 - # - name: Run molecule action - # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - # with: - # molecule_parentdir: 'ansible_collections/arista/avd' - # molecule_command: 'test' - # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - # pip_file: .github/requirements-ci.txt - # galaxy_file: "ansible_collections/arista/avd/collections.yml" - # ansible: ${{ matrix.ansible_version }} - # check_git: true - # check_git_enforced: true - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - - # # ----------------------------------- # - # # DHCP PROVISIONNER MOLECULE - # # ----------------------------------- # - # molecule_dhcp_provisionner: - # name: Validate DHCP configuration - # runs-on: ubuntu-latest - # strategy: - # fail-fast: true - # matrix: - # avd_scenario: ['dhcp_configuration', 'dhcp_provisioning'] - # ansible_version: ['ansible-core<2.19.0 --upgrade'] - # needs: [ file-changes ] - # if: needs.file-changes.outputs.dhcp == 'true' - # steps: - # - uses: actions/checkout@v4 - # - name: Run molecule action - # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - # with: - # molecule_parentdir: 'ansible_collections/arista/avd' - # molecule_command: 'test' - # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - # pip_file: .github/requirements-ci.txt - # galaxy_file: "ansible_collections/arista/avd/collections.yml" - # ansible: ${{ matrix.ansible_version }} - # check_git: true - # check_git_enforced: true - # # - uses: actions/upload-artifact@v4 - # # with: - # # name: molecule-${{ matrix.avd_scenario }}-artifacts - # # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - - # # ----------------------------------- # - # # EOS Design MOLECULE - # # ----------------------------------- # - # molecule_eos_designs: - # name: Validate eos_designs - # runs-on: ubuntu-latest - # strategy: - # fail-fast: true - # matrix: - # avd_scenario: - # - 'eos_designs_deprecated_vars' - # - 'eos_designs-l2ls' - # - 'eos_designs-mpls-isis-sr-ldp' - # - 'eos_designs_negative_unit_tests' - # - 'eos_designs-twodc-5stage-clos' - # - 'eos_designs_unit_tests' - # - 'evpn_underlay_ebgp_overlay_ebgp' - # - 'evpn_underlay_isis_overlay_ibgp' - # - 'evpn_underlay_ospf_overlay_ebgp' - # - 'evpn_underlay_rfc5549_overlay_ebgp' - # - 'example-campus-fabric' - # - 'example-dual-dc-l3ls' - # - 'example-isis-ldp-ipvpn' - # - 'example-l2ls-fabric' - # - 'example-single-dc-l3ls' - # - 'example-cv-pathfinder' - # ansible_version: - # # Testing all scenario with 2.16.x, due to bug with in 2.17.0 with and the way we test eos_designs_negative_unit_tests https://github.com/ansible/ansible/issues/83292 - # - 'ansible-core>=2.16.0,<2.17.0 --upgrade' - # pip_requirements: - # - '.github/requirements-ci.txt' - # # Also test minimum ansible version for one scenario. - # include: - # - avd_scenario: 'eos_designs_unit_tests' - # ansible_version: 'ansible-core==2.15.0' - # pip_requirements: 'tmp-requirements-minimum.txt' - # - avd_scenario: 'eos_designs_unit_tests' - # ansible_version: 'ansible-core>=2.15.0,<2.16.0 --upgrade' - # pip_requirements: '.github/requirements-ci.txt' - # - avd_scenario: 'eos_designs_unit_tests' - # ansible_version: 'ansible-core<2.18.0 --upgrade' - # pip_requirements: '.github/requirements-ci.txt' - # - avd_scenario: 'eos_designs_unit_tests' - # ansible_version: 'ansible-core<2.19.0 --upgrade' - # pip_requirements: '.github/requirements-ci.txt' - # needs: [ file-changes ] - # if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' - # steps: - # - uses: actions/checkout@v4 - # - name: Build minimum requirements - # run: | - # pip install uv - # uv pip compile .github/requirements-ci.txt --resolution=lowest-direct > ${{ matrix.pip_requirements }} - # cat ${{ matrix.pip_requirements }} - # if: matrix.pip_requirements == 'tmp-requirements-minimum.txt' - # - name: Run molecule action - # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - # with: - # molecule_parentdir: 'ansible_collections/arista/avd' - # molecule_command: 'test' - # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - # pip_file: ${{ matrix.pip_requirements }} - # galaxy_file: "ansible_collections/arista/avd/collections.yml" - # ansible: ${{ matrix.ansible_version }} - # check_git: true - # check_git_enforced: true - # # - uses: actions/upload-artifact@v4 - # # with: - # # name: molecule-${{ matrix.avd_scenario }}-artifacts - # # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - # # ----------------------------------- # - # # Cloudvision MOLECULE - # # ----------------------------------- # - # molecule_cloudvision: - # name: Validate cvp_collection - # runs-on: ubuntu-latest - # strategy: - # fail-fast: true - # matrix: - # avd_scenario: - # - 'eos_config_deploy_cvp' - # ansible_version: - # - 'ansible-core<2.19.0 --upgrade' - # include: - # - avd_scenario: 'eos_config_deploy_cvp' - # ansible_version: 'ansible-core==2.15.0' - # needs: [ file-changes ] - # if: needs.file-changes.outputs.cloudvision == 'true' || needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' - - # steps: - # - uses: actions/checkout@v4 - # - name: Run molecule action - # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - # with: - # molecule_parentdir: 'ansible_collections/arista/avd' - # molecule_command: 'test' - # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - # pip_file: .github/requirements-ci.txt - # galaxy_file: "ansible_collections/arista/avd/collections.yml" - # ansible: ${{ matrix.ansible_version }} - # check_git: true - # check_git_enforced: true - # # - uses: actions/upload-artifact@v4 - # # with: - # # name: molecule-${{ matrix.avd_scenario }}-artifacts - # # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - # # - # # ----------------------------------- # - # # EOS Validate State MOLECULE - # # ----------------------------------- # - # molecule_eos_validate_state: - # name: Validate eos_validate_state - # runs-on: ubuntu-latest - # strategy: - # fail-fast: true - # matrix: - # avd_scenario: - # - 'eos_validate_state' - # ansible_version: - # - 'ansible-core<2.19.0 --upgrade' - # include: - # - avd_scenario: 'eos_validate_state' - # ansible_version: 'ansible-core==2.15.0' - # needs: [ file-changes ] - # if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.validate_state == 'true' - # steps: - # - uses: actions/checkout@v4 - # - name: Run molecule action - # uses: arista-netdevops-community/action-molecule-avd@v1.8.1 - # with: - # molecule_parentdir: 'ansible_collections/arista/avd' - # molecule_command: 'test' - # molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' - # pip_file: .github/requirements-ci.txt - # galaxy_file: "ansible_collections/arista/avd/collections.yml" - # ansible: ${{ matrix.ansible_version }} - # check_git: true - # check_git_enforced: true - - # # ----------------------------------- # - # # Galaxy Importer - # # ----------------------------------- # - # galaxy_importer: - # name: Test galaxy-importer - # runs-on: ubuntu-20.04 # Older version to be compatible with old python - # env: - # GALAXY_IMPORTER_CONFIG: galaxy-importer/galaxy-importer.cfg - # steps: - # - uses: actions/setup-python@v5 - # with: - # python-version: | - # 3.10 - # - uses: actions/checkout@v4 - # - name: 'Install Python & Ansible requirements' - # run: | - # pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade - # ansible-galaxy collection install -r ansible_collections/arista/avd/collections.yml - # - name: Install galaxy-importer - # # Install the specific version of galaxy-importer used on galaxy.ansible.com - # # The version conflicts with our requirements, - # # so we let the galaxy-importer version resolve remaining requirements. - # run: | - # pip install "galaxy-importer==0.4.26" - # - name: 'Build ansible package' - # run: make collection-build - # - name: 'Run galaxy-importer checks' - # run: python -m galaxy_importer.main *.tar.gz - # - uses: actions/upload-artifact@v4 - # with: - # name: importer-logs - # path: ./importer_result.json - - # # ----------------------------------- # - # # Test of pyavd - # # ----------------------------------- # - # pyavd: - # name: Test pyavd - # runs-on: ubuntu-latest - # needs: [file-changes] - # if: | - # needs.file-changes.outputs.eos_design == 'true' || - # needs.file-changes.outputs.config_gen == 'true' || - # needs.file-changes.outputs.pyavd == 'true' - # strategy: - # matrix: - # python: ["3.10", "3.11", "3.12", "3.13"] - # steps: - # - uses: actions/checkout@v4 - # - name: Set up Python 3 - # uses: actions/setup-python@v5 - # with: - # python-version: ${{ matrix.python }} - # - name: 'Install tox' - # run: | - # pip install tox tox-gh-actions --upgrade - # - name: "Run pytest via tox for ${{ matrix.python }}" - # working-directory: python-avd - # run: | - # tox + name: "Collection code testing" + + "on": pull_request + + concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + + env: + # Set -vvv is ACTIONS_STEP_DEBUG is set + # Apparently it is set in secrets when running with debug + ANSIBLE_VERBOSITY: ${{ secrets.ACTIONS_STEP_DEBUG && 3 || 0 }} + AVD_NEVER_RUN_FROM_SOURCE: 1 + PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions + ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions + + jobs: + file-changes: + runs-on: ubuntu-latest + outputs: + eos_design: ${{ steps.filter.outputs.eos_design }} + config_gen: ${{ steps.filter.outputs.config_gen }} + cloudvision: ${{ steps.filter.outputs.cloudvision }} + dhcp: ${{ steps.filter.outputs.dhcp }} + plugins: ${{ steps.filter.outputs.plugins }} + requirements: ${{ steps.filter.outputs.requirements }} + docs: ${{ steps.filter.outputs.docs }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + eos_design: + - 'ansible_collections/arista/avd/roles/eos_designs/*' + - 'ansible_collections/arista/avd/roles/eos_designs/**/*' + - '.github/workflows/pull-request-management.yml' + - 'ansible_collections/arista/avd/molecule/*' + - 'ansible_collections/arista/avd/molecule/**/*' + - 'python-avd/pyavd/_eos_designs/*' + - 'python-avd/pyavd/_eos_designs/**/*' + - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' + - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' + - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' + - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' + config_gen: + - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' + - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' + - '.github/workflows/pull-request-management.yml' + - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/*' + - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/**/*' + - 'python-avd/pyavd/_eos_cli_config_gen/*' + - 'python-avd/pyavd/_eos_cli_config_gen/**/*' + validate_state: + - 'ansible_collections/arista/avd/roles/eos_validate_state/*' + - 'ansible_collections/arista/avd/roles/eos_validate_state/**/*' + cloudvision: + - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' + - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' + - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' + - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' + - '.github/workflows/pull-request-management.yml' + dhcp: + - 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' + - 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' + - '.github/workflows/pull-request-management.yml' + plugins: + - 'ansible_collections/arista/avd/plugins/filter/**' + - 'ansible_collections/arista/avd/plugins/test/**' + requirements: + - 'ansible_collections/arista/avd/requirements.txt' + - 'ansible_collections/arista/avd/requirements-dev.txt' + - 'ansible_collections/arista/avd/meta/runtime.yml' + - '.github/requirements-ci.txt' + docs: + - '.github/workflows/pull-request-management.yml' + - 'mkdocs.yml' + - 'ansible_collections/arista/avd/docs/**' + - 'ansible_collections/arista/avd/roles/**/*.md' + - 'ansible_collections/arista/avd/**/*.md' + - 'ansible_collections/arista/avd/README.md' + - 'ansible_collections/arista/avd/**/*.schema.yml' + pyavd: + - 'python_avd/*' + - 'python_avd/**/*' + avd-base-image: + runs-on: ubuntu-latest + container: + image: ubuntu:latest + options: --cpus 1 + outputs: + base_image_tag: ${{ steps.set-base-tag.outputs.base_image_tag }} + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Calculate Hash of Requirements + id: hash-reqs + run: | + HASH_OF_REQS=$(sha256sum ansible_collections/arista/avd/requirements-dev.txt | cut -d' ' -f1) + echo "Hash of requirements: $HASH_OF_REQS" + echo "::set-output name=hash_of_reqs::$HASH_OF_REQS" + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + - name: Set Base Image Tag + id: set-base-tag + run: | + BASE_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ steps.hash-reqs.outputs.hash_of_reqs }}" + echo "::set-output name=base_image_tag::$BASE_IMAGE_TAG" + - name: Set up Docker + run: | + apt-get update + apt-get install -y docker.io + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Check if image exists + id: check-base-image + run: | + if docker manifest inspect ${{ steps.set-base-tag.outputs.base_image_tag }} > /dev/null 2>&1; then + echo "Base image exists." + echo "::set-output name=image_exists::true" + else + echo "Base image does not exist." + echo "::set-output name=image_exists::false" + fi + - name: Set up Docker Buildx + if: steps.check-base-image.outputs.image_exists == 'false' + uses: docker/setup-buildx-action@v3 + + - name: Build and push + if: steps.check-base-image.outputs.image_exists == 'false' + uses: docker/build-push-action@v6 + with: + file: .github/DockerfileBase + target: base + push: true + tags: ${{ steps.set-base-tag.outputs.base_image_tag }} + cache-from: type=gha + cache-to: type=gha,mode=max + + build-pyavd: + name: Install pyavd and Build Image + needs: [avd-base-image] + runs-on: ubuntu-latest + outputs: + build_image_tag: ${{ steps.set-build-tag.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + - name: Set Build Image Tag + id: set-build-tag + run: | + SHORT_SHA=$(git rev-parse --short HEAD) + BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" + echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v6 + with: + file: .github/DockerfileBase + push: true + target: run + tags: ${{ steps.set-build-tag.outputs.build_image_tag }} + cache-from: type=gha + cache-to: type=gha,mode=max + # build-args: | + # BASE_IMAGE_TAG: ${{ needs.setup-avd.outputs.image_tag }} + # run-anisble-tests: + # name: Run Ansible Tests + # needs: [build-pyavd] + # runs-on: ubuntu-latest + # container: + # image: ${{ needs.build-pyavd.outputs.build_image_tag }} + # options: --cpus 1 + # strategy: + # matrix: + # task: + # - name: Ansible Unit Tests 3.12 + # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + # - name: Ansible Integration Tests 3.12 + # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + # - name: Ansible Integration Tests 3.13 + # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + # - name: Ansible Sanity Tests 3.13 + # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # - name: Ansible Sanity Tests 3.12 + # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # - name: Ansible Lint Tests 3.11 + # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + # steps: + # - name: Run Task - ${{ matrix.task.name }} + # run: | + # ${{ matrix.task.command }} + + + # ----------------------------------- # + # EOS CLI CONFIG GEN MOLECULE + # ----------------------------------- # + molecule_eos_cli_config_gen: + name: Validate eos_cli_config_gen + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: + - "eos_cli_config_gen" + - "eos_cli_config_gen_deprecated_vars" + - "eos_cli_config_gen_negative_unit_tests" + ansible_version: + - "'ansible-core<2.19.0' --upgrade" + # Also test minimum ansible version for one scenario. + include: + - avd_scenario: "eos_cli_config_gen" + ansible_version: "ansible-core==2.16.0" + needs: [ build-pyavd ] + if: needs.file-changes.outputs.config_gen == 'true' + steps: + - name: Install the specified Ansible version + run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: " . /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + + # ----------------------------------- # + # DHCP PROVISIONNER MOLECULE + # ----------------------------------- # + molecule_dhcp_provisionner: + name: Validate DHCP configuration + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: ["dhcp_configuration", "dhcp_provisioning"] + ansible_version: ["'ansible-core<2.19.0' --upgrade"] + needs: [ build-pyavd ] + if: needs.file-changes.outputs.dhcp == 'true' + steps: + - name: Install the specified Ansible version + run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + + # ----------------------------------- # + # EOS Design MOLECULE + # ----------------------------------- # + molecule_eos_designs: + name: Validate eos_designs + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: + - "eos_designs_deprecated_vars" + - "eos_designs-l2ls" + - "eos_designs-mpls-isis-sr-ldp" + - "eos_designs_negative_unit_tests" + - "eos_designs-twodc-5stage-clos" + - "eos_designs_unit_tests" + - "evpn_underlay_ebgp_overlay_ebgp" + - "evpn_underlay_isis_overlay_ibgp" + - "evpn_underlay_ospf_overlay_ebgp" + - "evpn_underlay_rfc5549_overlay_ebgp" + - "example-campus-fabric" + - "example-dual-dc-l3ls" + - "example-isis-ldp-ipvpn" + - "example-l2ls-fabric" + - "example-single-dc-l3ls" + - "example-cv-pathfinder" + ansible_version: + # Testing all scenario with 2.16.x, due to bug with in 2.17.0 with and the way we test eos_designs_negative_unit_tests https://github.com/ansible/ansible/issues/83292 + - "'ansible-core>=2.16.0,<2.17.0' --upgrade" + pip_requirements: + - '.github/requirements-ci.txt' + # Also test minimum ansible version for one scenario. + include: + - avd_scenario: "eos_designs_unit_tests" + ansible_version: "'ansible-core==2.16.0' --upgrade" + - avd_scenario: "eos_designs_unit_tests" + ansible_version: "'ansible-core<2.18.0' --upgrade" + - avd_scenario: "eos_designs_unit_tests" + ansible_version: "'ansible-core<2.19.0' --upgrade" + needs: [ build-pyavd ] + if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' + steps: + - name: Install the specified Ansible version + run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + # ----------------------------------- # + # Cloudvision MOLECULE + # ----------------------------------- # + molecule_cloudvision: + name: Validate cvp_collection + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: + - "eos_config_deploy_cvp" + ansible_version: + - "'ansible-core<2.19.0' --upgrade" + include: + - avd_scenario: "eos_config_deploy_cvp" + ansible_version: "ansible-core==2.16.0" + needs: [ build-pyavd ] + if: needs.file-changes.outputs.cloudvision == 'true' || needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' + + steps: + - name: Install the specified Ansible version + run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + # + # ----------------------------------- # + # EOS Validate State MOLECULE + # ----------------------------------- # + molecule_eos_validate_state: + name: Validate eos_validate_state + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: + - "eos_validate_state" + ansible_version: + - "'ansible-core<2.19.0' --upgrade" + include: + - avd_scenario: "eos_validate_state" + ansible_version: "ansible-core==2.16.0" + needs: [ build-pyavd ] + if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.validate_state == 'true' + steps: + - name: Install the specified Ansible version + run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + + # ----------------------------------- # + # Ansible tests + # ----------------------------------- # + ansible_test_sanity: + name: Run ansible-test sanity validation + runs-on: ubuntu-latest + needs: [build-pyavd] + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + steps: + - name: "Run ansible-test sanity" + run: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + + ansible_test_units: + name: Run ansible-test units test cases + runs-on: ubuntu-latest + needs: [build-pyavd] + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + steps: + - name: "Run ansible-test units test cases" + run: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + + ansible_test_integration: + name: Run ansible-test integration test cases + runs-on: ubuntu-latest + needs: [build-pyavd] + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: "Run ansible-test integration test cases" + run: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + + ansible_lint: + name: Run ansible-lint test case + runs-on: ubuntu-latest + needs: [build-pyavd] + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + steps: + - name: "Run ansible-test integration test cases" + run: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + + # ----------------------------------- # + # Galaxy Importer + # ----------------------------------- # + # galaxy_importer: + # name: Test galaxy-importer + # runs-on: ubuntu-20.04 # Older version to be compatible with old python + # env: + # GALAXY_IMPORTER_CONFIG: galaxy-importer/galaxy-importer.cfg + # steps: + # - uses: actions/setup-python@v5 + # with: + # python-version: | + # 3.10 + # - uses: actions/checkout@v4 + # - name: 'Install Python & Ansible requirements' + # run: | + # pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade + # ansible-galaxy collection install -r ansible_collections/arista/avd/collections.yml + # - name: Install galaxy-importer + # # Install the specific version of galaxy-importer used on galaxy.ansible.com + # # The version conflicts with our requirements, + # # so we let the galaxy-importer version resolve remaining requirements. + # run: | + # pip install "galaxy-importer==0.4.26" + # - name: 'Build ansible package' + # run: make collection-build + # - name: 'Run galaxy-importer checks' + # run: python -m galaxy_importer.main *.tar.gz + # - uses: actions/upload-artifact@v4 + # with: + # name: importer-logs + # path: ./importer_result.json + + # # ----------------------------------- # + # # Test of pyavd + # # ----------------------------------- # + # pyavd: + # name: Test pyavd + # runs-on: ubuntu-latest + # needs: [file-changes] + # if: | + # needs.file-changes.outputs.eos_design == 'true' || + # needs.file-changes.outputs.config_gen == 'true' || + # needs.file-changes.outputs.pyavd == 'true' + # strategy: + # matrix: + # python: ["3.10", "3.11", "3.12", "3.13"] + # steps: + # - uses: actions/checkout@v4 + # - name: Set up Python 3 + # uses: actions/setup-python@v5 + # with: + # python-version: ${{ matrix.python }} + # - name: 'Install tox' + # run: | + # pip install tox tox-gh-actions --upgrade + # - name: "Run pytest via tox for ${{ matrix.python }}" + # working-directory: python-avd + # run: | + # tox From 0fb409471c32ef7a479915cb166e54ca41504461 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 11:32:17 +0530 Subject: [PATCH 125/324] updated workflow1 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index bcc29c57e6d..a0ce18784cf 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -399,7 +399,7 @@ image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - name: "Run ansible-test units test cases" - run: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + run: ". /UV3.12/bin/activate && pwd && ls -al && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" ansible_test_integration: name: Run ansible-test integration test cases From 9d4d18820efd48b00989f4281acd239622ee2223 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 11:37:56 +0530 Subject: [PATCH 126/324] updated workflow2 --- .github/workflows/pull-request-management.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index a0ce18784cf..062c9381232 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -389,7 +389,7 @@ image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - name: "Run ansible-test sanity" - run: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases @@ -399,7 +399,7 @@ image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - name: "Run ansible-test units test cases" - run: ". /UV3.12/bin/activate && pwd && ls -al && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + run: ". /UV3.12/bin/activate && pwd && ls -al && cd ansible_collections/arista/avd && ansible-test units -vv" ansible_test_integration: name: Run ansible-test integration test cases @@ -411,7 +411,7 @@ - name: Check out repository code uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" - run: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + run: ". /UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" ansible_lint: name: Run ansible-lint test case @@ -421,7 +421,7 @@ image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - name: "Run ansible-test integration test cases" - run: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From cfc63c5b351b92c8135ee3f2334e15b4f0021d4c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 11:51:34 +0530 Subject: [PATCH 127/324] updated workflow3 --- .github/DockerfileBase | 2 +- .github/workflows/pull-request-management.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 81825842928..194a4e59197 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -35,4 +35,4 @@ COPY --from=build /UV3.10 /UV3.10 COPY --from=build /UV3.11 /UV3.11 COPY --from=build /UV3.12 /UV3.12 COPY --from=build /UV3.13 /UV3.13 -Workdir /avd +COPY --from=pyavd_build /avd /avd diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 062c9381232..bcc29c57e6d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -389,7 +389,7 @@ image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - name: "Run ansible-test sanity" - run: ". /UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases @@ -399,7 +399,7 @@ image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - name: "Run ansible-test units test cases" - run: ". /UV3.12/bin/activate && pwd && ls -al && cd ansible_collections/arista/avd && ansible-test units -vv" + run: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" ansible_test_integration: name: Run ansible-test integration test cases @@ -411,7 +411,7 @@ - name: Check out repository code uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" - run: ". /UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + run: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" ansible_lint: name: Run ansible-lint test case @@ -421,7 +421,7 @@ image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - name: "Run ansible-test integration test cases" - run: ". /UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From 26b28bd5ce5bd1a6151eb003c1ba7786b0fae818 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 11:53:49 +0530 Subject: [PATCH 128/324] updated workflow4 --- .github/DockerfileBase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 194a4e59197..72cb6df01af 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -35,4 +35,4 @@ COPY --from=build /UV3.10 /UV3.10 COPY --from=build /UV3.11 /UV3.11 COPY --from=build /UV3.12 /UV3.12 COPY --from=build /UV3.13 /UV3.13 -COPY --from=pyavd_build /avd /avd +COPY --from=build /avd /avd From ae2565f9b99be3634c2d95b19bc536128bd5323f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 12:01:56 +0530 Subject: [PATCH 129/324] updated workflow5 --- .github/DockerfileBase | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 72cb6df01af..68b9a0f483c 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -26,7 +26,6 @@ RUN python3 -m pip install --break-system-packages build && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done -RUN rm -rf /avd FROM base AS run LABEL stage=run From 8435b930adbc874da02bd3904aa09d9b795b8301 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 12:19:39 +0530 Subject: [PATCH 130/324] updated workflow6 --- .github/workflows/pull-request-management.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index bcc29c57e6d..9185e3ddcad 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -110,10 +110,10 @@ run: | BASE_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ steps.hash-reqs.outputs.hash_of_reqs }}" echo "::set-output name=base_image_tag::$BASE_IMAGE_TAG" - - name: Set up Docker - run: | - apt-get update - apt-get install -y docker.io + # - name: Set up Docker + # run: | + # apt-get update + # apt-get install -y docker.io - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: From 210a5c69c6498cd74472290ea73d99859c72c87a Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 12:23:48 +0530 Subject: [PATCH 131/324] updated workflow7 --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 9185e3ddcad..c52bd93d719 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -114,6 +114,8 @@ # run: | # apt-get update # apt-get install -y docker.io + - name: Install Docker CLI + run: apk add --no-cache docker-cli - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: From 2af7c971fb60ec7cb3c1c3ba2356e8b10aff865b Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 13:00:47 +0530 Subject: [PATCH 132/324] updated dockerfile1 --- .github/DockerfileBase | 10 ++++++++-- .github/workflows/pull-request-management.yml | 10 ++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 68b9a0f483c..7bf6e3593ca 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -17,7 +17,13 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ -r /requirements-dev.txt --upgrade; \ done -FROM base AS build +FROM ubuntu:latest AS base_run +COPY --from=base /UV3.10 /UV3.10 +COPY --from=base /UV3.11 /UV3.11 +COPY --from=base /UV3.12 /UV3.12 +COPY --from=base /UV3.13 /UV3.13 + +FROM base_run AS build LABEL stage=build COPY . /avd WORKDIR /avd/python-avd @@ -27,7 +33,7 @@ RUN python3 -m pip install --break-system-packages build && \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done -FROM base AS run +FROM ubuntu:latest AS run LABEL stage=run # Copy virtual environments from the build stage COPY --from=build /UV3.10 /UV3.10 diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index c52bd93d719..bcc29c57e6d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -110,12 +110,10 @@ run: | BASE_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ steps.hash-reqs.outputs.hash_of_reqs }}" echo "::set-output name=base_image_tag::$BASE_IMAGE_TAG" - # - name: Set up Docker - # run: | - # apt-get update - # apt-get install -y docker.io - - name: Install Docker CLI - run: apk add --no-cache docker-cli + - name: Set up Docker + run: | + apt-get update + apt-get install -y docker.io - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: From 8bbdf02440a5570aceca3d11d7d834b55731da2d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 13:05:37 +0530 Subject: [PATCH 133/324] updated dockerfile2 --- .github/DockerfileBase | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 7bf6e3593ca..c58b94c837e 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -18,6 +18,7 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ done FROM ubuntu:latest AS base_run +RUN apt-get install -y --no-install-recommends python3-pip python3-dev COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 From 5a13e8ae8988edd8e7e247534c98bef7a7a6e7d7 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 13:09:45 +0530 Subject: [PATCH 134/324] updated dockerfile3 --- .github/DockerfileBase | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index c58b94c837e..6028457e164 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -18,7 +18,7 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ done FROM ubuntu:latest AS base_run -RUN apt-get install -y --no-install-recommends python3-pip python3-dev +# Copy Python binaries, libraries, and necessary files COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 @@ -28,6 +28,9 @@ FROM base_run AS build LABEL stage=build COPY . /avd WORKDIR /avd/python-avd +COPY --from=base /usr/bin/python3 /usr/bin/python3 +COPY --from=base /usr/lib/python3.*/ /usr/lib/python3.*/ +COPY --from=base /usr/include/python3.*/ /usr/include/python3.*/ RUN python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ From 106ce5f3dac2e8f0948c4efd69ce835e664d9973 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 14:40:49 +0530 Subject: [PATCH 135/324] updated dockerfile4 --- .github/DockerfileBase | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 6028457e164..6430729f38a 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -28,11 +28,8 @@ FROM base_run AS build LABEL stage=build COPY . /avd WORKDIR /avd/python-avd -COPY --from=base /usr/bin/python3 /usr/bin/python3 -COPY --from=base /usr/lib/python3.*/ /usr/lib/python3.*/ -COPY --from=base /usr/include/python3.*/ /usr/include/python3.*/ -RUN python3 -m pip install --break-system-packages build && \ - python3 -m build --wheel --outdir /tmp/wheels && \ +RUN /UV3.12/bin/python -m pip install --break-system-packages build && \ + /UV3.12/bin/python -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done From ba4789461c58325160d89a4b615348a72cafbd7c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 14:47:28 +0530 Subject: [PATCH 136/324] updated dockerfile5 --- .github/DockerfileBase | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 6430729f38a..18cff15c39d 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -17,16 +17,13 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ -r /requirements-dev.txt --upgrade; \ done -FROM ubuntu:latest AS base_run -# Copy Python binaries, libraries, and necessary files +FROM ubuntu:latest AS build +LABEL stage=build +COPY . /avd COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 COPY --from=base /UV3.13 /UV3.13 - -FROM base_run AS build -LABEL stage=build -COPY . /avd WORKDIR /avd/python-avd RUN /UV3.12/bin/python -m pip install --break-system-packages build && \ /UV3.12/bin/python -m build --wheel --outdir /tmp/wheels && \ From 1aaac44fb145e49c81c8192498e3eb22e3437636 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 16:41:42 +0530 Subject: [PATCH 137/324] updated dockerfile6 --- .github/DockerfileBase | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 18cff15c39d..820684ac5b7 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -17,16 +17,21 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ -r /requirements-dev.txt --upgrade; \ done -FROM ubuntu:latest AS build -LABEL stage=build -COPY . /avd +FROM ubuntu:latest AS base_run +# Copy Python binaries, libraries, and necessary files COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 COPY --from=base /UV3.13 /UV3.13 + +FROM base_run AS build +LABEL stage=build +COPY . /avd WORKDIR /avd/python-avd -RUN /UV3.12/bin/python -m pip install --break-system-packages build && \ - /UV3.12/bin/python -m build --wheel --outdir /tmp/wheels && \ +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3-pip python3-dev +RUN python3 -m pip install --break-system-packages build && \ + python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done From 422a953fa4227abdf69ffe0a0a2406997b6e55cd Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 17:39:41 +0530 Subject: [PATCH 138/324] updated dockerfile7 --- .github/DockerfileBase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 820684ac5b7..9ee50958096 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -29,7 +29,7 @@ LABEL stage=build COPY . /avd WORKDIR /avd/python-avd RUN apt-get update && apt-get install -y --no-install-recommends \ - python3-pip python3-dev + python3-pip python3-dev make RUN python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ From 5acd02bfd42db5d4b543de517f30610056ec1512 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 17:44:55 +0530 Subject: [PATCH 139/324] updated dockerfile8 --- .github/DockerfileBase | 6 ++---- .github/workflows/pull-request-management.yml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 9ee50958096..6430729f38a 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -28,10 +28,8 @@ FROM base_run AS build LABEL stage=build COPY . /avd WORKDIR /avd/python-avd -RUN apt-get update && apt-get install -y --no-install-recommends \ - python3-pip python3-dev make -RUN python3 -m pip install --break-system-packages build && \ - python3 -m build --wheel --outdir /tmp/wheels && \ +RUN /UV3.12/bin/python -m pip install --break-system-packages build && \ + /UV3.12/bin/python -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index bcc29c57e6d..ef2aa57759d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -131,7 +131,7 @@ echo "::set-output name=image_exists::false" fi - name: Set up Docker Buildx - if: steps.check-base-image.outputs.image_exists == 'false' + # if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/setup-buildx-action@v3 - name: Build and push From 9fb5c1025a44d70c0c755121691282b1995ebbad Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 17:48:32 +0530 Subject: [PATCH 140/324] updated dockerfile9 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index ef2aa57759d..d3141df66d7 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -135,7 +135,7 @@ uses: docker/setup-buildx-action@v3 - name: Build and push - if: steps.check-base-image.outputs.image_exists == 'false' + # if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 with: file: .github/DockerfileBase From ddb916bb06683cf2412281abec26e36712bd379d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 17:55:14 +0530 Subject: [PATCH 141/324] updated dockerfile10 --- .github/DockerfileBase | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 6430729f38a..e97666cc90b 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -28,8 +28,8 @@ FROM base_run AS build LABEL stage=build COPY . /avd WORKDIR /avd/python-avd -RUN /UV3.12/bin/python -m pip install --break-system-packages build && \ - /UV3.12/bin/python -m build --wheel --outdir /tmp/wheels && \ +RUN uv pip install build && \ + uv -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done From bf1dbe45b61a61d8a48be71b66c7ff97d047bd9e Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 17:57:47 +0530 Subject: [PATCH 142/324] updated dockerfile11 --- .github/DockerfileBase | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index e97666cc90b..c94f37dea43 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -28,6 +28,7 @@ FROM base_run AS build LABEL stage=build COPY . /avd WORKDIR /avd/python-avd +Run apt-get install -y uv RUN uv pip install build && \ uv -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ From 5dd396dd7a65cbbda3d6099bb9a4dbb51e7d3187 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 18:01:17 +0530 Subject: [PATCH 143/324] updated dockerfile12 --- .github/DockerfileBase | 2 +- .github/workflows/pull-request-management.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index c94f37dea43..5877d16e025 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -28,7 +28,7 @@ FROM base_run AS build LABEL stage=build COPY . /avd WORKDIR /avd/python-avd -Run apt-get install -y uv +Run curl -LsSf https://astral.sh/uv/install.sh | sh RUN uv pip install build && \ uv -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d3141df66d7..31deee66923 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -135,7 +135,7 @@ uses: docker/setup-buildx-action@v3 - name: Build and push - # if: steps.check-base-image.outputs.image_exists == 'false' + #if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 with: file: .github/DockerfileBase From 21a4f2320ba14fb0aa3381c4316eae2328320d7e Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 30 Jan 2025 18:23:35 +0530 Subject: [PATCH 144/324] updated dockerfile13 --- .github/DockerfileBase | 5 ++--- .github/workflows/pull-request-management.yml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 5877d16e025..ecab1e3d2c5 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -28,9 +28,8 @@ FROM base_run AS build LABEL stage=build COPY . /avd WORKDIR /avd/python-avd -Run curl -LsSf https://astral.sh/uv/install.sh | sh -RUN uv pip install build && \ - uv -m build --wheel --outdir /tmp/wheels && \ +RUN /UV3.12/bin/python -m pip install build && \ + /UV3.12/bin/python -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 31deee66923..30f10235667 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -139,7 +139,7 @@ uses: docker/build-push-action@v6 with: file: .github/DockerfileBase - target: base + target: base_run push: true tags: ${{ steps.set-base-tag.outputs.base_image_tag }} cache-from: type=gha From 3cc0ddaeb6290b8bead2b9fc2438bd29c6267711 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 11:50:30 +0530 Subject: [PATCH 145/324] updated dockerfile14 --- .github/DockerfileBase | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index ecab1e3d2c5..d1fede844cb 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -23,6 +23,7 @@ COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 COPY --from=base /UV3.13 /UV3.13 +RUN /UV3.12/bin/python -m pip install build FROM base_run AS build LABEL stage=build From 7d11c3932ee5c69f61d58e7cd809a9d113787a29 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 11:55:34 +0530 Subject: [PATCH 146/324] updated dockerfile15 --- .github/DockerfileBase | 2 -- .github/workflows/pull-request-management.yml | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index d1fede844cb..b7b8cb96c39 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -22,8 +22,6 @@ FROM ubuntu:latest AS base_run COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 -COPY --from=base /UV3.13 /UV3.13 -RUN /UV3.12/bin/python -m pip install build FROM base_run AS build LABEL stage=build diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 30f10235667..9e538745e24 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -131,15 +131,13 @@ echo "::set-output name=image_exists::false" fi - name: Set up Docker Buildx - # if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/setup-buildx-action@v3 - name: Build and push - #if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 with: file: .github/DockerfileBase - target: base_run + target: base push: true tags: ${{ steps.set-base-tag.outputs.base_image_tag }} cache-from: type=gha From c4704af9c367a674ccba0cda95406baed3cff749 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 12:07:48 +0530 Subject: [PATCH 147/324] updated dockerfile16 --- .github/DockerfileBase | 2 ++ .github/workflows/pull-request-management.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index b7b8cb96c39..439649cf7b2 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -22,6 +22,8 @@ FROM ubuntu:latest AS base_run COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 +WORKDIR / +RUN pwd && ls FROM base_run AS build LABEL stage=build diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 9e538745e24..bcc29c57e6d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -131,9 +131,11 @@ echo "::set-output name=image_exists::false" fi - name: Set up Docker Buildx + if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/setup-buildx-action@v3 - name: Build and push + if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 with: file: .github/DockerfileBase From 37d1495a522d52293542a278e9a76446458f1023 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 12:11:17 +0530 Subject: [PATCH 148/324] updated dockerfile17 --- .github/DockerfileBase | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 439649cf7b2..e3c8c6b20f3 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -22,11 +22,11 @@ FROM ubuntu:latest AS base_run COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 -WORKDIR / -RUN pwd && ls FROM base_run AS build LABEL stage=build +WORKDIR / +RUN pwd && ls COPY . /avd WORKDIR /avd/python-avd RUN /UV3.12/bin/python -m pip install build && \ From 082c55f1d35403f1c4c20e4d886e021057f7c09c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 12:24:23 +0530 Subject: [PATCH 149/324] updated dockerfile18 --- .github/DockerfileBase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index e3c8c6b20f3..dadd94699f0 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -26,7 +26,7 @@ COPY --from=base /UV3.12 /UV3.12 FROM base_run AS build LABEL stage=build WORKDIR / -RUN pwd && ls +RUN pwd && ls -l COPY . /avd WORKDIR /avd/python-avd RUN /UV3.12/bin/python -m pip install build && \ From 8c1f673662cb44cb034026ed66005b8c7f0fba82 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 12:28:13 +0530 Subject: [PATCH 150/324] updated dockerfile19 --- .github/DockerfileBase | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index dadd94699f0..d93d30e0188 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -29,6 +29,7 @@ WORKDIR / RUN pwd && ls -l COPY . /avd WORKDIR /avd/python-avd +RUN . /UV3.11/bin/activate && python --version RUN /UV3.12/bin/python -m pip install build && \ /UV3.12/bin/python -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ From 82e02b2578225a69774a35fd925c243233f6e855 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 12:32:16 +0530 Subject: [PATCH 151/324] updated dockerfile20 --- .github/DockerfileBase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index d93d30e0188..5057b5d8cc4 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -29,7 +29,7 @@ WORKDIR / RUN pwd && ls -l COPY . /avd WORKDIR /avd/python-avd -RUN . /UV3.11/bin/activate && python --version +RUN . /UV3.11/bin/activate && python3 --version RUN /UV3.12/bin/python -m pip install build && \ /UV3.12/bin/python -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ From dc23f10b09b757dc52f6f439b868c24c450eb4df Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 12:51:09 +0530 Subject: [PATCH 152/324] updated dockerfile21 --- .github/DockerfileBase | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 5057b5d8cc4..a3b8f58f7e1 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -25,8 +25,8 @@ COPY --from=base /UV3.12 /UV3.12 FROM base_run AS build LABEL stage=build -WORKDIR / -RUN pwd && ls -l +WORKDIR /UV3.11/bin/ +RUN pwd && ls COPY . /avd WORKDIR /avd/python-avd RUN . /UV3.11/bin/activate && python3 --version From 761090b06815150ae10b7b74ba4f1d47efb1ee9c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 13:10:01 +0530 Subject: [PATCH 153/324] updated dockerfile22 --- .github/DockerfileBase | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index a3b8f58f7e1..4a1fc3dd782 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -19,9 +19,10 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ FROM ubuntu:latest AS base_run # Copy Python binaries, libraries, and necessary files -COPY --from=base /UV3.10 /UV3.10 -COPY --from=base /UV3.11 /UV3.11 -COPY --from=base /UV3.12 /UV3.12 +COPY --from=base_run /usr/lib/libpython3.10.so /usr/lib/ +COPY --from=base_run /usr/lib/libpython3.11.so /usr/lib/ +COPY --from=base_run /usr/lib/libpython3.12.so /usr/lib/ +COPY --from=base_run /usr/lib/libpython3.13.so /usr/lib/ FROM base_run AS build LABEL stage=build From 73ae0cac1beb4d513aaa83d885724ddbbe97c8f6 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 13:11:37 +0530 Subject: [PATCH 154/324] updated dockerfile23 --- .github/DockerfileBase | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 4a1fc3dd782..4a6ed59a3d9 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -19,10 +19,10 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ FROM ubuntu:latest AS base_run # Copy Python binaries, libraries, and necessary files -COPY --from=base_run /usr/lib/libpython3.10.so /usr/lib/ -COPY --from=base_run /usr/lib/libpython3.11.so /usr/lib/ -COPY --from=base_run /usr/lib/libpython3.12.so /usr/lib/ -COPY --from=base_run /usr/lib/libpython3.13.so /usr/lib/ +COPY --from=base /usr/lib/libpython3.10.so /usr/lib/ +COPY --from=base /usr/lib/libpython3.11.so /usr/lib/ +COPY --from=base /usr/lib/libpython3.12.so /usr/lib/ +COPY --from=base /usr/lib/libpython3.13.so /usr/lib/ FROM base_run AS build LABEL stage=build From 041e45d19148f993906793cd1b97888ebb4b7288 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 14:36:01 +0530 Subject: [PATCH 155/324] updated dockerfile24 --- .github/DockerfileBase | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 4a6ed59a3d9..4b1c8a7fb8e 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -19,15 +19,12 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ FROM ubuntu:latest AS base_run # Copy Python binaries, libraries, and necessary files -COPY --from=base /usr/lib/libpython3.10.so /usr/lib/ -COPY --from=base /usr/lib/libpython3.11.so /usr/lib/ -COPY --from=base /usr/lib/libpython3.12.so /usr/lib/ -COPY --from=base /usr/lib/libpython3.13.so /usr/lib/ +COPY --from=base /UV3.10 /UV3.10 +COPY --from=base /UV3.11 /UV3.11 +COPY --from=base /UV3.12 /UV3.12 FROM base_run AS build LABEL stage=build -WORKDIR /UV3.11/bin/ -RUN pwd && ls COPY . /avd WORKDIR /avd/python-avd RUN . /UV3.11/bin/activate && python3 --version From adcb41d25e337dff7aa70f31e2951ca833a7b7ba Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 14:43:33 +0530 Subject: [PATCH 156/324] updated dockerfile25 --- .github/Dockerfile | 27 ++++++++++++--- .github/DockerfileBase | 33 +++---------------- .github/workflows/pull-request-management.yml | 8 ++--- 3 files changed, 30 insertions(+), 38 deletions(-) diff --git a/.github/Dockerfile b/.github/Dockerfile index 508be2fce45..1967ffe20c5 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -1,7 +1,24 @@ -FROM ghcr.io/maheshgslab/avd-slim-test1:0.1 +FROM ubuntu:latest AS base +#LABEL stage=base +# Install essential packages and UV +RUN apt-get update && apt-get install -y --no-install-recommends \ + openssh-client git make python3-pip python3-dev docker.io && \ + pip install uv --break-system-packages && \ + apt-get clean && rm -rf /var/lib/apt/lists + +# Copy requirements file after installing essential tools COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt +# Install Python versions and dependencies in a single step RUN uv python install 3.10 3.11 3.12 3.13 && \ - /UV3.10/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r /requirements-dev.txt --upgrade && \ - /UV3.11/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r /requirements-dev.txt --upgrade && \ - /UV3.12/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r /requirements-dev.txt --upgrade && \ - /UV3.13/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" -r /requirements-dev.txt --upgrade + for VERSION in 3.10 3.11 3.12 3.13; do \ + uv venv --python $VERSION /UV$VERSION && \ + /UV$VERSION/bin/python -m ensurepip --upgrade && \ + /UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + -r /requirements-dev.txt --upgrade; \ + done + +FROM ubuntu:latest AS base_run +# Copy Python binaries, libraries, and necessary files +COPY --from=base /UV3.10 /UV3.10 +COPY --from=base /UV3.11 /UV3.11 +COPY --from=base /UV3.12 /UV3.12 \ No newline at end of file diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 4b1c8a7fb8e..755e9186287 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -1,35 +1,10 @@ -FROM ubuntu:latest AS base -#LABEL stage=base -# Install essential packages and UV -RUN apt-get update && apt-get install -y --no-install-recommends \ - openssh-client git make python3-pip python3-dev docker.io && \ - pip install uv --break-system-packages && \ - apt-get clean && rm -rf /var/lib/apt/lists - -# Copy requirements file after installing essential tools -COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt -# Install Python versions and dependencies in a single step -RUN uv python install 3.10 3.11 3.12 3.13 && \ - for VERSION in 3.10 3.11 3.12 3.13; do \ - uv venv --python $VERSION /UV$VERSION && \ - /UV$VERSION/bin/python -m ensurepip --upgrade && \ - /UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r /requirements-dev.txt --upgrade; \ - done - -FROM ubuntu:latest AS base_run -# Copy Python binaries, libraries, and necessary files -COPY --from=base /UV3.10 /UV3.10 -COPY --from=base /UV3.11 /UV3.11 -COPY --from=base /UV3.12 /UV3.12 - -FROM base_run AS build +ARG BASE_IMAGE_TAG +FROM $BASE_IMAGE_TAG as build LABEL stage=build COPY . /avd WORKDIR /avd/python-avd -RUN . /UV3.11/bin/activate && python3 --version -RUN /UV3.12/bin/python -m pip install build && \ - /UV3.12/bin/python -m build --wheel --outdir /tmp/wheels && \ +RUN python3 -m pip install build && \ + python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index bcc29c57e6d..7d9856a129c 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -138,8 +138,8 @@ if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 with: - file: .github/DockerfileBase - target: base + file: .github/Dockerfile + target: base_run push: true tags: ${{ steps.set-base-tag.outputs.base_image_tag }} cache-from: type=gha @@ -181,8 +181,8 @@ tags: ${{ steps.set-build-tag.outputs.build_image_tag }} cache-from: type=gha cache-to: type=gha,mode=max - # build-args: | - # BASE_IMAGE_TAG: ${{ needs.setup-avd.outputs.image_tag }} + build-args: | + BASE_IMAGE_TAG: ${{ steps.set-build-tag.outputs.build_image_tag }} # run-anisble-tests: # name: Run Ansible Tests # needs: [build-pyavd] From b631f6212a277b1a11bd3e118e77e4f31b1dda39 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 15:30:53 +0530 Subject: [PATCH 157/324] updated dockerfile26 --- .github/DockerfileBase | 4 ++-- .github/workflows/pull-request-management.yml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 755e9186287..bf3e4815f9d 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -1,5 +1,5 @@ -ARG BASE_IMAGE_TAG -FROM $BASE_IMAGE_TAG as build +ARG BASE_IMAGE_TAG=ubuntu:latest +FROM ${BASE_IMAGE_TAG} as build LABEL stage=build COPY . /avd WORKDIR /avd/python-avd diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 7d9856a129c..3500471d499 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -93,8 +93,7 @@ base_image_tag: ${{ steps.set-base-tag.outputs.base_image_tag }} steps: - name: Check out repository - uses: actions/checkout@v4 - + uses: actions/checkout@v4 - name: Calculate Hash of Requirements id: hash-reqs run: | From 082fa200e3a06ad8cd06ea0bb0e2a95ef40eb8d8 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 15:32:37 +0530 Subject: [PATCH 158/324] updated dockerfile27 --- .github/DockerfileBase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index bf3e4815f9d..4f29103db2f 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -1,5 +1,5 @@ ARG BASE_IMAGE_TAG=ubuntu:latest -FROM ${BASE_IMAGE_TAG} as build +FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build COPY . /avd WORKDIR /avd/python-avd From 222a921743fb20d7499a97d7525b67e41c7c3f4e Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 15:39:17 +0530 Subject: [PATCH 159/324] updated dockerfile28 --- .github/Dockerfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/Dockerfile b/.github/Dockerfile index 1967ffe20c5..5d7a634894e 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -17,8 +17,20 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ -r /requirements-dev.txt --upgrade; \ done +# Create symlinks to make Python globally accessible +RUN ln -s /UV3.12/bin/python /usr/local/bin/python3 && \ + ln -s /UV3.12/bin/pip /usr/local/bin/pip3 + + FROM ubuntu:latest AS base_run # Copy Python binaries, libraries, and necessary files COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 -COPY --from=base /UV3.12 /UV3.12 \ No newline at end of file +COPY --from=base /UV3.12 /UV3.12 + +# Ensure Python is available globally +RUN ln -s /UV3.12/bin/python /usr/local/bin/python3 && \ + ln -s /UV3.12/bin/pip /usr/local/bin/pip3 + +# Verify Python versions +RUN python3 --version && pip3 --version \ No newline at end of file From 418f48e4517e1a8e27d165b6eb3544e865935de5 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 15:41:20 +0530 Subject: [PATCH 160/324] updated dockerfile29 --- .github/workflows/pull-request-management.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 3500471d499..1a196bbd16f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -130,11 +130,9 @@ echo "::set-output name=image_exists::false" fi - name: Set up Docker Buildx - if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/setup-buildx-action@v3 - name: Build and push - if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 with: file: .github/Dockerfile From 7a57178b2c47b48f0c9ccf5ec23e987cf8334bc7 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 17:53:51 +0530 Subject: [PATCH 161/324] image build 1 --- .github/Dockerfile | 36 ------------------ .github/DockerfileBase | 37 +++++++++++-------- .github/DockerfileBuild | 19 ++++++++++ .github/workflows/pull-request-management.yml | 4 +- 4 files changed, 42 insertions(+), 54 deletions(-) delete mode 100644 .github/Dockerfile create mode 100644 .github/DockerfileBuild diff --git a/.github/Dockerfile b/.github/Dockerfile deleted file mode 100644 index 5d7a634894e..00000000000 --- a/.github/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM ubuntu:latest AS base -#LABEL stage=base -# Install essential packages and UV -RUN apt-get update && apt-get install -y --no-install-recommends \ - openssh-client git make python3-pip python3-dev docker.io && \ - pip install uv --break-system-packages && \ - apt-get clean && rm -rf /var/lib/apt/lists - -# Copy requirements file after installing essential tools -COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt -# Install Python versions and dependencies in a single step -RUN uv python install 3.10 3.11 3.12 3.13 && \ - for VERSION in 3.10 3.11 3.12 3.13; do \ - uv venv --python $VERSION /UV$VERSION && \ - /UV$VERSION/bin/python -m ensurepip --upgrade && \ - /UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r /requirements-dev.txt --upgrade; \ - done - -# Create symlinks to make Python globally accessible -RUN ln -s /UV3.12/bin/python /usr/local/bin/python3 && \ - ln -s /UV3.12/bin/pip /usr/local/bin/pip3 - - -FROM ubuntu:latest AS base_run -# Copy Python binaries, libraries, and necessary files -COPY --from=base /UV3.10 /UV3.10 -COPY --from=base /UV3.11 /UV3.11 -COPY --from=base /UV3.12 /UV3.12 - -# Ensure Python is available globally -RUN ln -s /UV3.12/bin/python /usr/local/bin/python3 && \ - ln -s /UV3.12/bin/pip /usr/local/bin/pip3 - -# Verify Python versions -RUN python3 --version && pip3 --version \ No newline at end of file diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 4f29103db2f..0177ff9e891 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -1,19 +1,24 @@ -ARG BASE_IMAGE_TAG=ubuntu:latest -FROM ${BASE_IMAGE_TAG} AS build -LABEL stage=build -COPY . /avd -WORKDIR /avd/python-avd -RUN python3 -m pip install build && \ - python3 -m build --wheel --outdir /tmp/wheels && \ +FROM ubuntu:latest AS base +#LABEL stage=base +# Install essential packages and UV +RUN apt-get update && apt-get install -y --no-install-recommends \ + openssh-client git make python3-pip python3-dev docker.io && \ + pip install uv --break-system-packages && \ + apt-get clean && rm -rf /var/lib/apt/lists + +# Copy requirements file after installing essential tools +COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt +# Install Python versions and dependencies in a single step +RUN uv python install 3.10 3.11 3.12 3.13 && \ for VERSION in 3.10 3.11 3.12 3.13; do \ - /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ + uv venv --python $VERSION /UV$VERSION && \ + /UV$VERSION/bin/python -m ensurepip --upgrade && \ + /UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + -r /requirements-dev.txt --upgrade; \ done -FROM ubuntu:latest AS run -LABEL stage=run -# Copy virtual environments from the build stage -COPY --from=build /UV3.10 /UV3.10 -COPY --from=build /UV3.11 /UV3.11 -COPY --from=build /UV3.12 /UV3.12 -COPY --from=build /UV3.13 /UV3.13 -COPY --from=build /avd /avd +FROM ubuntu:latest AS base_run +# Copy Python binaries, libraries, and necessary files +COPY --from=base /UV3.10 /UV3.10 +COPY --from=base /UV3.11 /UV3.11 +COPY --from=base /UV3.12 /UV3.12 diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild new file mode 100644 index 00000000000..4f29103db2f --- /dev/null +++ b/.github/DockerfileBuild @@ -0,0 +1,19 @@ +ARG BASE_IMAGE_TAG=ubuntu:latest +FROM ${BASE_IMAGE_TAG} AS build +LABEL stage=build +COPY . /avd +WORKDIR /avd/python-avd +RUN python3 -m pip install build && \ + python3 -m build --wheel --outdir /tmp/wheels && \ + for VERSION in 3.10 3.11 3.12 3.13; do \ + /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ + done + +FROM ubuntu:latest AS run +LABEL stage=run +# Copy virtual environments from the build stage +COPY --from=build /UV3.10 /UV3.10 +COPY --from=build /UV3.11 /UV3.11 +COPY --from=build /UV3.12 /UV3.12 +COPY --from=build /UV3.13 /UV3.13 +COPY --from=build /avd /avd diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 1a196bbd16f..d634450aae4 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -135,7 +135,7 @@ - name: Build and push uses: docker/build-push-action@v6 with: - file: .github/Dockerfile + file: .github/DockerfileBase target: base_run push: true tags: ${{ steps.set-base-tag.outputs.base_image_tag }} @@ -172,7 +172,7 @@ - name: Build and push uses: docker/build-push-action@v6 with: - file: .github/DockerfileBase + file: .github/DockerfileBuild push: true target: run tags: ${{ steps.set-build-tag.outputs.build_image_tag }} From 28b4cec8bb02f85487612d7bb41b3adc537df0da Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 18:15:39 +0530 Subject: [PATCH 162/324] image build 2 --- .github/DockerfileBuild | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 4f29103db2f..64027aa71b0 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,6 +2,10 @@ ARG BASE_IMAGE_TAG=ubuntu:latest FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build COPY . /avd +RUN apt-get update && apt-get install -y --no-install-recommends \ + openssh-client git make python3-pip python3-dev && \ + pip install uv --break-system-packages && \ + apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd RUN python3 -m pip install build && \ python3 -m build --wheel --outdir /tmp/wheels && \ From b4d69d1d06f2f1f5cb60b851e04ff3c7fbc13830 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 31 Jan 2025 18:20:51 +0530 Subject: [PATCH 163/324] image build 3 --- .github/DockerfileBuild | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 64027aa71b0..c940f651503 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,6 +2,7 @@ ARG BASE_IMAGE_TAG=ubuntu:latest FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build COPY . /avd +RUN echo ${BASE_IMAGE_TAG} RUN apt-get update && apt-get install -y --no-install-recommends \ openssh-client git make python3-pip python3-dev && \ pip install uv --break-system-packages && \ From c5984a56ccc824b71656787ac468f4a3c1716d6d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 11:19:16 +0530 Subject: [PATCH 164/324] image build 4 --- .github/DockerfileBuild | 4 +--- .github/workflows/pull-request-management.yml | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index c940f651503..be6da4ae2e1 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -1,8 +1,6 @@ -ARG BASE_IMAGE_TAG=ubuntu:latest -FROM ${BASE_IMAGE_TAG} AS build +FROM ghcr.io/shivani-gslab/avd-base:2ac024829aeecef47018498a31d8ece53037d9424c5264ef95d6b8cb5595426d AS build LABEL stage=build COPY . /avd -RUN echo ${BASE_IMAGE_TAG} RUN apt-get update && apt-get install -y --no-install-recommends \ openssh-client git make python3-pip python3-dev && \ pip install uv --break-system-packages && \ diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d634450aae4..840ddfeda14 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -130,9 +130,11 @@ echo "::set-output name=image_exists::false" fi - name: Set up Docker Buildx + if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/setup-buildx-action@v3 - name: Build and push + if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 with: file: .github/DockerfileBase From 066f00976ed5769bf3d9968558ee77ebf3d48a9c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 11:24:00 +0530 Subject: [PATCH 165/324] image build 5 --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index be6da4ae2e1..09a35cc26d4 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pip install uv --break-system-packages && \ apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN python3 -m pip install build && \ +RUN python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ From 781aecbd4f5befa8fe69f8787b0f78c30d37c2ad Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 11:32:15 +0530 Subject: [PATCH 166/324] image build 6 --- .github/DockerfileBase | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 0177ff9e891..1c500734bd5 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -11,6 +11,7 @@ COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt # Install Python versions and dependencies in a single step RUN uv python install 3.10 3.11 3.12 3.13 && \ for VERSION in 3.10 3.11 3.12 3.13; do \ + /UV$VERSION/bin/python -c 'import pathlib' \ uv venv --python $VERSION /UV$VERSION && \ /UV$VERSION/bin/python -m ensurepip --upgrade && \ /UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ From d2d8318b994090eecb2ed0be4e26fa8007848b71 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 11:41:44 +0530 Subject: [PATCH 167/324] image build 7 --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 840ddfeda14..f076c24804d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -163,6 +163,8 @@ SHORT_SHA=$(git rev-parse --short HEAD) BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" + - name: Echo image name + run: echo ${{ steps.set-build-tag.outputs.build_image_tag }} - name: Log in to GitHub Container Registry uses: docker/login-action@v2 with: From 01ec0dd380bdd911906046908ae7f44e1a43cf0d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 11:46:59 +0530 Subject: [PATCH 168/324] image build 8 --- .github/DockerfileBase | 1 - .github/workflows/pull-request-management.yml | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 1c500734bd5..0177ff9e891 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -11,7 +11,6 @@ COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt # Install Python versions and dependencies in a single step RUN uv python install 3.10 3.11 3.12 3.13 && \ for VERSION in 3.10 3.11 3.12 3.13; do \ - /UV$VERSION/bin/python -c 'import pathlib' \ uv venv --python $VERSION /UV$VERSION && \ /UV$VERSION/bin/python -m ensurepip --upgrade && \ /UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index f076c24804d..90d3dd1e098 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -130,11 +130,9 @@ echo "::set-output name=image_exists::false" fi - name: Set up Docker Buildx - if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/setup-buildx-action@v3 - name: Build and push - if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 with: file: .github/DockerfileBase @@ -183,7 +181,7 @@ cache-from: type=gha cache-to: type=gha,mode=max build-args: | - BASE_IMAGE_TAG: ${{ steps.set-build-tag.outputs.build_image_tag }} + BASE_IMAGE_TAG: ${{ needs.avd-base-image.outputs.base_image_tag }} # run-anisble-tests: # name: Run Ansible Tests # needs: [build-pyavd] From 6c913e15cc73a96f1d50fe47c9a4116f84287f51 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 11:48:41 +0530 Subject: [PATCH 169/324] image build 9 --- .github/DockerfileBuild | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 09a35cc26d4..44ba4521e95 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -1,4 +1,5 @@ -FROM ghcr.io/shivani-gslab/avd-base:2ac024829aeecef47018498a31d8ece53037d9424c5264ef95d6b8cb5595426d AS build +ARG BASE_IMAGE_TAG=ubuntu:latest +FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build COPY . /avd RUN apt-get update && apt-get install -y --no-install-recommends \ From e162e58d6be334ed7ed7b02fcd82b8f7a85908d1 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 11:52:28 +0530 Subject: [PATCH 170/324] image build 11 --- .github/workflows/pull-request-management.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 90d3dd1e098..765c3ea9635 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -130,9 +130,11 @@ echo "::set-output name=image_exists::false" fi - name: Set up Docker Buildx + if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/setup-buildx-action@v3 - name: Build and push + if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 with: file: .github/DockerfileBase @@ -162,7 +164,7 @@ BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" - name: Echo image name - run: echo ${{ steps.set-build-tag.outputs.build_image_tag }} + run: echo ${{ needs.avd-base-image.outputs.base_image_tag }} - name: Log in to GitHub Container Registry uses: docker/login-action@v2 with: From b070c007fc6cda04dddae8eb0ab65e5cd861a791 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 12:00:57 +0530 Subject: [PATCH 171/324] image build 12 --- .github/DockerfileBuild | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 44ba4521e95..047ad5e77fe 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -7,7 +7,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pip install uv --break-system-packages && \ apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN python3 -m pip install --break-system-packages build && \ +RUN uv python install 3.10 3.11 3.12 3.13 && + python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ From b4d10c21e3b57778147ccef5014652688907cbe3 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 12:04:22 +0530 Subject: [PATCH 172/324] image build 13 --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 047ad5e77fe..768eedea3f9 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pip install uv --break-system-packages && \ apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN uv python install 3.10 3.11 3.12 3.13 && +RUN uv python install 3.10 3.11 3.12 3.13 && \ python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ From 98ab13a369980a3ca161e975efcacdc81d9bc70d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 13:04:29 +0530 Subject: [PATCH 173/324] image build 14 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 765c3ea9635..33a24c6bf3b 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -183,7 +183,7 @@ cache-from: type=gha cache-to: type=gha,mode=max build-args: | - BASE_IMAGE_TAG: ${{ needs.avd-base-image.outputs.base_image_tag }} + BASE_IMAGE_TAG: ghcr.io/shivani-gslab/avd-base:2ac024829aeecef47018498a31d8ece53037d9424c5264ef95d6b8cb5595426d # run-anisble-tests: # name: Run Ansible Tests # needs: [build-pyavd] From 8507fa74283ca4680e2873e60fbf17c79b4a2ec1 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 13:09:20 +0530 Subject: [PATCH 174/324] image build 15 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 33a24c6bf3b..bd7153dba8f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -183,7 +183,7 @@ cache-from: type=gha cache-to: type=gha,mode=max build-args: | - BASE_IMAGE_TAG: ghcr.io/shivani-gslab/avd-base:2ac024829aeecef47018498a31d8ece53037d9424c5264ef95d6b8cb5595426d + BASE_IMAGE_TAG=ghcr.io/shivani-gslab/avd-base:2ac024829aeecef47018498a31d8ece53037d9424c5264ef95d6b8cb5595426d # run-anisble-tests: # name: Run Ansible Tests # needs: [build-pyavd] From 90bf89d0324772fa0cecae09f0d1dffa12497fc0 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 13:10:54 +0530 Subject: [PATCH 175/324] image build 16 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index bd7153dba8f..9ca97bb9709 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -183,7 +183,7 @@ cache-from: type=gha cache-to: type=gha,mode=max build-args: | - BASE_IMAGE_TAG=ghcr.io/shivani-gslab/avd-base:2ac024829aeecef47018498a31d8ece53037d9424c5264ef95d6b8cb5595426d + BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} # run-anisble-tests: # name: Run Ansible Tests # needs: [build-pyavd] From 150de444521dc1a936c829e5c975dce3de8d7891 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 13:22:27 +0530 Subject: [PATCH 176/324] image build 17 --- .github/DockerfileBase | 4 ++++ .github/DockerfileBuild | 11 +++++------ .github/workflows/pull-request-management.yml | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 0177ff9e891..7ae7af69948 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -19,6 +19,10 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ FROM ubuntu:latest AS base_run # Copy Python binaries, libraries, and necessary files +COPY --from=base /usr/bin/python3 /usr/bin/python3 +COPY --from=base /usr/local/bin/uv /usr/local/bin/uv COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 +COPY --from=base /UV3.13 /UV3.13 +RUN /UV3.10/bin/python --version diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 768eedea3f9..afbf53513b3 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,13 +2,12 @@ ARG BASE_IMAGE_TAG=ubuntu:latest FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build COPY . /avd -RUN apt-get update && apt-get install -y --no-install-recommends \ - openssh-client git make python3-pip python3-dev && \ - pip install uv --break-system-packages && \ - apt-get clean && rm -rf /var/lib/apt/lists +# RUN apt-get update && apt-get install -y --no-install-recommends \ +# openssh-client git make python3-pip python3-dev && \ +# pip install uv --break-system-packages && \ +# apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN uv python install 3.10 3.11 3.12 3.13 && \ - python3 -m pip install --break-system-packages build && \ +RUN python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 9ca97bb9709..e9d35bc9b7a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -130,11 +130,11 @@ echo "::set-output name=image_exists::false" fi - name: Set up Docker Buildx - if: steps.check-base-image.outputs.image_exists == 'false' + # if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/setup-buildx-action@v3 - name: Build and push - if: steps.check-base-image.outputs.image_exists == 'false' + # if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 with: file: .github/DockerfileBase From d3ed3badcc68b0854e9563e8055c74236c139ffc Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 13:25:06 +0530 Subject: [PATCH 177/324] image build 18 --- .github/DockerfileBase | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 7ae7af69948..87bc65aba10 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -25,4 +25,3 @@ COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 COPY --from=base /UV3.13 /UV3.13 -RUN /UV3.10/bin/python --version From 8ffca1a20e4beb53c2933a18ad0fded495f309cd Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 13:31:09 +0530 Subject: [PATCH 178/324] image build 19 --- .github/DockerfileBase | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 87bc65aba10..58089d48cce 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -25,3 +25,4 @@ COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 COPY --from=base /UV3.13 /UV3.13 +COPY --from=base /lib/x86_64-linux-gnu/libexpat.so.1 /lib/x86_64-linux-gnu/libexpat.so.1 From bcd1665021dc0c7d286cd262be644c6219a238ed Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 13:34:53 +0530 Subject: [PATCH 179/324] image build 20 --- .github/DockerfileBase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 58089d48cce..ae28cb7ba17 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -19,8 +19,8 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ FROM ubuntu:latest AS base_run # Copy Python binaries, libraries, and necessary files -COPY --from=base /usr/bin/python3 /usr/bin/python3 COPY --from=base /usr/local/bin/uv /usr/local/bin/uv +COPY --from=base /usr/lib /usr/lib COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 From c59e196421b97e6900cacea3388a14925c062ef8 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 13:37:50 +0530 Subject: [PATCH 180/324] image build 21 --- .github/DockerfileBase | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index ae28cb7ba17..bd3469f92f4 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -19,6 +19,11 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ FROM ubuntu:latest AS base_run # Copy Python binaries, libraries, and necessary files +COPY --from=base /usr/bin/python3 /usr/bin/python3 +COPY --from=base /usr/lib/python3.10 /usr/lib/python3.10 +COPY --from=base /usr/lib/python3.11 /usr/lib/python3.11 +COPY --from=base /usr/lib/python3.12 /usr/lib/python3.12 +COPY --from=base /usr/lib/python3.13 /usr/lib/python3.13 COPY --from=base /usr/local/bin/uv /usr/local/bin/uv COPY --from=base /usr/lib /usr/lib COPY --from=base /UV3.10 /UV3.10 From 935c7db9cfa36388b0416100e10e07273c370adf Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 13:39:30 +0530 Subject: [PATCH 181/324] image build 22 --- .github/DockerfileBase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index bd3469f92f4..99aa21ba755 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -23,7 +23,7 @@ COPY --from=base /usr/bin/python3 /usr/bin/python3 COPY --from=base /usr/lib/python3.10 /usr/lib/python3.10 COPY --from=base /usr/lib/python3.11 /usr/lib/python3.11 COPY --from=base /usr/lib/python3.12 /usr/lib/python3.12 -COPY --from=base /usr/lib/python3.13 /usr/lib/python3.13 +# COPY --from=base /usr/lib/python3.13 /usr/lib/python3.13 COPY --from=base /usr/local/bin/uv /usr/local/bin/uv COPY --from=base /usr/lib /usr/lib COPY --from=base /UV3.10 /UV3.10 From 9c3b359d4950a7194e5f41d8430306ec257d9164 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 13:39:58 +0530 Subject: [PATCH 182/324] image build 23 --- .github/DockerfileBase | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 99aa21ba755..f3f2604e5b8 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -20,10 +20,6 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ FROM ubuntu:latest AS base_run # Copy Python binaries, libraries, and necessary files COPY --from=base /usr/bin/python3 /usr/bin/python3 -COPY --from=base /usr/lib/python3.10 /usr/lib/python3.10 -COPY --from=base /usr/lib/python3.11 /usr/lib/python3.11 -COPY --from=base /usr/lib/python3.12 /usr/lib/python3.12 -# COPY --from=base /usr/lib/python3.13 /usr/lib/python3.13 COPY --from=base /usr/local/bin/uv /usr/local/bin/uv COPY --from=base /usr/lib /usr/lib COPY --from=base /UV3.10 /UV3.10 From 6d6a80cd98499774172a6088f348dda6857ba3cb Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 14:15:40 +0530 Subject: [PATCH 183/324] image build 24 --- .github/DockerfileBase | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index f3f2604e5b8..66803720cc7 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -26,4 +26,5 @@ COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 COPY --from=base /UV3.13 /UV3.13 +Run ls -l /UV3.10/bin/ COPY --from=base /lib/x86_64-linux-gnu/libexpat.so.1 /lib/x86_64-linux-gnu/libexpat.so.1 From 218f50ef6a449487b34317db521217ef0564c2c9 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 14:26:47 +0530 Subject: [PATCH 184/324] image build 25 --- .github/DockerfilePyavd | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 .github/DockerfilePyavd diff --git a/.github/DockerfilePyavd b/.github/DockerfilePyavd deleted file mode 100644 index cf80cc4b9e0..00000000000 --- a/.github/DockerfilePyavd +++ /dev/null @@ -1,9 +0,0 @@ -ARG BASE_IMAGE_TAG -FROM $BASE_IMAGE_TAG -COPY . /avd -WORKDIR /avd/python-avd -RUN python3 -m pip install --break-system-packages build && \ - python3 -m build --wheel --outdir /tmp/wheels -RUN for VERSION in UV3.10 UV3.11 UV3.12 UV3.13; do \ - /$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ - done From eced7c84334f83a6526669881a664c5355887517 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 15:04:26 +0530 Subject: [PATCH 185/324] image build 26 --- .github/DockerfileBase | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 66803720cc7..da8635ab7ed 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -1,10 +1,7 @@ -FROM ubuntu:latest AS base +FROM python:3.12-slim AS base #LABEL stage=base # Install essential packages and UV -RUN apt-get update && apt-get install -y --no-install-recommends \ - openssh-client git make python3-pip python3-dev docker.io && \ - pip install uv --break-system-packages && \ - apt-get clean && rm -rf /var/lib/apt/lists +RUN pip install uv --user # Copy requirements file after installing essential tools COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt @@ -17,14 +14,14 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ -r /requirements-dev.txt --upgrade; \ done -FROM ubuntu:latest AS base_run +FROM python:3.12-slim AS base_run # Copy Python binaries, libraries, and necessary files -COPY --from=base /usr/bin/python3 /usr/bin/python3 -COPY --from=base /usr/local/bin/uv /usr/local/bin/uv -COPY --from=base /usr/lib /usr/lib +# COPY --from=base /usr/bin/python3 /usr/bin/python3 +# COPY --from=base /usr/local/bin/uv /usr/local/bin/uv +# COPY --from=base /usr/lib /usr/lib COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 COPY --from=base /UV3.13 /UV3.13 -Run ls -l /UV3.10/bin/ -COPY --from=base /lib/x86_64-linux-gnu/libexpat.so.1 /lib/x86_64-linux-gnu/libexpat.so.1 +# Run ls -l /UV3.10/bin/ +# COPY --from=base /lib/x86_64-linux-gnu/libexpat.so.1 /lib/x86_64-linux-gnu/libexpat.so.1 From 4127ed1759e07160992f86eadcc762fb2cf0f61b Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 15:10:04 +0530 Subject: [PATCH 186/324] image build 27 --- .github/DockerfileBase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index da8635ab7ed..7139e8e9733 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -1,7 +1,7 @@ FROM python:3.12-slim AS base #LABEL stage=base # Install essential packages and UV -RUN pip install uv --user +RUN pip install uv # Copy requirements file after installing essential tools COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt From e486b05200fc466c9a2b62de1f9349cfb32ee1bc Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 15:27:17 +0530 Subject: [PATCH 187/324] image build 28 --- .github/DockerfileBase | 1 + .github/DockerfileBuild | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 7139e8e9733..ec5df7a5a24 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -2,6 +2,7 @@ FROM python:3.12-slim AS base #LABEL stage=base # Install essential packages and UV RUN pip install uv +RUN pip install make # Copy requirements file after installing essential tools COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index afbf53513b3..a23c4f6d553 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -1,7 +1,8 @@ -ARG BASE_IMAGE_TAG=ubuntu:latest +ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build COPY . /avd +RUN apt-get update && apt-get install -y --no-install-recommends make # RUN apt-get update && apt-get install -y --no-install-recommends \ # openssh-client git make python3-pip python3-dev && \ # pip install uv --break-system-packages && \ @@ -13,7 +14,7 @@ RUN python3 -m pip install --break-system-packages build && \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done -FROM ubuntu:latest AS run +FROM ${BASE_IMAGE_TAG} AS run LABEL stage=run # Copy virtual environments from the build stage COPY --from=build /UV3.10 /UV3.10 From 17fcffcbd0ecf18985e470e1f25935183e21c12a Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 15:35:50 +0530 Subject: [PATCH 188/324] image build 29 --- .github/DockerfileBase | 7 ------- .github/DockerfileBuild | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index ec5df7a5a24..1e9f28cfee6 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -2,7 +2,6 @@ FROM python:3.12-slim AS base #LABEL stage=base # Install essential packages and UV RUN pip install uv -RUN pip install make # Copy requirements file after installing essential tools COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt @@ -16,13 +15,7 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ done FROM python:3.12-slim AS base_run -# Copy Python binaries, libraries, and necessary files -# COPY --from=base /usr/bin/python3 /usr/bin/python3 -# COPY --from=base /usr/local/bin/uv /usr/local/bin/uv -# COPY --from=base /usr/lib /usr/lib COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 COPY --from=base /UV3.13 /UV3.13 -# Run ls -l /UV3.10/bin/ -# COPY --from=base /lib/x86_64-linux-gnu/libexpat.so.1 /lib/x86_64-linux-gnu/libexpat.so.1 diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index a23c4f6d553..49d6a33ce49 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -8,7 +8,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends make # pip install uv --break-system-packages && \ # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN python3 -m pip install --break-system-packages build && \ +RUN source /UV3.10/bin/activate && \ + python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ From 05880c07248af2e375e4c0f2cdb8fc9f1fb16557 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 15:45:42 +0530 Subject: [PATCH 189/324] image build 30 --- .github/DockerfileBuild | 2 +- .github/workflows/pull-request-management.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 49d6a33ce49..9cbc56ac01c 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends make # pip install uv --break-system-packages && \ # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN source /UV3.10/bin/activate && \ +RUN . /UV3.10/bin/activate && \ python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index e9d35bc9b7a..9ca97bb9709 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -130,11 +130,11 @@ echo "::set-output name=image_exists::false" fi - name: Set up Docker Buildx - # if: steps.check-base-image.outputs.image_exists == 'false' + if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/setup-buildx-action@v3 - name: Build and push - # if: steps.check-base-image.outputs.image_exists == 'false' + if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 with: file: .github/DockerfileBase From 9ef4af3af71b2044e1b524167327d08528c678dc Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 16:03:34 +0530 Subject: [PATCH 190/324] image build 31 --- .github/DockerfileBuild | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 9cbc56ac01c..3b7b6c8c9e6 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -8,11 +8,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends make # pip install uv --break-system-packages && \ # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN . /UV3.10/bin/activate && \ python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ - /UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ + . /UV$VERSION/bin/activate && pip install --no-cache-dir /tmp/wheels/*.whl; \ done FROM ${BASE_IMAGE_TAG} AS run From 70149995f2bac19971cba2b913745bcec32cabb3 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 16:06:28 +0530 Subject: [PATCH 191/324] image build 31 --- .github/DockerfileBuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 3b7b6c8c9e6..f00f4eb70db 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -8,10 +8,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends make # pip install uv --break-system-packages && \ # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd - python3 -m pip install --break-system-packages build && \ +RUN python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ - . /UV$VERSION/bin/activate && pip install --no-cache-dir /tmp/wheels/*.whl; \ + . /UV$VERSION/bin/activate && pip install --no-cache-dir /tmp/wheels/*.whl; \ done FROM ${BASE_IMAGE_TAG} AS run From 59f900bb9986a0a1514dbdea177b96a2bc7c76db Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 16:32:07 +0530 Subject: [PATCH 192/324] image build 32 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 9ca97bb9709..8402c4ba71b 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -400,7 +400,7 @@ image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - name: "Run ansible-test units test cases" - run: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + run: ". /UV3.12/bin/activate && pip list && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" ansible_test_integration: name: Run ansible-test integration test cases From 5e78b3cbe7f350f8e741359a10e4e70c7b8eaa72 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 16:44:33 +0530 Subject: [PATCH 193/324] image build 33 --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 8402c4ba71b..6c2050f9e61 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -399,6 +399,8 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: + - name: Check packages + run: "ls -l /UV3.12/lib/python3.12/site-packages/" - name: "Run ansible-test units test cases" run: ". /UV3.12/bin/activate && pip list && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" From 38ec62f62738bd991797128cdc604e765f0b8f32 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 16:50:54 +0530 Subject: [PATCH 194/324] image build 34 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6c2050f9e61..4411a961c59 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -402,7 +402,7 @@ - name: Check packages run: "ls -l /UV3.12/lib/python3.12/site-packages/" - name: "Run ansible-test units test cases" - run: ". /UV3.12/bin/activate && pip list && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + run: "cd /avd/ansible_collections/arista/avd && /UV3.12/bin/python -m ansible_test units -vv" ansible_test_integration: name: Run ansible-test integration test cases From 827aa823ab2304db784ddd96e66630cac8db64b5 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 16:57:50 +0530 Subject: [PATCH 195/324] image build 35 --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 4411a961c59..8ac401b607e 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -390,7 +390,7 @@ image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - name: "Run ansible-test sanity" - run: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /UV3.13/bin/activate && python --version && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases @@ -402,7 +402,7 @@ - name: Check packages run: "ls -l /UV3.12/lib/python3.12/site-packages/" - name: "Run ansible-test units test cases" - run: "cd /avd/ansible_collections/arista/avd && /UV3.12/bin/python -m ansible_test units -vv" + run: ". /UV3.12/bin/activate && python --version && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" ansible_test_integration: name: Run ansible-test integration test cases From 2d7bef6f69e4c90e8db344b027610ed5aa3fb3e3 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 16:58:04 +0530 Subject: [PATCH 196/324] image build 35 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 8ac401b607e..29afddf3525 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -390,7 +390,7 @@ image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - name: "Run ansible-test sanity" - run: ". /UV3.13/bin/activate && python --version && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /UV3.13/bin/activate && python3 --version && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases From 1ae1271c594768cd75fe6a2637a5095ddd1fc916 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 17:09:47 +0530 Subject: [PATCH 197/324] image build 36 --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 29afddf3525..4bfc15ed33e 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -389,6 +389,8 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: + - name: Install packages + run: "pip install uv && uv python install 3.13" - name: "Run ansible-test sanity" run: ". /UV3.13/bin/activate && python3 --version && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" From 2374e7e2f548f0c3b778de2a9210891bf6bbb286 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 18:05:27 +0530 Subject: [PATCH 198/324] image build 37 --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 4bfc15ed33e..9d9a222ea21 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -391,6 +391,8 @@ steps: - name: Install packages run: "pip install uv && uv python install 3.13" + - name: Check packages + run: "ls -l /UV3.13/lib/python3.13/site-packages/" - name: "Run ansible-test sanity" run: ". /UV3.13/bin/activate && python3 --version && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" From aa1205a56041c9665b1a3d0a06bb4999b80d3ea3 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 18:18:09 +0530 Subject: [PATCH 199/324] image build 38 --- .github/workflows/pull-request-management.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 9d9a222ea21..5c2be158cd3 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -393,8 +393,10 @@ run: "pip install uv && uv python install 3.13" - name: Check packages run: "ls -l /UV3.13/lib/python3.13/site-packages/" + - name: Debug venv binaries + run: "ls -l /UV3.13/bin/" - name: "Run ansible-test sanity" - run: ". /UV3.13/bin/activate && python3 --version && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: "cd /avd/ansible_collections/arista/avd && /UV3.13/bin/ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases From 73b83b2383033855d221bde2f3866690ed5175c1 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Feb 2025 18:22:28 +0530 Subject: [PATCH 200/324] image build 39 --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 5c2be158cd3..154da1daeb5 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -393,8 +393,8 @@ run: "pip install uv && uv python install 3.13" - name: Check packages run: "ls -l /UV3.13/lib/python3.13/site-packages/" - - name: Debug venv binaries - run: "ls -l /UV3.13/bin/" + - name: Check Library Dependencies + run: "ldd /UV3.13/bin/ansible-test" - name: "Run ansible-test sanity" run: "cd /avd/ansible_collections/arista/avd && /UV3.13/bin/ansible-test sanity --color yes -v" From 3b9c9597041f458bb8cfa5204563397c864d9248 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 4 Feb 2025 11:16:52 +0530 Subject: [PATCH 201/324] image build 40 --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 154da1daeb5..356ba16fce4 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -395,6 +395,8 @@ run: "ls -l /UV3.13/lib/python3.13/site-packages/" - name: Check Library Dependencies run: "ldd /UV3.13/bin/ansible-test" + - name: Activate venv + run: ". /UV3.13/bin/activate && echo $VIRTUAL_ENV" - name: "Run ansible-test sanity" run: "cd /avd/ansible_collections/arista/avd && /UV3.13/bin/ansible-test sanity --color yes -v" From 81e7db041a221c25fe7b0f4433d609572448ef84 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 4 Feb 2025 11:22:50 +0530 Subject: [PATCH 202/324] image build 41 --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 356ba16fce4..0f119a4141a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -393,8 +393,8 @@ run: "pip install uv && uv python install 3.13" - name: Check packages run: "ls -l /UV3.13/lib/python3.13/site-packages/" - - name: Check Library Dependencies - run: "ldd /UV3.13/bin/ansible-test" + # - name: Check Library Dependencies + # run: "ldd /UV3.13/bin/ansible-test" - name: Activate venv run: ". /UV3.13/bin/activate && echo $VIRTUAL_ENV" - name: "Run ansible-test sanity" From 2a1bc4fccba141d61ec40802fb206947f45ed6aa Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 4 Feb 2025 11:29:34 +0530 Subject: [PATCH 203/324] image build 42 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 0f119a4141a..ffa67fc1746 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -396,7 +396,7 @@ # - name: Check Library Dependencies # run: "ldd /UV3.13/bin/ansible-test" - name: Activate venv - run: ". /UV3.13/bin/activate && echo $VIRTUAL_ENV" + run: ". /UV3.13/bin/activate && echo $VIRTUAL_ENV && which python && uv pip list" - name: "Run ansible-test sanity" run: "cd /avd/ansible_collections/arista/avd && /UV3.13/bin/ansible-test sanity --color yes -v" From 3fdf9054166dc88e180451250f4ceb0a9ee6134a Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 4 Feb 2025 11:54:32 +0530 Subject: [PATCH 204/324] image build 43 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index ffa67fc1746..0c3f3b2f450 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -396,7 +396,7 @@ # - name: Check Library Dependencies # run: "ldd /UV3.13/bin/ansible-test" - name: Activate venv - run: ". /UV3.13/bin/activate && echo $VIRTUAL_ENV && which python && uv pip list" + run: ". /UV3.13/bin/activate && ln -s /UV3.13/bin/python /UV3.13/bin/python3 && echo $VIRTUAL_ENV && which python && uv pip list" - name: "Run ansible-test sanity" run: "cd /avd/ansible_collections/arista/avd && /UV3.13/bin/ansible-test sanity --color yes -v" From ba5b76ce515978ab4829400757e724e79f094890 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 4 Feb 2025 12:12:40 +0530 Subject: [PATCH 205/324] image build 44 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 0c3f3b2f450..c024944cea6 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -396,7 +396,7 @@ # - name: Check Library Dependencies # run: "ldd /UV3.13/bin/ansible-test" - name: Activate venv - run: ". /UV3.13/bin/activate && ln -s /UV3.13/bin/python /UV3.13/bin/python3 && echo $VIRTUAL_ENV && which python && uv pip list" + run: ". /UV3.13/bin/activate && export PATH='/UV3.13/bin:$PATH' && echo $VIRTUAL_ENV && which python && uv pip list" - name: "Run ansible-test sanity" run: "cd /avd/ansible_collections/arista/avd && /UV3.13/bin/ansible-test sanity --color yes -v" From 20810163b041f40493ffcf2cc0081b03208b42fc Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 4 Feb 2025 12:24:31 +0530 Subject: [PATCH 206/324] image build 45 --- .github/DockerfileBase | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 1e9f28cfee6..b28c9b65431 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -9,6 +9,7 @@ COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt RUN uv python install 3.10 3.11 3.12 3.13 && \ for VERSION in 3.10 3.11 3.12 3.13; do \ uv venv --python $VERSION /UV$VERSION && \ + . /UV$VERSION/bin/activate && which python && \ /UV$VERSION/bin/python -m ensurepip --upgrade && \ /UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ -r /requirements-dev.txt --upgrade; \ From fec4a0d3942ec13606f37abbb722cbb2d6adacef Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 4 Feb 2025 12:33:42 +0530 Subject: [PATCH 207/324] image build 46 --- .github/DockerfileBase | 5 +++-- .github/DockerfileBuild | 1 + .github/workflows/pull-request-management.yml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index b28c9b65431..849c6790790 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -1,4 +1,4 @@ -FROM python:3.12-slim AS base +FROM ubuntu:latest AS base #LABEL stage=base # Install essential packages and UV RUN pip install uv @@ -15,8 +15,9 @@ RUN uv python install 3.10 3.11 3.12 3.13 && \ -r /requirements-dev.txt --upgrade; \ done -FROM python:3.12-slim AS base_run +FROM ubuntu:latest AS base_run COPY --from=base /UV3.10 /UV3.10 COPY --from=base /UV3.11 /UV3.11 COPY --from=base /UV3.12 /UV3.12 COPY --from=base /UV3.13 /UV3.13 +COPY --from=base /usr/lib /usr/lib diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index f00f4eb70db..1304b3e0ccf 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -8,6 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends make # pip install uv --break-system-packages && \ # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd +RUN ln -sf /UV$VERSION/bin/python /usr/local/bin/python RUN python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index c024944cea6..3f190c174c7 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -396,7 +396,7 @@ # - name: Check Library Dependencies # run: "ldd /UV3.13/bin/ansible-test" - name: Activate venv - run: ". /UV3.13/bin/activate && export PATH='/UV3.13/bin:$PATH' && echo $VIRTUAL_ENV && which python && uv pip list" + run: ". /UV3.13/bin/activate && ln -sf /UV3.10/bin/python /usr/local/bin/python && echo $VIRTUAL_ENV && which python && python --version" - name: "Run ansible-test sanity" run: "cd /avd/ansible_collections/arista/avd && /UV3.13/bin/ansible-test sanity --color yes -v" From b5ba609ec048e8bb484f84af2ce20d91b08b1af6 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 4 Feb 2025 12:47:12 +0530 Subject: [PATCH 208/324] image build 47 --- .github/DockerfileBase | 5 ++++- .github/DockerfileBuild | 5 +++-- .github/workflows/pull-request-management.yml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 849c6790790..616e8ec8553 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -1,7 +1,10 @@ FROM ubuntu:latest AS base #LABEL stage=base # Install essential packages and UV -RUN pip install uv +RUN apt-get update && apt-get install -y --no-install-recommends \ + openssh-client git make python3-pip python3-dev && \ + pip install uv --break-system-packages && \ + apt-get clean && rm -rf /var/lib/apt/lists # Copy requirements file after installing essential tools COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 1304b3e0ccf..e45f89d7f9a 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -8,10 +8,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends make # pip install uv --break-system-packages && \ # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN ln -sf /UV$VERSION/bin/python /usr/local/bin/python -RUN python3 -m pip install --break-system-packages build && \ +RUN . /UV3.10/bin/activate && ln -sf /UV3.10/bin/python /usr/local/bin/python && \ + python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ + ln -sf /UV$VERSION/bin/python /usr/local/bin/python . /UV$VERSION/bin/activate && pip install --no-cache-dir /tmp/wheels/*.whl; \ done diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 3f190c174c7..babc7952ae1 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -396,7 +396,7 @@ # - name: Check Library Dependencies # run: "ldd /UV3.13/bin/ansible-test" - name: Activate venv - run: ". /UV3.13/bin/activate && ln -sf /UV3.10/bin/python /usr/local/bin/python && echo $VIRTUAL_ENV && which python && python --version" + run: ". /UV3.13/bin/activate && ln -sf /UV3.13/bin/python /usr/local/bin/python && echo $VIRTUAL_ENV && which python && python --version" - name: "Run ansible-test sanity" run: "cd /avd/ansible_collections/arista/avd && /UV3.13/bin/ansible-test sanity --color yes -v" From aac4ecca396748dad57873a61aa8f808d9901c78 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 4 Feb 2025 12:52:24 +0530 Subject: [PATCH 209/324] image build 48 --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index e45f89d7f9a..b9ac432902d 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -12,7 +12,7 @@ RUN . /UV3.10/bin/activate && ln -sf /UV3.10/bin/python /usr/local/bin/python && python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ - ln -sf /UV$VERSION/bin/python /usr/local/bin/python + ln -sf /UV$VERSION/bin/python /usr/local/bin/python && \ . /UV$VERSION/bin/activate && pip install --no-cache-dir /tmp/wheels/*.whl; \ done From fc34ac610ba04f559dd4adc266f32678002fafd7 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 4 Feb 2025 13:08:53 +0530 Subject: [PATCH 210/324] image build 49 --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index b9ac432902d..432a45bd14e 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends make # pip install uv --break-system-packages && \ # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN . /UV3.10/bin/activate && ln -sf /UV3.10/bin/python /usr/local/bin/python && \ +RUN . /UV3.10/bin/activate && ln -sf /UV3.10/bin/python3 /usr/local/bin/python3 && \ python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ From d596fbe29df9bf0b30f99c7e2d9d8695ef90ae68 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 11 Feb 2025 13:10:17 +0530 Subject: [PATCH 211/324] Update dockerfile with Guillaume --- .github/DockerfileBase | 27 +++++++++++---------------- .github/DockerfileBuild | 12 +++--------- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 616e8ec8553..227ce79a43a 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -1,26 +1,21 @@ FROM ubuntu:latest AS base #LABEL stage=base # Install essential packages and UV -RUN apt-get update && apt-get install -y --no-install-recommends \ - openssh-client git make python3-pip python3-dev && \ - pip install uv --break-system-packages && \ - apt-get clean && rm -rf /var/lib/apt/lists +RUN apt-get update && apt-get install -y --no-install-recommends make curl ca-certificates && \ + update-ca-certificates && \ + curl -LsSf https://astral.sh/uv/install.sh | sh # Copy requirements file after installing essential tools COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt + # Install Python versions and dependencies in a single step -RUN uv python install 3.10 3.11 3.12 3.13 && \ - for VERSION in 3.10 3.11 3.12 3.13; do \ - uv venv --python $VERSION /UV$VERSION && \ - . /UV$VERSION/bin/activate && which python && \ - /UV$VERSION/bin/python -m ensurepip --upgrade && \ - /UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r /requirements-dev.txt --upgrade; \ +RUN . $HOME/.local/bin/env && for VERSION in 3.10 3.11 3.12 3.13; do \ + UV_PYTHON_INSTALL_DIR=/venvs/python-versions uv venv --python $VERSION /venvs/UV$VERSION && \ + . /venvs/UV$VERSION/bin/activate && which python && \ + /venvs/UV$VERSION/bin/python -m ensurepip --upgrade && \ + /venvs/UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ + -r /requirements-dev.txt --upgrade; \ done FROM ubuntu:latest AS base_run -COPY --from=base /UV3.10 /UV3.10 -COPY --from=base /UV3.11 /UV3.11 -COPY --from=base /UV3.12 /UV3.12 -COPY --from=base /UV3.13 /UV3.13 -COPY --from=base /usr/lib /usr/lib +COPY --from=base /venvs /venvs \ No newline at end of file diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 432a45bd14e..3b42e29268b 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -8,19 +8,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends make # pip install uv --break-system-packages && \ # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN . /UV3.10/bin/activate && ln -sf /UV3.10/bin/python3 /usr/local/bin/python3 && \ - python3 -m pip install --break-system-packages build && \ +RUN python3 -m pip install --break-system-packages build && \ python3 -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ - ln -sf /UV$VERSION/bin/python /usr/local/bin/python && \ - . /UV$VERSION/bin/activate && pip install --no-cache-dir /tmp/wheels/*.whl; \ + . /venvs/UV$VERSION/bin/activate && pip install --no-cache-dir /tmp/wheels/*.whl; \ done FROM ${BASE_IMAGE_TAG} AS run LABEL stage=run # Copy virtual environments from the build stage -COPY --from=build /UV3.10 /UV3.10 -COPY --from=build /UV3.11 /UV3.11 -COPY --from=build /UV3.12 /UV3.12 -COPY --from=build /UV3.13 /UV3.13 -COPY --from=build /avd /avd +COPY --from=build /venvs /venvs From e79e0a45120424a48f19ebdbcb80711183f2edaf Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 11 Feb 2025 13:36:18 +0530 Subject: [PATCH 212/324] activate veenv in build stage --- .github/DockerfileBase | 2 +- .github/DockerfileBuild | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 227ce79a43a..b3780331d98 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -18,4 +18,4 @@ RUN . $HOME/.local/bin/env && for VERSION in 3.10 3.11 3.12 3.13; do \ done FROM ubuntu:latest AS base_run -COPY --from=base /venvs /venvs \ No newline at end of file +COPY --from=base /venvs /venvs diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 3b42e29268b..d97ad20d4d1 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -8,8 +8,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends make # pip install uv --break-system-packages && \ # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN python3 -m pip install --break-system-packages build && \ - python3 -m build --wheel --outdir /tmp/wheels && \ +RUN . /venvs/UV3.11/bin/activate &&\ + python -m pip install --break-system-packages build && \ + python -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ . /venvs/UV$VERSION/bin/activate && pip install --no-cache-dir /tmp/wheels/*.whl; \ done From b07a74f87b9006546e36bbb2c1a93199ee14300c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 11 Feb 2025 13:46:34 +0530 Subject: [PATCH 213/324] activate venv in build --- .github/DockerfileBuild | 12 +++++--- .github/workflows/pull-request-management.yml | 30 +++++++++---------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index d97ad20d4d1..8ee8a8dd4c4 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -8,14 +8,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends make # pip install uv --break-system-packages && \ # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN . /venvs/UV3.11/bin/activate &&\ - python -m pip install --break-system-packages build && \ - python -m build --wheel --outdir /tmp/wheels && \ +RUN /venvs/UV3.11/bin/python -m ensurepip --upgrade &&\ + /venvs/UV3.11/bin/python -m pip install --break-system-packages build && \ + /venvs/UV3.11/bin/python -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ - . /venvs/UV$VERSION/bin/activate && pip install --no-cache-dir /tmp/wheels/*.whl; \ + /venvs/UV$VERSION/bin/python -m ensurepip --upgrade &&\ + /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done FROM ${BASE_IMAGE_TAG} AS run LABEL stage=run # Copy virtual environments from the build stage COPY --from=build /venvs /venvs +COPY --from=build /avd /avd +RUN apt-get update && apt-get install -y --no-install-recommends \ + openssh-client diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index babc7952ae1..a7f8092092f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -389,16 +389,10 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - - name: Install packages - run: "pip install uv && uv python install 3.13" - - name: Check packages - run: "ls -l /UV3.13/lib/python3.13/site-packages/" - # - name: Check Library Dependencies - # run: "ldd /UV3.13/bin/ansible-test" - - name: Activate venv - run: ". /UV3.13/bin/activate && ln -sf /UV3.13/bin/python /usr/local/bin/python && echo $VIRTUAL_ENV && which python && python --version" + # - name: Check out repository code + # uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: "cd /avd/ansible_collections/arista/avd && /UV3.13/bin/ansible-test sanity --color yes -v" + run: "cd /avd/ansible_collections/arista/avd && /venvs/UV3.13/bin/python -m ensurepip --upgrade && /venvs/UV3.13/bin/ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases @@ -407,10 +401,10 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - - name: Check packages - run: "ls -l /UV3.12/lib/python3.12/site-packages/" + # - name: Check out repository code + # uses: actions/checkout@v4 - name: "Run ansible-test units test cases" - run: ". /UV3.12/bin/activate && python --version && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + run: ". /venvs/UV3.12/bin/activate && python --version && pwd && ls && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" ansible_test_integration: name: Run ansible-test integration test cases @@ -419,10 +413,12 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - - name: Check out repository code - uses: actions/checkout@v4 + # - name: Check out repository code + # uses: actions/checkout@v4 + # - name: Install ssh-keygen + # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client - name: "Run ansible-test integration test cases" - run: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + run: ". /venvs/UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" ansible_lint: name: Run ansible-lint test case @@ -431,8 +427,10 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: + # - name: Check out repository code + # uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" - run: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /venvs/UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From 765726b3eacbf61e68df9512f2f0e83a92f81e8a Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 11 Feb 2025 17:46:33 +0530 Subject: [PATCH 214/324] activate venv in build 2 --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index a7f8092092f..d8c891296c1 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -404,7 +404,7 @@ # - name: Check out repository code # uses: actions/checkout@v4 - name: "Run ansible-test units test cases" - run: ". /venvs/UV3.12/bin/activate && python --version && pwd && ls && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + run: ". /venvs/UV3.12/bin/activate && python --version && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" ansible_test_integration: name: Run ansible-test integration test cases @@ -430,7 +430,7 @@ # - name: Check out repository code # uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m ensurepip --upgrade && pip install --upgrade certifi && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From 777ab709ba92a9ccdd4b4251aae9f14519c9bdf3 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 11 Feb 2025 17:55:11 +0530 Subject: [PATCH 215/324] activate venv in build 3 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d8c891296c1..9459a43aa15 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -430,7 +430,7 @@ # - name: Check out repository code # uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m ensurepip --upgrade && pip install --upgrade certifi && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m ensurepip --upgrade && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From 0daaa8be5427bd9a3546ac93b3f148a62ad78bc8 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 11 Feb 2025 18:20:40 +0530 Subject: [PATCH 216/324] activate venv in build 4 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 9459a43aa15..7781db29035 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -430,7 +430,7 @@ # - name: Check out repository code # uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m ensurepip --upgrade && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m ensurepip --upgrade && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From e6642a17a59c7f5385e65a66c0853594e24d4a2c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 11 Feb 2025 18:38:37 +0530 Subject: [PATCH 217/324] activate venv in build 5 --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 7781db29035..b61af5a68de 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -392,7 +392,7 @@ # - name: Check out repository code # uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: "cd /avd/ansible_collections/arista/avd && /venvs/UV3.13/bin/python -m ensurepip --upgrade && /venvs/UV3.13/bin/ansible-test sanity --color yes -v" + run: "cd /avd/ansible_collections/arista/avd && /venvs/UV3.13/bin/python -m ensurepip --upgrade && . /venvs/UV3.13/bin/activate && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases From f172a750b434934e45c805898f56be7dec091c0e Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 12 Feb 2025 15:23:18 +0530 Subject: [PATCH 218/324] change base image for run --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 8ee8a8dd4c4..be013f31099 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -16,7 +16,7 @@ RUN /venvs/UV3.11/bin/python -m ensurepip --upgrade &&\ /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done -FROM ${BASE_IMAGE_TAG} AS run +FROM ubuntu:latest AS run LABEL stage=run # Copy virtual environments from the build stage COPY --from=build /venvs /venvs From b8afad8fe11d5554bf8bafc095f0bd983d254cdf Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 12 Feb 2025 17:42:10 +0530 Subject: [PATCH 219/324] export ANSIBLE_TEST_PYTHON --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index b61af5a68de..57ce1f186dd 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -392,7 +392,7 @@ # - name: Check out repository code # uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: "cd /avd/ansible_collections/arista/avd && /venvs/UV3.13/bin/python -m ensurepip --upgrade && . /venvs/UV3.13/bin/activate && ansible-test sanity --color yes -v" + run: "cd /avd/ansible_collections/arista/avd && /venvs/UV3.13/bin/python -m ensurepip --upgrade && . /venvs/UV3.13/bin/activate && export ANSIBLE_TEST_PYTHON=/UV3.13/bin/python && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases From 19be9877eef403f7db6118743f503badad962c32 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 12 Feb 2025 17:48:07 +0530 Subject: [PATCH 220/324] export ANSIBLE_TEST_PYTHON --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 57ce1f186dd..e78482ff273 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -392,7 +392,7 @@ # - name: Check out repository code # uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: "cd /avd/ansible_collections/arista/avd && /venvs/UV3.13/bin/python -m ensurepip --upgrade && . /venvs/UV3.13/bin/activate && export ANSIBLE_TEST_PYTHON=/UV3.13/bin/python && ansible-test sanity --color yes -v" + run: "cd /avd/ansible_collections/arista/avd && /venvs/UV3.13/bin/python -m ensurepip --upgrade && . /venvs/UV3.13/bin/activate && export ANSIBLE_TEST_PYTHON=/venvs/UV3.13/bin/python && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases From 831a70376d9bc5682103555bbc36a46755b86ad9 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 12 Feb 2025 18:00:52 +0530 Subject: [PATCH 221/324] export ANSIBLE_TEST_VENV --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index e78482ff273..0ba1ff31ccb 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -392,7 +392,7 @@ # - name: Check out repository code # uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: "cd /avd/ansible_collections/arista/avd && /venvs/UV3.13/bin/python -m ensurepip --upgrade && . /venvs/UV3.13/bin/activate && export ANSIBLE_TEST_PYTHON=/venvs/UV3.13/bin/python && ansible-test sanity --color yes -v" + run: "cd /avd/ansible_collections/arista/avd && /venvs/UV3.13/bin/python -m ensurepip --upgrade && . /venvs/UV3.13/bin/activate && export ANSIBLE_TEST_PYTHON=/venvs/UV3.13/bin/python && ANSIBLE_TEST_VENV=/venvs/UV3.13 ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases From 6f24fbbbe7434696a83512cc4265a16b09433fa6 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 12 Feb 2025 18:10:48 +0530 Subject: [PATCH 222/324] pip install from setuptools --- .github/DockerfileBase | 2 +- .github/workflows/pull-request-management.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index b3780331d98..6c7eebce4b6 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -11,8 +11,8 @@ COPY ansible_collections/arista/avd/requirements-dev.txt /requirements-dev.txt # Install Python versions and dependencies in a single step RUN . $HOME/.local/bin/env && for VERSION in 3.10 3.11 3.12 3.13; do \ UV_PYTHON_INSTALL_DIR=/venvs/python-versions uv venv --python $VERSION /venvs/UV$VERSION && \ - . /venvs/UV$VERSION/bin/activate && which python && \ /venvs/UV$VERSION/bin/python -m ensurepip --upgrade && \ + /venvs/UV$VERSION/bin/python -m pip install --upgrade pip setuptools && \ /venvs/UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ -r /requirements-dev.txt --upgrade; \ done diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 0ba1ff31ccb..66e31a4a289 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -392,7 +392,7 @@ # - name: Check out repository code # uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: "cd /avd/ansible_collections/arista/avd && /venvs/UV3.13/bin/python -m ensurepip --upgrade && . /venvs/UV3.13/bin/activate && export ANSIBLE_TEST_PYTHON=/venvs/UV3.13/bin/python && ANSIBLE_TEST_VENV=/venvs/UV3.13 ansible-test sanity --color yes -v" + run: "cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases @@ -430,7 +430,7 @@ # - name: Check out repository code # uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m ensurepip --upgrade && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From 1ab6c39ad1ccacedd7810095d906e9bc66d69bf6 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 12 Feb 2025 18:11:08 +0530 Subject: [PATCH 223/324] pip install from setuptools --- .github/DockerfileBuild | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index be013f31099..e2dd5039179 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -12,7 +12,6 @@ RUN /venvs/UV3.11/bin/python -m ensurepip --upgrade &&\ /venvs/UV3.11/bin/python -m pip install --break-system-packages build && \ /venvs/UV3.11/bin/python -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ - /venvs/UV$VERSION/bin/python -m ensurepip --upgrade &&\ /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done From 789f0f1a1664c919271ccd8d335537f920050f4d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 12 Feb 2025 18:21:14 +0530 Subject: [PATCH 224/324] pip install from setuptools --- .github/DockerfileBuild | 4 ++-- .github/workflows/pull-request-management.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index e2dd5039179..ee1607951c0 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -18,7 +18,7 @@ RUN /venvs/UV3.11/bin/python -m ensurepip --upgrade &&\ FROM ubuntu:latest AS run LABEL stage=run # Copy virtual environments from the build stage -COPY --from=build /venvs /venvs -COPY --from=build /avd /avd RUN apt-get update && apt-get install -y --no-install-recommends \ openssh-client +COPY --from=build /venvs /venvs +COPY --from=build /avd /avd diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 66e31a4a289..b818291f3f3 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -392,7 +392,7 @@ # - name: Check out repository code # uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: "cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /venvs/UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases From d00ff11e5f386774cfac8ddc1526ebb07cb757d6 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 12 Feb 2025 18:34:08 +0530 Subject: [PATCH 225/324] update build --- .github/DockerfileBuild | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index ee1607951c0..c3449097e55 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,18 +2,24 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build COPY . /avd -RUN apt-get update && apt-get install -y --no-install-recommends make # RUN apt-get update && apt-get install -y --no-install-recommends \ # openssh-client git make python3-pip python3-dev && \ # pip install uv --break-system-packages && \ # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -RUN /venvs/UV3.11/bin/python -m ensurepip --upgrade &&\ + +RUN apt-get update && apt-get install -y --no-install-recommends make && \ /venvs/UV3.11/bin/python -m pip install --break-system-packages build && \ /venvs/UV3.11/bin/python -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done +# RUN /venvs/UV3.11/bin/python -m ensurepip --upgrade &&\ +# /venvs/UV3.11/bin/python -m pip install --break-system-packages build && \ +# /venvs/UV3.11/bin/python -m build --wheel --outdir /tmp/wheels && \ +# for VERSION in 3.10 3.11 3.12 3.13; do \ +# /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ +# done FROM ubuntu:latest AS run LABEL stage=run From ac5a3a63c1a49b2b52b4bf4cf74336dce8a3d4db Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 13 Feb 2025 17:29:31 +0530 Subject: [PATCH 226/324] build update --- .github/DockerfileBase | 2 +- .github/DockerfileBuild | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 6c7eebce4b6..0ddba105e34 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -14,7 +14,7 @@ RUN . $HOME/.local/bin/env && for VERSION in 3.10 3.11 3.12 3.13; do \ /venvs/UV$VERSION/bin/python -m ensurepip --upgrade && \ /venvs/UV$VERSION/bin/python -m pip install --upgrade pip setuptools && \ /venvs/UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r /requirements-dev.txt --upgrade; \ + -r ansible_collections/arista/avd/requirements-dev.txt --upgrade; \ done FROM ubuntu:latest AS base_run diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index c3449097e55..3c2e423539e 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -8,6 +8,12 @@ COPY . /avd # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd +# RUN apt-get update && apt-get install -y --no-install-recommends make && \ +# /venvs/UV3.11/bin/python -m pip install --break-system-packages build && \ +# /venvs/UV3.11/bin/python -m build --wheel --outdir /tmp/wheels && \ +# for VERSION in 3.10 3.11 3.12 3.13; do \ +# /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ +# done RUN apt-get update && apt-get install -y --no-install-recommends make && \ /venvs/UV3.11/bin/python -m pip install --break-system-packages build && \ /venvs/UV3.11/bin/python -m build --wheel --outdir /tmp/wheels && \ From 535532a1737cfd2dfbbe09a2e9507c321878b61b Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 13 Feb 2025 18:47:20 +0530 Subject: [PATCH 227/324] req path update --- .github/DockerfileBase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBase b/.github/DockerfileBase index 0ddba105e34..6c7eebce4b6 100644 --- a/.github/DockerfileBase +++ b/.github/DockerfileBase @@ -14,7 +14,7 @@ RUN . $HOME/.local/bin/env && for VERSION in 3.10 3.11 3.12 3.13; do \ /venvs/UV$VERSION/bin/python -m ensurepip --upgrade && \ /venvs/UV$VERSION/bin/python -m pip install --upgrade pip setuptools && \ /venvs/UV$VERSION/bin/python -m pip install mock pytest pytest-mock pytest-xdist pyyaml "ansible-core<2.19.0" \ - -r ansible_collections/arista/avd/requirements-dev.txt --upgrade; \ + -r /requirements-dev.txt --upgrade; \ done FROM ubuntu:latest AS base_run From d1c1dee4215fedbbe47796029fb7ae2b18813df6 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 13 Feb 2025 18:54:15 +0530 Subject: [PATCH 228/324] run update --- .github/DockerfileBuild | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 3c2e423539e..c4ef0292897 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -32,5 +32,4 @@ LABEL stage=run # Copy virtual environments from the build stage RUN apt-get update && apt-get install -y --no-install-recommends \ openssh-client -COPY --from=build /venvs /venvs -COPY --from=build /avd /avd +COPY --from=build /venvs /venvs /avd /avd From de96d43ea54b004323d8cf05383a4d14565aa121 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 13 Feb 2025 19:07:16 +0530 Subject: [PATCH 229/324] add cache --- .github/DockerfileBuild | 3 ++- .github/workflows/pull-request-management.yml | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index c4ef0292897..d136ba5ed7e 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -32,4 +32,5 @@ LABEL stage=run # Copy virtual environments from the build stage RUN apt-get update && apt-get install -y --no-install-recommends \ openssh-client -COPY --from=build /venvs /venvs /avd /avd +COPY --from=build /venvs /venvs +COPY --from=build /avd /avd diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index b818291f3f3..96f69ad052f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -141,7 +141,9 @@ target: base_run push: true tags: ${{ steps.set-base-tag.outputs.base_image_tag }} - cache-from: type=gha + cache-from: | + type=gha + type=registry, ref="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest" cache-to: type=gha,mode=max build-pyavd: @@ -180,7 +182,9 @@ push: true target: run tags: ${{ steps.set-build-tag.outputs.build_image_tag }} - cache-from: type=gha + cache-from: | + type=gha + type=registry, ref="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest" cache-to: type=gha,mode=max build-args: | BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} From 906664a5d1a313b2d855ac9040ac0c37a136e317 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 13 Feb 2025 19:46:56 +0530 Subject: [PATCH 230/324] Refactor(eos_designs): Refactor eos_designs structured_config code for management_security --- .../structured_config/base/__init__.py | 10 +++--- .../overlay/management_security.py | 36 +++++++++---------- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/python-avd/pyavd/_eos_designs/structured_config/base/__init__.py b/python-avd/pyavd/_eos_designs/structured_config/base/__init__.py index 34a9f50484b..b0109d3b20c 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/base/__init__.py +++ b/python-avd/pyavd/_eos_designs/structured_config/base/__init__.py @@ -469,13 +469,11 @@ def management_interfaces(self) -> list | None: return None - @cached_property - def management_security(self) -> dict | None: - """Return structured config for management_security.""" + @structured_config_contributor + def management_security(self) -> None: + """Set the structured config for management_security.""" if entropy_sources := self.shared_utils.platform_settings.security_entropy_sources: - return {"entropy_sources": entropy_sources._as_dict(include_default_values=True)} - - return None + self.structured_config.management_security.entropy_sources = entropy_sources @cached_property def tcam_profile(self) -> dict | None: diff --git a/python-avd/pyavd/_eos_designs/structured_config/overlay/management_security.py b/python-avd/pyavd/_eos_designs/structured_config/overlay/management_security.py index c34b34d62d1..9c8cd443763 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/overlay/management_security.py +++ b/python-avd/pyavd/_eos_designs/structured_config/overlay/management_security.py @@ -3,9 +3,11 @@ # that can be found in the LICENSE file. from __future__ import annotations -from functools import cached_property from typing import TYPE_CHECKING, Protocol +from pyavd._eos_cli_config_gen.schema import EosCliConfigGen +from pyavd._eos_designs.structured_config.structured_config_generator import structured_config_contributor + if TYPE_CHECKING: from . import AvdStructuredConfigOverlayProtocol @@ -17,26 +19,22 @@ class ManagementSecurityMixin(Protocol): Class should only be used as Mixin to a AvdStructuredConfig class. """ - @cached_property - def management_security(self: AvdStructuredConfigOverlayProtocol) -> dict | None: + @structured_config_contributor + def management_security(self: AvdStructuredConfigOverlayProtocol) -> None: """ - Return structured config for management_security. + Set the structured config for management_security. Currently only relevant on WAN routers where STUN DTLS has not been disabled. """ if (profile_name := self.shared_utils.wan_stun_dtls_profile_name) is None: - return None - - return { - "ssl_profiles": [ - { - "name": profile_name, - "certificate": { - "file": f"{profile_name}.crt", - "key": f"{profile_name}.key", - }, - "trust_certificate": {"certificates": ["aristaDeviceCertProvisionerDefaultRootCA.crt"]}, - "tls_versions": "1.2", - }, - ], - } + return + + ssl_profile = EosCliConfigGen.ManagementSecurity.SslProfilesItem( + name=profile_name, + certificate=EosCliConfigGen.ManagementSecurity.SslProfilesItem.Certificate( + file=f"{profile_name}.crt", + key=f"{profile_name}.key" + ), + tls_versions="1.2") + ssl_profile.trust_certificate.certificates.append( "aristaDeviceCertProvisionerDefaultRootCA.crt") + self.structured_config.management_security.ssl_profiles.append(ssl_profile) From 72200398fa2ca20e862334960e7b587a3a131a2a Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 14 Feb 2025 16:19:53 +0530 Subject: [PATCH 231/324] update cache ref path with single quote --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 96f69ad052f..c762ae0af59 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -143,7 +143,7 @@ tags: ${{ steps.set-base-tag.outputs.base_image_tag }} cache-from: | type=gha - type=registry, ref="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest" + type=registry, ref='ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest' cache-to: type=gha,mode=max build-pyavd: @@ -184,7 +184,7 @@ tags: ${{ steps.set-build-tag.outputs.build_image_tag }} cache-from: | type=gha - type=registry, ref="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest" + type=registry, ref='ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest' cache-to: type=gha,mode=max build-args: | BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} From 0863a22af735b70707c12068c908a3e647301457 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 14 Feb 2025 16:34:31 +0530 Subject: [PATCH 232/324] update workflow --- .github/workflows/pull-request-management.yml | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index c762ae0af59..229e0b7046a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -133,18 +133,17 @@ if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/setup-buildx-action@v3 - - name: Build and push + - name: Build and Push Base Run Image if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 with: + context: . file: .github/DockerfileBase target: base_run push: true tags: ${{ steps.set-base-tag.outputs.base_image_tag }} - cache-from: | - type=gha - type=registry, ref='ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest' - cache-to: type=gha,mode=max + cache-from: type=gha,scope=base-run + cache-to: type=gha,mode=max,scope=base-run build-pyavd: name: Install pyavd and Build Image @@ -175,19 +174,18 @@ password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build and push + - name: Build and push PyAVD Image uses: docker/build-push-action@v6 with: file: .github/DockerfileBuild push: true target: run tags: ${{ steps.set-build-tag.outputs.build_image_tag }} - cache-from: | - type=gha - type=registry, ref='ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest' + build-args: + BASE_RUN_IMAGE=${{ needs.avd-base-image.outputs.base_image_tag }} + cache-from: type=gha cache-to: type=gha,mode=max - build-args: | - BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} + outputs: type=image,push=true # run-anisble-tests: # name: Run Ansible Tests # needs: [build-pyavd] From fa23252e1dc9a4f735e164fdba86ad103c3500ca Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 14 Feb 2025 16:35:11 +0530 Subject: [PATCH 233/324] update workflow --- .github/DockerfileBuild | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index d136ba5ed7e..20a03aea3c9 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -8,24 +8,12 @@ COPY . /avd # apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd -# RUN apt-get update && apt-get install -y --no-install-recommends make && \ -# /venvs/UV3.11/bin/python -m pip install --break-system-packages build && \ -# /venvs/UV3.11/bin/python -m build --wheel --outdir /tmp/wheels && \ -# for VERSION in 3.10 3.11 3.12 3.13; do \ -# /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ -# done RUN apt-get update && apt-get install -y --no-install-recommends make && \ /venvs/UV3.11/bin/python -m pip install --break-system-packages build && \ /venvs/UV3.11/bin/python -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done -# RUN /venvs/UV3.11/bin/python -m ensurepip --upgrade &&\ -# /venvs/UV3.11/bin/python -m pip install --break-system-packages build && \ -# /venvs/UV3.11/bin/python -m build --wheel --outdir /tmp/wheels && \ -# for VERSION in 3.10 3.11 3.12 3.13; do \ -# /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ -# done FROM ubuntu:latest AS run LABEL stage=run From fe9ff463b3b3a125e0a36dd6013bf1310f86a114 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 14 Feb 2025 16:43:26 +0530 Subject: [PATCH 234/324] update workflow --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 229e0b7046a..23f5d2b380c 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -182,7 +182,7 @@ target: run tags: ${{ steps.set-build-tag.outputs.build_image_tag }} build-args: - BASE_RUN_IMAGE=${{ needs.avd-base-image.outputs.base_image_tag }} + BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} cache-from: type=gha cache-to: type=gha,mode=max outputs: type=image,push=true From 82f9ef6bd28492cd8f2bf1a0308d8ce84ed1dd35 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 14 Feb 2025 16:53:29 +0530 Subject: [PATCH 235/324] update workflow --- .github/workflows/pull-request-management.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 23f5d2b380c..be29d7104cc 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -184,7 +184,9 @@ build-args: BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} cache-from: type=gha - cache-to: type=gha,mode=max + cache-to: | + type=gha,mode=max + type=registry,ref=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest outputs: type=image,push=true # run-anisble-tests: # name: Run Ansible Tests From 57691091c31e96112729944b9e582a3ceab237e6 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 12:17:46 +0530 Subject: [PATCH 236/324] update avd-bas-image job --- .github/workflows/pull-request-management.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index be29d7104cc..6e8ba02eb19 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -86,39 +86,37 @@ - 'python_avd/**/*' avd-base-image: runs-on: ubuntu-latest - container: - image: ubuntu:latest - options: --cpus 1 outputs: base_image_tag: ${{ steps.set-base-tag.outputs.base_image_tag }} steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v4 + - name: Calculate Hash of Requirements id: hash-reqs run: | HASH_OF_REQS=$(sha256sum ansible_collections/arista/avd/requirements-dev.txt | cut -d' ' -f1) echo "Hash of requirements: $HASH_OF_REQS" echo "::set-output name=hash_of_reqs::$HASH_OF_REQS" + - name: Convert GitHub username to lowercase id: lowercase run: | echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + - name: Set Base Image Tag id: set-base-tag run: | BASE_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ steps.hash-reqs.outputs.hash_of_reqs }}" echo "::set-output name=base_image_tag::$BASE_IMAGE_TAG" - - name: Set up Docker - run: | - apt-get update - apt-get install -y docker.io + - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ steps.lowercase.outputs.lowercase }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Check if image exists id: check-base-image run: | @@ -129,10 +127,11 @@ echo "Base image does not exist." echo "::set-output name=image_exists::false" fi + - name: Set up Docker Buildx if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/setup-buildx-action@v3 - + - name: Build and Push Base Run Image if: steps.check-base-image.outputs.image_exists == 'false' uses: docker/build-push-action@v6 From 91ba7852a323d2da6dcf530621614993960b26ec Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 12:31:56 +0530 Subject: [PATCH 237/324] not copy avd --- .github/DockerfileBuild | 6 +----- .github/workflows/pull-request-management.yml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 20a03aea3c9..3f33da306d7 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,10 +2,6 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build COPY . /avd -# RUN apt-get update && apt-get install -y --no-install-recommends \ -# openssh-client git make python3-pip python3-dev && \ -# pip install uv --break-system-packages && \ -# apt-get clean && rm -rf /var/lib/apt/lists WORKDIR /avd/python-avd RUN apt-get update && apt-get install -y --no-install-recommends make && \ @@ -21,4 +17,4 @@ LABEL stage=run RUN apt-get update && apt-get install -y --no-install-recommends \ openssh-client COPY --from=build /venvs /venvs -COPY --from=build /avd /avd +# COPY --from=build /avd /avd diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6e8ba02eb19..5fa05782c3b 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -392,8 +392,8 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - # - name: Check out repository code - # uses: actions/checkout@v4 + - name: Check out repository code + uses: actions/checkout@v4 - name: "Run ansible-test sanity" run: ". /venvs/UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" @@ -404,8 +404,8 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - # - name: Check out repository code - # uses: actions/checkout@v4 + - name: Check out repository code + uses: actions/checkout@v4 - name: "Run ansible-test units test cases" run: ". /venvs/UV3.12/bin/activate && python --version && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" @@ -416,8 +416,8 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - # - name: Check out repository code - # uses: actions/checkout@v4 + - name: Check out repository code + uses: actions/checkout@v4 # - name: Install ssh-keygen # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client - name: "Run ansible-test integration test cases" @@ -430,8 +430,8 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - # - name: Check out repository code - # uses: actions/checkout@v4 + - name: Check out repository code + uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" From 05c7631c0512eaaa4e909538cec80f0b03bad442 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 12:39:15 +0530 Subject: [PATCH 238/324] fix path --- .github/workflows/pull-request-management.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 5fa05782c3b..bcc9a741c0a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -395,7 +395,7 @@ - name: Check out repository code uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: ". /venvs/UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases @@ -407,7 +407,7 @@ - name: Check out repository code uses: actions/checkout@v4 - name: "Run ansible-test units test cases" - run: ". /venvs/UV3.12/bin/activate && python --version && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + run: ". /venvs/UV3.12/bin/activate && python --version && cd ansible_collections/arista/avd && ansible-test units -vv" ansible_test_integration: name: Run ansible-test integration test cases @@ -421,7 +421,7 @@ # - name: Install ssh-keygen # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" ansible_lint: name: Run ansible-lint test case @@ -433,7 +433,7 @@ - name: Check out repository code uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From 319deddf374b9cb7635739a47e32ac647e7d7456 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 12:52:25 +0530 Subject: [PATCH 239/324] copy avd --- .github/DockerfileBuild | 2 +- .github/workflows/pull-request-management.yml | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 3f33da306d7..ff3e826d040 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -17,4 +17,4 @@ LABEL stage=run RUN apt-get update && apt-get install -y --no-install-recommends \ openssh-client COPY --from=build /venvs /venvs -# COPY --from=build /avd /avd +COPY --from=build /avd /avd diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index bcc9a741c0a..6e8ba02eb19 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -392,10 +392,10 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - - name: Check out repository code - uses: actions/checkout@v4 + # - name: Check out repository code + # uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /venvs/UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases @@ -404,10 +404,10 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - - name: Check out repository code - uses: actions/checkout@v4 + # - name: Check out repository code + # uses: actions/checkout@v4 - name: "Run ansible-test units test cases" - run: ". /venvs/UV3.12/bin/activate && python --version && cd ansible_collections/arista/avd && ansible-test units -vv" + run: ". /venvs/UV3.12/bin/activate && python --version && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" ansible_test_integration: name: Run ansible-test integration test cases @@ -416,12 +416,12 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - - name: Check out repository code - uses: actions/checkout@v4 + # - name: Check out repository code + # uses: actions/checkout@v4 # - name: Install ssh-keygen # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + run: ". /venvs/UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" ansible_lint: name: Run ansible-lint test case @@ -430,10 +430,10 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - - name: Check out repository code - uses: actions/checkout@v4 + # - name: Check out repository code + # uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From 0106c0b1959d6d0b430e54426a233c1d1a900b8d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 15:06:51 +0530 Subject: [PATCH 240/324] reproduce ssh client issue --- .github/DockerfileBuild | 7 +++---- .github/workflows/pull-request-management.yml | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index ff3e826d040..8b0811318a8 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -14,7 +14,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends make && \ FROM ubuntu:latest AS run LABEL stage=run # Copy virtual environments from the build stage -RUN apt-get update && apt-get install -y --no-install-recommends \ - openssh-client -COPY --from=build /venvs /venvs -COPY --from=build /avd /avd +# RUN apt-get update && apt-get install -y --no-install-recommends \ + # openssh-client +COPY --from=build /venvs /venvs diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6e8ba02eb19..8abb455239e 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -392,10 +392,10 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - # - name: Check out repository code - # uses: actions/checkout@v4 + - name: Check out repository code + uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: ". /venvs/UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases From 6d5b56d42edcb0e95e8cbf11af6dac4fea3c5b9f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 15:18:25 +0530 Subject: [PATCH 241/324] fix path --- .github/workflows/pull-request-management.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 8abb455239e..bcc9a741c0a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -404,10 +404,10 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - # - name: Check out repository code - # uses: actions/checkout@v4 + - name: Check out repository code + uses: actions/checkout@v4 - name: "Run ansible-test units test cases" - run: ". /venvs/UV3.12/bin/activate && python --version && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" + run: ". /venvs/UV3.12/bin/activate && python --version && cd ansible_collections/arista/avd && ansible-test units -vv" ansible_test_integration: name: Run ansible-test integration test cases @@ -416,12 +416,12 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - # - name: Check out repository code - # uses: actions/checkout@v4 + - name: Check out repository code + uses: actions/checkout@v4 # - name: Install ssh-keygen # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" + run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" ansible_lint: name: Run ansible-lint test case @@ -430,10 +430,10 @@ container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} steps: - # - name: Check out repository code - # uses: actions/checkout@v4 + - name: Check out repository code + uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From d3659e2de15a69a0e7fc27260c3482983eaae482 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 16:03:07 +0530 Subject: [PATCH 242/324] install certifi in sanity test --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index bcc9a741c0a..0fc10cfa9ba 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -395,7 +395,7 @@ - name: Check out repository code uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases From d900e33ec7ae8e107b0fdc01503288a094e9929d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 16:09:16 +0530 Subject: [PATCH 243/324] install ca-certificates && update-ca-certificates --- .github/DockerfileBuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 8b0811318a8..e7780bbb6a8 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -14,6 +14,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends make && \ FROM ubuntu:latest AS run LABEL stage=run # Copy virtual environments from the build stage -# RUN apt-get update && apt-get install -y --no-install-recommends \ - # openssh-client +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates update-ca-certificates COPY --from=build /venvs /venvs From 0c7270c609450f49c91eca24e2a651110f343a56 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 16:13:36 +0530 Subject: [PATCH 244/324] pip upgrade --- .github/DockerfileBuild | 3 +-- .github/workflows/pull-request-management.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index e7780bbb6a8..3b6ce268154 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -14,6 +14,5 @@ RUN apt-get update && apt-get install -y --no-install-recommends make && \ FROM ubuntu:latest AS run LABEL stage=run # Copy virtual environments from the build stage -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates update-ca-certificates +# RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && update-ca-certificates COPY --from=build /venvs /venvs diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 0fc10cfa9ba..348fd9fe469 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -395,7 +395,7 @@ - name: Check out repository code uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade pip && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases From 412e2b3e71aa8e32dbba9c02d9167eb6ed8f9608 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 16:23:56 +0530 Subject: [PATCH 245/324] install ca-certificates --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 3b6ce268154..49e698bf793 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -14,5 +14,5 @@ RUN apt-get update && apt-get install -y --no-install-recommends make && \ FROM ubuntu:latest AS run LABEL stage=run # Copy virtual environments from the build stage -# RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && update-ca-certificates +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && update-ca-certificates COPY --from=build /venvs /venvs From 94065feb52faca0de53d77be1a56185cd1e9eedf Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 16:32:43 +0530 Subject: [PATCH 246/324] install ca-certificates --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 49e698bf793..0e74e29538a 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -14,5 +14,5 @@ RUN apt-get update && apt-get install -y --no-install-recommends make && \ FROM ubuntu:latest AS run LABEL stage=run # Copy virtual environments from the build stage -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && update-ca-certificates +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates COPY --from=build /venvs /venvs From 7ba5a17352f9ac7cfc84878702ca7d197f6505d9 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 16:51:35 +0530 Subject: [PATCH 247/324] test lint without certifi --- .github/workflows/pull-request-management.yml | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 348fd9fe469..dc96ec5e030 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -395,7 +395,7 @@ - name: Check out repository code uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade pip && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases @@ -409,19 +409,19 @@ - name: "Run ansible-test units test cases" run: ". /venvs/UV3.12/bin/activate && python --version && cd ansible_collections/arista/avd && ansible-test units -vv" - ansible_test_integration: - name: Run ansible-test integration test cases - runs-on: ubuntu-latest - needs: [build-pyavd] - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - # - name: Install ssh-keygen - # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client - - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + # ansible_test_integration: + # name: Run ansible-test integration test cases + # runs-on: ubuntu-latest + # needs: [build-pyavd] + # container: + # image: ${{ needs.build-pyavd.outputs.build_image_tag }} + # steps: + # - name: Check out repository code + # uses: actions/checkout@v4 + # # - name: Install ssh-keygen + # # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client + # - name: "Run ansible-test integration test cases" + # run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" ansible_lint: name: Run ansible-lint test case @@ -433,7 +433,7 @@ - name: Check out repository code uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From 15e697398fe36792d7c7b0342721c8ffdab2e749 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 16:59:44 +0530 Subject: [PATCH 248/324] test lint without certifi --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 0e74e29538a..e5325310ade 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -14,5 +14,5 @@ RUN apt-get update && apt-get install -y --no-install-recommends make && \ FROM ubuntu:latest AS run LABEL stage=run # Copy virtual environments from the build stage -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates +# RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates COPY --from=build /venvs /venvs From 41765f6440b4158f0b1b1220c7ee53a0f3df269e Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 17 Feb 2025 18:11:50 +0530 Subject: [PATCH 249/324] test lint with certifi --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index dc96ec5e030..bf9a9d40697 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -395,7 +395,7 @@ - name: Check out repository code uses: actions/checkout@v4 - name: "Run ansible-test sanity" - run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases @@ -433,7 +433,7 @@ - name: Check out repository code uses: actions/checkout@v4 - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From c2dba88c9e8f9f19e2475ee3f5ea05c7c0d761da Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 21 Feb 2025 18:48:24 +0530 Subject: [PATCH 250/324] fix sanity test fail --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index e5325310ade..0e74e29538a 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -14,5 +14,5 @@ RUN apt-get update && apt-get install -y --no-install-recommends make && \ FROM ubuntu:latest AS run LABEL stage=run # Copy virtual environments from the build stage -# RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates COPY --from=build /venvs /venvs From 28644aa5fb9bb3591956baaa31f41881cd804b15 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Tue, 25 Feb 2025 17:41:46 +0530 Subject: [PATCH 251/324] Install ca certificate for sanity test job --- .github/DockerfileBuild | 1 - .github/workflows/pull-request-management.yml | 31 ++----------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 0e74e29538a..e6174867645 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -14,5 +14,4 @@ RUN apt-get update && apt-get install -y --no-install-recommends make && \ FROM ubuntu:latest AS run LABEL stage=run # Copy virtual environments from the build stage -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates COPY --from=build /venvs /venvs diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index bf9a9d40697..dcade928f02 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -187,33 +187,6 @@ type=gha,mode=max type=registry,ref=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest outputs: type=image,push=true - # run-anisble-tests: - # name: Run Ansible Tests - # needs: [build-pyavd] - # runs-on: ubuntu-latest - # container: - # image: ${{ needs.build-pyavd.outputs.build_image_tag }} - # options: --cpus 1 - # strategy: - # matrix: - # task: - # - name: Ansible Unit Tests 3.12 - # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test units -vv" - # - name: Ansible Integration Tests 3.12 - # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - # - name: Ansible Integration Tests 3.13 - # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test integration -vv" - # - name: Ansible Sanity Tests 3.13 - # command: ". /UV3.13/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # - name: Ansible Sanity Tests 3.12 - # command: ". /UV3.12/bin/activate && cd /avd/ansible_collections/arista/avd && ansible-test sanity --color yes -v" - # - name: Ansible Lint Tests 3.11 - # command: ". /UV3.11/bin/activate && ansible-galaxy collection install -r /avd/ansible_collections/arista/avd/collections.yml && cd /avd/ansible_collections/arista/avd && ansible-lint --force-color --strict -v" - # steps: - # - name: Run Task - ${{ matrix.task.name }} - # run: | - # ${{ matrix.task.command }} - # ----------------------------------- # # EOS CLI CONFIG GEN MOLECULE @@ -394,8 +367,10 @@ steps: - name: Check out repository code uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - name: "Run ansible-test sanity" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" ansible_test_units: name: Run ansible-test units test cases From 94ebf1c01694cae2c5e15e860c48b7414ac02309 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 26 Feb 2025 11:30:47 +0530 Subject: [PATCH 252/324] skip ansible-lint rule --- .github/workflows/pull-request-management.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index dcade928f02..2d89aa90941 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -407,6 +407,9 @@ steps: - name: Check out repository code uses: actions/checkout@v4 + - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" + run: | + sed -i 's/- syntax-check/# - syntax-check/g' .ansible-lint - name: "Run ansible-test integration test cases" run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" From 28bf2a855b63caa1c17e55551e546ba85bf1d200 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 26 Feb 2025 14:49:40 +0530 Subject: [PATCH 253/324] fix syntax-check --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 2d89aa90941..1d7a7f48db4 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -409,9 +409,9 @@ uses: actions/checkout@v4 - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" run: | - sed -i 's/- syntax-check/# - syntax-check/g' .ansible-lint + sed -i 's/- syntax-check/# - syntax-check/g' ansible_collections/arista/avd/.ansible-lint - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From 2c4db8619278b2c411633ed3ffc5b83cd9076582 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 26 Feb 2025 14:56:41 +0530 Subject: [PATCH 254/324] fix ansible lint tests --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 1d7a7f48db4..6b316833b56 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -411,7 +411,7 @@ run: | sed -i 's/- syntax-check/# - syntax-check/g' ansible_collections/arista/avd/.ansible-lint - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer From ce56204531ba522e823c76aaadad45a6193d8017 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 26 Feb 2025 15:14:51 +0530 Subject: [PATCH 255/324] update workflow --- .github/workflows/pull-request-management.yml | 932 +++++++++--------- 1 file changed, 469 insertions(+), 463 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6b316833b56..19a123e267c 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -1,475 +1,481 @@ --- - name: "Collection code testing" +name: "Collection code testing" - "on": pull_request +"on": + pull_request: + merge_group: + push: + branches: + - devel - concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true - env: - # Set -vvv is ACTIONS_STEP_DEBUG is set - # Apparently it is set in secrets when running with debug - ANSIBLE_VERBOSITY: ${{ secrets.ACTIONS_STEP_DEBUG && 3 || 0 }} - AVD_NEVER_RUN_FROM_SOURCE: 1 - PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions - ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions +env: + # Set -vvv is ACTIONS_STEP_DEBUG is set + # Apparently it is set in secrets when running with debug + ANSIBLE_VERBOSITY: ${{ secrets.ACTIONS_STEP_DEBUG && 3 || 0 }} + AVD_NEVER_RUN_FROM_SOURCE: 1 + PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions + ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions - jobs: - file-changes: - runs-on: ubuntu-latest - outputs: - eos_design: ${{ steps.filter.outputs.eos_design }} - config_gen: ${{ steps.filter.outputs.config_gen }} - cloudvision: ${{ steps.filter.outputs.cloudvision }} - dhcp: ${{ steps.filter.outputs.dhcp }} - plugins: ${{ steps.filter.outputs.plugins }} - requirements: ${{ steps.filter.outputs.requirements }} - docs: ${{ steps.filter.outputs.docs }} - steps: - - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - eos_design: - - 'ansible_collections/arista/avd/roles/eos_designs/*' - - 'ansible_collections/arista/avd/roles/eos_designs/**/*' - - '.github/workflows/pull-request-management.yml' - - 'ansible_collections/arista/avd/molecule/*' - - 'ansible_collections/arista/avd/molecule/**/*' - - 'python-avd/pyavd/_eos_designs/*' - - 'python-avd/pyavd/_eos_designs/**/*' - - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' - - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' - - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' - - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' - config_gen: - - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' - - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' - - '.github/workflows/pull-request-management.yml' - - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/*' - - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/**/*' - - 'python-avd/pyavd/_eos_cli_config_gen/*' - - 'python-avd/pyavd/_eos_cli_config_gen/**/*' - validate_state: - - 'ansible_collections/arista/avd/roles/eos_validate_state/*' - - 'ansible_collections/arista/avd/roles/eos_validate_state/**/*' - cloudvision: - - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' - - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' - - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' - - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' - - '.github/workflows/pull-request-management.yml' - dhcp: - - 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' - - 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' - - '.github/workflows/pull-request-management.yml' - plugins: - - 'ansible_collections/arista/avd/plugins/filter/**' - - 'ansible_collections/arista/avd/plugins/test/**' - requirements: - - 'ansible_collections/arista/avd/requirements.txt' - - 'ansible_collections/arista/avd/requirements-dev.txt' - - 'ansible_collections/arista/avd/meta/runtime.yml' - - '.github/requirements-ci.txt' - docs: - - '.github/workflows/pull-request-management.yml' - - 'mkdocs.yml' - - 'ansible_collections/arista/avd/docs/**' - - 'ansible_collections/arista/avd/roles/**/*.md' - - 'ansible_collections/arista/avd/**/*.md' - - 'ansible_collections/arista/avd/README.md' - - 'ansible_collections/arista/avd/**/*.schema.yml' - pyavd: - - 'python_avd/*' - - 'python_avd/**/*' - avd-base-image: - runs-on: ubuntu-latest - outputs: - base_image_tag: ${{ steps.set-base-tag.outputs.base_image_tag }} - steps: - - name: Check out repository - uses: actions/checkout@v4 +jobs: + file-changes: + runs-on: ubuntu-latest + outputs: + eos_design: ${{ steps.filter.outputs.eos_design }} + config_gen: ${{ steps.filter.outputs.config_gen }} + cloudvision: ${{ steps.filter.outputs.cloudvision }} + dhcp: ${{ steps.filter.outputs.dhcp }} + plugins: ${{ steps.filter.outputs.plugins }} + requirements: ${{ steps.filter.outputs.requirements }} + docs: ${{ steps.filter.outputs.docs }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + eos_design: + - 'ansible_collections/arista/avd/roles/eos_designs/*' + - 'ansible_collections/arista/avd/roles/eos_designs/**/*' + - '.github/workflows/pull-request-management.yml' + - 'ansible_collections/arista/avd/molecule/*' + - 'ansible_collections/arista/avd/molecule/**/*' + - 'python-avd/pyavd/_eos_designs/*' + - 'python-avd/pyavd/_eos_designs/**/*' + - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' + - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' + - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' + - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' + config_gen: + - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' + - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' + - '.github/workflows/pull-request-management.yml' + - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/*' + - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/**/*' + - 'python-avd/pyavd/_eos_cli_config_gen/*' + - 'python-avd/pyavd/_eos_cli_config_gen/**/*' + validate_state: + - 'ansible_collections/arista/avd/roles/eos_validate_state/*' + - 'ansible_collections/arista/avd/roles/eos_validate_state/**/*' + cloudvision: + - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' + - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' + - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' + - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' + - '.github/workflows/pull-request-management.yml' + dhcp: + - 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' + - 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' + - '.github/workflows/pull-request-management.yml' + plugins: + - 'ansible_collections/arista/avd/plugins/filter/**' + - 'ansible_collections/arista/avd/plugins/test/**' + requirements: + - 'ansible_collections/arista/avd/requirements.txt' + - 'ansible_collections/arista/avd/requirements-dev.txt' + - 'ansible_collections/arista/avd/meta/runtime.yml' + - '.github/requirements-ci-dev.txt' + - '.github/workflows/pull-request-management.yml' + docs: + - '.github/workflows/pull-request-management.yml' + - 'mkdocs.yml' + - 'ansible_collections/arista/avd/docs/**' + - 'ansible_collections/arista/avd/roles/**/*.md' + - 'ansible_collections/arista/avd/**/*.md' + - 'ansible_collections/arista/avd/README.md' + - 'ansible_collections/arista/avd/**/*.schema.yml' + pyavd: + - 'python_avd/*' + - 'python_avd/**/*' + avd-base-image: + runs-on: ubuntu-latest + outputs: + base_image_tag: ${{ steps.set-base-tag.outputs.base_image_tag }} + steps: + - name: Check out repository + uses: actions/checkout@v4 - - name: Calculate Hash of Requirements - id: hash-reqs - run: | - HASH_OF_REQS=$(sha256sum ansible_collections/arista/avd/requirements-dev.txt | cut -d' ' -f1) - echo "Hash of requirements: $HASH_OF_REQS" - echo "::set-output name=hash_of_reqs::$HASH_OF_REQS" + - name: Calculate Hash of Requirements + id: hash-reqs + run: | + HASH_OF_REQS=$(sha256sum ansible_collections/arista/avd/requirements-dev.txt | cut -d' ' -f1) + echo "Hash of requirements: $HASH_OF_REQS" + echo "::set-output name=hash_of_reqs::$HASH_OF_REQS" - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - name: Set Base Image Tag - id: set-base-tag - run: | - BASE_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ steps.hash-reqs.outputs.hash_of_reqs }}" - echo "::set-output name=base_image_tag::$BASE_IMAGE_TAG" + - name: Set Base Image Tag + id: set-base-tag + run: | + BASE_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ steps.hash-reqs.outputs.hash_of_reqs }}" + echo "::set-output name=base_image_tag::$BASE_IMAGE_TAG" - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Check if image exists - id: check-base-image - run: | - if docker manifest inspect ${{ steps.set-base-tag.outputs.base_image_tag }} > /dev/null 2>&1; then - echo "Base image exists." - echo "::set-output name=image_exists::true" - else - echo "Base image does not exist." - echo "::set-output name=image_exists::false" - fi + - name: Check if image exists + id: check-base-image + run: | + if docker manifest inspect ${{ steps.set-base-tag.outputs.base_image_tag }} > /dev/null 2>&1; then + echo "Base image exists." + echo "::set-output name=image_exists::true" + else + echo "Base image does not exist." + echo "::set-output name=image_exists::false" + fi - - name: Set up Docker Buildx - if: steps.check-base-image.outputs.image_exists == 'false' - uses: docker/setup-buildx-action@v3 + - name: Set up Docker Buildx + if: steps.check-base-image.outputs.image_exists == 'false' + uses: docker/setup-buildx-action@v3 - - name: Build and Push Base Run Image - if: steps.check-base-image.outputs.image_exists == 'false' - uses: docker/build-push-action@v6 - with: - context: . - file: .github/DockerfileBase - target: base_run - push: true - tags: ${{ steps.set-base-tag.outputs.base_image_tag }} - cache-from: type=gha,scope=base-run - cache-to: type=gha,mode=max,scope=base-run - - build-pyavd: - name: Install pyavd and Build Image - needs: [avd-base-image] - runs-on: ubuntu-latest - outputs: - build_image_tag: ${{ steps.set-build-tag.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - name: Set Build Image Tag - id: set-build-tag - run: | - SHORT_SHA=$(git rev-parse --short HEAD) - BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" - echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" - - name: Echo image name - run: echo ${{ needs.avd-base-image.outputs.base_image_tag }} - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push PyAVD Image - uses: docker/build-push-action@v6 - with: - file: .github/DockerfileBuild - push: true - target: run - tags: ${{ steps.set-build-tag.outputs.build_image_tag }} - build-args: - BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} - cache-from: type=gha - cache-to: | - type=gha,mode=max - type=registry,ref=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest - outputs: type=image,push=true - - # ----------------------------------- # - # EOS CLI CONFIG GEN MOLECULE - # ----------------------------------- # - molecule_eos_cli_config_gen: - name: Validate eos_cli_config_gen - runs-on: ubuntu-latest - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - strategy: - fail-fast: true - matrix: - avd_scenario: - - "eos_cli_config_gen" - - "eos_cli_config_gen_deprecated_vars" - - "eos_cli_config_gen_negative_unit_tests" - ansible_version: - - "'ansible-core<2.19.0' --upgrade" - # Also test minimum ansible version for one scenario. - include: - - avd_scenario: "eos_cli_config_gen" - ansible_version: "ansible-core==2.16.0" - needs: [ build-pyavd ] - if: needs.file-changes.outputs.config_gen == 'true' - steps: - - name: Install the specified Ansible version - run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" - - name: Run molecule action - run: " . /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - - # ----------------------------------- # - # DHCP PROVISIONNER MOLECULE - # ----------------------------------- # - molecule_dhcp_provisionner: - name: Validate DHCP configuration - runs-on: ubuntu-latest - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - strategy: - fail-fast: true - matrix: - avd_scenario: ["dhcp_configuration", "dhcp_provisioning"] - ansible_version: ["'ansible-core<2.19.0' --upgrade"] - needs: [ build-pyavd ] - if: needs.file-changes.outputs.dhcp == 'true' - steps: - - name: Install the specified Ansible version - run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" - - name: Run molecule action - run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - - # ----------------------------------- # - # EOS Design MOLECULE - # ----------------------------------- # - molecule_eos_designs: - name: Validate eos_designs - runs-on: ubuntu-latest - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - strategy: - fail-fast: true - matrix: - avd_scenario: - - "eos_designs_deprecated_vars" - - "eos_designs-l2ls" - - "eos_designs-mpls-isis-sr-ldp" - - "eos_designs_negative_unit_tests" - - "eos_designs-twodc-5stage-clos" - - "eos_designs_unit_tests" - - "evpn_underlay_ebgp_overlay_ebgp" - - "evpn_underlay_isis_overlay_ibgp" - - "evpn_underlay_ospf_overlay_ebgp" - - "evpn_underlay_rfc5549_overlay_ebgp" - - "example-campus-fabric" - - "example-dual-dc-l3ls" - - "example-isis-ldp-ipvpn" - - "example-l2ls-fabric" - - "example-single-dc-l3ls" - - "example-cv-pathfinder" - ansible_version: - # Testing all scenario with 2.16.x, due to bug with in 2.17.0 with and the way we test eos_designs_negative_unit_tests https://github.com/ansible/ansible/issues/83292 - - "'ansible-core>=2.16.0,<2.17.0' --upgrade" - pip_requirements: - - '.github/requirements-ci.txt' - # Also test minimum ansible version for one scenario. - include: - - avd_scenario: "eos_designs_unit_tests" - ansible_version: "'ansible-core==2.16.0' --upgrade" - - avd_scenario: "eos_designs_unit_tests" - ansible_version: "'ansible-core<2.18.0' --upgrade" - - avd_scenario: "eos_designs_unit_tests" - ansible_version: "'ansible-core<2.19.0' --upgrade" - needs: [ build-pyavd ] - if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' - steps: - - name: Install the specified Ansible version - run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" - - name: Run molecule action - run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - # ----------------------------------- # - # Cloudvision MOLECULE - # ----------------------------------- # - molecule_cloudvision: - name: Validate cvp_collection - runs-on: ubuntu-latest - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - strategy: - fail-fast: true - matrix: - avd_scenario: - - "eos_config_deploy_cvp" - ansible_version: - - "'ansible-core<2.19.0' --upgrade" - include: - - avd_scenario: "eos_config_deploy_cvp" - ansible_version: "ansible-core==2.16.0" - needs: [ build-pyavd ] - if: needs.file-changes.outputs.cloudvision == 'true' || needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' - - steps: - - name: Install the specified Ansible version - run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" - - name: Run molecule action - run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - # - # ----------------------------------- # - # EOS Validate State MOLECULE - # ----------------------------------- # - molecule_eos_validate_state: - name: Validate eos_validate_state - runs-on: ubuntu-latest - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - strategy: - fail-fast: true - matrix: - avd_scenario: - - "eos_validate_state" - ansible_version: - - "'ansible-core<2.19.0' --upgrade" - include: - - avd_scenario: "eos_validate_state" - ansible_version: "ansible-core==2.16.0" - needs: [ build-pyavd ] - if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.validate_state == 'true' - steps: - - name: Install the specified Ansible version - run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" - - name: Run molecule action - run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - - # ----------------------------------- # - # Ansible tests - # ----------------------------------- # - ansible_test_sanity: - name: Run ansible-test sanity validation - runs-on: ubuntu-latest - needs: [build-pyavd] - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Install CA certificate - run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - - name: "Run ansible-test sanity" - run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - - ansible_test_units: - name: Run ansible-test units test cases - runs-on: ubuntu-latest - needs: [build-pyavd] - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: "Run ansible-test units test cases" - run: ". /venvs/UV3.12/bin/activate && python --version && cd ansible_collections/arista/avd && ansible-test units -vv" - - # ansible_test_integration: - # name: Run ansible-test integration test cases - # runs-on: ubuntu-latest - # needs: [build-pyavd] - # container: - # image: ${{ needs.build-pyavd.outputs.build_image_tag }} - # steps: - # - name: Check out repository code - # uses: actions/checkout@v4 - # # - name: Install ssh-keygen - # # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client - # - name: "Run ansible-test integration test cases" - # run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - - ansible_lint: - name: Run ansible-lint test case - runs-on: ubuntu-latest - needs: [build-pyavd] - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" - run: | - sed -i 's/- syntax-check/# - syntax-check/g' ansible_collections/arista/avd/.ansible-lint - - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" - - # ----------------------------------- # - # Galaxy Importer - # ----------------------------------- # - # galaxy_importer: - # name: Test galaxy-importer - # runs-on: ubuntu-20.04 # Older version to be compatible with old python - # env: - # GALAXY_IMPORTER_CONFIG: galaxy-importer/galaxy-importer.cfg - # steps: - # - uses: actions/setup-python@v5 - # with: - # python-version: | - # 3.10 - # - uses: actions/checkout@v4 - # - name: 'Install Python & Ansible requirements' - # run: | - # pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade - # ansible-galaxy collection install -r ansible_collections/arista/avd/collections.yml - # - name: Install galaxy-importer - # # Install the specific version of galaxy-importer used on galaxy.ansible.com - # # The version conflicts with our requirements, - # # so we let the galaxy-importer version resolve remaining requirements. - # run: | - # pip install "galaxy-importer==0.4.26" - # - name: 'Build ansible package' - # run: make collection-build - # - name: 'Run galaxy-importer checks' - # run: python -m galaxy_importer.main *.tar.gz - # - uses: actions/upload-artifact@v4 - # with: - # name: importer-logs - # path: ./importer_result.json - - # # ----------------------------------- # - # # Test of pyavd - # # ----------------------------------- # - # pyavd: - # name: Test pyavd - # runs-on: ubuntu-latest - # needs: [file-changes] - # if: | - # needs.file-changes.outputs.eos_design == 'true' || - # needs.file-changes.outputs.config_gen == 'true' || - # needs.file-changes.outputs.pyavd == 'true' - # strategy: - # matrix: - # python: ["3.10", "3.11", "3.12", "3.13"] - # steps: - # - uses: actions/checkout@v4 - # - name: Set up Python 3 - # uses: actions/setup-python@v5 - # with: - # python-version: ${{ matrix.python }} - # - name: 'Install tox' - # run: | - # pip install tox tox-gh-actions --upgrade - # - name: "Run pytest via tox for ${{ matrix.python }}" - # working-directory: python-avd - # run: | - # tox + - name: Build and Push Base Run Image + if: steps.check-base-image.outputs.image_exists == 'false' + uses: docker/build-push-action@v6 + with: + context: . + file: .github/DockerfileBase + target: base_run + push: true + tags: ${{ steps.set-base-tag.outputs.base_image_tag }} + cache-from: type=gha,scope=base-run + cache-to: type=gha,mode=max,scope=base-run + + build-pyavd: + name: Install pyavd and Build Image + needs: [avd-base-image] + runs-on: ubuntu-latest + outputs: + build_image_tag: ${{ steps.set-build-tag.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + - name: Set Build Image Tag + id: set-build-tag + run: | + SHORT_SHA=$(git rev-parse --short HEAD) + BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" + echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" + - name: Echo image name + run: echo ${{ needs.avd-base-image.outputs.base_image_tag }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push PyAVD Image + uses: docker/build-push-action@v6 + with: + file: .github/DockerfileBuild + push: true + target: run + tags: ${{ steps.set-build-tag.outputs.build_image_tag }} + build-args: + BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} + cache-from: type=gha + cache-to: | + type=gha,mode=max + type=registry,ref=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest + outputs: type=image,push=true + + # ----------------------------------- # + # EOS CLI CONFIG GEN MOLECULE + # ----------------------------------- # + molecule_eos_cli_config_gen: + name: Validate eos_cli_config_gen + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: + - "eos_cli_config_gen" + - "eos_cli_config_gen_deprecated_vars" + - "eos_cli_config_gen_negative_unit_tests" + ansible_version: + - "'ansible-core<2.19.0' --upgrade" + # Also test minimum ansible version for one scenario. + include: + - avd_scenario: "eos_cli_config_gen" + ansible_version: "ansible-core==2.16.0" + needs: [ build-pyavd ] + if: needs.file-changes.outputs.config_gen == 'true' + steps: + - name: Install the specified Ansible version + run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: " . /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + + # ----------------------------------- # + # DHCP PROVISIONNER MOLECULE + # ----------------------------------- # + molecule_dhcp_provisionner: + name: Validate DHCP configuration + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: ["dhcp_configuration", "dhcp_provisioning"] + ansible_version: ["'ansible-core<2.19.0' --upgrade"] + needs: [ build-pyavd ] + if: needs.file-changes.outputs.dhcp == 'true' + steps: + - name: Install the specified Ansible version + run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + + # ----------------------------------- # + # EOS Design MOLECULE + # ----------------------------------- # + molecule_eos_designs: + name: Validate eos_designs + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: + - "eos_designs_deprecated_vars" + - "eos_designs-l2ls" + - "eos_designs-mpls-isis-sr-ldp" + - "eos_designs_negative_unit_tests" + - "eos_designs-twodc-5stage-clos" + - "eos_designs_unit_tests" + - "evpn_underlay_ebgp_overlay_ebgp" + - "evpn_underlay_isis_overlay_ibgp" + - "evpn_underlay_ospf_overlay_ebgp" + - "evpn_underlay_rfc5549_overlay_ebgp" + - "example-campus-fabric" + - "example-dual-dc-l3ls" + - "example-isis-ldp-ipvpn" + - "example-l2ls-fabric" + - "example-single-dc-l3ls" + - "example-cv-pathfinder" + ansible_version: + # Testing all scenario with 2.16.x, due to bug with in 2.17.0 with and the way we test eos_designs_negative_unit_tests https://github.com/ansible/ansible/issues/83292 + - "'ansible-core>=2.16.0,<2.17.0' --upgrade" + pip_requirements: + - '.github/requirements-ci.txt' + # Also test minimum ansible version for one scenario. + include: + - avd_scenario: "eos_designs_unit_tests" + ansible_version: "'ansible-core==2.16.0' --upgrade" + - avd_scenario: "eos_designs_unit_tests" + ansible_version: "'ansible-core<2.18.0' --upgrade" + - avd_scenario: "eos_designs_unit_tests" + ansible_version: "'ansible-core<2.19.0' --upgrade" + needs: [ build-pyavd ] + if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' + steps: + - name: Install the specified Ansible version + run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + # ----------------------------------- # + # Cloudvision MOLECULE + # ----------------------------------- # + molecule_cloudvision: + name: Validate cvp_collection + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: + - "eos_config_deploy_cvp" + ansible_version: + - "'ansible-core<2.19.0' --upgrade" + include: + - avd_scenario: "eos_config_deploy_cvp" + ansible_version: "ansible-core==2.16.0" + needs: [ build-pyavd ] + if: needs.file-changes.outputs.cloudvision == 'true' || needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' + + steps: + - name: Install the specified Ansible version + run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + # + # ----------------------------------- # + # EOS Validate State MOLECULE + # ----------------------------------- # + molecule_eos_validate_state: + name: Validate eos_validate_state + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: + - "eos_validate_state" + ansible_version: + - "'ansible-core<2.19.0' --upgrade" + include: + - avd_scenario: "eos_validate_state" + ansible_version: "ansible-core==2.16.0" + needs: [ build-pyavd ] + if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.validate_state == 'true' + steps: + - name: Install the specified Ansible version + run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + + # ----------------------------------- # + # Ansible tests + # ----------------------------------- # + ansible_test_sanity: + name: Run ansible-test sanity validation + runs-on: ubuntu-latest + needs: [build-pyavd] + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates + - name: "Run ansible-test sanity" + run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + + ansible_test_units: + name: Run ansible-test units test cases + runs-on: ubuntu-latest + needs: [build-pyavd] + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: "Run ansible-test units test cases" + run: ". /venvs/UV3.12/bin/activate && python --version && cd ansible_collections/arista/avd && ansible-test units -vv" + + # ansible_test_integration: + # name: Run ansible-test integration test cases + # runs-on: ubuntu-latest + # needs: [build-pyavd] + # container: + # image: ${{ needs.build-pyavd.outputs.build_image_tag }} + # steps: + # - name: Check out repository code + # uses: actions/checkout@v4 + # # - name: Install ssh-keygen + # # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client + # - name: "Run ansible-test integration test cases" + # run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + + ansible_lint: + name: Run ansible-lint test case + runs-on: ubuntu-latest + needs: [build-pyavd] + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" + run: | + sed -i 's/- syntax-check/# - syntax-check/g' ansible_collections/arista/avd/.ansible-lint + - name: "Run ansible-test integration test cases" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + + # ----------------------------------- # + # Galaxy Importer + # ----------------------------------- # + # galaxy_importer: + # name: Test galaxy-importer + # runs-on: ubuntu-20.04 # Older version to be compatible with old python + # env: + # GALAXY_IMPORTER_CONFIG: galaxy-importer/galaxy-importer.cfg + # steps: + # - uses: actions/setup-python@v5 + # with: + # python-version: | + # 3.10 + # - uses: actions/checkout@v4 + # - name: 'Install Python & Ansible requirements' + # run: | + # pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade + # ansible-galaxy collection install -r ansible_collections/arista/avd/collections.yml + # - name: Install galaxy-importer + # # Install the specific version of galaxy-importer used on galaxy.ansible.com + # # The version conflicts with our requirements, + # # so we let the galaxy-importer version resolve remaining requirements. + # run: | + # pip install "galaxy-importer==0.4.26" + # - name: 'Build ansible package' + # run: make collection-build + # - name: 'Run galaxy-importer checks' + # run: python -m galaxy_importer.main *.tar.gz + # - uses: actions/upload-artifact@v4 + # with: + # name: importer-logs + # path: ./importer_result.json + + # # ----------------------------------- # + # # Test of pyavd + # # ----------------------------------- # + # pyavd: + # name: Test pyavd + # runs-on: ubuntu-latest + # needs: [file-changes] + # if: | + # needs.file-changes.outputs.eos_design == 'true' || + # needs.file-changes.outputs.config_gen == 'true' || + # needs.file-changes.outputs.pyavd == 'true' + # strategy: + # matrix: + # python: ["3.10", "3.11", "3.12", "3.13"] + # steps: + # - uses: actions/checkout@v4 + # - name: Set up Python 3 + # uses: actions/setup-python@v5 + # with: + # python-version: ${{ matrix.python }} + # - name: 'Install tox' + # run: | + # pip install tox tox-gh-actions --upgrade + # - name: "Run pytest via tox for ${{ matrix.python }}" + # working-directory: python-avd + # run: | + # tox From 9ba88b83ac45a00d5343ae10b7fc7a1ccb67a53a Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 26 Feb 2025 15:37:22 +0530 Subject: [PATCH 256/324] Run molecule eos_cli_config_gen --- .github/workflows/pull-request-management.yml | 7 ++++--- .../inventory/host_vars/host1/aaa-accounting.yml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 19a123e267c..6ebef678c94 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -210,7 +210,7 @@ jobs: - "eos_cli_config_gen_deprecated_vars" - "eos_cli_config_gen_negative_unit_tests" ansible_version: - - "'ansible-core<2.19.0' --upgrade" + - "ansible-core<2.19.0 --upgrade" # Also test minimum ansible version for one scenario. include: - avd_scenario: "eos_cli_config_gen" @@ -218,10 +218,11 @@ jobs: needs: [ build-pyavd ] if: needs.file-changes.outputs.config_gen == 'true' steps: + - uses: actions/checkout@v4 - name: Install the specified Ansible version - run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" - name: Run molecule action - run: " . /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + run: " . /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" # - uses: actions/upload-artifact@v4 # with: # name: molecule-${{ matrix.avd_scenario }}-artifacts diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/aaa-accounting.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/aaa-accounting.yml index 134bee8ef1b..e288de5ffb8 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/aaa-accounting.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/aaa-accounting.yml @@ -31,7 +31,7 @@ aaa_accounting: type: start-stop logging: false group: TACACS1 - # As type is none hence logging will not render in config as per actual EOS + # As type is none hence logging will not render in config as per actual EOS config - commands: 2 type: none logging: true From 05b7b95cc6810362de435be55e3530ed83579d71 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 26 Feb 2025 15:44:28 +0530 Subject: [PATCH 257/324] molecule --- .../eos_cli_config_gen/documentation/devices/host1.md | 4 ++-- .../molecule/eos_cli_config_gen/intended/configs/host1.cfg | 2 +- .../inventory/host_vars/host1/aaa-accounting.yml | 2 +- .../eos_cli_config_gen/inventory/host_vars/host1/acl.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md index d404a2c128d..8937453497e 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md @@ -10299,7 +10299,7 @@ ip access-list standard ACL-SSH-VRF | Sequence | Action | | -------- | ------ | -| 10 | remark ACL to restrict access to switch API to CVP and Ansible | +| 10 | remark ACL to restrict access to switch API to CVP and Ansible etc | | 20 | deny ip host 192.0.2.1 any | | 30 | permit ip 192.0.2.0/24 any | @@ -10354,7 +10354,7 @@ ip access-list 4 30 permit ip 192.0.2.0/24 any ! ip access-list ACL-01 - 10 remark ACL to restrict access to switch API to CVP and Ansible + 10 remark ACL to restrict access to switch API to CVP and Ansible etc 20 deny ip host 192.0.2.1 any 30 permit ip 192.0.2.0/24 any ! diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg index d985bd9eb04..cdaac83a319 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg @@ -4273,7 +4273,7 @@ ip access-list 4 30 permit ip 192.0.2.0/24 any ! ip access-list ACL-01 - 10 remark ACL to restrict access to switch API to CVP and Ansible + 10 remark ACL to restrict access to switch API to CVP and Ansible etc 20 deny ip host 192.0.2.1 any 30 permit ip 192.0.2.0/24 any ! diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/aaa-accounting.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/aaa-accounting.yml index e288de5ffb8..134bee8ef1b 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/aaa-accounting.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/aaa-accounting.yml @@ -31,7 +31,7 @@ aaa_accounting: type: start-stop logging: false group: TACACS1 - # As type is none hence logging will not render in config as per actual EOS config + # As type is none hence logging will not render in config as per actual EOS - commands: 2 type: none logging: true diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml index 14d49748bbd..b62a8a203ef 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml @@ -12,7 +12,7 @@ access_lists: - name: ACL-01 sequence_numbers: - sequence: 10 - action: "remark ACL to restrict access to switch API to CVP and Ansible" + action: "remark ACL to restrict access to switch API to CVP and Ansible etc" - sequence: 20 action: "deny ip host 192.0.2.1 any" - sequence: 30 From cdfcce6fc8bfe26524da28cc74f62db2a5d0cba2 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 26 Feb 2025 15:54:36 +0530 Subject: [PATCH 258/324] eorkflow fix --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6ebef678c94..644e4b2dfc9 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -215,7 +215,7 @@ jobs: include: - avd_scenario: "eos_cli_config_gen" ansible_version: "ansible-core==2.16.0" - needs: [ build-pyavd ] + needs: [ "build-pyavd", "file-changes" ] if: needs.file-changes.outputs.config_gen == 'true' steps: - uses: actions/checkout@v4 From 102feb6120de018426a80fad1b0ccbaf898967f0 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 26 Feb 2025 16:00:46 +0530 Subject: [PATCH 259/324] Workflow fix --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 644e4b2dfc9..fe23a29439a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -210,7 +210,7 @@ jobs: - "eos_cli_config_gen_deprecated_vars" - "eos_cli_config_gen_negative_unit_tests" ansible_version: - - "ansible-core<2.19.0 --upgrade" + - "ansible-core<2.19.0" # Also test minimum ansible version for one scenario. include: - avd_scenario: "eos_cli_config_gen" @@ -220,7 +220,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install the specified Ansible version - run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }} --upgrade" - name: Run molecule action run: " . /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" # - uses: actions/upload-artifact@v4 From a84836e8adc41d07606b94122385b020edf14e0c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 26 Feb 2025 16:11:42 +0530 Subject: [PATCH 260/324] fix ansible-version --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index fe23a29439a..cbe56b9d176 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -220,7 +220,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install the specified Ansible version - run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }} --upgrade" + run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}' --upgrade" - name: Run molecule action run: " . /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" # - uses: actions/upload-artifact@v4 From bbb138adb5b194c7e1b11b7dc531d701a47111c5 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 26 Feb 2025 16:17:28 +0530 Subject: [PATCH 261/324] fix certificate error --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index cbe56b9d176..a9429f62c75 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -219,6 +219,8 @@ jobs: if: needs.file-changes.outputs.config_gen == 'true' steps: - uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - name: Install the specified Ansible version run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}' --upgrade" - name: Run molecule action From 9c09eecd11ff8f89ab155895b34e5857abb5272a Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 26 Feb 2025 19:31:10 +0530 Subject: [PATCH 262/324] Removing molecule changes --- .github/workflows/pull-request-management.yml | 28 +++++++++++++------ .../documentation/devices/host1.md | 4 +-- .../intended/configs/host1.cfg | 2 +- .../inventory/host_vars/host1/acl.yml | 2 +- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index a9429f62c75..e8f3760adcc 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -246,10 +246,13 @@ jobs: needs: [ build-pyavd ] if: needs.file-changes.outputs.dhcp == 'true' steps: + - uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - name: Install the specified Ansible version - run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}'" - name: Run molecule action - run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + run: ". /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" # - uses: actions/upload-artifact@v4 # with: # name: molecule-${{ matrix.avd_scenario }}-artifacts @@ -299,10 +302,13 @@ jobs: needs: [ build-pyavd ] if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' steps: + - uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - name: Install the specified Ansible version - run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" - name: Run molecule action - run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + run: ". /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" # - uses: actions/upload-artifact@v4 # with: # name: molecule-${{ matrix.avd_scenario }}-artifacts @@ -329,10 +335,13 @@ jobs: if: needs.file-changes.outputs.cloudvision == 'true' || needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' steps: + - uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - name: Install the specified Ansible version - run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" - name: Run molecule action - run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + run: ". /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" # - uses: actions/upload-artifact@v4 # with: # name: molecule-${{ matrix.avd_scenario }}-artifacts @@ -359,10 +368,13 @@ jobs: needs: [ build-pyavd ] if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.validate_state == 'true' steps: + - uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - name: Install the specified Ansible version - run: "/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" - name: Run molecule action - run: ". /UV3.11/bin/activate && cd /avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + run: ". /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" # ----------------------------------- # # Ansible tests diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md index 8937453497e..d404a2c128d 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md @@ -10299,7 +10299,7 @@ ip access-list standard ACL-SSH-VRF | Sequence | Action | | -------- | ------ | -| 10 | remark ACL to restrict access to switch API to CVP and Ansible etc | +| 10 | remark ACL to restrict access to switch API to CVP and Ansible | | 20 | deny ip host 192.0.2.1 any | | 30 | permit ip 192.0.2.0/24 any | @@ -10354,7 +10354,7 @@ ip access-list 4 30 permit ip 192.0.2.0/24 any ! ip access-list ACL-01 - 10 remark ACL to restrict access to switch API to CVP and Ansible etc + 10 remark ACL to restrict access to switch API to CVP and Ansible 20 deny ip host 192.0.2.1 any 30 permit ip 192.0.2.0/24 any ! diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg index cdaac83a319..d985bd9eb04 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg @@ -4273,7 +4273,7 @@ ip access-list 4 30 permit ip 192.0.2.0/24 any ! ip access-list ACL-01 - 10 remark ACL to restrict access to switch API to CVP and Ansible etc + 10 remark ACL to restrict access to switch API to CVP and Ansible 20 deny ip host 192.0.2.1 any 30 permit ip 192.0.2.0/24 any ! diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml index b62a8a203ef..14d49748bbd 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml @@ -12,7 +12,7 @@ access_lists: - name: ACL-01 sequence_numbers: - sequence: 10 - action: "remark ACL to restrict access to switch API to CVP and Ansible etc" + action: "remark ACL to restrict access to switch API to CVP and Ansible" - sequence: 20 action: "deny ip host 192.0.2.1 any" - sequence: 30 From 98f8cdb83c38ea326fe92394c5b337c2b0a6d510 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 16:32:25 +0530 Subject: [PATCH 263/324] Fail the molecule eos_cli_config_gen --- .github/workflows/pull-request-management.yml | 8 +++++++- .../eos_cli_config_gen/inventory/host_vars/host1/acl.yml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index e8f3760adcc..e12cb2b6abe 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -225,7 +225,13 @@ jobs: run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}' --upgrade" - name: Run molecule action run: " . /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - # - uses: actions/upload-artifact@v4 + - name: Check status + run: | + if [[ -n "$(git status --porcelain)" ]]; then + echo "❌ Changes detected! Failing the job..." + git diff + exit 1 + # - uses: actions/upload-artifact@v4 # with: # name: molecule-${{ matrix.avd_scenario }}-artifacts # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml index 14d49748bbd..b62a8a203ef 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml @@ -12,7 +12,7 @@ access_lists: - name: ACL-01 sequence_numbers: - sequence: 10 - action: "remark ACL to restrict access to switch API to CVP and Ansible" + action: "remark ACL to restrict access to switch API to CVP and Ansible etc" - sequence: 20 action: "deny ip host 192.0.2.1 any" - sequence: 30 From e6cd5605466e0a352c2b22de6eb05cd6bda5eb68 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 16:39:51 +0530 Subject: [PATCH 264/324] add fi --- .github/workflows/pull-request-management.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index e12cb2b6abe..81d5f43e071 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -231,6 +231,7 @@ jobs: echo "❌ Changes detected! Failing the job..." git diff exit 1 + fi # - uses: actions/upload-artifact@v4 # with: # name: molecule-${{ matrix.avd_scenario }}-artifacts From 980b3565092804d97c87ad7e9183a31a7de71fdd Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 16:48:00 +0530 Subject: [PATCH 265/324] install git --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 81d5f43e071..ee43fe870f8 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -220,7 +220,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install CA certificate - run: apt-get update && apt-get install -y --no-install-recommends ca-certificates + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates git - name: Install the specified Ansible version run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}' --upgrade" - name: Run molecule action From ea62eb14e78aba4afb71dd3dc1b1defe8d0ae051 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 17:00:36 +0530 Subject: [PATCH 266/324] pwd --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index ee43fe870f8..50f3c0ee98e 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -227,6 +227,8 @@ jobs: run: " . /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - name: Check status run: | + pwd + cd /avd if [[ -n "$(git status --porcelain)" ]]; then echo "❌ Changes detected! Failing the job..." git diff From d7431fee274eda153ea46d85331b8a9e59716683 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 17:09:28 +0530 Subject: [PATCH 267/324] git status --- .github/workflows/pull-request-management.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 50f3c0ee98e..794cda00d76 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -227,13 +227,14 @@ jobs: run: " . /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - name: Check status run: | - pwd - cd /avd - if [[ -n "$(git status --porcelain)" ]]; then - echo "❌ Changes detected! Failing the job..." - git diff - exit 1 - fi + ls -l + git status + # pwd + # if [[ -n "$(git status --porcelain)" ]]; then + # echo "❌ Changes detected! Failing the job..." + # git diff + # exit 1 + # fi # - uses: actions/upload-artifact@v4 # with: # name: molecule-${{ matrix.avd_scenario }}-artifacts From c278f33176f225a315176988f6d04622ea314807 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 17:22:31 +0530 Subject: [PATCH 268/324] add volume --- .github/workflows/pull-request-management.yml | 103 +++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 794cda00d76..5f59eb5946d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -90,6 +90,105 @@ jobs: pyavd: - 'python_avd/*' - 'python_avd/**/*' + + # ----------------------------------- # + # Build Collection + # ----------------------------------- # + build_collection: + name: Build Ansible collection + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v5 + with: + python-version: | + 3.12 + - uses: actions/checkout@v4 + - name: "Install Python & Ansible requirements" + run: | + # distlib is required when using manifest + pip install "ansible-core<2.19.0" distlib --upgrade + - name: "Build Ansible collection" + run: | + ansible-galaxy collection build -vvv --force ansible_collections/arista/avd + - name: Upload collection + uses: actions/upload-artifact@v4 + with: + name: avd-collection + path: ./arista-avd-*.tar.gz + + # ----------------------------------- # + # Galaxy Importer + # ----------------------------------- # + galaxy_importer: + name: Test galaxy-importer + runs-on: ubuntu-latest + needs: [build_collection] + steps: + - uses: actions/setup-python@v5 + with: + python-version: | + 3.11 + - uses: actions/checkout@v4 + - name: "Install Python & Ansible requirements" + run: | + pip install "ansible-core==2.16.0" + - name: Download collection + uses: actions/download-artifact@v4 + with: + name: avd-collection + - name: Install galaxy-importer + # Install the specific version of galaxy-importer used on galaxy.ansible.com + # The version conflicts with our requirements, + # so we let the galaxy-importer version resolve remaining requirements. + run: | + pip install "galaxy-importer==0.4.26" + - name: "Run galaxy-importer checks" + run: python -m galaxy_importer.main *.tar.gz + - uses: actions/upload-artifact@v4 + with: + name: importer-logs + path: ./importer_result.json + + # ----------------------------------- # + # Ansible Lint + # Run on the built collection from Galaxy importer + # ----------------------------------- # + ansible_lint: + name: Run ansible-lint test case + runs-on: ubuntu-latest + needs: [build_collection] + env: + ANSIBLE_COLLECTIONS_PATH: /home/runner/work/avd/avd + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3 + uses: actions/setup-python@v5 + with: + python-version: | + 3.10 + 3.11 + 3.12 + 3.13 + - name: "Install Python & Ansible requirements" + run: | + pip install -r .github/requirements-ci-dev.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + - name: Download collection + uses: actions/download-artifact@v4 + with: + name: avd-collection + - name: "Extract collection" + run: | + mkdir collections + tar xvzf arista-avd-*.tar.gz -C collections + - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" + working-directory: collections + run: | + sed -i 's/- syntax-check/# - syntax-check/g' .ansible-lint + - name: "Run ansible-lint" + working-directory: collections + run: | + ansible-lint --force-color --strict -v + avd-base-image: runs-on: ubuntu-latest outputs: @@ -202,6 +301,7 @@ jobs: runs-on: ubuntu-latest container: image: ${{ needs.build-pyavd.outputs.build_image_tag }} + options: --volume "${{ github.workspace }}:/workspace" strategy: fail-fast: true matrix: @@ -224,10 +324,11 @@ jobs: - name: Install the specified Ansible version run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}' --upgrade" - name: Run molecule action - run: " . /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + run: " . /venvs/UV3.11/bin/activate && ls- l && cd /workspace/avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - name: Check status run: | ls -l + cd /workspace/avd/ git status # pwd # if [[ -n "$(git status --porcelain)" ]]; then From 54fd21c20572cc9715611c48564f8800245ab6db Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 17:31:39 +0530 Subject: [PATCH 269/324] add volume --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 5f59eb5946d..af7334f42e5 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -530,7 +530,7 @@ jobs: # - name: "Run ansible-test integration test cases" # run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - ansible_lint: + ansible_lint_job: name: Run ansible-lint test case runs-on: ubuntu-latest needs: [build-pyavd] From 1b64f96ab642b5c4d68bc54eab4ef277613efe56 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 17:38:06 +0530 Subject: [PATCH 270/324] fix workspace path --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index af7334f42e5..d9a46d60d0c 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -324,7 +324,7 @@ jobs: - name: Install the specified Ansible version run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}' --upgrade" - name: Run molecule action - run: " . /venvs/UV3.11/bin/activate && ls- l && cd /workspace/avd/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + run: " . /venvs/UV3.11/bin/activate && ls -l && cd /workspace/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - name: Check status run: | ls -l From 3211e8c82f2f937b56e272161183628d393f261d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 17:46:48 +0530 Subject: [PATCH 271/324] fix workspace path --- .github/workflows/pull-request-management.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d9a46d60d0c..c005618b0b7 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -328,7 +328,8 @@ jobs: - name: Check status run: | ls -l - cd /workspace/avd/ + cd /workspace + ls -l git status # pwd # if [[ -n "$(git status --porcelain)" ]]; then From 4205f8b0ddeaa5c655208746358c7749ca8c8270 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 17:56:21 +0530 Subject: [PATCH 272/324] fix workspace path --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index c005618b0b7..edbe3b5b6e0 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -327,9 +327,9 @@ jobs: run: " . /venvs/UV3.11/bin/activate && ls -l && cd /workspace/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - name: Check status run: | - ls -l + ls -al cd /workspace - ls -l + ls -la /workspace/.git || echo ".git not found!" git status # pwd # if [[ -n "$(git status --porcelain)" ]]; then From abedafbdaa5df5a23d260ad0b528f63972413cb4 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 19:04:39 +0530 Subject: [PATCH 273/324] test molecule --- .github/workflows/pull-request-management.yml | 188 +++++++++--------- .../inventory/host_vars/host1/acl.yml | 1 + 2 files changed, 95 insertions(+), 94 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index edbe3b5b6e0..5280f2b6b0d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -258,40 +258,40 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - name: Set Build Image Tag - id: set-build-tag - run: | - SHORT_SHA=$(git rev-parse --short HEAD) - BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" - echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" - - name: Echo image name - run: echo ${{ needs.avd-base-image.outputs.base_image_tag }} - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push PyAVD Image - uses: docker/build-push-action@v6 - with: - file: .github/DockerfileBuild - push: true - target: run - tags: ${{ steps.set-build-tag.outputs.build_image_tag }} - build-args: - BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} - cache-from: type=gha - cache-to: | - type=gha,mode=max - type=registry,ref=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest - outputs: type=image,push=true + # - name: Convert GitHub username to lowercase + # id: lowercase + # run: | + # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + # - name: Set Build Image Tag + # id: set-build-tag + # run: | + # SHORT_SHA=$(git rev-parse --short HEAD) + # BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" + # echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" + # - name: Echo image name + # run: echo ${{ needs.avd-base-image.outputs.base_image_tag }} + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v2 + # with: + # registry: ghcr.io + # username: ${{ steps.lowercase.outputs.lowercase }} + # password: ${{ secrets.GITHUB_TOKEN }} + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + # - name: Build and push PyAVD Image + # uses: docker/build-push-action@v6 + # with: + # file: .github/DockerfileBuild + # push: true + # target: run + # tags: ${{ steps.set-build-tag.outputs.build_image_tag }} + # build-args: + # BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} + # cache-from: type=gha + # cache-to: | + # type=gha,mode=max + # type=registry,ref=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest + # outputs: type=image,push=true # ----------------------------------- # # EOS CLI CONFIG GEN MOLECULE @@ -300,8 +300,8 @@ jobs: name: Validate eos_cli_config_gen runs-on: ubuntu-latest container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - options: --volume "${{ github.workspace }}:/workspace" + image: ghcr.io/shivani-gslab/avd-base:latest + # options: --volume "${{ github.workspace }}:/workspace" strategy: fail-fast: true matrix: @@ -324,19 +324,19 @@ jobs: - name: Install the specified Ansible version run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}' --upgrade" - name: Run molecule action - run: " . /venvs/UV3.11/bin/activate && ls -l && cd /workspace/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - - name: Check status - run: | - ls -al - cd /workspace - ls -la /workspace/.git || echo ".git not found!" - git status - # pwd - # if [[ -n "$(git status --porcelain)" ]]; then - # echo "❌ Changes detected! Failing the job..." - # git diff - # exit 1 - # fi + run: " . /venvs/UV3.11/bin/activate && ls -l && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + # - name: Check status + # run: | + # ls -al + # cd /workspace + # ls -la /workspace/.git || echo ".git not found!" + # git status + # # pwd + # # if [[ -n "$(git status --porcelain)" ]]; then + # # echo "❌ Changes detected! Failing the job..." + # # git diff + # # exit 1 + # # fi # - uses: actions/upload-artifact@v4 # with: # name: molecule-${{ matrix.avd_scenario }}-artifacts @@ -466,7 +466,7 @@ jobs: name: Validate eos_validate_state runs-on: ubuntu-latest container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} + image: ghcr.io/shivani-gslab/avd-base:latest strategy: fail-fast: true matrix: @@ -491,34 +491,48 @@ jobs: # ----------------------------------- # # Ansible tests # ----------------------------------- # - ansible_test_sanity: - name: Run ansible-test sanity validation - runs-on: ubuntu-latest - needs: [build-pyavd] - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Install CA certificate - run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - - name: "Run ansible-test sanity" - run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + # ansible_test_sanity: + # name: Run ansible-test sanity validation + # runs-on: ubuntu-latest + # needs: [build-pyavd] + # container: + # image: ${{ needs.build-pyavd.outputs.build_image_tag }} + # steps: + # - name: Check out repository code + # uses: actions/checkout@v4 + # - name: Install CA certificate + # run: apt-get update && apt-get install -y --no-install-recommends ca-certificates + # - name: "Run ansible-test sanity" + # run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - ansible_test_units: - name: Run ansible-test units test cases - runs-on: ubuntu-latest - needs: [build-pyavd] - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: "Run ansible-test units test cases" - run: ". /venvs/UV3.12/bin/activate && python --version && cd ansible_collections/arista/avd && ansible-test units -vv" + # ansible_test_units: + # name: Run ansible-test units test cases + # runs-on: ubuntu-latest + # needs: [build-pyavd] + # container: + # image: ${{ needs.build-pyavd.outputs.build_image_tag }} + # steps: + # - name: Check out repository code + # uses: actions/checkout@v4 + # - name: "Run ansible-test units test cases" + # run: ". /venvs/UV3.12/bin/activate && python --version && cd ansible_collections/arista/avd && ansible-test units -vv" + + # # ansible_test_integration: + # # name: Run ansible-test integration test cases + # # runs-on: ubuntu-latest + # # needs: [build-pyavd] + # # container: + # # image: ${{ needs.build-pyavd.outputs.build_image_tag }} + # # steps: + # # - name: Check out repository code + # # uses: actions/checkout@v4 + # # # - name: Install ssh-keygen + # # # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client + # # - name: "Run ansible-test integration test cases" + # # run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - # ansible_test_integration: - # name: Run ansible-test integration test cases + # ansible_lint_job: + # name: Run ansible-lint test case # runs-on: ubuntu-latest # needs: [build-pyavd] # container: @@ -526,25 +540,11 @@ jobs: # steps: # - name: Check out repository code # uses: actions/checkout@v4 - # # - name: Install ssh-keygen - # # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client + # - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" + # run: | + # sed -i 's/- syntax-check/# - syntax-check/g' ansible_collections/arista/avd/.ansible-lint # - name: "Run ansible-test integration test cases" - # run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - - ansible_lint_job: - name: Run ansible-lint test case - runs-on: ubuntu-latest - needs: [build-pyavd] - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" - run: | - sed -i 's/- syntax-check/# - syntax-check/g' ansible_collections/arista/avd/.ansible-lint - - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + # run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml index b62a8a203ef..702427c6c4b 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml @@ -23,6 +23,7 @@ access_lists: sequence_numbers: - sequence: 10 action: "remark ACL to restrict access RFC1918 addresses" + name: shivani - sequence: 20 action: "permit ip 10.0.0.0/8 any" - sequence: 30 From 65fb46f989f77770e2754f3f8657725239d81f9e Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 19:09:10 +0530 Subject: [PATCH 274/324] test molecule --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 5280f2b6b0d..3261507fa37 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -300,7 +300,7 @@ jobs: name: Validate eos_cli_config_gen runs-on: ubuntu-latest container: - image: ghcr.io/shivani-gslab/avd-base:latest + image: ghcr.io/shivani-gslab/avd-base:778-946c060 # options: --volume "${{ github.workspace }}:/workspace" strategy: fail-fast: true From ab8f62466fd11966c1c3c3b9aa25f4b01f968f31 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 19:13:08 +0530 Subject: [PATCH 275/324] test molecule --- .../eos_cli_config_gen/inventory/host_vars/host1/acl.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml index 702427c6c4b..b62a8a203ef 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/acl.yml @@ -23,7 +23,6 @@ access_lists: sequence_numbers: - sequence: 10 action: "remark ACL to restrict access RFC1918 addresses" - name: shivani - sequence: 20 action: "permit ip 10.0.0.0/8 any" - sequence: 30 From c336875a8862b599c1e9c85950524bd7595fe22c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 19:23:22 +0530 Subject: [PATCH 276/324] test molecule --- .github/workflows/pull-request-management.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 3261507fa37..7fefa4f02e4 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -324,13 +324,15 @@ jobs: - name: Install the specified Ansible version run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}' --upgrade" - name: Run molecule action - run: " . /venvs/UV3.11/bin/activate && ls -l && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - # - name: Check status - # run: | - # ls -al - # cd /workspace - # ls -la /workspace/.git || echo ".git not found!" - # git status + run: " . /venvs/UV3.11/bin/activate && git init && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + - name: Check status + run: | + cd /workspace # Ensure you're in the correct directory + git init + git add . + git commit -m "Initial commit inside container" + git status # Shows modified files after running Molecule + git diff # # pwd # # if [[ -n "$(git status --porcelain)" ]]; then # # echo "❌ Changes detected! Failing the job..." From b8237c5b0ae8501cc28150530ee189ff8885b31c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 19:24:24 +0530 Subject: [PATCH 277/324] test molecule --- .github/workflows/pull-request-management.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 7fefa4f02e4..ac3f090d3d4 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -301,7 +301,7 @@ jobs: runs-on: ubuntu-latest container: image: ghcr.io/shivani-gslab/avd-base:778-946c060 - # options: --volume "${{ github.workspace }}:/workspace" + options: --volume "${{ github.workspace }}:/workspace" strategy: fail-fast: true matrix: @@ -323,14 +323,16 @@ jobs: run: apt-get update && apt-get install -y --no-install-recommends ca-certificates git - name: Install the specified Ansible version run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}' --upgrade" - - name: Run molecule action - run: " . /venvs/UV3.11/bin/activate && git init && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - name: Check status run: | cd /workspace # Ensure you're in the correct directory git init git add . git commit -m "Initial commit inside container" + - name: Run molecule action + run: " . /venvs/UV3.11/bin/activate && git init && cd /workspace/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + - name: Check status + run: | git status # Shows modified files after running Molecule git diff # # pwd From 5bfcbd5e7a727e96bdf5bad5da3852b46ab0a166 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 19:30:56 +0530 Subject: [PATCH 278/324] test status --- .github/workflows/pull-request-management.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index ac3f090d3d4..5a575ae5b62 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -326,6 +326,7 @@ jobs: - name: Check status run: | cd /workspace # Ensure you're in the correct directory + git config --global --add safe.directory /workspace git init git add . git commit -m "Initial commit inside container" From 1adc200965ad31a01e78b6b3392c56698181ff37 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 19:33:58 +0530 Subject: [PATCH 279/324] git config --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 5a575ae5b62..7fc7e3d6dd5 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -326,6 +326,8 @@ jobs: - name: Check status run: | cd /workspace # Ensure you're in the correct directory + git config --global user.email "schourasiya-ext@arista.com" + git config --global user.name "Shivani chourasiya" git config --global --add safe.directory /workspace git init git add . From 47b8c3ab21b0dfd76b7ae4df14efbd58fdfee63a Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 19:37:43 +0530 Subject: [PATCH 280/324] git config --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 7fc7e3d6dd5..2ad67676b35 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -328,7 +328,7 @@ jobs: cd /workspace # Ensure you're in the correct directory git config --global user.email "schourasiya-ext@arista.com" git config --global user.name "Shivani chourasiya" - git config --global --add safe.directory /workspace + git config --global --add safe.directory $(pwd) git init git add . git commit -m "Initial commit inside container" From 821f411c3f2d9574c5074c1101693d0e22936753 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 19:41:40 +0530 Subject: [PATCH 281/324] git config --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 2ad67676b35..e4fb528a94b 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -336,6 +336,8 @@ jobs: run: " . /venvs/UV3.11/bin/activate && git init && cd /workspace/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - name: Check status run: | + cd /workspace + git config --global --add safe.directory $(pwd) git status # Shows modified files after running Molecule git diff # # pwd From aa1cc03266d3a74b083c04c80fed7b3909900518 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 19:45:26 +0530 Subject: [PATCH 282/324] git config --- .github/workflows/pull-request-management.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index e4fb528a94b..e208a8270e0 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -337,15 +337,15 @@ jobs: - name: Check status run: | cd /workspace - git config --global --add safe.directory $(pwd) - git status # Shows modified files after running Molecule - git diff - # # pwd - # # if [[ -n "$(git status --porcelain)" ]]; then - # # echo "❌ Changes detected! Failing the job..." - # # git diff - # # exit 1 - # # fi + # git config --global --add safe.directory $(pwd) + # git status # Shows modified files after running Molecule + # git diff + # pwd + if [[ -n "$(git status --porcelain)" ]]; then + echo "❌ Changes detected! Failing the job..." + git diff + exit 1 + fi # - uses: actions/upload-artifact@v4 # with: # name: molecule-${{ matrix.avd_scenario }}-artifacts From 002fdece91318769f6ff50c1c15c8d43512d4329 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Thu, 27 Feb 2025 19:48:46 +0530 Subject: [PATCH 283/324] git config --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index e208a8270e0..6a5e9342fbb 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -341,7 +341,7 @@ jobs: # git status # Shows modified files after running Molecule # git diff # pwd - if [[ -n "$(git status --porcelain)" ]]; then + if [ -n "$(git status --porcelain)" ]; then echo "❌ Changes detected! Failing the job..." git diff exit 1 From 70e13a02ae92eb89d0995851ff2ec0aa3398e55f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 12:30:00 +0530 Subject: [PATCH 284/324] build wheel --- .github/workflows/pull-request-management.yml | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 6a5e9342fbb..f55651a8f1a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -248,7 +248,37 @@ jobs: tags: ${{ steps.set-base-tag.outputs.base_image_tag }} cache-from: type=gha,scope=base-run cache-to: type=gha,mode=max,scope=base-run + + build-pyavd-package: + name: Build pyavd + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v5 + with: + python-version: | + 3.12 + + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --no-cache-dir build + + - name: Build PyAVD wheel + run: | + cd python-avd + mkdir -p /tmp/wheels + python -m build --wheel --outdir /tmp/wheels + ls -l /tmp/wheels # Verify the wheel is created + - name: Upload PyAVD wheel as an artifact + uses: actions/upload-artifact@v4 + with: + name: pyavd-wheel + path: /tmp/wheels/*.whl + retention-days: 7 + build-pyavd: name: Install pyavd and Build Image needs: [avd-base-image] @@ -325,7 +355,7 @@ jobs: run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}' --upgrade" - name: Check status run: | - cd /workspace # Ensure you're in the correct directory + cd /workspace git config --global user.email "schourasiya-ext@arista.com" git config --global user.name "Shivani chourasiya" git config --global --add safe.directory $(pwd) @@ -337,10 +367,6 @@ jobs: - name: Check status run: | cd /workspace - # git config --global --add safe.directory $(pwd) - # git status # Shows modified files after running Molecule - # git diff - # pwd if [ -n "$(git status --porcelain)" ]; then echo "❌ Changes detected! Failing the job..." git diff From 1a17c8d6f4ee30e78c68a9f68e6d643be6cc5688 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 14:17:43 +0530 Subject: [PATCH 285/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 3 - .github/workflows/pull-request-management.yml | 73 ++++++++++--------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index e6174867645..b7998d0585f 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,11 +2,8 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build COPY . /avd -WORKDIR /avd/python-avd RUN apt-get update && apt-get install -y --no-install-recommends make && \ - /venvs/UV3.11/bin/python -m pip install --break-system-packages build && \ - /venvs/UV3.11/bin/python -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index f55651a8f1a..db5aadcb85d 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -288,40 +288,45 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 - # - name: Convert GitHub username to lowercase - # id: lowercase - # run: | - # echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - # - name: Set Build Image Tag - # id: set-build-tag - # run: | - # SHORT_SHA=$(git rev-parse --short HEAD) - # BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" - # echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" - # - name: Echo image name - # run: echo ${{ needs.avd-base-image.outputs.base_image_tag }} - # - name: Log in to GitHub Container Registry - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ steps.lowercase.outputs.lowercase }} - # password: ${{ secrets.GITHUB_TOKEN }} - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 - # - name: Build and push PyAVD Image - # uses: docker/build-push-action@v6 - # with: - # file: .github/DockerfileBuild - # push: true - # target: run - # tags: ${{ steps.set-build-tag.outputs.build_image_tag }} - # build-args: - # BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} - # cache-from: type=gha - # cache-to: | - # type=gha,mode=max - # type=registry,ref=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest - # outputs: type=image,push=true + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + - name: Set Build Image Tag + id: set-build-tag + run: | + SHORT_SHA=$(git rev-parse --short HEAD) + BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" + echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" + - name: Echo image name + run: echo ${{ needs.avd-base-image.outputs.base_image_tag }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Download Wheel Package + uses: actions/download-artifact@v4 + with: + name: pyavd-wheel + path: /tmp/wheels + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push PyAVD Image + uses: docker/build-push-action@v6 + with: + file: .github/DockerfileBuild + push: true + target: run + tags: ${{ steps.set-build-tag.outputs.build_image_tag }} + build-args: + BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} + cache-from: type=gha + cache-to: | + type=gha,mode=max + type=registry,ref=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest + outputs: type=image,push=true # ----------------------------------- # # EOS CLI CONFIG GEN MOLECULE From 1d2141265451f42aed47d3c34a3c66b4c5d6e4db Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 14:22:17 +0530 Subject: [PATCH 286/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index db5aadcb85d..69f37407f1b 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -281,7 +281,7 @@ jobs: build-pyavd: name: Install pyavd and Build Image - needs: [avd-base-image] + needs: [build-pyavd-package, avd-base-image] runs-on: ubuntu-latest outputs: build_image_tag: ${{ steps.set-build-tag.outputs.build_image_tag }} From c179e6f80582dcfdb8d57fd8d4ea080e9eff452f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 14:25:47 +0530 Subject: [PATCH 287/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index b7998d0585f..0a79bf76155 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -1,7 +1,7 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build -COPY . /avd +COPY . /tmp/wheels RUN apt-get update && apt-get install -y --no-install-recommends make && \ for VERSION in 3.10 3.11 3.12 3.13; do \ From 4546fbece3a7013d16235d27bd46c7f6549e67e4 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 14:31:04 +0530 Subject: [PATCH 288/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 0a79bf76155..b5ebbc21cb5 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,7 +2,7 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build COPY . /tmp/wheels - +RUN ls-l && echo ${pwd} RUN apt-get update && apt-get install -y --no-install-recommends make && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ From 8311287f8a25fa4014258dbf7bc2ddbaa90c6147 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 14:35:34 +0530 Subject: [PATCH 289/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index b5ebbc21cb5..1e254efa878 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -1,8 +1,12 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build -COPY . /tmp/wheels -RUN ls-l && echo ${pwd} +# Copy wheel package from CI artifacts to /tmp/wheels +COPY /tmp/wheels /tmp/wheels + +# Debugging: Check if files exist +RUN ls -l /tmp/wheels && echo "Current directory: $(pwd)" + RUN apt-get update && apt-get install -y --no-install-recommends make && \ for VERSION in 3.10 3.11 3.12 3.13; do \ /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ From 6aace11245b25aee61df70ab70c810391e613b6c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 14:42:06 +0530 Subject: [PATCH 290/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 69f37407f1b..e2cb186e6af 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -311,6 +311,8 @@ jobs: with: name: pyavd-wheel path: /tmp/wheels + - name: check artifacts + run: ls -l /tmp/wheels - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push PyAVD Image From 1ecceb79abc3c07d5799905f72026f68f9eda223 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 14:44:59 +0530 Subject: [PATCH 291/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 1e254efa878..36589bbdf49 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,7 +2,7 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build # Copy wheel package from CI artifacts to /tmp/wheels -COPY /tmp/wheels /tmp/wheels +COPY /tmp/wheels . # Debugging: Check if files exist RUN ls -l /tmp/wheels && echo "Current directory: $(pwd)" From 421859554b433ad301852bb6b94c0cea49b365bd Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 14:47:50 +0530 Subject: [PATCH 292/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 36589bbdf49..33a74a3cf3f 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,10 +2,10 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build # Copy wheel package from CI artifacts to /tmp/wheels -COPY /tmp/wheels . +# COPY /tmp/wheels . # Debugging: Check if files exist -RUN ls -l /tmp/wheels && echo "Current directory: $(pwd)" +RUN echo "Current directory: $(pwd)" && ls -al RUN apt-get update && apt-get install -y --no-install-recommends make && \ for VERSION in 3.10 3.11 3.12 3.13; do \ From ff69a4505cb108add5e67ae864850d955abe551f Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 14:51:01 +0530 Subject: [PATCH 293/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 33a74a3cf3f..02afa846fb5 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -5,7 +5,8 @@ LABEL stage=build # COPY /tmp/wheels . # Debugging: Check if files exist -RUN echo "Current directory: $(pwd)" && ls -al +RUN echo "Current directory: $(pwd)" && ls -al tmp/ +# WORKDIR /tmp RUN apt-get update && apt-get install -y --no-install-recommends make && \ for VERSION in 3.10 3.11 3.12 3.13; do \ From 03f3dc1a4a6d91e45cdc07cfef0c8338f054dfd4 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 14:55:45 +0530 Subject: [PATCH 294/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 02afa846fb5..5e639f1809c 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,10 +2,10 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build # Copy wheel package from CI artifacts to /tmp/wheels -# COPY /tmp/wheels . +COPY /tmp /tmp/wheels # Debugging: Check if files exist -RUN echo "Current directory: $(pwd)" && ls -al tmp/ +RUN echo "Current directory: $(pwd)" && ls -al /tmp # WORKDIR /tmp RUN apt-get update && apt-get install -y --no-install-recommends make && \ From ba0613fb3ed6f7378a687f3d4148cad28eb645cd Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:01:36 +0530 Subject: [PATCH 295/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 4 ++-- .github/workflows/pull-request-management.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 5e639f1809c..67513fe58c3 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,10 +2,10 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build # Copy wheel package from CI artifacts to /tmp/wheels -COPY /tmp /tmp/wheels +COPY wheels /tmp/wheels # Debugging: Check if files exist -RUN echo "Current directory: $(pwd)" && ls -al /tmp +RUN echo "Current directory: $(pwd)" && ls -al /tmp/wheels # WORKDIR /tmp RUN apt-get update && apt-get install -y --no-install-recommends make && \ diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index e2cb186e6af..bf3c81fefff 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -310,7 +310,7 @@ jobs: uses: actions/download-artifact@v4 with: name: pyavd-wheel - path: /tmp/wheels + path: ./wheels - name: check artifacts run: ls -l /tmp/wheels - name: Set up Docker Buildx From 972a0c39d4e12fc4d8db082075e6887a7ffcf5dd Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:03:32 +0530 Subject: [PATCH 296/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index bf3c81fefff..e88d645ed72 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -311,8 +311,8 @@ jobs: with: name: pyavd-wheel path: ./wheels - - name: check artifacts - run: ls -l /tmp/wheels + # - name: check artifacts + # run: ls -l /tmp/wheels - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push PyAVD Image From 74f2f0f4d890f357a7821ccfc580865f26b023ae Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:06:20 +0530 Subject: [PATCH 297/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index e88d645ed72..d44035eaa58 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -310,9 +310,10 @@ jobs: uses: actions/download-artifact@v4 with: name: pyavd-wheel - path: ./wheels - # - name: check artifacts - # run: ls -l /tmp/wheels + path: wheels # ✅ Store wheels in the repo (inside build context) + + - name: Verify Wheel Package Exists + run: ls -l wheels || echo "❌ No wheel package found!" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push PyAVD Image From 53e8167b340ff1cc529fc9f9cee4f2d372701fa2 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:16:36 +0530 Subject: [PATCH 298/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 4 ++-- .github/workflows/pull-request-management.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 67513fe58c3..953339ea18e 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,7 +2,7 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build # Copy wheel package from CI artifacts to /tmp/wheels -COPY wheels /tmp/wheels +COPY . /wheels # Debugging: Check if files exist RUN echo "Current directory: $(pwd)" && ls -al /tmp/wheels @@ -10,7 +10,7 @@ RUN echo "Current directory: $(pwd)" && ls -al /tmp/wheels RUN apt-get update && apt-get install -y --no-install-recommends make && \ for VERSION in 3.10 3.11 3.12 3.13; do \ - /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ + /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /wheels/*.whl; \ done FROM ubuntu:latest AS run diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d44035eaa58..5c634662cee 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -310,7 +310,7 @@ jobs: uses: actions/download-artifact@v4 with: name: pyavd-wheel - path: wheels # ✅ Store wheels in the repo (inside build context) + path: wheels - name: Verify Wheel Package Exists run: ls -l wheels || echo "❌ No wheel package found!" From 45982d8d2a32ae9f5c884db577be61c9fb463525 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:21:15 +0530 Subject: [PATCH 299/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 953339ea18e..d02a6e8f1b6 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -5,7 +5,7 @@ LABEL stage=build COPY . /wheels # Debugging: Check if files exist -RUN echo "Current directory: $(pwd)" && ls -al /tmp/wheels +RUN echo "Current directory: $(pwd)" && ls -al /wheels # WORKDIR /tmp RUN apt-get update && apt-get install -y --no-install-recommends make && \ From d99c4f4947d5297cc611d522196d91556e914408 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:25:37 +0530 Subject: [PATCH 300/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index d02a6e8f1b6..6702e2e2861 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,10 +2,10 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build # Copy wheel package from CI artifacts to /tmp/wheels -COPY . /wheels +COPY /wheels . # Debugging: Check if files exist -RUN echo "Current directory: $(pwd)" && ls -al /wheels +RUN echo "Current directory: $(pwd)" && ls -al # WORKDIR /tmp RUN apt-get update && apt-get install -y --no-install-recommends make && \ From 4d4dce8f57e6e6d34f5312e5944d8d1b652b7ad6 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:25:46 +0530 Subject: [PATCH 301/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 6702e2e2861..15d6128f63d 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -10,7 +10,7 @@ RUN echo "Current directory: $(pwd)" && ls -al RUN apt-get update && apt-get install -y --no-install-recommends make && \ for VERSION in 3.10 3.11 3.12 3.13; do \ - /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /wheels/*.whl; \ + /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /*.whl; \ done FROM ubuntu:latest AS run From 140d19f83916086f6eab0ffa851965b83f04174d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:29:43 +0530 Subject: [PATCH 302/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 5c634662cee..fe262e2db83 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -310,10 +310,10 @@ jobs: uses: actions/download-artifact@v4 with: name: pyavd-wheel - path: wheels - - - name: Verify Wheel Package Exists - run: ls -l wheels || echo "❌ No wheel package found!" + path: /tmp/wheels + - name: Move Wheel Package to Build Context + run: | + mv /tmp/wheels ./wheels - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push PyAVD Image From ecb3088a0bee6694c0705b0142a8f25477f4fd16 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:31:15 +0530 Subject: [PATCH 303/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 15d6128f63d..6c3b95af1be 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,7 +2,7 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build # Copy wheel package from CI artifacts to /tmp/wheels -COPY /wheels . +# COPY /wheels . # Debugging: Check if files exist RUN echo "Current directory: $(pwd)" && ls -al From a7ce672191bebd6f47e22df48cb90231ed51e92e Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:34:29 +0530 Subject: [PATCH 304/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index fe262e2db83..961499c3a5f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -313,7 +313,7 @@ jobs: path: /tmp/wheels - name: Move Wheel Package to Build Context run: | - mv /tmp/wheels ./wheels + mv /tmp/wheels /wheels - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push PyAVD Image From 5f4de51cb672e228485b8962495cda39d643f6be Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:37:23 +0530 Subject: [PATCH 305/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 961499c3a5f..80aad623356 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -313,7 +313,9 @@ jobs: path: /tmp/wheels - name: Move Wheel Package to Build Context run: | - mv /tmp/wheels /wheels + mv /tmp/wheels ./wheels + - name: Get Full Path of Wheels Directory + run: echo "WHEELS_PATH=$(realpath ./wheels)" >> $GITHUB_ENV - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push PyAVD Image From 52f1ac1ad13bfafbd0eed74f68e80e0df3de4013 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:39:11 +0530 Subject: [PATCH 306/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 80aad623356..28ca5f4657a 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -316,6 +316,8 @@ jobs: mv /tmp/wheels ./wheels - name: Get Full Path of Wheels Directory run: echo "WHEELS_PATH=$(realpath ./wheels)" >> $GITHUB_ENV + - name: Use Full Path + run: echo "The wheels directory is at: $WHEELS_PATH" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push PyAVD Image From 5342a426b578b191bcea95e43ad8d78b5874e280 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:41:18 +0530 Subject: [PATCH 307/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 28ca5f4657a..cc95e24d98f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -317,7 +317,8 @@ jobs: - name: Get Full Path of Wheels Directory run: echo "WHEELS_PATH=$(realpath ./wheels)" >> $GITHUB_ENV - name: Use Full Path - run: echo "The wheels directory is at: $WHEELS_PATH" + run: | + echo "The wheels directory is at: $WHEELS_PATH" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push PyAVD Image From 0f729347e4f219c255eb38788e5ccd1fbad98ab7 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:44:36 +0530 Subject: [PATCH 308/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 6c3b95af1be..8684678f0e6 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,11 +2,11 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build # Copy wheel package from CI artifacts to /tmp/wheels -# COPY /wheels . +COPY . /avd/wheels # Debugging: Check if files exist RUN echo "Current directory: $(pwd)" && ls -al -# WORKDIR /tmp +WORKDIR /avd/wheels RUN apt-get update && apt-get install -y --no-install-recommends make && \ for VERSION in 3.10 3.11 3.12 3.13; do \ From 7727be1d2c5212fac3770686dd5238e2e21b5e52 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:47:28 +0530 Subject: [PATCH 309/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 8684678f0e6..7282c9dfb4f 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -5,7 +5,7 @@ LABEL stage=build COPY . /avd/wheels # Debugging: Check if files exist -RUN echo "Current directory: $(pwd)" && ls -al +RUN echo "Current directory: $(pwd)" && ls -al /avd/wheels WORKDIR /avd/wheels RUN apt-get update && apt-get install -y --no-install-recommends make && \ From d50a875c9ba2e122e1753244d8b5a6f01fa09943 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:53:45 +0530 Subject: [PATCH 310/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 7282c9dfb4f..37232840277 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,7 +2,7 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build # Copy wheel package from CI artifacts to /tmp/wheels -COPY . /avd/wheels +COPY /avd/wheels /avd/wheels # Debugging: Check if files exist RUN echo "Current directory: $(pwd)" && ls -al /avd/wheels From 2ff61980b7b1921bd2d369f3f04a53a3c982a14e Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 15:57:15 +0530 Subject: [PATCH 311/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 37232840277..0745cc90cb0 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,7 +2,7 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build # Copy wheel package from CI artifacts to /tmp/wheels -COPY /avd/wheels /avd/wheels +COPY ./tmp /avd/wheels # Debugging: Check if files exist RUN echo "Current directory: $(pwd)" && ls -al /avd/wheels From 66e145f920a6d9e95a7c5e6802da3c46b419a93c Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 16:03:25 +0530 Subject: [PATCH 312/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 0745cc90cb0..308e6b80665 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -2,7 +2,7 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build # Copy wheel package from CI artifacts to /tmp/wheels -COPY ./tmp /avd/wheels +COPY wheels /avd/wheels # Debugging: Check if files exist RUN echo "Current directory: $(pwd)" && ls -al /avd/wheels From 0467697307785c116d134b8609ea571cd6f3ffd2 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 16:06:42 +0530 Subject: [PATCH 313/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index cc95e24d98f..dd9edb23921 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -315,7 +315,7 @@ jobs: run: | mv /tmp/wheels ./wheels - name: Get Full Path of Wheels Directory - run: echo "WHEELS_PATH=$(realpath ./wheels)" >> $GITHUB_ENV + run: echo "WHEELS_PATH=$(realpath ./wheels/*.whl)" >> $GITHUB_ENV - name: Use Full Path run: | echo "The wheels directory is at: $WHEELS_PATH" From 03e177ecbc5114c966289967ffcae061ac4e6be4 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 16:10:03 +0530 Subject: [PATCH 314/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 9 ++++++--- .github/workflows/pull-request-management.yml | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 308e6b80665..38c291ab2c0 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -1,8 +1,11 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build -# Copy wheel package from CI artifacts to /tmp/wheels -COPY wheels /avd/wheels + +ARG WHEEL_PATH # Get the wheel file path from build args + +# Copy the wheel package using the provided path +COPY ${WHEEL_PATH} /avd/wheels/ # Debugging: Check if files exist RUN echo "Current directory: $(pwd)" && ls -al /avd/wheels @@ -10,7 +13,7 @@ WORKDIR /avd/wheels RUN apt-get update && apt-get install -y --no-install-recommends make && \ for VERSION in 3.10 3.11 3.12 3.13; do \ - /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /*.whl; \ + /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir *.whl; \ done FROM ubuntu:latest AS run diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index dd9edb23921..8dd4e795470 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -330,6 +330,7 @@ jobs: tags: ${{ steps.set-build-tag.outputs.build_image_tag }} build-args: BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} + WHEEL_PATH=$WHEELS_PATH cache-from: type=gha cache-to: | type=gha,mode=max From 0176e7ae9305619d6b5b7b65750810d900af22c3 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 16:16:00 +0530 Subject: [PATCH 315/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 8dd4e795470..d57c0966f7e 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -329,7 +329,7 @@ jobs: target: run tags: ${{ steps.set-build-tag.outputs.build_image_tag }} build-args: - BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} + BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }}, WHEEL_PATH=$WHEELS_PATH cache-from: type=gha cache-to: | From 8cb1ad9db49740772a70200ebf30e22880222436 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 16:27:52 +0530 Subject: [PATCH 316/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 4 ++-- .github/workflows/pull-request-management.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 38c291ab2c0..7f6fe9a791b 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -1,5 +1,5 @@ -ARG BASE_IMAGE_TAG -FROM ${BASE_IMAGE_TAG} AS build +# ARG BASE_IMAGE_TAG +FROM ghcr.io/shivani-gslab/avd-base:778-946c060 AS build LABEL stage=build ARG WHEEL_PATH # Get the wheel file path from build args diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d57c0966f7e..2294ea5c6bf 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -329,7 +329,7 @@ jobs: target: run tags: ${{ steps.set-build-tag.outputs.build_image_tag }} build-args: - BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }}, + # BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} WHEEL_PATH=$WHEELS_PATH cache-from: type=gha cache-to: | From 9a065a69c0a669ea87dbcf78a271a9fbcd9c8395 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 16:31:59 +0530 Subject: [PATCH 317/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 2294ea5c6bf..ecaa6c4b29f 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -315,7 +315,7 @@ jobs: run: | mv /tmp/wheels ./wheels - name: Get Full Path of Wheels Directory - run: echo "WHEELS_PATH=$(realpath ./wheels/*.whl)" >> $GITHUB_ENV + run: WHEELS_PATH=$(realpath ./wheels/*.whl)" - name: Use Full Path run: | echo "The wheels directory is at: $WHEELS_PATH" From d28f27569eb636677be4d73d68b201b700ef3d9b Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 16:40:53 +0530 Subject: [PATCH 318/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 4 ++-- .github/workflows/pull-request-management.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 7f6fe9a791b..a42a76b5f8c 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -1,5 +1,5 @@ -# ARG BASE_IMAGE_TAG -FROM ghcr.io/shivani-gslab/avd-base:778-946c060 AS build +ARG BASE_IMAGE_TAG +FROM ${{BASE_IMAGE_TAG}} AS build LABEL stage=build ARG WHEEL_PATH # Get the wheel file path from build args diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index ecaa6c4b29f..d590a0dc7f9 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -315,7 +315,7 @@ jobs: run: | mv /tmp/wheels ./wheels - name: Get Full Path of Wheels Directory - run: WHEELS_PATH=$(realpath ./wheels/*.whl)" + run: echo "WHEELS_PATH=$(realpath ./wheels/*.whl)" >> $GITHUB_ENV - name: Use Full Path run: | echo "The wheels directory is at: $WHEELS_PATH" @@ -328,8 +328,8 @@ jobs: push: true target: run tags: ${{ steps.set-build-tag.outputs.build_image_tag }} - build-args: - # BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} + build-args: | + BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} WHEEL_PATH=$WHEELS_PATH cache-from: type=gha cache-to: | From 7d22d885d291c64e3f55cdab00abd326f6a632c6 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 16:42:57 +0530 Subject: [PATCH 319/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index a42a76b5f8c..38c291ab2c0 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -1,5 +1,5 @@ ARG BASE_IMAGE_TAG -FROM ${{BASE_IMAGE_TAG}} AS build +FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build ARG WHEEL_PATH # Get the wheel file path from build args From cdf30fcecdee15a7ea864c95576daead2a52f669 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 16:51:39 +0530 Subject: [PATCH 320/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d590a0dc7f9..34ee9c9f3a6 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -315,10 +315,12 @@ jobs: run: | mv /tmp/wheels ./wheels - name: Get Full Path of Wheels Directory - run: echo "WHEELS_PATH=$(realpath ./wheels/*.whl)" >> $GITHUB_ENV - - name: Use Full Path run: | - echo "The wheels directory is at: $WHEELS_PATH" + WHEELS_PATH=$(realpath ./wheels/*.whl) + echo "wheel_path=$WHEELS_PATH" >> $GITHUB_ENV + # - name: Use Full Path + # run: | + # echo "The wheels directory is at: $WHEELS_PATH" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push PyAVD Image @@ -330,7 +332,7 @@ jobs: tags: ${{ steps.set-build-tag.outputs.build_image_tag }} build-args: | BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} - WHEEL_PATH=$WHEELS_PATH + WHEEL_PATH=${{ env.wheel_path }} cache-from: type=gha cache-to: | type=gha,mode=max From 4305eaccda7d0b761a6e85c4fc7f7edd75b77c79 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 16:58:36 +0530 Subject: [PATCH 321/324] download and install pyavd from artifacts --- .github/DockerfileBuild | 6 +++--- .github/workflows/pull-request-management.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index 38c291ab2c0..be7600f1614 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -5,11 +5,11 @@ LABEL stage=build ARG WHEEL_PATH # Get the wheel file path from build args # Copy the wheel package using the provided path -COPY ${WHEEL_PATH} /avd/wheels/ +COPY . /avd # Debugging: Check if files exist -RUN echo "Current directory: $(pwd)" && ls -al /avd/wheels -WORKDIR /avd/wheels +RUN echo "Current directory: $(pwd)" && ls -al /avd +WORKDIR /avd RUN apt-get update && apt-get install -y --no-install-recommends make && \ for VERSION in 3.10 3.11 3.12 3.13; do \ diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 34ee9c9f3a6..76290076a6c 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -313,7 +313,7 @@ jobs: path: /tmp/wheels - name: Move Wheel Package to Build Context run: | - mv /tmp/wheels ./wheels + mv /tmp/wheels $GITHUB_WORKSPACE - name: Get Full Path of Wheels Directory run: | WHEELS_PATH=$(realpath ./wheels/*.whl) From 8018da1bfcb7569378cb3dcaf3b8934adea3082d Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Fri, 28 Feb 2025 17:28:02 +0530 Subject: [PATCH 322/324] download and install pyavd from artifacts --- .github/workflows/pull-request-management.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 76290076a6c..88436ef76e7 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -314,13 +314,14 @@ jobs: - name: Move Wheel Package to Build Context run: | mv /tmp/wheels $GITHUB_WORKSPACE + ls -l $GITHUB_WORKSPACE - name: Get Full Path of Wheels Directory run: | WHEELS_PATH=$(realpath ./wheels/*.whl) echo "wheel_path=$WHEELS_PATH" >> $GITHUB_ENV - # - name: Use Full Path - # run: | - # echo "The wheels directory is at: $WHEELS_PATH" + - name: Use Full Path + run: | + echo "The wheels directory is at: $WHEELS_PATH" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push PyAVD Image From 2b1d9b33ac693793d18207b2902d3ac8395467aa Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Mar 2025 12:58:55 +0530 Subject: [PATCH 323/324] pipeline with molecule diff --- .github/DockerfileBuild | 13 +- .github/workflows/pull-request-management.yml | 1290 ++++++++--------- 2 files changed, 641 insertions(+), 662 deletions(-) diff --git a/.github/DockerfileBuild b/.github/DockerfileBuild index be7600f1614..e6174867645 100644 --- a/.github/DockerfileBuild +++ b/.github/DockerfileBuild @@ -1,19 +1,14 @@ ARG BASE_IMAGE_TAG FROM ${BASE_IMAGE_TAG} AS build LABEL stage=build - -ARG WHEEL_PATH # Get the wheel file path from build args - -# Copy the wheel package using the provided path COPY . /avd - -# Debugging: Check if files exist -RUN echo "Current directory: $(pwd)" && ls -al /avd -WORKDIR /avd +WORKDIR /avd/python-avd RUN apt-get update && apt-get install -y --no-install-recommends make && \ + /venvs/UV3.11/bin/python -m pip install --break-system-packages build && \ + /venvs/UV3.11/bin/python -m build --wheel --outdir /tmp/wheels && \ for VERSION in 3.10 3.11 3.12 3.13; do \ - /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir *.whl; \ + /venvs/UV$VERSION/bin/python -m pip install --no-cache-dir /tmp/wheels/*.whl; \ done FROM ubuntu:latest AS run diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 88436ef76e7..181fe381062 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -1,660 +1,644 @@ --- -name: "Collection code testing" + name: "Collection code testing" + + "on": + pull_request: + merge_group: + push: + branches: + - devel + + concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + + env: + # Set -vvv is ACTIONS_STEP_DEBUG is set + # Apparently it is set in secrets when running with debug + ANSIBLE_VERBOSITY: ${{ secrets.ACTIONS_STEP_DEBUG && 3 || 0 }} + AVD_NEVER_RUN_FROM_SOURCE: 1 + PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions + ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions + + jobs: + file-changes: + runs-on: ubuntu-latest + outputs: + eos_design: ${{ steps.filter.outputs.eos_design }} + config_gen: ${{ steps.filter.outputs.config_gen }} + cloudvision: ${{ steps.filter.outputs.cloudvision }} + dhcp: ${{ steps.filter.outputs.dhcp }} + plugins: ${{ steps.filter.outputs.plugins }} + requirements: ${{ steps.filter.outputs.requirements }} + docs: ${{ steps.filter.outputs.docs }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + eos_design: + - 'ansible_collections/arista/avd/roles/eos_designs/*' + - 'ansible_collections/arista/avd/roles/eos_designs/**/*' + - '.github/workflows/pull-request-management.yml' + - 'ansible_collections/arista/avd/molecule/*' + - 'ansible_collections/arista/avd/molecule/**/*' + - 'python-avd/pyavd/_eos_designs/*' + - 'python-avd/pyavd/_eos_designs/**/*' + - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' + - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' + - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' + - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' + config_gen: + - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' + - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' + - '.github/workflows/pull-request-management.yml' + - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/*' + - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/**/*' + - 'python-avd/pyavd/_eos_cli_config_gen/*' + - 'python-avd/pyavd/_eos_cli_config_gen/**/*' + validate_state: + - 'ansible_collections/arista/avd/roles/eos_validate_state/*' + - 'ansible_collections/arista/avd/roles/eos_validate_state/**/*' + cloudvision: + - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' + - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' + - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' + - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' + - '.github/workflows/pull-request-management.yml' + dhcp: + - 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' + - 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' + - '.github/workflows/pull-request-management.yml' + plugins: + - 'ansible_collections/arista/avd/plugins/filter/**' + - 'ansible_collections/arista/avd/plugins/test/**' + requirements: + - 'ansible_collections/arista/avd/requirements.txt' + - 'ansible_collections/arista/avd/requirements-dev.txt' + - 'ansible_collections/arista/avd/meta/runtime.yml' + - '.github/requirements-ci-dev.txt' + - '.github/workflows/pull-request-management.yml' + docs: + - '.github/workflows/pull-request-management.yml' + - 'mkdocs.yml' + - 'ansible_collections/arista/avd/docs/**' + - 'ansible_collections/arista/avd/roles/**/*.md' + - 'ansible_collections/arista/avd/**/*.md' + - 'ansible_collections/arista/avd/README.md' + - 'ansible_collections/arista/avd/**/*.schema.yml' + pyavd: + - 'python_avd/*' + - 'python_avd/**/*' -"on": - pull_request: - merge_group: - push: - branches: - - devel + # ----------------------------------- # + # Build Collection + # ----------------------------------- # + build_collection: + name: Build Ansible collection + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v5 + with: + python-version: | + 3.12 + - uses: actions/checkout@v4 + - name: "Install Python & Ansible requirements" + run: | + # distlib is required when using manifest + pip install "ansible-core<2.19.0" distlib --upgrade + - name: "Build Ansible collection" + run: | + ansible-galaxy collection build -vvv --force ansible_collections/arista/avd + - name: Upload collection + uses: actions/upload-artifact@v4 + with: + name: avd-collection + path: ./arista-avd-*.tar.gz -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true + # ----------------------------------- # + # Galaxy Importer + # ----------------------------------- # + galaxy_importer: + name: Test galaxy-importer + runs-on: ubuntu-latest + needs: [build_collection] + steps: + - uses: actions/setup-python@v5 + with: + python-version: | + 3.11 + - uses: actions/checkout@v4 + - name: "Install Python & Ansible requirements" + run: | + pip install "ansible-core==2.16.0" + - name: Download collection + uses: actions/download-artifact@v4 + with: + name: avd-collection + - name: Install galaxy-importer + # Install the specific version of galaxy-importer used on galaxy.ansible.com + # The version conflicts with our requirements, + # so we let the galaxy-importer version resolve remaining requirements. + run: | + pip install "galaxy-importer==0.4.26" + - name: "Run galaxy-importer checks" + run: python -m galaxy_importer.main *.tar.gz + - uses: actions/upload-artifact@v4 + with: + name: importer-logs + path: ./importer_result.json -env: - # Set -vvv is ACTIONS_STEP_DEBUG is set - # Apparently it is set in secrets when running with debug - ANSIBLE_VERBOSITY: ${{ secrets.ACTIONS_STEP_DEBUG && 3 || 0 }} - AVD_NEVER_RUN_FROM_SOURCE: 1 - PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions - ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions + # ----------------------------------- # + # Ansible Lint + # Run on the built collection from Galaxy importer + # ----------------------------------- # + ansible_lint: + name: Run ansible-lint test case + runs-on: ubuntu-latest + needs: [build_collection] + env: + ANSIBLE_COLLECTIONS_PATH: /home/runner/work/avd/avd + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3 + uses: actions/setup-python@v5 + with: + python-version: | + 3.10 + 3.11 + 3.12 + 3.13 + - name: "Install Python & Ansible requirements" + run: | + pip install -r .github/requirements-ci-dev.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade + - name: Download collection + uses: actions/download-artifact@v4 + with: + name: avd-collection + - name: "Extract collection" + run: | + mkdir collections + tar xvzf arista-avd-*.tar.gz -C collections + - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" + working-directory: collections + run: | + sed -i 's/- syntax-check/# - syntax-check/g' .ansible-lint + - name: "Run ansible-lint" + working-directory: collections + run: | + ansible-lint --force-color --strict -v -jobs: - file-changes: - runs-on: ubuntu-latest - outputs: - eos_design: ${{ steps.filter.outputs.eos_design }} - config_gen: ${{ steps.filter.outputs.config_gen }} - cloudvision: ${{ steps.filter.outputs.cloudvision }} - dhcp: ${{ steps.filter.outputs.dhcp }} - plugins: ${{ steps.filter.outputs.plugins }} - requirements: ${{ steps.filter.outputs.requirements }} - docs: ${{ steps.filter.outputs.docs }} - steps: - - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - eos_design: - - 'ansible_collections/arista/avd/roles/eos_designs/*' - - 'ansible_collections/arista/avd/roles/eos_designs/**/*' - - '.github/workflows/pull-request-management.yml' - - 'ansible_collections/arista/avd/molecule/*' - - 'ansible_collections/arista/avd/molecule/**/*' - - 'python-avd/pyavd/_eos_designs/*' - - 'python-avd/pyavd/_eos_designs/**/*' - - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' - - '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' - - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' - - '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' - config_gen: - - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' - - 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' - - '.github/workflows/pull-request-management.yml' - - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/*' - - 'ansible_collections/arista/avd/molecule/eos_cli_config_gen*/**/*' - - 'python-avd/pyavd/_eos_cli_config_gen/*' - - 'python-avd/pyavd/_eos_cli_config_gen/**/*' - validate_state: - - 'ansible_collections/arista/avd/roles/eos_validate_state/*' - - 'ansible_collections/arista/avd/roles/eos_validate_state/**/*' - cloudvision: - - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' - - 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' - - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' - - 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' - - '.github/workflows/pull-request-management.yml' - dhcp: - - 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' - - 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' - - '.github/workflows/pull-request-management.yml' - plugins: - - 'ansible_collections/arista/avd/plugins/filter/**' - - 'ansible_collections/arista/avd/plugins/test/**' - requirements: - - 'ansible_collections/arista/avd/requirements.txt' - - 'ansible_collections/arista/avd/requirements-dev.txt' - - 'ansible_collections/arista/avd/meta/runtime.yml' - - '.github/requirements-ci-dev.txt' - - '.github/workflows/pull-request-management.yml' - docs: - - '.github/workflows/pull-request-management.yml' - - 'mkdocs.yml' - - 'ansible_collections/arista/avd/docs/**' - - 'ansible_collections/arista/avd/roles/**/*.md' - - 'ansible_collections/arista/avd/**/*.md' - - 'ansible_collections/arista/avd/README.md' - - 'ansible_collections/arista/avd/**/*.schema.yml' - pyavd: - - 'python_avd/*' - - 'python_avd/**/*' - - # ----------------------------------- # - # Build Collection - # ----------------------------------- # - build_collection: - name: Build Ansible collection - runs-on: ubuntu-latest - steps: - - uses: actions/setup-python@v5 - with: - python-version: | - 3.12 - - uses: actions/checkout@v4 - - name: "Install Python & Ansible requirements" - run: | - # distlib is required when using manifest - pip install "ansible-core<2.19.0" distlib --upgrade - - name: "Build Ansible collection" - run: | - ansible-galaxy collection build -vvv --force ansible_collections/arista/avd - - name: Upload collection - uses: actions/upload-artifact@v4 - with: - name: avd-collection - path: ./arista-avd-*.tar.gz - - # ----------------------------------- # - # Galaxy Importer - # ----------------------------------- # - galaxy_importer: - name: Test galaxy-importer - runs-on: ubuntu-latest - needs: [build_collection] - steps: - - uses: actions/setup-python@v5 - with: - python-version: | - 3.11 - - uses: actions/checkout@v4 - - name: "Install Python & Ansible requirements" - run: | - pip install "ansible-core==2.16.0" - - name: Download collection - uses: actions/download-artifact@v4 - with: - name: avd-collection - - name: Install galaxy-importer - # Install the specific version of galaxy-importer used on galaxy.ansible.com - # The version conflicts with our requirements, - # so we let the galaxy-importer version resolve remaining requirements. - run: | - pip install "galaxy-importer==0.4.26" - - name: "Run galaxy-importer checks" - run: python -m galaxy_importer.main *.tar.gz - - uses: actions/upload-artifact@v4 - with: - name: importer-logs - path: ./importer_result.json - - # ----------------------------------- # - # Ansible Lint - # Run on the built collection from Galaxy importer - # ----------------------------------- # - ansible_lint: - name: Run ansible-lint test case - runs-on: ubuntu-latest - needs: [build_collection] - env: - ANSIBLE_COLLECTIONS_PATH: /home/runner/work/avd/avd - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3 - uses: actions/setup-python@v5 - with: - python-version: | - 3.10 - 3.11 - 3.12 - 3.13 - - name: "Install Python & Ansible requirements" - run: | - pip install -r .github/requirements-ci-dev.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade - - name: Download collection - uses: actions/download-artifact@v4 - with: - name: avd-collection - - name: "Extract collection" - run: | - mkdir collections - tar xvzf arista-avd-*.tar.gz -C collections - - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" - working-directory: collections - run: | - sed -i 's/- syntax-check/# - syntax-check/g' .ansible-lint - - name: "Run ansible-lint" - working-directory: collections - run: | - ansible-lint --force-color --strict -v - - avd-base-image: - runs-on: ubuntu-latest - outputs: - base_image_tag: ${{ steps.set-base-tag.outputs.base_image_tag }} - steps: - - name: Check out repository - uses: actions/checkout@v4 - - - name: Calculate Hash of Requirements - id: hash-reqs - run: | - HASH_OF_REQS=$(sha256sum ansible_collections/arista/avd/requirements-dev.txt | cut -d' ' -f1) - echo "Hash of requirements: $HASH_OF_REQS" - echo "::set-output name=hash_of_reqs::$HASH_OF_REQS" - - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - - name: Set Base Image Tag - id: set-base-tag - run: | - BASE_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ steps.hash-reqs.outputs.hash_of_reqs }}" - echo "::set-output name=base_image_tag::$BASE_IMAGE_TAG" - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Check if image exists - id: check-base-image - run: | - if docker manifest inspect ${{ steps.set-base-tag.outputs.base_image_tag }} > /dev/null 2>&1; then - echo "Base image exists." - echo "::set-output name=image_exists::true" - else - echo "Base image does not exist." - echo "::set-output name=image_exists::false" - fi - - - name: Set up Docker Buildx - if: steps.check-base-image.outputs.image_exists == 'false' - uses: docker/setup-buildx-action@v3 - - - name: Build and Push Base Run Image - if: steps.check-base-image.outputs.image_exists == 'false' - uses: docker/build-push-action@v6 - with: - context: . - file: .github/DockerfileBase - target: base_run - push: true - tags: ${{ steps.set-base-tag.outputs.base_image_tag }} - cache-from: type=gha,scope=base-run - cache-to: type=gha,mode=max,scope=base-run + avd-base-image: + runs-on: ubuntu-latest + outputs: + base_image_tag: ${{ steps.set-base-tag.outputs.base_image_tag }} + steps: + - name: Check out repository + uses: actions/checkout@v4 - build-pyavd-package: - name: Build pyavd - runs-on: ubuntu-latest - steps: - - uses: actions/setup-python@v5 - with: - python-version: | - 3.12 - - - uses: actions/checkout@v4 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --no-cache-dir build - - - name: Build PyAVD wheel - run: | - cd python-avd - mkdir -p /tmp/wheels - python -m build --wheel --outdir /tmp/wheels - ls -l /tmp/wheels # Verify the wheel is created - - - name: Upload PyAVD wheel as an artifact - uses: actions/upload-artifact@v4 - with: - name: pyavd-wheel - path: /tmp/wheels/*.whl - retention-days: 7 - - build-pyavd: - name: Install pyavd and Build Image - needs: [build-pyavd-package, avd-base-image] - runs-on: ubuntu-latest - outputs: - build_image_tag: ${{ steps.set-build-tag.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Convert GitHub username to lowercase - id: lowercase - run: | - echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" - - name: Set Build Image Tag - id: set-build-tag - run: | - SHORT_SHA=$(git rev-parse --short HEAD) - BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" - echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" - - name: Echo image name - run: echo ${{ needs.avd-base-image.outputs.base_image_tag }} - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ steps.lowercase.outputs.lowercase }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Download Wheel Package - uses: actions/download-artifact@v4 - with: - name: pyavd-wheel - path: /tmp/wheels - - name: Move Wheel Package to Build Context - run: | - mv /tmp/wheels $GITHUB_WORKSPACE - ls -l $GITHUB_WORKSPACE - - name: Get Full Path of Wheels Directory - run: | - WHEELS_PATH=$(realpath ./wheels/*.whl) - echo "wheel_path=$WHEELS_PATH" >> $GITHUB_ENV - - name: Use Full Path - run: | - echo "The wheels directory is at: $WHEELS_PATH" - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push PyAVD Image - uses: docker/build-push-action@v6 - with: - file: .github/DockerfileBuild - push: true - target: run - tags: ${{ steps.set-build-tag.outputs.build_image_tag }} - build-args: | - BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} - WHEEL_PATH=${{ env.wheel_path }} - cache-from: type=gha - cache-to: | - type=gha,mode=max - type=registry,ref=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest - outputs: type=image,push=true - - # ----------------------------------- # - # EOS CLI CONFIG GEN MOLECULE - # ----------------------------------- # - molecule_eos_cli_config_gen: - name: Validate eos_cli_config_gen - runs-on: ubuntu-latest - container: - image: ghcr.io/shivani-gslab/avd-base:778-946c060 - options: --volume "${{ github.workspace }}:/workspace" - strategy: - fail-fast: true - matrix: - avd_scenario: - - "eos_cli_config_gen" - - "eos_cli_config_gen_deprecated_vars" - - "eos_cli_config_gen_negative_unit_tests" - ansible_version: - - "ansible-core<2.19.0" - # Also test minimum ansible version for one scenario. - include: - - avd_scenario: "eos_cli_config_gen" - ansible_version: "ansible-core==2.16.0" - needs: [ "build-pyavd", "file-changes" ] - if: needs.file-changes.outputs.config_gen == 'true' - steps: - - uses: actions/checkout@v4 - - name: Install CA certificate - run: apt-get update && apt-get install -y --no-install-recommends ca-certificates git - - name: Install the specified Ansible version - run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}' --upgrade" - - name: Check status - run: | - cd /workspace - git config --global user.email "schourasiya-ext@arista.com" - git config --global user.name "Shivani chourasiya" - git config --global --add safe.directory $(pwd) - git init - git add . - git commit -m "Initial commit inside container" - - name: Run molecule action - run: " . /venvs/UV3.11/bin/activate && git init && cd /workspace/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - - name: Check status - run: | - cd /workspace - if [ -n "$(git status --porcelain)" ]; then - echo "❌ Changes detected! Failing the job..." - git diff - exit 1 - fi + - name: Calculate Hash of Requirements + id: hash-reqs + run: | + HASH_OF_REQS=$(sha256sum ansible_collections/arista/avd/requirements-dev.txt | cut -d' ' -f1) + echo "Hash of requirements: $HASH_OF_REQS" + echo "::set-output name=hash_of_reqs::$HASH_OF_REQS" + + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + + - name: Set Base Image Tag + id: set-base-tag + run: | + BASE_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ steps.hash-reqs.outputs.hash_of_reqs }}" + echo "::set-output name=base_image_tag::$BASE_IMAGE_TAG" + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Check if image exists + id: check-base-image + run: | + if docker manifest inspect ${{ steps.set-base-tag.outputs.base_image_tag }} > /dev/null 2>&1; then + echo "Base image exists." + echo "::set-output name=image_exists::true" + else + echo "Base image does not exist." + echo "::set-output name=image_exists::false" + fi + + - name: Set up Docker Buildx + if: steps.check-base-image.outputs.image_exists == 'false' + uses: docker/setup-buildx-action@v3 + + - name: Build and Push Base Run Image + if: steps.check-base-image.outputs.image_exists == 'false' + uses: docker/build-push-action@v6 + with: + context: . + file: .github/DockerfileBase + target: base_run + push: true + tags: ${{ steps.set-base-tag.outputs.base_image_tag }} + cache-from: type=gha,scope=base-run + cache-to: type=gha,mode=max,scope=base-run + + # build-pyavd-package: + # name: Build pyavd + # runs-on: ubuntu-latest + # steps: + # - uses: actions/setup-python@v5 + # with: + # python-version: | + # 3.12 + + # - uses: actions/checkout@v4 + + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip + # python -m pip install --no-cache-dir build + + # - name: Build PyAVD wheel + # run: | + # cd python-avd + # mkdir -p /tmp/wheels + # python -m build --wheel --outdir /tmp/wheels + # ls -l /tmp/wheels # Verify the wheel is created + + # - name: Upload PyAVD wheel as an artifact + # uses: actions/upload-artifact@v4 + # with: + # name: pyavd-wheel + # path: /tmp/wheels/*.whl + # retention-days: 7 + + build-pyavd: + name: Install pyavd and Build Image + needs: [avd-base-image] + runs-on: ubuntu-latest + outputs: + build_image_tag: ${{ steps.set-build-tag.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Convert GitHub username to lowercase + id: lowercase + run: | + echo "::set-output name=lowercase::$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + - name: Set Build Image Tag + id: set-build-tag + run: | + SHORT_SHA=$(git rev-parse --short HEAD) + BUILD_IMAGE_TAG="ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:${{ github.run_number }}-${SHORT_SHA}" + echo "::set-output name=build_image_tag::$BUILD_IMAGE_TAG" + - name: Echo image name + run: echo ${{ needs.avd-base-image.outputs.base_image_tag }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ steps.lowercase.outputs.lowercase }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push PyAVD Image + uses: docker/build-push-action@v6 + with: + file: .github/DockerfileBuild + push: true + target: run + tags: ${{ steps.set-build-tag.outputs.build_image_tag }} + build-args: + BASE_IMAGE_TAG=${{ needs.avd-base-image.outputs.base_image_tag }} + cache-from: type=gha + cache-to: | + type=gha,mode=max + type=registry,ref=ghcr.io/${{ steps.lowercase.outputs.lowercase }}/avd-base:latest + outputs: type=image,push=true + + # ----------------------------------- # + # EOS CLI CONFIG GEN MOLECULE + # ----------------------------------- # + molecule_eos_cli_config_gen: + name: Validate eos_cli_config_gen + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + options: --volume "${{ github.workspace }}:/workspace" + strategy: + fail-fast: true + matrix: + avd_scenario: + - "eos_cli_config_gen" + - "eos_cli_config_gen_deprecated_vars" + - "eos_cli_config_gen_negative_unit_tests" + ansible_version: + - "ansible-core<2.19.0" + # Also test minimum ansible version for one scenario. + include: + - avd_scenario: "eos_cli_config_gen" + ansible_version: "ansible-core==2.16.0" + needs: [ "build-pyavd", "file-changes" ] + if: needs.file-changes.outputs.config_gen == 'true' + steps: + - uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates git + - name: Install the specified Ansible version + run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}' --upgrade" + - name: Check status + run: | + cd /workspace + git config --global user.email "schourasiya-ext@arista.com" + git config --global user.name "Shivani chourasiya" + git config --global --add safe.directory $(pwd) + git init + git add . + git commit -m "Initial commit inside container" + - name: Run molecule action + run: " . /venvs/UV3.11/bin/activate && git init && cd /workspace/ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + - name: Check status + run: | + cd /workspace + if [ -n "$(git status --porcelain)" ]; then + echo "❌ Changes detected! Failing the job..." + git diff + exit 1 + fi + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + + # ----------------------------------- # + # DHCP PROVISIONNER MOLECULE + # ----------------------------------- # + molecule_dhcp_provisionner: + name: Validate DHCP configuration + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: ["dhcp_configuration", "dhcp_provisioning"] + ansible_version: ["'ansible-core<2.19.0' --upgrade"] + needs: [ build-pyavd ] + if: needs.file-changes.outputs.dhcp == 'true' + steps: + - uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates + - name: Install the specified Ansible version + run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}'" + - name: Run molecule action + run: ". /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + + # ----------------------------------- # + # EOS Design MOLECULE + # ----------------------------------- # + molecule_eos_designs: + name: Validate eos_designs + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: + - "eos_designs_deprecated_vars" + - "eos_designs-l2ls" + - "eos_designs-mpls-isis-sr-ldp" + - "eos_designs_negative_unit_tests" + - "eos_designs-twodc-5stage-clos" + - "eos_designs_unit_tests" + - "evpn_underlay_ebgp_overlay_ebgp" + - "evpn_underlay_isis_overlay_ibgp" + - "evpn_underlay_ospf_overlay_ebgp" + - "evpn_underlay_rfc5549_overlay_ebgp" + - "example-campus-fabric" + - "example-dual-dc-l3ls" + - "example-isis-ldp-ipvpn" + - "example-l2ls-fabric" + - "example-single-dc-l3ls" + - "example-cv-pathfinder" + ansible_version: + # Testing all scenario with 2.16.x, due to bug with in 2.17.0 with and the way we test eos_designs_negative_unit_tests https://github.com/ansible/ansible/issues/83292 + - "'ansible-core>=2.16.0,<2.17.0' --upgrade" + pip_requirements: + - '.github/requirements-ci.txt' + # Also test minimum ansible version for one scenario. + include: + - avd_scenario: "eos_designs_unit_tests" + ansible_version: "'ansible-core==2.16.0' --upgrade" + - avd_scenario: "eos_designs_unit_tests" + ansible_version: "'ansible-core<2.18.0' --upgrade" + - avd_scenario: "eos_designs_unit_tests" + ansible_version: "'ansible-core<2.19.0' --upgrade" + needs: [ build-pyavd ] + if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' + steps: + - uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates + - name: Install the specified Ansible version + run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: ". /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - - # ----------------------------------- # - # DHCP PROVISIONNER MOLECULE - # ----------------------------------- # - molecule_dhcp_provisionner: - name: Validate DHCP configuration - runs-on: ubuntu-latest - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - strategy: - fail-fast: true - matrix: - avd_scenario: ["dhcp_configuration", "dhcp_provisioning"] - ansible_version: ["'ansible-core<2.19.0' --upgrade"] - needs: [ build-pyavd ] - if: needs.file-changes.outputs.dhcp == 'true' - steps: - - uses: actions/checkout@v4 - - name: Install CA certificate - run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - - name: Install the specified Ansible version - run: "/venvs/UV3.11/bin/python -m pip install '${{ matrix.ansible_version }}'" - - name: Run molecule action - run: ". /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - - # ----------------------------------- # - # EOS Design MOLECULE - # ----------------------------------- # - molecule_eos_designs: - name: Validate eos_designs - runs-on: ubuntu-latest - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - strategy: - fail-fast: true - matrix: - avd_scenario: - - "eos_designs_deprecated_vars" - - "eos_designs-l2ls" - - "eos_designs-mpls-isis-sr-ldp" - - "eos_designs_negative_unit_tests" - - "eos_designs-twodc-5stage-clos" - - "eos_designs_unit_tests" - - "evpn_underlay_ebgp_overlay_ebgp" - - "evpn_underlay_isis_overlay_ibgp" - - "evpn_underlay_ospf_overlay_ebgp" - - "evpn_underlay_rfc5549_overlay_ebgp" - - "example-campus-fabric" - - "example-dual-dc-l3ls" - - "example-isis-ldp-ipvpn" - - "example-l2ls-fabric" - - "example-single-dc-l3ls" - - "example-cv-pathfinder" - ansible_version: - # Testing all scenario with 2.16.x, due to bug with in 2.17.0 with and the way we test eos_designs_negative_unit_tests https://github.com/ansible/ansible/issues/83292 - - "'ansible-core>=2.16.0,<2.17.0' --upgrade" - pip_requirements: - - '.github/requirements-ci.txt' - # Also test minimum ansible version for one scenario. - include: - - avd_scenario: "eos_designs_unit_tests" - ansible_version: "'ansible-core==2.16.0' --upgrade" - - avd_scenario: "eos_designs_unit_tests" - ansible_version: "'ansible-core<2.18.0' --upgrade" - - avd_scenario: "eos_designs_unit_tests" - ansible_version: "'ansible-core<2.19.0' --upgrade" - needs: [ build-pyavd ] - if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' - steps: - - uses: actions/checkout@v4 - - name: Install CA certificate - run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - - name: Install the specified Ansible version - run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" - - name: Run molecule action - run: ". /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - # ----------------------------------- # - # Cloudvision MOLECULE - # ----------------------------------- # - molecule_cloudvision: - name: Validate cvp_collection - runs-on: ubuntu-latest - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - strategy: - fail-fast: true - matrix: - avd_scenario: - - "eos_config_deploy_cvp" - ansible_version: - - "'ansible-core<2.19.0' --upgrade" - include: - - avd_scenario: "eos_config_deploy_cvp" - ansible_version: "ansible-core==2.16.0" - needs: [ build-pyavd ] - if: needs.file-changes.outputs.cloudvision == 'true' || needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' - - steps: - - uses: actions/checkout@v4 - - name: Install CA certificate - run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - - name: Install the specified Ansible version - run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" - - name: Run molecule action - run: ". /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - # - uses: actions/upload-artifact@v4 - # with: - # name: molecule-${{ matrix.avd_scenario }}-artifacts - # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} - # - # ----------------------------------- # - # EOS Validate State MOLECULE - # ----------------------------------- # - molecule_eos_validate_state: - name: Validate eos_validate_state - runs-on: ubuntu-latest - container: - image: ghcr.io/shivani-gslab/avd-base:latest - strategy: - fail-fast: true - matrix: - avd_scenario: - - "eos_validate_state" - ansible_version: - - "'ansible-core<2.19.0' --upgrade" - include: - - avd_scenario: "eos_validate_state" - ansible_version: "ansible-core==2.16.0" - needs: [ build-pyavd ] - if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.validate_state == 'true' - steps: - - uses: actions/checkout@v4 - - name: Install CA certificate - run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - - name: Install the specified Ansible version - run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" - - name: Run molecule action - run: ". /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" - - # ----------------------------------- # - # Ansible tests - # ----------------------------------- # - # ansible_test_sanity: - # name: Run ansible-test sanity validation - # runs-on: ubuntu-latest - # needs: [build-pyavd] - # container: - # image: ${{ needs.build-pyavd.outputs.build_image_tag }} - # steps: - # - name: Check out repository code - # uses: actions/checkout@v4 - # - name: Install CA certificate - # run: apt-get update && apt-get install -y --no-install-recommends ca-certificates - # - name: "Run ansible-test sanity" - # run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" - - # ansible_test_units: - # name: Run ansible-test units test cases - # runs-on: ubuntu-latest - # needs: [build-pyavd] - # container: - # image: ${{ needs.build-pyavd.outputs.build_image_tag }} - # steps: - # - name: Check out repository code - # uses: actions/checkout@v4 - # - name: "Run ansible-test units test cases" - # run: ". /venvs/UV3.12/bin/activate && python --version && cd ansible_collections/arista/avd && ansible-test units -vv" - - # # ansible_test_integration: - # # name: Run ansible-test integration test cases - # # runs-on: ubuntu-latest - # # needs: [build-pyavd] - # # container: - # # image: ${{ needs.build-pyavd.outputs.build_image_tag }} - # # steps: - # # - name: Check out repository code - # # uses: actions/checkout@v4 - # # # - name: Install ssh-keygen - # # # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client - # # - name: "Run ansible-test integration test cases" - # # run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - - # ansible_lint_job: - # name: Run ansible-lint test case - # runs-on: ubuntu-latest - # needs: [build-pyavd] - # container: - # image: ${{ needs.build-pyavd.outputs.build_image_tag }} - # steps: - # - name: Check out repository code - # uses: actions/checkout@v4 - # - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" - # run: | - # sed -i 's/- syntax-check/# - syntax-check/g' ansible_collections/arista/avd/.ansible-lint - # - name: "Run ansible-test integration test cases" - # run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" - - # ----------------------------------- # - # Galaxy Importer - # ----------------------------------- # - # galaxy_importer: - # name: Test galaxy-importer - # runs-on: ubuntu-20.04 # Older version to be compatible with old python - # env: - # GALAXY_IMPORTER_CONFIG: galaxy-importer/galaxy-importer.cfg - # steps: - # - uses: actions/setup-python@v5 - # with: - # python-version: | - # 3.10 - # - uses: actions/checkout@v4 - # - name: 'Install Python & Ansible requirements' - # run: | - # pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade - # ansible-galaxy collection install -r ansible_collections/arista/avd/collections.yml - # - name: Install galaxy-importer - # # Install the specific version of galaxy-importer used on galaxy.ansible.com - # # The version conflicts with our requirements, - # # so we let the galaxy-importer version resolve remaining requirements. - # run: | - # pip install "galaxy-importer==0.4.26" - # - name: 'Build ansible package' - # run: make collection-build - # - name: 'Run galaxy-importer checks' - # run: python -m galaxy_importer.main *.tar.gz - # - uses: actions/upload-artifact@v4 - # with: - # name: importer-logs - # path: ./importer_result.json - - # # ----------------------------------- # - # # Test of pyavd - # # ----------------------------------- # - # pyavd: - # name: Test pyavd - # runs-on: ubuntu-latest - # needs: [file-changes] - # if: | - # needs.file-changes.outputs.eos_design == 'true' || - # needs.file-changes.outputs.config_gen == 'true' || - # needs.file-changes.outputs.pyavd == 'true' - # strategy: - # matrix: - # python: ["3.10", "3.11", "3.12", "3.13"] - # steps: - # - uses: actions/checkout@v4 - # - name: Set up Python 3 - # uses: actions/setup-python@v5 - # with: - # python-version: ${{ matrix.python }} - # - name: 'Install tox' - # run: | - # pip install tox tox-gh-actions --upgrade - # - name: "Run pytest via tox for ${{ matrix.python }}" - # working-directory: python-avd - # run: | - # tox + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + # ----------------------------------- # + # Cloudvision MOLECULE + # ----------------------------------- # + molecule_cloudvision: + name: Validate cvp_collection + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: + - "eos_config_deploy_cvp" + ansible_version: + - "'ansible-core<2.19.0' --upgrade" + include: + - avd_scenario: "eos_config_deploy_cvp" + ansible_version: "ansible-core==2.16.0" + needs: [ build-pyavd ] + if: needs.file-changes.outputs.cloudvision == 'true' || needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' + + steps: + - uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates + - name: Install the specified Ansible version + run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: ". /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + # - uses: actions/upload-artifact@v4 + # with: + # name: molecule-${{ matrix.avd_scenario }}-artifacts + # path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} + # + # ----------------------------------- # + # EOS Validate State MOLECULE + # ----------------------------------- # + molecule_eos_validate_state: + name: Validate eos_validate_state + runs-on: ubuntu-latest + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + strategy: + fail-fast: true + matrix: + avd_scenario: + - "eos_validate_state" + ansible_version: + - "'ansible-core<2.19.0' --upgrade" + include: + - avd_scenario: "eos_validate_state" + ansible_version: "ansible-core==2.16.0" + needs: [ build-pyavd ] + if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.validate_state == 'true' + steps: + - uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates + - name: Install the specified Ansible version + run: "/venvs/UV3.11/bin/python -m pip install ${{ matrix.ansible_version }}" + - name: Run molecule action + run: ". /venvs/UV3.11/bin/activate && cd ansible_collections/arista/avd && molecule test --scenario-name ${{ matrix.avd_scenario }}" + + # ----------------------------------- # + # Ansible tests + # ----------------------------------- # + ansible_test_sanity: + name: Run ansible-test sanity validation + runs-on: ubuntu-latest + needs: [build-pyavd] + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Install CA certificate + run: apt-get update && apt-get install -y --no-install-recommends ca-certificates + - name: "Run ansible-test sanity" + run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test sanity --color yes -v" + + ansible_test_units: + name: Run ansible-test units test cases + runs-on: ubuntu-latest + needs: [build-pyavd] + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: "Run ansible-test units test cases" + run: ". /venvs/UV3.12/bin/activate && python --version && cd ansible_collections/arista/avd && ansible-test units -vv" + + ansible_test_integration: + name: Run ansible-test integration test cases + runs-on: ubuntu-latest + needs: [build-pyavd] + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + # - name: Install ssh-keygen + # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client + - name: "Run ansible-test integration test cases" + run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + + ansible_lint_job: + name: Run ansible-lint test case + runs-on: ubuntu-latest + needs: [build-pyavd] + container: + image: ${{ needs.build-pyavd.outputs.build_image_tag }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" + run: | + sed -i 's/- syntax-check/# - syntax-check/g' ansible_collections/arista/avd/.ansible-lint + - name: "Run ansible-test integration test cases" + run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + + # ----------------------------------- # + # Galaxy Importer + # ----------------------------------- # + # galaxy_importer: + # name: Test galaxy-importer + # runs-on: ubuntu-20.04 # Older version to be compatible with old python + # env: + # GALAXY_IMPORTER_CONFIG: galaxy-importer/galaxy-importer.cfg + # steps: + # - uses: actions/setup-python@v5 + # with: + # python-version: | + # 3.10 + # - uses: actions/checkout@v4 + # - name: 'Install Python & Ansible requirements' + # run: | + # pip install "ansible-core<2.19.0" -r .github/requirements-ci.txt --upgrade + # ansible-galaxy collection install -r ansible_collections/arista/avd/collections.yml + # - name: Install galaxy-importer + # # Install the specific version of galaxy-importer used on galaxy.ansible.com + # # The version conflicts with our requirements, + # # so we let the galaxy-importer version resolve remaining requirements. + # run: | + # pip install "galaxy-importer==0.4.26" + # - name: 'Build ansible package' + # run: make collection-build + # - name: 'Run galaxy-importer checks' + # run: python -m galaxy_importer.main *.tar.gz + # - uses: actions/upload-artifact@v4 + # with: + # name: importer-logs + # path: ./importer_result.json + + # # ----------------------------------- # + # # Test of pyavd + # # ----------------------------------- # + # pyavd: + # name: Test pyavd + # runs-on: ubuntu-latest + # needs: [file-changes] + # if: | + # needs.file-changes.outputs.eos_design == 'true' || + # needs.file-changes.outputs.config_gen == 'true' || + # needs.file-changes.outputs.pyavd == 'true' + # strategy: + # matrix: + # python: ["3.10", "3.11", "3.12", "3.13"] + # steps: + # - uses: actions/checkout@v4 + # - name: Set up Python 3 + # uses: actions/setup-python@v5 + # with: + # python-version: ${{ matrix.python }} + # - name: 'Install tox' + # run: | + # pip install tox tox-gh-actions --upgrade + # - name: "Run pytest via tox for ${{ matrix.python }}" + # working-directory: python-avd + # run: | + # tox + \ No newline at end of file From 3d01b1481497c9748406c1ee311e5e4935748000 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Mon, 3 Mar 2025 13:09:44 +0530 Subject: [PATCH 324/324] pipeline with molecule diff --- .github/workflows/pull-request-management.yml | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 181fe381062..2e05721ca69 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -552,34 +552,34 @@ - name: "Run ansible-test units test cases" run: ". /venvs/UV3.12/bin/activate && python --version && cd ansible_collections/arista/avd && ansible-test units -vv" - ansible_test_integration: - name: Run ansible-test integration test cases - runs-on: ubuntu-latest - needs: [build-pyavd] - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - # - name: Install ssh-keygen - # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client - - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" + # ansible_test_integration: + # name: Run ansible-test integration test cases + # runs-on: ubuntu-latest + # needs: [build-pyavd] + # container: + # image: ${{ needs.build-pyavd.outputs.build_image_tag }} + # steps: + # - name: Check out repository code + # uses: actions/checkout@v4 + # - name: Install ssh-keygen + # run: apt-get update && sudo apt-get install -y --no-install-recommends openssh-client + # - name: "Run ansible-test integration test cases" + # run: ". /venvs/UV3.13/bin/activate && cd ansible_collections/arista/avd && ansible-test integration -vv" - ansible_lint_job: - name: Run ansible-lint test case - runs-on: ubuntu-latest - needs: [build-pyavd] - container: - image: ${{ needs.build-pyavd.outputs.build_image_tag }} - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" - run: | - sed -i 's/- syntax-check/# - syntax-check/g' ansible_collections/arista/avd/.ansible-lint - - name: "Run ansible-test integration test cases" - run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" + # ansible_lint_job: + # name: Run ansible-lint test case + # runs-on: ubuntu-latest + # needs: [build-pyavd] + # container: + # image: ${{ needs.build-pyavd.outputs.build_image_tag }} + # steps: + # - name: Check out repository code + # uses: actions/checkout@v4 + # - name: "🥷 Remove unskippable ansible-lint rule added for Galaxy" + # run: | + # sed -i 's/- syntax-check/# - syntax-check/g' ansible_collections/arista/avd/.ansible-lint + # - name: "Run ansible-test integration test cases" + # run: ". /venvs/UV3.13/bin/activate && /venvs/UV3.13/bin/python -m pip install --upgrade certifi && export SSL_CERT_FILE=$(/venvs/UV3.13/bin/python -m certifi) && cd ansible_collections/arista/avd && ansible-lint --force-color --strict -v" # ----------------------------------- # # Galaxy Importer