From 3f1d8308f651c9f39bd919f9680a4b00309906e6 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Sun, 19 Oct 2025 13:24:58 -0400 Subject: [PATCH 1/5] bump versions --- .github/workflows/main.yml | 22 +++++++++++----------- docker/Dockerfile | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 22d477b..951e950 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,14 +19,14 @@ jobs: build_pypi_and_docker: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v5 with: fetch-depth: 0 # unshallow checkout enables setuptools_scm to infer PyPi version from Git - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: - python-version: '3.7' + python-version: '3.13' - name: Install dependencies run: | @@ -37,7 +37,7 @@ jobs: run: python -m build - name: Upload Wheel Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: netfoundry-wheel-${{ github.run_id }} path: dist/netfoundry-*.whl @@ -98,7 +98,7 @@ jobs: delete network - name: Publish Test Package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + uses: pypa/gh-action-pypi-publish@v1 with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} @@ -120,21 +120,21 @@ jobs: - name: Publish Release to PyPi if: github.event.action == 'published' - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + uses: pypa/gh-action-pypi-publish@v1 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} - name: Attach Wheel Artifact to GH Release if: ${{ github.event.action == 'published' }} - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: dist/netfoundry-*.whl fail_on_unmatched_files: true generate_release_notes: true - name: Set up QEMU - uses: docker/setup-qemu-action@master + uses: docker/setup-qemu-action@v3 with: platforms: amd64,arm64 # ignore arm/v7 (32bit) because unsupported by "cryptography" dep of @@ -142,16 +142,16 @@ jobs: - name: Set up Docker BuildKit id: buildx - uses: docker/setup-buildx-action@master + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_API_USER }} password: ${{ secrets.DOCKER_HUB_API_TOKEN }} - name: Build & Push Multi-Platform Container - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 with: context: ${{ github.workspace }} # build context is workspace so we can copy artifacts from ./dist/ file: ${{ github.workspace }}/docker/Dockerfile diff --git a/docker/Dockerfile b/docker/Dockerfile index edf66fa..12dc7d5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim-buster +FROM python:3.13-slim-bookworm COPY ./dist/netfoundry-*.whl /tmp/ RUN pip install --upgrade pip RUN pip install /tmp/netfoundry-*.whl From 46c59249af8ad20af2bf6e0d48803fa84df60808 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Sun, 19 Oct 2025 14:04:13 -0400 Subject: [PATCH 2/5] bump actions --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 951e950..ec77cb5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -98,7 +98,7 @@ jobs: delete network - name: Publish Test Package - uses: pypa/gh-action-pypi-publish@v1 + uses: pypa/gh-action-pypi-publish@v1.13.0 with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} @@ -120,7 +120,7 @@ jobs: - name: Publish Release to PyPi if: github.event.action == 'published' - uses: pypa/gh-action-pypi-publish@v1 + uses: pypa/gh-action-pypi-publish@v1.13.0 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} From d9b3c0d1407e74a6ada81777b886d70aebc227be Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Sun, 19 Oct 2025 14:05:55 -0400 Subject: [PATCH 3/5] install setuptools --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec77cb5..5938e20 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install build + pip install build setuptools - name: Build Package run: python -m build From 6a572826cf7285a19a95d23187b7038d65a23b5f Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Sun, 19 Oct 2025 14:12:18 -0400 Subject: [PATCH 4/5] use py 3.12 --- .github/workflows/main.yml | 7 +++++-- docker/Dockerfile | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5938e20..143c148 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: '3.13' + python-version: '3.12' - name: Install dependencies run: | @@ -72,12 +72,15 @@ jobs: register-python-argcomplete nfctl - name: Run the NF CLI demo to test installed version + shell: bash env: NETFOUNDRY_CLIENT_ID: ${{ secrets.NETFOUNDRY_CLIENT_ID }} NETFOUNDRY_PASSWORD: ${{ secrets.NETFOUNDRY_PASSWORD }} NETFOUNDRY_OAUTH_URL: ${{ secrets.NETFOUNDRY_OAUTH_URL }} run: | - set -x + set -o xtrace + set -o pipefail + nfctl config \ general.network=$(nfctl demo --echo-name --prefix 'gh-${{ github.run_id }}') \ general.yes=True \ diff --git a/docker/Dockerfile b/docker/Dockerfile index 12dc7d5..6db8e49 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.13-slim-bookworm +FROM python:3.12-slim-bookworm COPY ./dist/netfoundry-*.whl /tmp/ RUN pip install --upgrade pip RUN pip install /tmp/netfoundry-*.whl From 61947c9ebd06b7e33afee5f8976a10f83ee63700 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Sun, 19 Oct 2025 14:19:28 -0400 Subject: [PATCH 5/5] refactor for new milc api --- netfoundry/ctl.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/netfoundry/ctl.py b/netfoundry/ctl.py index 34fe585..ddca9c8 100644 --- a/netfoundry/ctl.py +++ b/netfoundry/ctl.py @@ -25,7 +25,7 @@ from xml.sax.xmlreader import InputSource from jwt.exceptions import PyJWTError -from milc import set_metadata # this function needed to set metadata immediately below +# milc metadata will be set after cli import from pygments import highlight from pygments.formatters import Terminal256Formatter from pygments.lexers import get_lexer_by_name, load_lexer_from_file @@ -42,10 +42,10 @@ from .organization import Organization from .utility import DC_PROVIDERS, EMBED_NET_RESOURCES, IDENTITY_ID_PROPERTIES, MUTABLE_NET_RESOURCES, MUTABLE_RESOURCE_ABBREV, RESOURCE_ABBREV, RESOURCES, any_in, get_generic_resource_by_type_and_id, normalize_caseless, plural, propid2type, singular -# must precend import milc.cli -set_metadata(version=f"v{netfoundry_version}", author="NetFoundry", name="nfctl") -# this uses metadata set above +# import milc cli from milc import cli, questions # noqa: E402 +# set milc options using new API +cli.milc_options(name='nfctl', author='NetFoundry', version=f'v{netfoundry_version}') # this creates the config subcommand from milc.subcommand import config # noqa: F401,E402 @@ -871,7 +871,7 @@ def delete(cli): sysexit(1) -@cli.argument("-p", "--prefix", default=f"{cli.prog_name}-demo", help="choose a network name prefix to identify all of your demos") +@cli.argument("-p", "--prefix", default="nfctl-demo", help="choose a network name prefix to identify all of your demos") @cli.argument("-j", "--jwt", action="store_boolean", default=True, help="save the one-time enroll token for each demo identity in the current directory") @cli.argument("-e", "--echo-name", arg_only=True, action="store_true", default=False, help="only echo a friendly network name then exit") @cli.argument("-s", "--size", default="medium", help=argparse.SUPPRESS) # troubleshoot scale-up instance size factor