From 4af16d05b36d040409121d3d62613047e456f8d3 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Mon, 9 Sep 2024 18:26:35 +0100 Subject: [PATCH 01/29] Rename argo workflow files We had a hierarchy of workflows that was not being fully utilised. This discards that structure in favour of the yaml file being organised by Kind and then by name. for i in `grep -lr "^kind: WorkflowTemplate"` ; do mv $i workflows/`cat "$i" | yq ".metadata.name"`.yaml done for i in `grep -lr "^kind: Sensor"` ; do mv $i sensors/`cat "$i" | yq ".metadata.name"`.yaml done etc --- .../{generic/deps => secrets}/externalsecret-nautobot-token.yaml | 0 .../nautobot-token-secret.yaml => secrets/nautobot-token.yaml} | 0 .../deps/obm-creds-secret.yaml => secrets/obm-creds.yaml} | 0 .../operate-workflow-sa.token.yaml} | 0 .../placeholder-obm-creds.yaml} | 0 .../placeholder-obm-legacy-passwords.yaml} | 0 .../production-ironic-for-argo-creds.yaml} | 0 .../{sync-nb-server-to-ironic => }/sensors/debug-sensor.yaml | 0 .../ironic-node-update.yaml} | 0 .../nb-oob-interface-update.yaml} | 0 .../workflowtemplates => workflows}/get-device-nautobot.yaml | 0 .../{generic/workflowtemplates => workflows}/get-obm-creds.yaml | 0 .../{generic/workflowtemplates => workflows}/get-obm-ip.yaml | 0 .../idrac-enable-network-boot.yaml | 0 .../{generic/workflowtemplates => workflows}/nautobot-api.yaml | 0 .../workflowtemplates => workflows}/node-events.yaml | 0 .../workflowtemplates => workflows}/obm-firmware-update.yaml | 0 .../workflowtemplates => workflows}/obm-sync-creds.yaml | 0 .../sync-interfaces-to-ironic.yaml | 0 .../sync-interfaces-to-nautobot.yaml | 0 .../workflowtemplates => workflows}/sync-nb-server-to-ironic.yaml | 0 .../workflowtemplates => workflows}/sync-obm-creds.yaml | 0 .../sync.yaml => workflows/sync-provision-state-to-nautobot.yaml} | 0 .../workflowtemplates => workflows}/sync-server-to-ironic.yaml | 0 .../sync-srv-redfish-intfs-to-nb.yaml | 0 .../workflowtemplates => workflows}/undersync-device.yaml | 0 .../workflowtemplates => workflows}/undersync-switch.yaml | 0 27 files changed, 0 insertions(+), 0 deletions(-) rename argo-workflows/{generic/deps => secrets}/externalsecret-nautobot-token.yaml (100%) rename argo-workflows/{sync-srv-redfish-intfs-to-nb/deps/nautobot-token-secret.yaml => secrets/nautobot-token.yaml} (100%) rename argo-workflows/{sync-srv-redfish-intfs-to-nb/deps/obm-creds-secret.yaml => secrets/obm-creds.yaml} (100%) rename argo-workflows/{sync-nb-server-to-ironic/deps/operate-workflow-sa-token.yaml => secrets/operate-workflow-sa.token.yaml} (100%) rename argo-workflows/{generic/deps/placeholder-obm-creds-secret.yaml => secrets/placeholder-obm-creds.yaml} (100%) rename argo-workflows/{obm-utils/deps/placeholder-obm-legacy-passwords-secret.yaml => secrets/placeholder-obm-legacy-passwords.yaml} (100%) rename argo-workflows/{sync-nb-server-to-ironic/deps/example-ironic-secrets.yaml => secrets/production-ironic-for-argo-creds.yaml} (100%) rename argo-workflows/{sync-nb-server-to-ironic => }/sensors/debug-sensor.yaml (100%) rename argo-workflows/{ironic-to-nautobot-sync/sensors/ironic-to-nautobot-sensor.yaml => sensors/ironic-node-update.yaml} (100%) rename argo-workflows/{shared-sensors/nb-oob-interface-update-sensor.yaml => sensors/nb-oob-interface-update.yaml} (100%) rename argo-workflows/{generic/workflowtemplates => workflows}/get-device-nautobot.yaml (100%) rename argo-workflows/{generic/workflowtemplates => workflows}/get-obm-creds.yaml (100%) rename argo-workflows/{generic/workflowtemplates => workflows}/get-obm-ip.yaml (100%) rename argo-workflows/{obm-utils/workflowtemplates => workflows}/idrac-enable-network-boot.yaml (100%) rename argo-workflows/{generic/workflowtemplates => workflows}/nautobot-api.yaml (100%) rename argo-workflows/{sync-nb-server-to-ironic/workflowtemplates => workflows}/node-events.yaml (100%) rename argo-workflows/{obm-utils/workflowtemplates => workflows}/obm-firmware-update.yaml (100%) rename argo-workflows/{obm-utils/workflowtemplates => workflows}/obm-sync-creds.yaml (100%) rename argo-workflows/{sync-nb-server-to-ironic/workflowtemplates => workflows}/sync-interfaces-to-ironic.yaml (100%) rename argo-workflows/{sync-srv-redfish-intfs-to-nb/workflowtemplates => workflows}/sync-interfaces-to-nautobot.yaml (100%) rename argo-workflows/{sync-nb-server-to-ironic/workflowtemplates => workflows}/sync-nb-server-to-ironic.yaml (100%) rename argo-workflows/{sync-nb-server-to-ironic/workflowtemplates => workflows}/sync-obm-creds.yaml (100%) rename argo-workflows/{ironic-to-nautobot-sync/workflowtemplates/sync.yaml => workflows/sync-provision-state-to-nautobot.yaml} (100%) rename argo-workflows/{sync-nb-server-to-ironic/workflowtemplates => workflows}/sync-server-to-ironic.yaml (100%) rename argo-workflows/{sync-srv-redfish-intfs-to-nb/workflowtemplates => workflows}/sync-srv-redfish-intfs-to-nb.yaml (100%) rename argo-workflows/{trigger-undersync/workflowtemplates => workflows}/undersync-device.yaml (100%) rename argo-workflows/{trigger-undersync/workflowtemplates => workflows}/undersync-switch.yaml (100%) diff --git a/argo-workflows/generic/deps/externalsecret-nautobot-token.yaml b/argo-workflows/secrets/externalsecret-nautobot-token.yaml similarity index 100% rename from argo-workflows/generic/deps/externalsecret-nautobot-token.yaml rename to argo-workflows/secrets/externalsecret-nautobot-token.yaml diff --git a/argo-workflows/sync-srv-redfish-intfs-to-nb/deps/nautobot-token-secret.yaml b/argo-workflows/secrets/nautobot-token.yaml similarity index 100% rename from argo-workflows/sync-srv-redfish-intfs-to-nb/deps/nautobot-token-secret.yaml rename to argo-workflows/secrets/nautobot-token.yaml diff --git a/argo-workflows/sync-srv-redfish-intfs-to-nb/deps/obm-creds-secret.yaml b/argo-workflows/secrets/obm-creds.yaml similarity index 100% rename from argo-workflows/sync-srv-redfish-intfs-to-nb/deps/obm-creds-secret.yaml rename to argo-workflows/secrets/obm-creds.yaml diff --git a/argo-workflows/sync-nb-server-to-ironic/deps/operate-workflow-sa-token.yaml b/argo-workflows/secrets/operate-workflow-sa.token.yaml similarity index 100% rename from argo-workflows/sync-nb-server-to-ironic/deps/operate-workflow-sa-token.yaml rename to argo-workflows/secrets/operate-workflow-sa.token.yaml diff --git a/argo-workflows/generic/deps/placeholder-obm-creds-secret.yaml b/argo-workflows/secrets/placeholder-obm-creds.yaml similarity index 100% rename from argo-workflows/generic/deps/placeholder-obm-creds-secret.yaml rename to argo-workflows/secrets/placeholder-obm-creds.yaml diff --git a/argo-workflows/obm-utils/deps/placeholder-obm-legacy-passwords-secret.yaml b/argo-workflows/secrets/placeholder-obm-legacy-passwords.yaml similarity index 100% rename from argo-workflows/obm-utils/deps/placeholder-obm-legacy-passwords-secret.yaml rename to argo-workflows/secrets/placeholder-obm-legacy-passwords.yaml diff --git a/argo-workflows/sync-nb-server-to-ironic/deps/example-ironic-secrets.yaml b/argo-workflows/secrets/production-ironic-for-argo-creds.yaml similarity index 100% rename from argo-workflows/sync-nb-server-to-ironic/deps/example-ironic-secrets.yaml rename to argo-workflows/secrets/production-ironic-for-argo-creds.yaml diff --git a/argo-workflows/sync-nb-server-to-ironic/sensors/debug-sensor.yaml b/argo-workflows/sensors/debug-sensor.yaml similarity index 100% rename from argo-workflows/sync-nb-server-to-ironic/sensors/debug-sensor.yaml rename to argo-workflows/sensors/debug-sensor.yaml diff --git a/argo-workflows/ironic-to-nautobot-sync/sensors/ironic-to-nautobot-sensor.yaml b/argo-workflows/sensors/ironic-node-update.yaml similarity index 100% rename from argo-workflows/ironic-to-nautobot-sync/sensors/ironic-to-nautobot-sensor.yaml rename to argo-workflows/sensors/ironic-node-update.yaml diff --git a/argo-workflows/shared-sensors/nb-oob-interface-update-sensor.yaml b/argo-workflows/sensors/nb-oob-interface-update.yaml similarity index 100% rename from argo-workflows/shared-sensors/nb-oob-interface-update-sensor.yaml rename to argo-workflows/sensors/nb-oob-interface-update.yaml diff --git a/argo-workflows/generic/workflowtemplates/get-device-nautobot.yaml b/argo-workflows/workflows/get-device-nautobot.yaml similarity index 100% rename from argo-workflows/generic/workflowtemplates/get-device-nautobot.yaml rename to argo-workflows/workflows/get-device-nautobot.yaml diff --git a/argo-workflows/generic/workflowtemplates/get-obm-creds.yaml b/argo-workflows/workflows/get-obm-creds.yaml similarity index 100% rename from argo-workflows/generic/workflowtemplates/get-obm-creds.yaml rename to argo-workflows/workflows/get-obm-creds.yaml diff --git a/argo-workflows/generic/workflowtemplates/get-obm-ip.yaml b/argo-workflows/workflows/get-obm-ip.yaml similarity index 100% rename from argo-workflows/generic/workflowtemplates/get-obm-ip.yaml rename to argo-workflows/workflows/get-obm-ip.yaml diff --git a/argo-workflows/obm-utils/workflowtemplates/idrac-enable-network-boot.yaml b/argo-workflows/workflows/idrac-enable-network-boot.yaml similarity index 100% rename from argo-workflows/obm-utils/workflowtemplates/idrac-enable-network-boot.yaml rename to argo-workflows/workflows/idrac-enable-network-boot.yaml diff --git a/argo-workflows/generic/workflowtemplates/nautobot-api.yaml b/argo-workflows/workflows/nautobot-api.yaml similarity index 100% rename from argo-workflows/generic/workflowtemplates/nautobot-api.yaml rename to argo-workflows/workflows/nautobot-api.yaml diff --git a/argo-workflows/sync-nb-server-to-ironic/workflowtemplates/node-events.yaml b/argo-workflows/workflows/node-events.yaml similarity index 100% rename from argo-workflows/sync-nb-server-to-ironic/workflowtemplates/node-events.yaml rename to argo-workflows/workflows/node-events.yaml diff --git a/argo-workflows/obm-utils/workflowtemplates/obm-firmware-update.yaml b/argo-workflows/workflows/obm-firmware-update.yaml similarity index 100% rename from argo-workflows/obm-utils/workflowtemplates/obm-firmware-update.yaml rename to argo-workflows/workflows/obm-firmware-update.yaml diff --git a/argo-workflows/obm-utils/workflowtemplates/obm-sync-creds.yaml b/argo-workflows/workflows/obm-sync-creds.yaml similarity index 100% rename from argo-workflows/obm-utils/workflowtemplates/obm-sync-creds.yaml rename to argo-workflows/workflows/obm-sync-creds.yaml diff --git a/argo-workflows/sync-nb-server-to-ironic/workflowtemplates/sync-interfaces-to-ironic.yaml b/argo-workflows/workflows/sync-interfaces-to-ironic.yaml similarity index 100% rename from argo-workflows/sync-nb-server-to-ironic/workflowtemplates/sync-interfaces-to-ironic.yaml rename to argo-workflows/workflows/sync-interfaces-to-ironic.yaml diff --git a/argo-workflows/sync-srv-redfish-intfs-to-nb/workflowtemplates/sync-interfaces-to-nautobot.yaml b/argo-workflows/workflows/sync-interfaces-to-nautobot.yaml similarity index 100% rename from argo-workflows/sync-srv-redfish-intfs-to-nb/workflowtemplates/sync-interfaces-to-nautobot.yaml rename to argo-workflows/workflows/sync-interfaces-to-nautobot.yaml diff --git a/argo-workflows/sync-nb-server-to-ironic/workflowtemplates/sync-nb-server-to-ironic.yaml b/argo-workflows/workflows/sync-nb-server-to-ironic.yaml similarity index 100% rename from argo-workflows/sync-nb-server-to-ironic/workflowtemplates/sync-nb-server-to-ironic.yaml rename to argo-workflows/workflows/sync-nb-server-to-ironic.yaml diff --git a/argo-workflows/sync-nb-server-to-ironic/workflowtemplates/sync-obm-creds.yaml b/argo-workflows/workflows/sync-obm-creds.yaml similarity index 100% rename from argo-workflows/sync-nb-server-to-ironic/workflowtemplates/sync-obm-creds.yaml rename to argo-workflows/workflows/sync-obm-creds.yaml diff --git a/argo-workflows/ironic-to-nautobot-sync/workflowtemplates/sync.yaml b/argo-workflows/workflows/sync-provision-state-to-nautobot.yaml similarity index 100% rename from argo-workflows/ironic-to-nautobot-sync/workflowtemplates/sync.yaml rename to argo-workflows/workflows/sync-provision-state-to-nautobot.yaml diff --git a/argo-workflows/sync-nb-server-to-ironic/workflowtemplates/sync-server-to-ironic.yaml b/argo-workflows/workflows/sync-server-to-ironic.yaml similarity index 100% rename from argo-workflows/sync-nb-server-to-ironic/workflowtemplates/sync-server-to-ironic.yaml rename to argo-workflows/workflows/sync-server-to-ironic.yaml diff --git a/argo-workflows/sync-srv-redfish-intfs-to-nb/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml b/argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml similarity index 100% rename from argo-workflows/sync-srv-redfish-intfs-to-nb/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml rename to argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml diff --git a/argo-workflows/trigger-undersync/workflowtemplates/undersync-device.yaml b/argo-workflows/workflows/undersync-device.yaml similarity index 100% rename from argo-workflows/trigger-undersync/workflowtemplates/undersync-device.yaml rename to argo-workflows/workflows/undersync-device.yaml diff --git a/argo-workflows/trigger-undersync/workflowtemplates/undersync-switch.yaml b/argo-workflows/workflows/undersync-switch.yaml similarity index 100% rename from argo-workflows/trigger-undersync/workflowtemplates/undersync-switch.yaml rename to argo-workflows/workflows/undersync-switch.yaml From b7f9d128c1251c9c542cdba57ac83e0e79cdf2c6 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Mon, 9 Sep 2024 18:33:05 +0100 Subject: [PATCH 02/29] Delete example-feature argo-workflows folders We don't use this structure any more. --- argo-workflows/example-feature/code/.gitkeep | 0 argo-workflows/example-feature/containers/.gitkeep | 0 argo-workflows/example-feature/deps/.gitkeep | 0 argo-workflows/example-feature/docs/.gitkeep | 0 argo-workflows/example-feature/eventsources/.gitkeep | 0 argo-workflows/example-feature/sensors/.gitkeep | 0 argo-workflows/example-feature/workflowtemplates/.gitkeep | 0 7 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 argo-workflows/example-feature/code/.gitkeep delete mode 100644 argo-workflows/example-feature/containers/.gitkeep delete mode 100644 argo-workflows/example-feature/deps/.gitkeep delete mode 100644 argo-workflows/example-feature/docs/.gitkeep delete mode 100644 argo-workflows/example-feature/eventsources/.gitkeep delete mode 100644 argo-workflows/example-feature/sensors/.gitkeep delete mode 100644 argo-workflows/example-feature/workflowtemplates/.gitkeep diff --git a/argo-workflows/example-feature/code/.gitkeep b/argo-workflows/example-feature/code/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/argo-workflows/example-feature/containers/.gitkeep b/argo-workflows/example-feature/containers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/argo-workflows/example-feature/deps/.gitkeep b/argo-workflows/example-feature/deps/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/argo-workflows/example-feature/docs/.gitkeep b/argo-workflows/example-feature/docs/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/argo-workflows/example-feature/eventsources/.gitkeep b/argo-workflows/example-feature/eventsources/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/argo-workflows/example-feature/sensors/.gitkeep b/argo-workflows/example-feature/sensors/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/argo-workflows/example-feature/workflowtemplates/.gitkeep b/argo-workflows/example-feature/workflowtemplates/.gitkeep deleted file mode 100644 index e69de29b..00000000 From 379b485d86d665bd477efdd2ded8dfabd83a5669 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Mon, 9 Sep 2024 20:06:40 +0100 Subject: [PATCH 03/29] Re-organise workflow docker containers into their own folder --- .github/workflows/build-container-images.yaml | 16 ++++++++-------- .../argo_utils}/Dockerfile.argo_utils | 0 .../docs => containers/argo_utils}/README.md | 0 .../argo_utils}/code/argo_python/README.md | 0 .../argo_utils}/code/argo_python/__init__.py | 0 .../obm-utils}/Dockerfile.obm_utils | 0 .../docs => containers/obm-utils}/README.md | 0 .../{ => containers}/obm-utils/code/__init__.py | 0 .../obm-utils/code/obm_firmware_update.py | 0 .../obm-utils/code/obm_sync_creds.py | 0 .../obm-utils}/requirements.txt | 0 .../Dockerfile.python311_alpine | 0 .../Dockerfile.python312_alpine | 0 13 files changed, 8 insertions(+), 8 deletions(-) rename argo-workflows/{generic/containers => containers/argo_utils}/Dockerfile.argo_utils (100%) rename argo-workflows/{generic/docs => containers/argo_utils}/README.md (100%) rename argo-workflows/{generic => containers/argo_utils}/code/argo_python/README.md (100%) rename argo-workflows/{generic => containers/argo_utils}/code/argo_python/__init__.py (100%) rename argo-workflows/{obm-utils/containers => containers/obm-utils}/Dockerfile.obm_utils (100%) rename argo-workflows/{obm-utils/docs => containers/obm-utils}/README.md (100%) rename argo-workflows/{ => containers}/obm-utils/code/__init__.py (100%) rename argo-workflows/{ => containers}/obm-utils/code/obm_firmware_update.py (100%) rename argo-workflows/{ => containers}/obm-utils/code/obm_sync_creds.py (100%) rename argo-workflows/{obm-utils/containers => containers/obm-utils}/requirements.txt (100%) rename argo-workflows/{generic/containers => containers/python311_alpine}/Dockerfile.python311_alpine (100%) rename argo-workflows/{generic/containers => containers/python312_alpine}/Dockerfile.python312_alpine (100%) diff --git a/.github/workflows/build-container-images.yaml b/.github/workflows/build-container-images.yaml index 97375079..1ebc9b6e 100644 --- a/.github/workflows/build-container-images.yaml +++ b/.github/workflows/build-container-images.yaml @@ -46,8 +46,8 @@ jobs: - name: Build and deploy Python 3.11 image uses: docker/build-push-action@v5 with: - context: argo-workflows/generic/ - file: argo-workflows/generic/containers/Dockerfile.python311_alpine + context: argo-workflows/containers/python311_alpine/ + file: argo-workflows/containers/python311_alpine/Dockerfile.python311_alpine # push for all main branch commits push: ${{ github.event_name != 'pull_request' }} tags: ghcr.io/rackerlabs/understack/argo-python3.11.8-alpine3.19:latest,ghcr.io/rackerlabs/understack/argo-python3.11.8-alpine3.19:${{ env.VERSION_PYTHON311 }} @@ -57,8 +57,8 @@ jobs: - name: Build and deploy Python 3.12 image uses: docker/build-push-action@v5 with: - context: argo-workflows/generic/ - file: argo-workflows/generic/containers/Dockerfile.python312_alpine + context: argo-workflows/containers/python312_alpine/ + file: argo-workflows/containers/python312_alpine/Dockerfile.python312_alpine # push for all main branch commits push: ${{ github.event_name != 'pull_request' }} tags: ghcr.io/rackerlabs/understack/argo-python3.12.2-alpine3.19:latest,ghcr.io/rackerlabs/understack/argo-python3.12.2-alpine3.19:${{ env.VERSION_PYTHON312 }} @@ -68,8 +68,8 @@ jobs: - name: Build and deploy Argo Utils image uses: docker/build-push-action@v5 with: - context: argo-workflows/generic/ - file: argo-workflows/generic/containers/Dockerfile.argo_utils + context: argo-workflows/containers/argo_utils/ + file: argo-workflows/containers/argo_utils/Dockerfile.argo_utils # push for all main branch commits push: ${{ github.event_name != 'pull_request' }} tags: ghcr.io/rackerlabs/understack/argo-utils-python3.11.8:latest,ghcr.io/rackerlabs/understack/argo-utils-python3.11.8:${{ env.VERSION_ARGO_UTILS }} @@ -79,8 +79,8 @@ jobs: - name: Build and deploy OBM Utils image uses: docker/build-push-action@v5 with: - context: argo-workflows/obm-utils/ - file: argo-workflows/obm-utils/containers/Dockerfile.obm_utils + context: argo-workflows/containers/obm-utils/ + file: argo-workflows/containers/obm-utils/Dockerfile.obm_utils # push for all main branch commits push: ${{ github.event_name != 'pull_request' }} tags: ghcr.io/rackerlabs/understack/argo-obm-utils-python3.11.8:latest,ghcr.io/rackerlabs/understack/argo-obm-utils-python3.11.8:${{ env.VERSION_OBM_UTILS }} diff --git a/argo-workflows/generic/containers/Dockerfile.argo_utils b/argo-workflows/containers/argo_utils/Dockerfile.argo_utils similarity index 100% rename from argo-workflows/generic/containers/Dockerfile.argo_utils rename to argo-workflows/containers/argo_utils/Dockerfile.argo_utils diff --git a/argo-workflows/generic/docs/README.md b/argo-workflows/containers/argo_utils/README.md similarity index 100% rename from argo-workflows/generic/docs/README.md rename to argo-workflows/containers/argo_utils/README.md diff --git a/argo-workflows/generic/code/argo_python/README.md b/argo-workflows/containers/argo_utils/code/argo_python/README.md similarity index 100% rename from argo-workflows/generic/code/argo_python/README.md rename to argo-workflows/containers/argo_utils/code/argo_python/README.md diff --git a/argo-workflows/generic/code/argo_python/__init__.py b/argo-workflows/containers/argo_utils/code/argo_python/__init__.py similarity index 100% rename from argo-workflows/generic/code/argo_python/__init__.py rename to argo-workflows/containers/argo_utils/code/argo_python/__init__.py diff --git a/argo-workflows/obm-utils/containers/Dockerfile.obm_utils b/argo-workflows/containers/obm-utils/Dockerfile.obm_utils similarity index 100% rename from argo-workflows/obm-utils/containers/Dockerfile.obm_utils rename to argo-workflows/containers/obm-utils/Dockerfile.obm_utils diff --git a/argo-workflows/obm-utils/docs/README.md b/argo-workflows/containers/obm-utils/README.md similarity index 100% rename from argo-workflows/obm-utils/docs/README.md rename to argo-workflows/containers/obm-utils/README.md diff --git a/argo-workflows/obm-utils/code/__init__.py b/argo-workflows/containers/obm-utils/code/__init__.py similarity index 100% rename from argo-workflows/obm-utils/code/__init__.py rename to argo-workflows/containers/obm-utils/code/__init__.py diff --git a/argo-workflows/obm-utils/code/obm_firmware_update.py b/argo-workflows/containers/obm-utils/code/obm_firmware_update.py similarity index 100% rename from argo-workflows/obm-utils/code/obm_firmware_update.py rename to argo-workflows/containers/obm-utils/code/obm_firmware_update.py diff --git a/argo-workflows/obm-utils/code/obm_sync_creds.py b/argo-workflows/containers/obm-utils/code/obm_sync_creds.py similarity index 100% rename from argo-workflows/obm-utils/code/obm_sync_creds.py rename to argo-workflows/containers/obm-utils/code/obm_sync_creds.py diff --git a/argo-workflows/obm-utils/containers/requirements.txt b/argo-workflows/containers/obm-utils/requirements.txt similarity index 100% rename from argo-workflows/obm-utils/containers/requirements.txt rename to argo-workflows/containers/obm-utils/requirements.txt diff --git a/argo-workflows/generic/containers/Dockerfile.python311_alpine b/argo-workflows/containers/python311_alpine/Dockerfile.python311_alpine similarity index 100% rename from argo-workflows/generic/containers/Dockerfile.python311_alpine rename to argo-workflows/containers/python311_alpine/Dockerfile.python311_alpine diff --git a/argo-workflows/generic/containers/Dockerfile.python312_alpine b/argo-workflows/containers/python312_alpine/Dockerfile.python312_alpine similarity index 100% rename from argo-workflows/generic/containers/Dockerfile.python312_alpine rename to argo-workflows/containers/python312_alpine/Dockerfile.python312_alpine From 9976d44e2a57a6d2d888b8afef960cab701ba79f Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Mon, 9 Sep 2024 20:33:57 +0100 Subject: [PATCH 04/29] Fix up the "defined in" metadata in workflows that were renamed --- argo-workflows/sensors/debug-sensor.yaml | 2 +- argo-workflows/sensors/ironic-node-update.yaml | 2 +- argo-workflows/sensors/nb-oob-interface-update.yaml | 2 +- argo-workflows/workflows/get-device-nautobot.yaml | 2 +- argo-workflows/workflows/get-obm-creds.yaml | 2 +- argo-workflows/workflows/get-obm-ip.yaml | 2 +- argo-workflows/workflows/idrac-enable-network-boot.yaml | 2 +- argo-workflows/workflows/nautobot-api.yaml | 2 +- argo-workflows/workflows/node-events.yaml | 2 +- argo-workflows/workflows/obm-firmware-update.yaml | 2 +- argo-workflows/workflows/obm-sync-creds.yaml | 2 +- argo-workflows/workflows/sync-interfaces-to-ironic.yaml | 2 +- argo-workflows/workflows/sync-interfaces-to-nautobot.yaml | 2 +- argo-workflows/workflows/sync-nb-server-to-ironic.yaml | 2 +- argo-workflows/workflows/sync-obm-creds.yaml | 2 +- argo-workflows/workflows/sync-provision-state-to-nautobot.yaml | 2 +- argo-workflows/workflows/sync-server-to-ironic.yaml | 2 +- argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml | 2 +- argo-workflows/workflows/undersync-device.yaml | 2 +- argo-workflows/workflows/undersync-switch.yaml | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/argo-workflows/sensors/debug-sensor.yaml b/argo-workflows/sensors/debug-sensor.yaml index ac543ecc..40725306 100644 --- a/argo-workflows/sensors/debug-sensor.yaml +++ b/argo-workflows/sensors/debug-sensor.yaml @@ -5,7 +5,7 @@ metadata: namespace: argo-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/sync-nb-server-to-ironic/sensors/debug-sensor.yaml` + Defined in `argo-workflows/sensors/debug-sensor.yaml` spec: dependencies: - eventName: interface-update diff --git a/argo-workflows/sensors/ironic-node-update.yaml b/argo-workflows/sensors/ironic-node-update.yaml index 4a08ba68..aee04a93 100644 --- a/argo-workflows/sensors/ironic-node-update.yaml +++ b/argo-workflows/sensors/ironic-node-update.yaml @@ -10,7 +10,7 @@ metadata: namespace: argo-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/ironic-to-nautobot-sensor/sensors/sync.yaml` + Defined in `argo-workflows/sensors/ironic-node-update.yaml` spec: dependencies: - eventName: openstack diff --git a/argo-workflows/sensors/nb-oob-interface-update.yaml b/argo-workflows/sensors/nb-oob-interface-update.yaml index 4826be81..b5e6df70 100644 --- a/argo-workflows/sensors/nb-oob-interface-update.yaml +++ b/argo-workflows/sensors/nb-oob-interface-update.yaml @@ -9,7 +9,7 @@ metadata: namespace: argo-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/shared-sensors/nb-oob-interface-update-sensor.yaml` + Defined in `argo-workflows/workflows/nb-oob-interface-update-sensor.yaml` spec: dependencies: - eventName: nautobot diff --git a/argo-workflows/workflows/get-device-nautobot.yaml b/argo-workflows/workflows/get-device-nautobot.yaml index 227fbe2f..2f7907a1 100644 --- a/argo-workflows/workflows/get-device-nautobot.yaml +++ b/argo-workflows/workflows/get-device-nautobot.yaml @@ -6,7 +6,7 @@ metadata: namespace: argo-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/generic/workflowtemplates/get-device-nautobot.yaml`. Return Device Information from Nautobot + Defined in `argo-workflows/workflows/get-device-nautobot.yaml`. Return Device Information from Nautobot spec: serviceAccountName: workflow entrypoint: main diff --git a/argo-workflows/workflows/get-obm-creds.yaml b/argo-workflows/workflows/get-obm-creds.yaml index a93a936a..29a145fe 100644 --- a/argo-workflows/workflows/get-obm-creds.yaml +++ b/argo-workflows/workflows/get-obm-creds.yaml @@ -5,7 +5,7 @@ metadata: namespace: argo-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/generic/workflowtemplates/get-obm-creds.yaml`. + Defined in `argo-workflows/workflows/get-obm-creds.yaml`. An example template to return the name of a Kubernetes Secret which containing device's OBM credentials. spec: # garbage collection on the secret is tied to this pod. we remove this pod only after workflow completion to diff --git a/argo-workflows/workflows/get-obm-ip.yaml b/argo-workflows/workflows/get-obm-ip.yaml index 834cb7e7..e8427041 100644 --- a/argo-workflows/workflows/get-obm-ip.yaml +++ b/argo-workflows/workflows/get-obm-ip.yaml @@ -5,7 +5,7 @@ metadata: namespace: argo-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/generic/workflowtemplates/get-obm-creds.yaml`. + Defined in `argo-workflows/workflows/get-obm-ip.yaml`. Get OBM IP address for target Device spec: serviceAccountName: workflow diff --git a/argo-workflows/workflows/idrac-enable-network-boot.yaml b/argo-workflows/workflows/idrac-enable-network-boot.yaml index 5c26136a..b44ebc7d 100644 --- a/argo-workflows/workflows/idrac-enable-network-boot.yaml +++ b/argo-workflows/workflows/idrac-enable-network-boot.yaml @@ -7,7 +7,7 @@ metadata: annotations: workflows.argoproj.io/title: Enable network boot in Dell iDrac BIOS workflows.argoproj.io/description: | - Defined in `argo-workflows/obm-utils/workflowtemplates/idrac-enable-network-boot.yaml` + Defined in `argo-workflows/workflows/idrac-enable-network-boot.yaml` spec: arguments: parameters: diff --git a/argo-workflows/workflows/nautobot-api.yaml b/argo-workflows/workflows/nautobot-api.yaml index e65b9218..fb2651d2 100644 --- a/argo-workflows/workflows/nautobot-api.yaml +++ b/argo-workflows/workflows/nautobot-api.yaml @@ -6,7 +6,7 @@ metadata: namespace: argo-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/generic/workflowtemplates/nautobot-api.yaml`. + Defined in `argo-workflows/workflows/nautobot-api.yaml`. HTTP Template Workflow to query the Nautobot API spec: serviceAccountName: workflow diff --git a/argo-workflows/workflows/node-events.yaml b/argo-workflows/workflows/node-events.yaml index 35db4167..9d7df78c 100644 --- a/argo-workflows/workflows/node-events.yaml +++ b/argo-workflows/workflows/node-events.yaml @@ -4,7 +4,7 @@ metadata: name: node-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/sync-nb-server-to-ironic/node-events.yaml` + Defined in `argo-workflows/workflows/node-events.yaml` spec: volumes: - name: argo-secrets diff --git a/argo-workflows/workflows/obm-firmware-update.yaml b/argo-workflows/workflows/obm-firmware-update.yaml index 235d84cc..06b636f8 100644 --- a/argo-workflows/workflows/obm-firmware-update.yaml +++ b/argo-workflows/workflows/obm-firmware-update.yaml @@ -6,7 +6,7 @@ metadata: annotations: workflows.argoproj.io/title: Update OBM firmware on target Device workflows.argoproj.io/description: | - Defined in `argo-workflows/obm-utils/workflowtemplates/obm-firmware-update.yaml` + Defined in `argo-workflows/workflows/obm-firmware-update.yaml` spec: serviceAccountName: workflow entrypoint: main diff --git a/argo-workflows/workflows/obm-sync-creds.yaml b/argo-workflows/workflows/obm-sync-creds.yaml index 42854bcb..b11c9136 100644 --- a/argo-workflows/workflows/obm-sync-creds.yaml +++ b/argo-workflows/workflows/obm-sync-creds.yaml @@ -7,7 +7,7 @@ metadata: annotations: workflows.argoproj.io/title: Sync's a devices OBM password with what we have on record workflows.argoproj.io/description: | - Defined in `argo-workflows/obm-utils/workflowtemplates/obm-sync-creds.yaml` + Defined in `argo-workflows/workflows/obm-sync-creds.yaml` spec: arguments: parameters: diff --git a/argo-workflows/workflows/sync-interfaces-to-ironic.yaml b/argo-workflows/workflows/sync-interfaces-to-ironic.yaml index e6e05832..3ea5dd22 100644 --- a/argo-workflows/workflows/sync-interfaces-to-ironic.yaml +++ b/argo-workflows/workflows/sync-interfaces-to-ironic.yaml @@ -3,7 +3,7 @@ metadata: name: sync-interfaces-to-ironic annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/sync-nb-server-to-ironic/sync-interfaces-to-ironic.yaml` + Defined in `argo-workflows/workflows/sync-interfaces-to-ironic.yaml` kind: WorkflowTemplate spec: arguments: diff --git a/argo-workflows/workflows/sync-interfaces-to-nautobot.yaml b/argo-workflows/workflows/sync-interfaces-to-nautobot.yaml index 8c8441ae..3e87bf39 100644 --- a/argo-workflows/workflows/sync-interfaces-to-nautobot.yaml +++ b/argo-workflows/workflows/sync-interfaces-to-nautobot.yaml @@ -3,7 +3,7 @@ metadata: name: sync-interfaces-to-nautobot annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/sync-srv-redfish-intfs-to-nb/sync-interfaces-to-nautobot.yaml` + Defined in `argo-workflows/workflows/sync-interfaces-to-nautobot.yaml` kind: WorkflowTemplate spec: arguments: diff --git a/argo-workflows/workflows/sync-nb-server-to-ironic.yaml b/argo-workflows/workflows/sync-nb-server-to-ironic.yaml index 247fae78..e0ca51ba 100644 --- a/argo-workflows/workflows/sync-nb-server-to-ironic.yaml +++ b/argo-workflows/workflows/sync-nb-server-to-ironic.yaml @@ -3,7 +3,7 @@ metadata: name: sync-nb-server-to-ironic annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/sync-nb-server-to-ironic/sync-nb-server-to-ironic.yaml` + Defined in `argo-workflows/workflows/sync-nb-server-to-ironic.yaml` kind: WorkflowTemplate spec: entrypoint: main diff --git a/argo-workflows/workflows/sync-obm-creds.yaml b/argo-workflows/workflows/sync-obm-creds.yaml index 15d6c378..28836117 100644 --- a/argo-workflows/workflows/sync-obm-creds.yaml +++ b/argo-workflows/workflows/sync-obm-creds.yaml @@ -3,7 +3,7 @@ metadata: name: sync-obm-creds annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/sync-nb-server-to-ironic/sync-obm-creds.yaml` + Defined in `argo-workflows/workflows/sync-obm-creds.yaml` kind: WorkflowTemplate spec: entrypoint: main diff --git a/argo-workflows/workflows/sync-provision-state-to-nautobot.yaml b/argo-workflows/workflows/sync-provision-state-to-nautobot.yaml index 2d6fad89..be7362ac 100644 --- a/argo-workflows/workflows/sync-provision-state-to-nautobot.yaml +++ b/argo-workflows/workflows/sync-provision-state-to-nautobot.yaml @@ -3,7 +3,7 @@ metadata: name: sync-provision-state-to-nautobot annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/ironic-to-nautobot-sensor/workflowtemplates/sync.yaml` + Defined in `argo-workflows/workflows/sync-provision-state-to-nautobot.yaml` kind: WorkflowTemplate spec: serviceAccountName: workflow diff --git a/argo-workflows/workflows/sync-server-to-ironic.yaml b/argo-workflows/workflows/sync-server-to-ironic.yaml index 27ab7d6f..0e54b20b 100644 --- a/argo-workflows/workflows/sync-server-to-ironic.yaml +++ b/argo-workflows/workflows/sync-server-to-ironic.yaml @@ -3,7 +3,7 @@ metadata: name: sync-server-to-ironic annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/sync-nb-server-to-ironic/sync-server-to-ironic.yaml` + Defined in `argo-workflows/workflows/sync-server-to-ironic.yaml` kind: WorkflowTemplate spec: arguments: diff --git a/argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml b/argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml index d205ac3c..9dccb189 100644 --- a/argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml +++ b/argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml @@ -3,7 +3,7 @@ metadata: name: sync-srv-redfish-intfs-to-nb annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/sync-srv-redfish-intfs-to-nb/sync-srv-redfish-intfs-to-nb.yaml` + Defined in `argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml` kind: WorkflowTemplate spec: entrypoint: main diff --git a/argo-workflows/workflows/undersync-device.yaml b/argo-workflows/workflows/undersync-device.yaml index 490eca64..ba1b5335 100644 --- a/argo-workflows/workflows/undersync-device.yaml +++ b/argo-workflows/workflows/undersync-device.yaml @@ -3,7 +3,7 @@ metadata: name: undersync-device annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/trigger-undersync/undersync-device.yaml` + Defined in `argo-workflows/workflows/undersync-device.yaml` kind: WorkflowTemplate spec: entrypoint: trigger-undersync diff --git a/argo-workflows/workflows/undersync-switch.yaml b/argo-workflows/workflows/undersync-switch.yaml index 1d2f9932..2f871bf0 100644 --- a/argo-workflows/workflows/undersync-switch.yaml +++ b/argo-workflows/workflows/undersync-switch.yaml @@ -3,7 +3,7 @@ metadata: name: undersync-switch annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/trigger-undersync/undersync-switch.yaml` + Defined in `argo-workflows/workflows/undersync-switch.yaml` kind: WorkflowTemplate spec: entrypoint: undersync-switch From 2e3f3fac7a527b4146874fb9eb6501ee2b74d34d Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Mon, 9 Sep 2024 21:23:17 +0100 Subject: [PATCH 05/29] Add titles to argo workflow templates --- argo-workflows/workflows/get-device-nautobot.yaml | 1 + argo-workflows/workflows/get-obm-creds.yaml | 1 + argo-workflows/workflows/get-obm-ip.yaml | 1 + argo-workflows/workflows/nautobot-api.yaml | 1 + argo-workflows/workflows/sync-interfaces-to-ironic.yaml | 1 + argo-workflows/workflows/sync-interfaces-to-nautobot.yaml | 1 + argo-workflows/workflows/sync-nb-server-to-ironic.yaml | 1 + argo-workflows/workflows/sync-obm-creds.yaml | 1 + argo-workflows/workflows/sync-provision-state-to-nautobot.yaml | 1 + argo-workflows/workflows/sync-server-to-ironic.yaml | 1 + argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml | 1 + argo-workflows/workflows/undersync-device.yaml | 1 + argo-workflows/workflows/undersync-switch.yaml | 1 + 13 files changed, 13 insertions(+) diff --git a/argo-workflows/workflows/get-device-nautobot.yaml b/argo-workflows/workflows/get-device-nautobot.yaml index 2f7907a1..729a1ba1 100644 --- a/argo-workflows/workflows/get-device-nautobot.yaml +++ b/argo-workflows/workflows/get-device-nautobot.yaml @@ -5,6 +5,7 @@ metadata: name: get-device-nautobot namespace: argo-events annotations: + workflows.argoproj.io/title: Output JSON blob of Nautobot data for given device hostname workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/get-device-nautobot.yaml`. Return Device Information from Nautobot spec: diff --git a/argo-workflows/workflows/get-obm-creds.yaml b/argo-workflows/workflows/get-obm-creds.yaml index 29a145fe..24eb1472 100644 --- a/argo-workflows/workflows/get-obm-creds.yaml +++ b/argo-workflows/workflows/get-obm-creds.yaml @@ -4,6 +4,7 @@ metadata: name: get-obm-creds namespace: argo-events annotations: + workflows.argoproj.io/title: Create a k8s secret containing OBM creds for given device hostname workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/get-obm-creds.yaml`. An example template to return the name of a Kubernetes Secret which containing device's OBM credentials. diff --git a/argo-workflows/workflows/get-obm-ip.yaml b/argo-workflows/workflows/get-obm-ip.yaml index e8427041..be7b10b2 100644 --- a/argo-workflows/workflows/get-obm-ip.yaml +++ b/argo-workflows/workflows/get-obm-ip.yaml @@ -4,6 +4,7 @@ metadata: name: get-obm-ip namespace: argo-events annotations: + workflows.argoproj.io/title: Output OBM IP address for the Device with the given hostname workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/get-obm-ip.yaml`. Get OBM IP address for target Device diff --git a/argo-workflows/workflows/nautobot-api.yaml b/argo-workflows/workflows/nautobot-api.yaml index fb2651d2..e6aff499 100644 --- a/argo-workflows/workflows/nautobot-api.yaml +++ b/argo-workflows/workflows/nautobot-api.yaml @@ -5,6 +5,7 @@ metadata: name: nautobot-api namespace: argo-events annotations: + workflows.argoproj.io/title: HTTP Template Workflow to query the Nautobot API workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/nautobot-api.yaml`. HTTP Template Workflow to query the Nautobot API diff --git a/argo-workflows/workflows/sync-interfaces-to-ironic.yaml b/argo-workflows/workflows/sync-interfaces-to-ironic.yaml index 3ea5dd22..2ab750e8 100644 --- a/argo-workflows/workflows/sync-interfaces-to-ironic.yaml +++ b/argo-workflows/workflows/sync-interfaces-to-ironic.yaml @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1 metadata: name: sync-interfaces-to-ironic annotations: + workflows.argoproj.io/title: Sync Nautobot information about a Device's interfaces to Ironic workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/sync-interfaces-to-ironic.yaml` kind: WorkflowTemplate diff --git a/argo-workflows/workflows/sync-interfaces-to-nautobot.yaml b/argo-workflows/workflows/sync-interfaces-to-nautobot.yaml index 3e87bf39..3927d337 100644 --- a/argo-workflows/workflows/sync-interfaces-to-nautobot.yaml +++ b/argo-workflows/workflows/sync-interfaces-to-nautobot.yaml @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1 metadata: name: sync-interfaces-to-nautobot annotations: + workflows.argoproj.io/title: Sync Redfish interface data to Nautobot workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/sync-interfaces-to-nautobot.yaml` kind: WorkflowTemplate diff --git a/argo-workflows/workflows/sync-nb-server-to-ironic.yaml b/argo-workflows/workflows/sync-nb-server-to-ironic.yaml index e0ca51ba..161c7390 100644 --- a/argo-workflows/workflows/sync-nb-server-to-ironic.yaml +++ b/argo-workflows/workflows/sync-nb-server-to-ironic.yaml @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1 metadata: name: sync-nb-server-to-ironic annotations: + workflows.argoproj.io/title: Sync Server Information from Nautobot to Ironic workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/sync-nb-server-to-ironic.yaml` kind: WorkflowTemplate diff --git a/argo-workflows/workflows/sync-obm-creds.yaml b/argo-workflows/workflows/sync-obm-creds.yaml index 28836117..b1d24a91 100644 --- a/argo-workflows/workflows/sync-obm-creds.yaml +++ b/argo-workflows/workflows/sync-obm-creds.yaml @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1 metadata: name: sync-obm-creds annotations: + workflows.argoproj.io/title: Update a Device's BMC (redfish) username/password in Ironic workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/sync-obm-creds.yaml` kind: WorkflowTemplate diff --git a/argo-workflows/workflows/sync-provision-state-to-nautobot.yaml b/argo-workflows/workflows/sync-provision-state-to-nautobot.yaml index be7362ac..a0ce6be5 100644 --- a/argo-workflows/workflows/sync-provision-state-to-nautobot.yaml +++ b/argo-workflows/workflows/sync-provision-state-to-nautobot.yaml @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1 metadata: name: sync-provision-state-to-nautobot annotations: + workflows.argoproj.io/title: Update Nautobot Device status and custom field ironic_provision_state workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/sync-provision-state-to-nautobot.yaml` kind: WorkflowTemplate diff --git a/argo-workflows/workflows/sync-server-to-ironic.yaml b/argo-workflows/workflows/sync-server-to-ironic.yaml index 0e54b20b..aeb4d546 100644 --- a/argo-workflows/workflows/sync-server-to-ironic.yaml +++ b/argo-workflows/workflows/sync-server-to-ironic.yaml @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1 metadata: name: sync-server-to-ironic annotations: + workflows.argoproj.io/title: Update a Device name, driver and BMC URL in Ironic workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/sync-server-to-ironic.yaml` kind: WorkflowTemplate diff --git a/argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml b/argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml index 9dccb189..044fde5b 100644 --- a/argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml +++ b/argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1 metadata: name: sync-srv-redfish-intfs-to-nb annotations: + workflows.argoproj.io/title: Sync Redfish interface data to Nautobot workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml` kind: WorkflowTemplate diff --git a/argo-workflows/workflows/undersync-device.yaml b/argo-workflows/workflows/undersync-device.yaml index ba1b5335..f3bbadf7 100644 --- a/argo-workflows/workflows/undersync-device.yaml +++ b/argo-workflows/workflows/undersync-device.yaml @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1 metadata: name: undersync-device annotations: + workflows.argoproj.io/title: Updates Interface Status in Nautobot and triggers Undersync workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/undersync-device.yaml` kind: WorkflowTemplate diff --git a/argo-workflows/workflows/undersync-switch.yaml b/argo-workflows/workflows/undersync-switch.yaml index 2f871bf0..44b35c19 100644 --- a/argo-workflows/workflows/undersync-switch.yaml +++ b/argo-workflows/workflows/undersync-switch.yaml @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1 metadata: name: undersync-switch annotations: + workflows.argoproj.io/title: Requests an Undersync run on a pair of switches workflows.argoproj.io/description: | Defined in `argo-workflows/workflows/undersync-switch.yaml` kind: WorkflowTemplate From bc1e7cdfd3d5888a9db769bb19a070244df11ef4 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Mon, 9 Sep 2024 21:23:49 +0100 Subject: [PATCH 06/29] Fix outdated docstring comment --- .../understack_workflows/main/undersync_device.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/understack-workflows/understack_workflows/main/undersync_device.py b/python/understack-workflows/understack_workflows/main/undersync_device.py index 886cb88c..a4064554 100644 --- a/python/understack-workflows/understack_workflows/main/undersync_device.py +++ b/python/understack-workflows/understack_workflows/main/undersync_device.py @@ -83,11 +83,11 @@ def argument_parser(): def main(): - """Updates Interface status in Nautobot triggers Undersync. + """Updates Interface Status in Nautobot and triggers Undersync. - Updates Nautobot Interfaces's status field and follows with request to - Undersync service, requesting sync for all of the uplink_switches that the - device is connected to. + Updates Nautobot Device Interface status field and follows with + request to Undersync service, requesting sync for all of the + uplink_switches that the device is connected to. """ args = argument_parser().parse_args() From bf9053a5eab3c9282a549e7d66fb23b7a787ff64 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Mon, 9 Sep 2024 21:27:36 +0100 Subject: [PATCH 07/29] Re-organise argo-workflow docs --- .../sync-nb-server-to-ironic.dumps.json} | 0 .../sync-nb-server-to-ironic.md} | 0 .../sync-srv-redfish-intfs-to-nb.md} | 0 .../deps/get-obm-creds.yaml | 26 ------------------- 4 files changed, 26 deletions(-) rename argo-workflows/{sync-nb-server-to-ironic/docs/dumps.json => docs/sync-nb-server-to-ironic.dumps.json} (100%) rename argo-workflows/{sync-nb-server-to-ironic/docs/README.md => docs/sync-nb-server-to-ironic.md} (100%) rename argo-workflows/{sync-srv-redfish-intfs-to-nb/docs/README.md => docs/sync-srv-redfish-intfs-to-nb.md} (100%) delete mode 100644 argo-workflows/sync-srv-redfish-intfs-to-nb/deps/get-obm-creds.yaml diff --git a/argo-workflows/sync-nb-server-to-ironic/docs/dumps.json b/argo-workflows/docs/sync-nb-server-to-ironic.dumps.json similarity index 100% rename from argo-workflows/sync-nb-server-to-ironic/docs/dumps.json rename to argo-workflows/docs/sync-nb-server-to-ironic.dumps.json diff --git a/argo-workflows/sync-nb-server-to-ironic/docs/README.md b/argo-workflows/docs/sync-nb-server-to-ironic.md similarity index 100% rename from argo-workflows/sync-nb-server-to-ironic/docs/README.md rename to argo-workflows/docs/sync-nb-server-to-ironic.md diff --git a/argo-workflows/sync-srv-redfish-intfs-to-nb/docs/README.md b/argo-workflows/docs/sync-srv-redfish-intfs-to-nb.md similarity index 100% rename from argo-workflows/sync-srv-redfish-intfs-to-nb/docs/README.md rename to argo-workflows/docs/sync-srv-redfish-intfs-to-nb.md diff --git a/argo-workflows/sync-srv-redfish-intfs-to-nb/deps/get-obm-creds.yaml b/argo-workflows/sync-srv-redfish-intfs-to-nb/deps/get-obm-creds.yaml deleted file mode 100644 index c3ac3581..00000000 --- a/argo-workflows/sync-srv-redfish-intfs-to-nb/deps/get-obm-creds.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: WorkflowTemplate -metadata: - name: get-obm-creds - namespace: argo-events - annotations: - workflows.argoproj.io/description: A placeholder template to return the name of a Kubernetes Secret which contains device's OBM credentials. -spec: - serviceAccountName: workflow - entrypoint: main - arguments: - parameters: - - name: hostname - templates: - - name: main - inputs: - parameters: - - name: hostname - outputs: - parameters: - - name: secret - value: "obm-creds" - container: - image: alpine:latest - command: [echo] - args: ["*** PLACEHOLDER TEMPLATE. A WORKFLOW NEEDS TO BE CREATED TO RETURN THE NAME OF A SECRET CONTAINING CREDENTIALS. ***"] From 677a207dc661a80fccd0b9e2e3910f3ed2f8c970 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Tue, 10 Sep 2024 10:50:35 +0100 Subject: [PATCH 08/29] Rename workflows->workflowtemplates to reflect the Kind of its contents --- argo-workflows/sensors/nb-oob-interface-update.yaml | 2 +- .../{workflows => workflowtemplates}/get-device-nautobot.yaml | 2 +- .../{workflows => workflowtemplates}/get-obm-creds.yaml | 2 +- argo-workflows/{workflows => workflowtemplates}/get-obm-ip.yaml | 2 +- .../idrac-enable-network-boot.yaml | 2 +- .../{workflows => workflowtemplates}/nautobot-api.yaml | 2 +- .../{workflows => workflowtemplates}/node-events.yaml | 2 +- .../{workflows => workflowtemplates}/obm-firmware-update.yaml | 2 +- .../{workflows => workflowtemplates}/obm-sync-creds.yaml | 2 +- .../sync-interfaces-to-ironic.yaml | 2 +- .../sync-interfaces-to-nautobot.yaml | 2 +- .../sync-nb-server-to-ironic.yaml | 2 +- .../{workflows => workflowtemplates}/sync-obm-creds.yaml | 2 +- .../sync-provision-state-to-nautobot.yaml | 2 +- .../{workflows => workflowtemplates}/sync-server-to-ironic.yaml | 2 +- .../sync-srv-redfish-intfs-to-nb.yaml | 2 +- .../{workflows => workflowtemplates}/undersync-device.yaml | 2 +- .../{workflows => workflowtemplates}/undersync-switch.yaml | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) rename argo-workflows/{workflows => workflowtemplates}/get-device-nautobot.yaml (89%) rename argo-workflows/{workflows => workflowtemplates}/get-obm-creds.yaml (96%) rename argo-workflows/{workflows => workflowtemplates}/get-obm-ip.yaml (93%) rename argo-workflows/{workflows => workflowtemplates}/idrac-enable-network-boot.yaml (96%) rename argo-workflows/{workflows => workflowtemplates}/nautobot-api.yaml (95%) rename argo-workflows/{workflows => workflowtemplates}/node-events.yaml (95%) rename argo-workflows/{workflows => workflowtemplates}/obm-firmware-update.yaml (96%) rename argo-workflows/{workflows => workflowtemplates}/obm-sync-creds.yaml (97%) rename argo-workflows/{workflows => workflowtemplates}/sync-interfaces-to-ironic.yaml (92%) rename argo-workflows/{workflows => workflowtemplates}/sync-interfaces-to-nautobot.yaml (92%) rename argo-workflows/{workflows => workflowtemplates}/sync-nb-server-to-ironic.yaml (93%) rename argo-workflows/{workflows => workflowtemplates}/sync-obm-creds.yaml (95%) rename argo-workflows/{workflows => workflowtemplates}/sync-provision-state-to-nautobot.yaml (91%) rename argo-workflows/{workflows => workflowtemplates}/sync-server-to-ironic.yaml (92%) rename argo-workflows/{workflows => workflowtemplates}/sync-srv-redfish-intfs-to-nb.yaml (94%) rename argo-workflows/{workflows => workflowtemplates}/undersync-device.yaml (95%) rename argo-workflows/{workflows => workflowtemplates}/undersync-switch.yaml (94%) diff --git a/argo-workflows/sensors/nb-oob-interface-update.yaml b/argo-workflows/sensors/nb-oob-interface-update.yaml index b5e6df70..33a96efc 100644 --- a/argo-workflows/sensors/nb-oob-interface-update.yaml +++ b/argo-workflows/sensors/nb-oob-interface-update.yaml @@ -9,7 +9,7 @@ metadata: namespace: argo-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/nb-oob-interface-update-sensor.yaml` + Defined in `argo-workflows/workflowtemplates/nb-oob-interface-update-sensor.yaml` spec: dependencies: - eventName: nautobot diff --git a/argo-workflows/workflows/get-device-nautobot.yaml b/argo-workflows/workflowtemplates/get-device-nautobot.yaml similarity index 89% rename from argo-workflows/workflows/get-device-nautobot.yaml rename to argo-workflows/workflowtemplates/get-device-nautobot.yaml index 729a1ba1..43d07c34 100644 --- a/argo-workflows/workflows/get-device-nautobot.yaml +++ b/argo-workflows/workflowtemplates/get-device-nautobot.yaml @@ -7,7 +7,7 @@ metadata: annotations: workflows.argoproj.io/title: Output JSON blob of Nautobot data for given device hostname workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/get-device-nautobot.yaml`. Return Device Information from Nautobot + Defined in `argo-workflows/workflowtemplates/get-device-nautobot.yaml`. Return Device Information from Nautobot spec: serviceAccountName: workflow entrypoint: main diff --git a/argo-workflows/workflows/get-obm-creds.yaml b/argo-workflows/workflowtemplates/get-obm-creds.yaml similarity index 96% rename from argo-workflows/workflows/get-obm-creds.yaml rename to argo-workflows/workflowtemplates/get-obm-creds.yaml index 24eb1472..2ae4bde3 100644 --- a/argo-workflows/workflows/get-obm-creds.yaml +++ b/argo-workflows/workflowtemplates/get-obm-creds.yaml @@ -6,7 +6,7 @@ metadata: annotations: workflows.argoproj.io/title: Create a k8s secret containing OBM creds for given device hostname workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/get-obm-creds.yaml`. + Defined in `argo-workflows/workflowtemplates/get-obm-creds.yaml`. An example template to return the name of a Kubernetes Secret which containing device's OBM credentials. spec: # garbage collection on the secret is tied to this pod. we remove this pod only after workflow completion to diff --git a/argo-workflows/workflows/get-obm-ip.yaml b/argo-workflows/workflowtemplates/get-obm-ip.yaml similarity index 93% rename from argo-workflows/workflows/get-obm-ip.yaml rename to argo-workflows/workflowtemplates/get-obm-ip.yaml index be7b10b2..e94e53dc 100644 --- a/argo-workflows/workflows/get-obm-ip.yaml +++ b/argo-workflows/workflowtemplates/get-obm-ip.yaml @@ -6,7 +6,7 @@ metadata: annotations: workflows.argoproj.io/title: Output OBM IP address for the Device with the given hostname workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/get-obm-ip.yaml`. + Defined in `argo-workflows/workflowtemplates/get-obm-ip.yaml`. Get OBM IP address for target Device spec: serviceAccountName: workflow diff --git a/argo-workflows/workflows/idrac-enable-network-boot.yaml b/argo-workflows/workflowtemplates/idrac-enable-network-boot.yaml similarity index 96% rename from argo-workflows/workflows/idrac-enable-network-boot.yaml rename to argo-workflows/workflowtemplates/idrac-enable-network-boot.yaml index b44ebc7d..b11114d3 100644 --- a/argo-workflows/workflows/idrac-enable-network-boot.yaml +++ b/argo-workflows/workflowtemplates/idrac-enable-network-boot.yaml @@ -7,7 +7,7 @@ metadata: annotations: workflows.argoproj.io/title: Enable network boot in Dell iDrac BIOS workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/idrac-enable-network-boot.yaml` + Defined in `argo-workflows/workflowtemplates/idrac-enable-network-boot.yaml` spec: arguments: parameters: diff --git a/argo-workflows/workflows/nautobot-api.yaml b/argo-workflows/workflowtemplates/nautobot-api.yaml similarity index 95% rename from argo-workflows/workflows/nautobot-api.yaml rename to argo-workflows/workflowtemplates/nautobot-api.yaml index e6aff499..3d4c57c4 100644 --- a/argo-workflows/workflows/nautobot-api.yaml +++ b/argo-workflows/workflowtemplates/nautobot-api.yaml @@ -7,7 +7,7 @@ metadata: annotations: workflows.argoproj.io/title: HTTP Template Workflow to query the Nautobot API workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/nautobot-api.yaml`. + Defined in `argo-workflows/workflowtemplates/nautobot-api.yaml`. HTTP Template Workflow to query the Nautobot API spec: serviceAccountName: workflow diff --git a/argo-workflows/workflows/node-events.yaml b/argo-workflows/workflowtemplates/node-events.yaml similarity index 95% rename from argo-workflows/workflows/node-events.yaml rename to argo-workflows/workflowtemplates/node-events.yaml index 9d7df78c..23cff392 100644 --- a/argo-workflows/workflows/node-events.yaml +++ b/argo-workflows/workflowtemplates/node-events.yaml @@ -4,7 +4,7 @@ metadata: name: node-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/node-events.yaml` + Defined in `argo-workflows/workflowtemplates/node-events.yaml` spec: volumes: - name: argo-secrets diff --git a/argo-workflows/workflows/obm-firmware-update.yaml b/argo-workflows/workflowtemplates/obm-firmware-update.yaml similarity index 96% rename from argo-workflows/workflows/obm-firmware-update.yaml rename to argo-workflows/workflowtemplates/obm-firmware-update.yaml index 06b636f8..23205f32 100644 --- a/argo-workflows/workflows/obm-firmware-update.yaml +++ b/argo-workflows/workflowtemplates/obm-firmware-update.yaml @@ -6,7 +6,7 @@ metadata: annotations: workflows.argoproj.io/title: Update OBM firmware on target Device workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/obm-firmware-update.yaml` + Defined in `argo-workflows/workflowtemplates/obm-firmware-update.yaml` spec: serviceAccountName: workflow entrypoint: main diff --git a/argo-workflows/workflows/obm-sync-creds.yaml b/argo-workflows/workflowtemplates/obm-sync-creds.yaml similarity index 97% rename from argo-workflows/workflows/obm-sync-creds.yaml rename to argo-workflows/workflowtemplates/obm-sync-creds.yaml index b11c9136..4852ef72 100644 --- a/argo-workflows/workflows/obm-sync-creds.yaml +++ b/argo-workflows/workflowtemplates/obm-sync-creds.yaml @@ -7,7 +7,7 @@ metadata: annotations: workflows.argoproj.io/title: Sync's a devices OBM password with what we have on record workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/obm-sync-creds.yaml` + Defined in `argo-workflows/workflowtemplates/obm-sync-creds.yaml` spec: arguments: parameters: diff --git a/argo-workflows/workflows/sync-interfaces-to-ironic.yaml b/argo-workflows/workflowtemplates/sync-interfaces-to-ironic.yaml similarity index 92% rename from argo-workflows/workflows/sync-interfaces-to-ironic.yaml rename to argo-workflows/workflowtemplates/sync-interfaces-to-ironic.yaml index 2ab750e8..93b49a14 100644 --- a/argo-workflows/workflows/sync-interfaces-to-ironic.yaml +++ b/argo-workflows/workflowtemplates/sync-interfaces-to-ironic.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Sync Nautobot information about a Device's interfaces to Ironic workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/sync-interfaces-to-ironic.yaml` + Defined in `argo-workflows/workflowtemplates/sync-interfaces-to-ironic.yaml` kind: WorkflowTemplate spec: arguments: diff --git a/argo-workflows/workflows/sync-interfaces-to-nautobot.yaml b/argo-workflows/workflowtemplates/sync-interfaces-to-nautobot.yaml similarity index 92% rename from argo-workflows/workflows/sync-interfaces-to-nautobot.yaml rename to argo-workflows/workflowtemplates/sync-interfaces-to-nautobot.yaml index 3927d337..3a6a380a 100644 --- a/argo-workflows/workflows/sync-interfaces-to-nautobot.yaml +++ b/argo-workflows/workflowtemplates/sync-interfaces-to-nautobot.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Sync Redfish interface data to Nautobot workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/sync-interfaces-to-nautobot.yaml` + Defined in `argo-workflows/workflowtemplates/sync-interfaces-to-nautobot.yaml` kind: WorkflowTemplate spec: arguments: diff --git a/argo-workflows/workflows/sync-nb-server-to-ironic.yaml b/argo-workflows/workflowtemplates/sync-nb-server-to-ironic.yaml similarity index 93% rename from argo-workflows/workflows/sync-nb-server-to-ironic.yaml rename to argo-workflows/workflowtemplates/sync-nb-server-to-ironic.yaml index 161c7390..83528a87 100644 --- a/argo-workflows/workflows/sync-nb-server-to-ironic.yaml +++ b/argo-workflows/workflowtemplates/sync-nb-server-to-ironic.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Sync Server Information from Nautobot to Ironic workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/sync-nb-server-to-ironic.yaml` + Defined in `argo-workflows/workflowtemplates/sync-nb-server-to-ironic.yaml` kind: WorkflowTemplate spec: entrypoint: main diff --git a/argo-workflows/workflows/sync-obm-creds.yaml b/argo-workflows/workflowtemplates/sync-obm-creds.yaml similarity index 95% rename from argo-workflows/workflows/sync-obm-creds.yaml rename to argo-workflows/workflowtemplates/sync-obm-creds.yaml index b1d24a91..85077aa8 100644 --- a/argo-workflows/workflows/sync-obm-creds.yaml +++ b/argo-workflows/workflowtemplates/sync-obm-creds.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Update a Device's BMC (redfish) username/password in Ironic workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/sync-obm-creds.yaml` + Defined in `argo-workflows/workflowtemplates/sync-obm-creds.yaml` kind: WorkflowTemplate spec: entrypoint: main diff --git a/argo-workflows/workflows/sync-provision-state-to-nautobot.yaml b/argo-workflows/workflowtemplates/sync-provision-state-to-nautobot.yaml similarity index 91% rename from argo-workflows/workflows/sync-provision-state-to-nautobot.yaml rename to argo-workflows/workflowtemplates/sync-provision-state-to-nautobot.yaml index a0ce6be5..cfd2c771 100644 --- a/argo-workflows/workflows/sync-provision-state-to-nautobot.yaml +++ b/argo-workflows/workflowtemplates/sync-provision-state-to-nautobot.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Update Nautobot Device status and custom field ironic_provision_state workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/sync-provision-state-to-nautobot.yaml` + Defined in `argo-workflows/workflowtemplates/sync-provision-state-to-nautobot.yaml` kind: WorkflowTemplate spec: serviceAccountName: workflow diff --git a/argo-workflows/workflows/sync-server-to-ironic.yaml b/argo-workflows/workflowtemplates/sync-server-to-ironic.yaml similarity index 92% rename from argo-workflows/workflows/sync-server-to-ironic.yaml rename to argo-workflows/workflowtemplates/sync-server-to-ironic.yaml index aeb4d546..a807dfe2 100644 --- a/argo-workflows/workflows/sync-server-to-ironic.yaml +++ b/argo-workflows/workflowtemplates/sync-server-to-ironic.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Update a Device name, driver and BMC URL in Ironic workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/sync-server-to-ironic.yaml` + Defined in `argo-workflows/workflowtemplates/sync-server-to-ironic.yaml` kind: WorkflowTemplate spec: arguments: diff --git a/argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml b/argo-workflows/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml similarity index 94% rename from argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml rename to argo-workflows/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml index 044fde5b..527afb6d 100644 --- a/argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml +++ b/argo-workflows/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Sync Redfish interface data to Nautobot workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/sync-srv-redfish-intfs-to-nb.yaml` + Defined in `argo-workflows/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml` kind: WorkflowTemplate spec: entrypoint: main diff --git a/argo-workflows/workflows/undersync-device.yaml b/argo-workflows/workflowtemplates/undersync-device.yaml similarity index 95% rename from argo-workflows/workflows/undersync-device.yaml rename to argo-workflows/workflowtemplates/undersync-device.yaml index f3bbadf7..0da4ae3a 100644 --- a/argo-workflows/workflows/undersync-device.yaml +++ b/argo-workflows/workflowtemplates/undersync-device.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Updates Interface Status in Nautobot and triggers Undersync workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/undersync-device.yaml` + Defined in `argo-workflows/workflowtemplates/undersync-device.yaml` kind: WorkflowTemplate spec: entrypoint: trigger-undersync diff --git a/argo-workflows/workflows/undersync-switch.yaml b/argo-workflows/workflowtemplates/undersync-switch.yaml similarity index 94% rename from argo-workflows/workflows/undersync-switch.yaml rename to argo-workflows/workflowtemplates/undersync-switch.yaml index 44b35c19..f5b7aa32 100644 --- a/argo-workflows/workflows/undersync-switch.yaml +++ b/argo-workflows/workflowtemplates/undersync-switch.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Requests an Undersync run on a pair of switches workflows.argoproj.io/description: | - Defined in `argo-workflows/workflows/undersync-switch.yaml` + Defined in `argo-workflows/workflowtemplates/undersync-switch.yaml` kind: WorkflowTemplate spec: entrypoint: undersync-switch From 5504ea9fc83e3401bf909072f97d233cdb18258b Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Tue, 10 Sep 2024 11:06:29 +0100 Subject: [PATCH 09/29] Move dnsmasq container to subdirectory --- .github/workflows/containers.yaml | 3 ++- containers/{ => dnsmasq}/Dockerfile.dnsmasq | 0 containers/{ => dnsmasq}/common/helpers.sh | 0 containers/dnsmasq/{ => dnsmasq}/dhcp-allowed-srvids.patch | 0 containers/dnsmasq/{ => dnsmasq}/dnsmasq.conf.j2 | 0 containers/dnsmasq/{ => dnsmasq}/entry-point.sh | 0 6 files changed, 2 insertions(+), 1 deletion(-) rename containers/{ => dnsmasq}/Dockerfile.dnsmasq (100%) rename containers/{ => dnsmasq}/common/helpers.sh (100%) rename containers/dnsmasq/{ => dnsmasq}/dhcp-allowed-srvids.patch (100%) rename containers/dnsmasq/{ => dnsmasq}/dnsmasq.conf.j2 (100%) rename containers/dnsmasq/{ => dnsmasq}/entry-point.sh (100%) diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 9d3201ac..84b8a727 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -98,8 +98,9 @@ jobs: - name: build and deploy dnsmasq container to registry uses: docker/build-push-action@v5 with: + context: "{{defaultContext}}:containers/dnsmasq" file: containers/Dockerfile.dnsmasq - push: true + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/containers/Dockerfile.dnsmasq b/containers/dnsmasq/Dockerfile.dnsmasq similarity index 100% rename from containers/Dockerfile.dnsmasq rename to containers/dnsmasq/Dockerfile.dnsmasq diff --git a/containers/common/helpers.sh b/containers/dnsmasq/common/helpers.sh similarity index 100% rename from containers/common/helpers.sh rename to containers/dnsmasq/common/helpers.sh diff --git a/containers/dnsmasq/dhcp-allowed-srvids.patch b/containers/dnsmasq/dnsmasq/dhcp-allowed-srvids.patch similarity index 100% rename from containers/dnsmasq/dhcp-allowed-srvids.patch rename to containers/dnsmasq/dnsmasq/dhcp-allowed-srvids.patch diff --git a/containers/dnsmasq/dnsmasq.conf.j2 b/containers/dnsmasq/dnsmasq/dnsmasq.conf.j2 similarity index 100% rename from containers/dnsmasq/dnsmasq.conf.j2 rename to containers/dnsmasq/dnsmasq/dnsmasq.conf.j2 diff --git a/containers/dnsmasq/entry-point.sh b/containers/dnsmasq/dnsmasq/entry-point.sh similarity index 100% rename from containers/dnsmasq/entry-point.sh rename to containers/dnsmasq/dnsmasq/entry-point.sh From d6e25757822049b9eacc10dce29b9d077f314a73 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Tue, 10 Sep 2024 11:07:23 +0100 Subject: [PATCH 10/29] Move ironiic-nautobot-client container to subdirectory --- .github/workflows/containers.yaml | 2 +- .../Dockerfile.ironic-nautobot-client | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename containers/{ => ironic-nautobot-client}/Dockerfile.ironic-nautobot-client (100%) diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 84b8a727..5514c068 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -143,7 +143,7 @@ jobs: - name: build and deploy container image to registry uses: docker/build-push-action@v5 with: - file: containers/Dockerfile.${{ matrix.container.name }} + file: containers/${{ matrix.container.name }}/Dockerfile.${{ matrix.container.name }} pull: true # ensure we always have an up to date source push: true tags: ${{ steps.meta.outputs.tags }} diff --git a/containers/Dockerfile.ironic-nautobot-client b/containers/ironic-nautobot-client/Dockerfile.ironic-nautobot-client similarity index 100% rename from containers/Dockerfile.ironic-nautobot-client rename to containers/ironic-nautobot-client/Dockerfile.ironic-nautobot-client From 73092532b1075306e0cda3f75277c244babb801d Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Tue, 10 Sep 2024 11:08:22 +0100 Subject: [PATCH 11/29] Move ironic and neutron containers to subdirectories --- .github/workflows/containers.yaml | 2 +- containers/{ => ironic}/Dockerfile.ironic | 0 containers/{ => neutron}/Dockerfile.neutron | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename containers/{ => ironic}/Dockerfile.ironic (100%) rename containers/{ => neutron}/Dockerfile.neutron (100%) diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 5514c068..9264a064 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -56,7 +56,7 @@ jobs: - name: build and deploy container image to registry uses: docker/build-push-action@v5 with: - file: containers/Dockerfile.${{ matrix.project }} + file: containers/${{ matrix.project }}/Dockerfile.${{ matrix.project }} build-args: OPENSTACK_VERSION=${{ matrix.openstack }} pull: true # ensure we always have an up to date source push: true diff --git a/containers/Dockerfile.ironic b/containers/ironic/Dockerfile.ironic similarity index 100% rename from containers/Dockerfile.ironic rename to containers/ironic/Dockerfile.ironic diff --git a/containers/Dockerfile.neutron b/containers/neutron/Dockerfile.neutron similarity index 100% rename from containers/Dockerfile.neutron rename to containers/neutron/Dockerfile.neutron From 251f058e5a8036a34205e5147ece6da0fd07e40c Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Tue, 10 Sep 2024 11:19:10 +0100 Subject: [PATCH 12/29] Move argo-workflow containers to central containers directory --- .github/workflows/build-container-images.yaml | 30 ++++++++++--------- .../argo_utils/Dockerfile.argo_utils | 0 .../argo_utils/README.md | 0 .../argo_utils/code/argo_python/README.md | 0 .../argo_utils/code/argo_python/__init__.py | 0 .../obm-utils/Dockerfile.obm_utils | 0 .../obm-utils/README.md | 0 .../obm-utils/code/__init__.py | 0 .../obm-utils/code/obm_firmware_update.py | 0 .../obm-utils/code/obm_sync_creds.py | 0 .../obm-utils/requirements.txt | 0 .../Dockerfile.python311_alpine | 0 .../Dockerfile.python312_alpine | 0 13 files changed, 16 insertions(+), 14 deletions(-) rename {argo-workflows/containers => containers}/argo_utils/Dockerfile.argo_utils (100%) rename {argo-workflows/containers => containers}/argo_utils/README.md (100%) rename {argo-workflows/containers => containers}/argo_utils/code/argo_python/README.md (100%) rename {argo-workflows/containers => containers}/argo_utils/code/argo_python/__init__.py (100%) rename {argo-workflows/containers => containers}/obm-utils/Dockerfile.obm_utils (100%) rename {argo-workflows/containers => containers}/obm-utils/README.md (100%) rename {argo-workflows/containers => containers}/obm-utils/code/__init__.py (100%) rename {argo-workflows/containers => containers}/obm-utils/code/obm_firmware_update.py (100%) rename {argo-workflows/containers => containers}/obm-utils/code/obm_sync_creds.py (100%) rename {argo-workflows/containers => containers}/obm-utils/requirements.txt (100%) rename {argo-workflows/containers => containers}/python311_alpine/Dockerfile.python311_alpine (100%) rename {argo-workflows/containers => containers}/python312_alpine/Dockerfile.python312_alpine (100%) diff --git a/.github/workflows/build-container-images.yaml b/.github/workflows/build-container-images.yaml index 1ebc9b6e..5d44971f 100644 --- a/.github/workflows/build-container-images.yaml +++ b/.github/workflows/build-container-images.yaml @@ -5,16 +5,18 @@ on: workflow_dispatch: pull_request: paths: - - 'argo-workflows/*/containers/*' - - 'argo-workflows/*/code/**' - - '!argo-workflows/example-feature/**' + - "containers/argo_utils/**" + - "containers/obm-utils/**" + - "containers/python311_alpine/**" + - "containers/python312_alpine/**" push: branches: - main paths: - - 'argo-workflows/*/containers/*' - - 'argo-workflows/*/code/**' - - '!argo-workflows/example-feature/**' + - "containers/argo_utils/**" + - "containers/obm-utils/**" + - "containers/python311_alpine/**" + - "containers/python312_alpine/**" # bump container versions here, they will be populated to tags and labels env: @@ -46,8 +48,8 @@ jobs: - name: Build and deploy Python 3.11 image uses: docker/build-push-action@v5 with: - context: argo-workflows/containers/python311_alpine/ - file: argo-workflows/containers/python311_alpine/Dockerfile.python311_alpine + context: containers/python311_alpine/ + file: containers/python311_alpine/Dockerfile.python311_alpine # push for all main branch commits push: ${{ github.event_name != 'pull_request' }} tags: ghcr.io/rackerlabs/understack/argo-python3.11.8-alpine3.19:latest,ghcr.io/rackerlabs/understack/argo-python3.11.8-alpine3.19:${{ env.VERSION_PYTHON311 }} @@ -57,8 +59,8 @@ jobs: - name: Build and deploy Python 3.12 image uses: docker/build-push-action@v5 with: - context: argo-workflows/containers/python312_alpine/ - file: argo-workflows/containers/python312_alpine/Dockerfile.python312_alpine + context: containers/python312_alpine/ + file: containers/python312_alpine/Dockerfile.python312_alpine # push for all main branch commits push: ${{ github.event_name != 'pull_request' }} tags: ghcr.io/rackerlabs/understack/argo-python3.12.2-alpine3.19:latest,ghcr.io/rackerlabs/understack/argo-python3.12.2-alpine3.19:${{ env.VERSION_PYTHON312 }} @@ -68,8 +70,8 @@ jobs: - name: Build and deploy Argo Utils image uses: docker/build-push-action@v5 with: - context: argo-workflows/containers/argo_utils/ - file: argo-workflows/containers/argo_utils/Dockerfile.argo_utils + context: containers/argo_utils/ + file: containers/argo_utils/Dockerfile.argo_utils # push for all main branch commits push: ${{ github.event_name != 'pull_request' }} tags: ghcr.io/rackerlabs/understack/argo-utils-python3.11.8:latest,ghcr.io/rackerlabs/understack/argo-utils-python3.11.8:${{ env.VERSION_ARGO_UTILS }} @@ -79,8 +81,8 @@ jobs: - name: Build and deploy OBM Utils image uses: docker/build-push-action@v5 with: - context: argo-workflows/containers/obm-utils/ - file: argo-workflows/containers/obm-utils/Dockerfile.obm_utils + context: containers/obm-utils/ + file: containers/obm-utils/Dockerfile.obm_utils # push for all main branch commits push: ${{ github.event_name != 'pull_request' }} tags: ghcr.io/rackerlabs/understack/argo-obm-utils-python3.11.8:latest,ghcr.io/rackerlabs/understack/argo-obm-utils-python3.11.8:${{ env.VERSION_OBM_UTILS }} diff --git a/argo-workflows/containers/argo_utils/Dockerfile.argo_utils b/containers/argo_utils/Dockerfile.argo_utils similarity index 100% rename from argo-workflows/containers/argo_utils/Dockerfile.argo_utils rename to containers/argo_utils/Dockerfile.argo_utils diff --git a/argo-workflows/containers/argo_utils/README.md b/containers/argo_utils/README.md similarity index 100% rename from argo-workflows/containers/argo_utils/README.md rename to containers/argo_utils/README.md diff --git a/argo-workflows/containers/argo_utils/code/argo_python/README.md b/containers/argo_utils/code/argo_python/README.md similarity index 100% rename from argo-workflows/containers/argo_utils/code/argo_python/README.md rename to containers/argo_utils/code/argo_python/README.md diff --git a/argo-workflows/containers/argo_utils/code/argo_python/__init__.py b/containers/argo_utils/code/argo_python/__init__.py similarity index 100% rename from argo-workflows/containers/argo_utils/code/argo_python/__init__.py rename to containers/argo_utils/code/argo_python/__init__.py diff --git a/argo-workflows/containers/obm-utils/Dockerfile.obm_utils b/containers/obm-utils/Dockerfile.obm_utils similarity index 100% rename from argo-workflows/containers/obm-utils/Dockerfile.obm_utils rename to containers/obm-utils/Dockerfile.obm_utils diff --git a/argo-workflows/containers/obm-utils/README.md b/containers/obm-utils/README.md similarity index 100% rename from argo-workflows/containers/obm-utils/README.md rename to containers/obm-utils/README.md diff --git a/argo-workflows/containers/obm-utils/code/__init__.py b/containers/obm-utils/code/__init__.py similarity index 100% rename from argo-workflows/containers/obm-utils/code/__init__.py rename to containers/obm-utils/code/__init__.py diff --git a/argo-workflows/containers/obm-utils/code/obm_firmware_update.py b/containers/obm-utils/code/obm_firmware_update.py similarity index 100% rename from argo-workflows/containers/obm-utils/code/obm_firmware_update.py rename to containers/obm-utils/code/obm_firmware_update.py diff --git a/argo-workflows/containers/obm-utils/code/obm_sync_creds.py b/containers/obm-utils/code/obm_sync_creds.py similarity index 100% rename from argo-workflows/containers/obm-utils/code/obm_sync_creds.py rename to containers/obm-utils/code/obm_sync_creds.py diff --git a/argo-workflows/containers/obm-utils/requirements.txt b/containers/obm-utils/requirements.txt similarity index 100% rename from argo-workflows/containers/obm-utils/requirements.txt rename to containers/obm-utils/requirements.txt diff --git a/argo-workflows/containers/python311_alpine/Dockerfile.python311_alpine b/containers/python311_alpine/Dockerfile.python311_alpine similarity index 100% rename from argo-workflows/containers/python311_alpine/Dockerfile.python311_alpine rename to containers/python311_alpine/Dockerfile.python311_alpine diff --git a/argo-workflows/containers/python312_alpine/Dockerfile.python312_alpine b/containers/python312_alpine/Dockerfile.python312_alpine similarity index 100% rename from argo-workflows/containers/python312_alpine/Dockerfile.python312_alpine rename to containers/python312_alpine/Dockerfile.python312_alpine From f8efe8c96202f29fda2bfe198c226ac984ebfe13 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Tue, 10 Sep 2024 11:20:19 +0100 Subject: [PATCH 13/29] Fix up precommit and github jobs paths for YAML tempalte changes --- .github/workflows/yamllint.yaml | 6 ++---- .pre-commit-config.yaml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml index 1f4ec222..f8648e17 100644 --- a/.github/workflows/yamllint.yaml +++ b/.github/workflows/yamllint.yaml @@ -43,11 +43,9 @@ jobs: with: jsonSchemaFile: argo-workflows/.workflow_with_description.schema.json yamlFiles: | - argo-workflows/**/workflowtemplates/*.y*ml - argo-workflows/**/sensors/*.y*ml - argo-workflows/**/workflows/*.y*ml + argo-workflows/workflowtemplates/*.y*ml + argo-workflows/sensors/*.y*ml apps/understack-workflows/workflows/workflowtemplates/*.y*ml - shellcheck: runs-on: ubuntu-latest steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2a63862a..4bd6605b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: args: - --schemafile - https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json - files: "argo-workflows/.*/(workflows|workflowtemplates)/.*.(yml|yaml)$" + files: "argo-workflows/(sensors|workflowtemplates)/.*.(yml|yaml)$" - repo: https://github.com/igorshubovych/markdownlint-cli rev: v0.37.0 hooks: From ada2611ff7d4100f54c3d9d5136f20cfd23bb8fc Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Tue, 10 Sep 2024 16:10:17 +0100 Subject: [PATCH 14/29] Organise the eventsource nautobot-webhook --- .../eventsources/nautobot-webhook.yaml | 0 components/argo-events/webhook-sensor.yaml | 45 ------------------- 2 files changed, 45 deletions(-) rename components/argo-events/webhook-event-source.yaml => argo-workflows/eventsources/nautobot-webhook.yaml (100%) delete mode 100644 components/argo-events/webhook-sensor.yaml diff --git a/components/argo-events/webhook-event-source.yaml b/argo-workflows/eventsources/nautobot-webhook.yaml similarity index 100% rename from components/argo-events/webhook-event-source.yaml rename to argo-workflows/eventsources/nautobot-webhook.yaml diff --git a/components/argo-events/webhook-sensor.yaml b/components/argo-events/webhook-sensor.yaml deleted file mode 100644 index 4cd06d14..00000000 --- a/components/argo-events/webhook-sensor.yaml +++ /dev/null @@ -1,45 +0,0 @@ ---- -apiVersion: argoproj.io/v1alpha1 -kind: Sensor -metadata: - name: nautobot-webhook -spec: - template: - serviceAccountName: operate-workflow-sa - dependencies: - - name: nautobot-dep - eventSourceName: nautobot-webhook # must match EventSource name - eventName: nautobot # must match event name defined in EventSource - triggers: - - template: - name: nautobot-workflow-trigger - k8s: - operation: create - source: - resource: - apiVersion: argoproj.io/v1alpha1 - kind: Workflow - metadata: - generateName: nautobot-webhook- - spec: - serviceAccountName: workflow - entrypoint: whalesay - arguments: - parameters: - - name: message - # the value will get overridden by event payload from test-dep - value: hello world - templates: - - name: whalesay - inputs: - parameters: - - name: message - container: - image: docker/whalesay:latest - command: [cowsay] - args: ["{{inputs.parameters.message}}"] - parameters: - - src: - dependencyName: nautobot-dep - dataKey: body - dest: spec.arguments.parameters.0.value From 86d4f25215e2779ea5fe3c491b4ff118f4d63e3e Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Tue, 10 Sep 2024 16:49:04 +0100 Subject: [PATCH 15/29] Merge the workflowtemplates into one place These are separated out into folders by k8s namespace and then by "kind". Kustomization is added to manage these --- .../workflows/kustomization.yaml | 10 ----- argo-workflows/secrets/nautobot-token.yaml | 8 ---- .../.workflow_with_description.schema.json | 0 .../argo-events/docs/README.md | 0 .../docs/sync-nb-server-to-ironic.dumps.json | 0 .../docs/sync-nb-server-to-ironic.md | 0 .../docs/sync-srv-redfish-intfs-to-nb.md | 0 .../eventsources/nautobot-webhook.yaml | 0 workflows/argo-events/kustomization.yaml | 37 +++++++++++++++++++ .../roles/sensor-submit-workflow-role.yaml | 0 .../argo-events/secrets/nautobot-token.yaml | 0 .../argo-events}/secrets/obm-creds.yaml | 0 .../secrets}/openstack-svc-acct.yaml | 0 .../secrets/operate-workflow-sa.token.yaml | 0 .../secrets/placeholder-obm-creds.yaml | 0 .../placeholder-obm-legacy-passwords.yaml | 0 .../production-ironic-for-argo-creds.yaml | 0 .../argo-events}/sensors/debug-sensor.yaml | 0 .../sensors/ironic-node-update.yaml | 0 .../sensors/nb-oob-interface-update.yaml | 0 .../get-device-nautobot.yaml | 0 .../workflowtemplates/get-obm-creds.yaml | 0 .../workflowtemplates/get-obm-ip.yaml | 0 .../idrac-enable-network-boot.yaml | 0 .../keystone-event-project.yaml | 0 .../workflowtemplates/nautobot-api.yaml | 0 .../workflowtemplates/node-events.yaml | 0 .../obm-firmware-update.yaml | 0 .../workflowtemplates/obm-sync-creds.yaml | 0 .../sync-interfaces-to-ironic.yaml | 0 .../sync-interfaces-to-nautobot.yaml | 0 .../sync-nb-server-to-ironic.yaml | 0 .../workflowtemplates/sync-obm-creds.yaml | 0 .../sync-provision-state-to-nautobot.yaml | 0 .../sync-server-to-ironic.yaml | 0 .../sync-srv-redfish-intfs-to-nb.yaml | 0 .../workflowtemplates/undersync-device.yaml | 0 .../workflowtemplates/undersync-switch.yaml | 0 .../kustomization.yaml | 4 +- .../openstack}/argo-rabbitmq.yaml | 0 .../openstack}/eventbus-default.yaml | 0 .../openstack}/kustomization.yaml | 0 .../openstack}/openstack-event-source.yaml | 0 .../sensor-keystone-event-project.yaml | 0 44 files changed, 39 insertions(+), 20 deletions(-) delete mode 100644 apps/understack-workflows/workflows/kustomization.yaml delete mode 100644 argo-workflows/secrets/nautobot-token.yaml rename {argo-workflows => understack-workflows}/.workflow_with_description.schema.json (100%) rename apps/understack-workflows/READMD.md => workflows/argo-events/docs/README.md (100%) rename {argo-workflows => workflows/argo-events}/docs/sync-nb-server-to-ironic.dumps.json (100%) rename {argo-workflows => workflows/argo-events}/docs/sync-nb-server-to-ironic.md (100%) rename {argo-workflows => workflows/argo-events}/docs/sync-srv-redfish-intfs-to-nb.md (100%) rename {argo-workflows => workflows/argo-events}/eventsources/nautobot-webhook.yaml (100%) create mode 100644 workflows/argo-events/kustomization.yaml rename apps/understack-workflows/workflows/sensor-submit-rbac.yaml => workflows/argo-events/roles/sensor-submit-workflow-role.yaml (100%) rename argo-workflows/secrets/externalsecret-nautobot-token.yaml => workflows/argo-events/secrets/nautobot-token.yaml (100%) rename {argo-workflows => workflows/argo-events}/secrets/obm-creds.yaml (100%) rename {apps/understack-workflows/workflows => workflows/argo-events/secrets}/openstack-svc-acct.yaml (100%) rename {argo-workflows => workflows/argo-events}/secrets/operate-workflow-sa.token.yaml (100%) rename {argo-workflows => workflows/argo-events}/secrets/placeholder-obm-creds.yaml (100%) rename {argo-workflows => workflows/argo-events}/secrets/placeholder-obm-legacy-passwords.yaml (100%) rename {argo-workflows => workflows/argo-events}/secrets/production-ironic-for-argo-creds.yaml (100%) rename {argo-workflows => workflows/argo-events}/sensors/debug-sensor.yaml (100%) rename {argo-workflows => workflows/argo-events}/sensors/ironic-node-update.yaml (100%) rename {argo-workflows => workflows/argo-events}/sensors/nb-oob-interface-update.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/get-device-nautobot.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/get-obm-creds.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/get-obm-ip.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/idrac-enable-network-boot.yaml (100%) rename {apps/understack-workflows/workflows => workflows/argo-events}/workflowtemplates/keystone-event-project.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/nautobot-api.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/node-events.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/obm-firmware-update.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/obm-sync-creds.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/sync-interfaces-to-ironic.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/sync-interfaces-to-nautobot.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/sync-nb-server-to-ironic.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/sync-obm-creds.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/sync-provision-state-to-nautobot.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/sync-server-to-ironic.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/undersync-device.yaml (100%) rename {argo-workflows => workflows/argo-events}/workflowtemplates/undersync-switch.yaml (100%) rename {apps/understack-workflows => workflows}/kustomization.yaml (65%) rename {apps/understack-workflows/eventsource-openstack => workflows/openstack}/argo-rabbitmq.yaml (100%) rename {apps/understack-workflows/eventsource-openstack => workflows/openstack}/eventbus-default.yaml (100%) rename {apps/understack-workflows/eventsource-openstack => workflows/openstack}/kustomization.yaml (100%) rename {apps/understack-workflows/eventsource-openstack => workflows/openstack}/openstack-event-source.yaml (100%) rename {apps/understack-workflows/eventsource-openstack => workflows/openstack}/sensor-keystone-event-project.yaml (100%) diff --git a/apps/understack-workflows/workflows/kustomization.yaml b/apps/understack-workflows/workflows/kustomization.yaml deleted file mode 100644 index a68ceb14..00000000 --- a/apps/understack-workflows/workflows/kustomization.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -# this is where our workflows currently run -namespace: argo-events - -resources: - - openstack-svc-acct.yaml - - sensor-submit-rbac.yaml - - workflowtemplates/keystone-event-project.yaml diff --git a/argo-workflows/secrets/nautobot-token.yaml b/argo-workflows/secrets/nautobot-token.yaml deleted file mode 100644 index 445921c1..00000000 --- a/argo-workflows/secrets/nautobot-token.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -apiVersion: v1 -data: - token: MTIzNDU2Nzg5MDEyMwo= -kind: Secret -metadata: - name: nautobot-token - namespace: argo-events diff --git a/argo-workflows/.workflow_with_description.schema.json b/understack-workflows/.workflow_with_description.schema.json similarity index 100% rename from argo-workflows/.workflow_with_description.schema.json rename to understack-workflows/.workflow_with_description.schema.json diff --git a/apps/understack-workflows/READMD.md b/workflows/argo-events/docs/README.md similarity index 100% rename from apps/understack-workflows/READMD.md rename to workflows/argo-events/docs/README.md diff --git a/argo-workflows/docs/sync-nb-server-to-ironic.dumps.json b/workflows/argo-events/docs/sync-nb-server-to-ironic.dumps.json similarity index 100% rename from argo-workflows/docs/sync-nb-server-to-ironic.dumps.json rename to workflows/argo-events/docs/sync-nb-server-to-ironic.dumps.json diff --git a/argo-workflows/docs/sync-nb-server-to-ironic.md b/workflows/argo-events/docs/sync-nb-server-to-ironic.md similarity index 100% rename from argo-workflows/docs/sync-nb-server-to-ironic.md rename to workflows/argo-events/docs/sync-nb-server-to-ironic.md diff --git a/argo-workflows/docs/sync-srv-redfish-intfs-to-nb.md b/workflows/argo-events/docs/sync-srv-redfish-intfs-to-nb.md similarity index 100% rename from argo-workflows/docs/sync-srv-redfish-intfs-to-nb.md rename to workflows/argo-events/docs/sync-srv-redfish-intfs-to-nb.md diff --git a/argo-workflows/eventsources/nautobot-webhook.yaml b/workflows/argo-events/eventsources/nautobot-webhook.yaml similarity index 100% rename from argo-workflows/eventsources/nautobot-webhook.yaml rename to workflows/argo-events/eventsources/nautobot-webhook.yaml diff --git a/workflows/argo-events/kustomization.yaml b/workflows/argo-events/kustomization.yaml new file mode 100644 index 00000000..327f73de --- /dev/null +++ b/workflows/argo-events/kustomization.yaml @@ -0,0 +1,37 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# this is where our workflows currently run +namespace: argo-events + +resources: + - secrets/openstack-svc-acct.yaml + - secrets/obm-creds.yaml + - secrets/placeholder-obm-creds.yaml + - secrets/operate-workflow-sa.token.yaml + - secrets/production-ironic-for-argo-creds.yaml + - secrets/nautobot-token.yaml + - secrets/placeholder-obm-legacy-passwords.yaml + - sensors/ironic-node-update.yaml + - sensors/debug-sensor.yaml + - sensors/nb-oob-interface-update.yaml + - eventsources/nautobot-webhook.yaml + - roles/sensor-submit-workflow-role.yaml + - workflowtemplates/nautobot-api.yaml + - workflowtemplates/get-device-nautobot.yaml + - workflowtemplates/sync-interfaces-to-nautobot.yaml + - workflowtemplates/sync-nb-server-to-ironic.yaml + - workflowtemplates/get-obm-ip.yaml + - workflowtemplates/sync-provision-state-to-nautobot.yaml + - workflowtemplates/node-events.yaml + - workflowtemplates/sync-interfaces-to-ironic.yaml + - workflowtemplates/undersync-device.yaml + - workflowtemplates/sync-server-to-ironic.yaml + - workflowtemplates/undersync-switch.yaml + - workflowtemplates/keystone-event-project.yaml + - workflowtemplates/get-obm-creds.yaml + - workflowtemplates/idrac-enable-network-boot.yaml + - workflowtemplates/obm-sync-creds.yaml + - workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml + - workflowtemplates/obm-firmware-update.yaml + - workflowtemplates/sync-obm-creds.yaml diff --git a/apps/understack-workflows/workflows/sensor-submit-rbac.yaml b/workflows/argo-events/roles/sensor-submit-workflow-role.yaml similarity index 100% rename from apps/understack-workflows/workflows/sensor-submit-rbac.yaml rename to workflows/argo-events/roles/sensor-submit-workflow-role.yaml diff --git a/argo-workflows/secrets/externalsecret-nautobot-token.yaml b/workflows/argo-events/secrets/nautobot-token.yaml similarity index 100% rename from argo-workflows/secrets/externalsecret-nautobot-token.yaml rename to workflows/argo-events/secrets/nautobot-token.yaml diff --git a/argo-workflows/secrets/obm-creds.yaml b/workflows/argo-events/secrets/obm-creds.yaml similarity index 100% rename from argo-workflows/secrets/obm-creds.yaml rename to workflows/argo-events/secrets/obm-creds.yaml diff --git a/apps/understack-workflows/workflows/openstack-svc-acct.yaml b/workflows/argo-events/secrets/openstack-svc-acct.yaml similarity index 100% rename from apps/understack-workflows/workflows/openstack-svc-acct.yaml rename to workflows/argo-events/secrets/openstack-svc-acct.yaml diff --git a/argo-workflows/secrets/operate-workflow-sa.token.yaml b/workflows/argo-events/secrets/operate-workflow-sa.token.yaml similarity index 100% rename from argo-workflows/secrets/operate-workflow-sa.token.yaml rename to workflows/argo-events/secrets/operate-workflow-sa.token.yaml diff --git a/argo-workflows/secrets/placeholder-obm-creds.yaml b/workflows/argo-events/secrets/placeholder-obm-creds.yaml similarity index 100% rename from argo-workflows/secrets/placeholder-obm-creds.yaml rename to workflows/argo-events/secrets/placeholder-obm-creds.yaml diff --git a/argo-workflows/secrets/placeholder-obm-legacy-passwords.yaml b/workflows/argo-events/secrets/placeholder-obm-legacy-passwords.yaml similarity index 100% rename from argo-workflows/secrets/placeholder-obm-legacy-passwords.yaml rename to workflows/argo-events/secrets/placeholder-obm-legacy-passwords.yaml diff --git a/argo-workflows/secrets/production-ironic-for-argo-creds.yaml b/workflows/argo-events/secrets/production-ironic-for-argo-creds.yaml similarity index 100% rename from argo-workflows/secrets/production-ironic-for-argo-creds.yaml rename to workflows/argo-events/secrets/production-ironic-for-argo-creds.yaml diff --git a/argo-workflows/sensors/debug-sensor.yaml b/workflows/argo-events/sensors/debug-sensor.yaml similarity index 100% rename from argo-workflows/sensors/debug-sensor.yaml rename to workflows/argo-events/sensors/debug-sensor.yaml diff --git a/argo-workflows/sensors/ironic-node-update.yaml b/workflows/argo-events/sensors/ironic-node-update.yaml similarity index 100% rename from argo-workflows/sensors/ironic-node-update.yaml rename to workflows/argo-events/sensors/ironic-node-update.yaml diff --git a/argo-workflows/sensors/nb-oob-interface-update.yaml b/workflows/argo-events/sensors/nb-oob-interface-update.yaml similarity index 100% rename from argo-workflows/sensors/nb-oob-interface-update.yaml rename to workflows/argo-events/sensors/nb-oob-interface-update.yaml diff --git a/argo-workflows/workflowtemplates/get-device-nautobot.yaml b/workflows/argo-events/workflowtemplates/get-device-nautobot.yaml similarity index 100% rename from argo-workflows/workflowtemplates/get-device-nautobot.yaml rename to workflows/argo-events/workflowtemplates/get-device-nautobot.yaml diff --git a/argo-workflows/workflowtemplates/get-obm-creds.yaml b/workflows/argo-events/workflowtemplates/get-obm-creds.yaml similarity index 100% rename from argo-workflows/workflowtemplates/get-obm-creds.yaml rename to workflows/argo-events/workflowtemplates/get-obm-creds.yaml diff --git a/argo-workflows/workflowtemplates/get-obm-ip.yaml b/workflows/argo-events/workflowtemplates/get-obm-ip.yaml similarity index 100% rename from argo-workflows/workflowtemplates/get-obm-ip.yaml rename to workflows/argo-events/workflowtemplates/get-obm-ip.yaml diff --git a/argo-workflows/workflowtemplates/idrac-enable-network-boot.yaml b/workflows/argo-events/workflowtemplates/idrac-enable-network-boot.yaml similarity index 100% rename from argo-workflows/workflowtemplates/idrac-enable-network-boot.yaml rename to workflows/argo-events/workflowtemplates/idrac-enable-network-boot.yaml diff --git a/apps/understack-workflows/workflows/workflowtemplates/keystone-event-project.yaml b/workflows/argo-events/workflowtemplates/keystone-event-project.yaml similarity index 100% rename from apps/understack-workflows/workflows/workflowtemplates/keystone-event-project.yaml rename to workflows/argo-events/workflowtemplates/keystone-event-project.yaml diff --git a/argo-workflows/workflowtemplates/nautobot-api.yaml b/workflows/argo-events/workflowtemplates/nautobot-api.yaml similarity index 100% rename from argo-workflows/workflowtemplates/nautobot-api.yaml rename to workflows/argo-events/workflowtemplates/nautobot-api.yaml diff --git a/argo-workflows/workflowtemplates/node-events.yaml b/workflows/argo-events/workflowtemplates/node-events.yaml similarity index 100% rename from argo-workflows/workflowtemplates/node-events.yaml rename to workflows/argo-events/workflowtemplates/node-events.yaml diff --git a/argo-workflows/workflowtemplates/obm-firmware-update.yaml b/workflows/argo-events/workflowtemplates/obm-firmware-update.yaml similarity index 100% rename from argo-workflows/workflowtemplates/obm-firmware-update.yaml rename to workflows/argo-events/workflowtemplates/obm-firmware-update.yaml diff --git a/argo-workflows/workflowtemplates/obm-sync-creds.yaml b/workflows/argo-events/workflowtemplates/obm-sync-creds.yaml similarity index 100% rename from argo-workflows/workflowtemplates/obm-sync-creds.yaml rename to workflows/argo-events/workflowtemplates/obm-sync-creds.yaml diff --git a/argo-workflows/workflowtemplates/sync-interfaces-to-ironic.yaml b/workflows/argo-events/workflowtemplates/sync-interfaces-to-ironic.yaml similarity index 100% rename from argo-workflows/workflowtemplates/sync-interfaces-to-ironic.yaml rename to workflows/argo-events/workflowtemplates/sync-interfaces-to-ironic.yaml diff --git a/argo-workflows/workflowtemplates/sync-interfaces-to-nautobot.yaml b/workflows/argo-events/workflowtemplates/sync-interfaces-to-nautobot.yaml similarity index 100% rename from argo-workflows/workflowtemplates/sync-interfaces-to-nautobot.yaml rename to workflows/argo-events/workflowtemplates/sync-interfaces-to-nautobot.yaml diff --git a/argo-workflows/workflowtemplates/sync-nb-server-to-ironic.yaml b/workflows/argo-events/workflowtemplates/sync-nb-server-to-ironic.yaml similarity index 100% rename from argo-workflows/workflowtemplates/sync-nb-server-to-ironic.yaml rename to workflows/argo-events/workflowtemplates/sync-nb-server-to-ironic.yaml diff --git a/argo-workflows/workflowtemplates/sync-obm-creds.yaml b/workflows/argo-events/workflowtemplates/sync-obm-creds.yaml similarity index 100% rename from argo-workflows/workflowtemplates/sync-obm-creds.yaml rename to workflows/argo-events/workflowtemplates/sync-obm-creds.yaml diff --git a/argo-workflows/workflowtemplates/sync-provision-state-to-nautobot.yaml b/workflows/argo-events/workflowtemplates/sync-provision-state-to-nautobot.yaml similarity index 100% rename from argo-workflows/workflowtemplates/sync-provision-state-to-nautobot.yaml rename to workflows/argo-events/workflowtemplates/sync-provision-state-to-nautobot.yaml diff --git a/argo-workflows/workflowtemplates/sync-server-to-ironic.yaml b/workflows/argo-events/workflowtemplates/sync-server-to-ironic.yaml similarity index 100% rename from argo-workflows/workflowtemplates/sync-server-to-ironic.yaml rename to workflows/argo-events/workflowtemplates/sync-server-to-ironic.yaml diff --git a/argo-workflows/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml b/workflows/argo-events/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml similarity index 100% rename from argo-workflows/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml rename to workflows/argo-events/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml diff --git a/argo-workflows/workflowtemplates/undersync-device.yaml b/workflows/argo-events/workflowtemplates/undersync-device.yaml similarity index 100% rename from argo-workflows/workflowtemplates/undersync-device.yaml rename to workflows/argo-events/workflowtemplates/undersync-device.yaml diff --git a/argo-workflows/workflowtemplates/undersync-switch.yaml b/workflows/argo-events/workflowtemplates/undersync-switch.yaml similarity index 100% rename from argo-workflows/workflowtemplates/undersync-switch.yaml rename to workflows/argo-events/workflowtemplates/undersync-switch.yaml diff --git a/apps/understack-workflows/kustomization.yaml b/workflows/kustomization.yaml similarity index 65% rename from apps/understack-workflows/kustomization.yaml rename to workflows/kustomization.yaml index 91ed5459..2fd7e122 100644 --- a/apps/understack-workflows/kustomization.yaml +++ b/workflows/kustomization.yaml @@ -2,5 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - eventsource-openstack - - workflows + - openstack + - argo-events diff --git a/apps/understack-workflows/eventsource-openstack/argo-rabbitmq.yaml b/workflows/openstack/argo-rabbitmq.yaml similarity index 100% rename from apps/understack-workflows/eventsource-openstack/argo-rabbitmq.yaml rename to workflows/openstack/argo-rabbitmq.yaml diff --git a/apps/understack-workflows/eventsource-openstack/eventbus-default.yaml b/workflows/openstack/eventbus-default.yaml similarity index 100% rename from apps/understack-workflows/eventsource-openstack/eventbus-default.yaml rename to workflows/openstack/eventbus-default.yaml diff --git a/apps/understack-workflows/eventsource-openstack/kustomization.yaml b/workflows/openstack/kustomization.yaml similarity index 100% rename from apps/understack-workflows/eventsource-openstack/kustomization.yaml rename to workflows/openstack/kustomization.yaml diff --git a/apps/understack-workflows/eventsource-openstack/openstack-event-source.yaml b/workflows/openstack/openstack-event-source.yaml similarity index 100% rename from apps/understack-workflows/eventsource-openstack/openstack-event-source.yaml rename to workflows/openstack/openstack-event-source.yaml diff --git a/apps/understack-workflows/eventsource-openstack/sensor-keystone-event-project.yaml b/workflows/openstack/sensor-keystone-event-project.yaml similarity index 100% rename from apps/understack-workflows/eventsource-openstack/sensor-keystone-event-project.yaml rename to workflows/openstack/sensor-keystone-event-project.yaml From 3b6db736afce9289c7cbe4580fe689eae3e7a721 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Tue, 10 Sep 2024 16:52:28 +0100 Subject: [PATCH 16/29] Update appsets configuration to reflect new path to workflows --- apps/appsets/components.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/appsets/components.yaml b/apps/appsets/components.yaml index 9b5cd713..f5b5d48f 100644 --- a/apps/appsets/components.yaml +++ b/apps/appsets/components.yaml @@ -179,7 +179,7 @@ spec: source: repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}' targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}' - path: 'apps/understack-workflows' + path: 'workflows' selector: # by setting the key in the elements 'skipComponent' to 'true' it will skip installing it # ArgoCD's templating operates with strings so it's the string "true" From 0d5b18a0fcfbce44cdf91e84b3f0df7afcd66f28 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Tue, 10 Sep 2024 17:27:03 +0100 Subject: [PATCH 17/29] Update workflow descriptions to match new paths --- workflows/argo-events/sensors/debug-sensor.yaml | 2 +- workflows/argo-events/sensors/ironic-node-update.yaml | 2 +- workflows/argo-events/sensors/nb-oob-interface-update.yaml | 2 +- .../argo-events/workflowtemplates/get-device-nautobot.yaml | 2 +- workflows/argo-events/workflowtemplates/get-obm-creds.yaml | 2 +- workflows/argo-events/workflowtemplates/get-obm-ip.yaml | 2 +- .../workflowtemplates/idrac-enable-network-boot.yaml | 2 +- .../argo-events/workflowtemplates/keystone-event-project.yaml | 2 +- workflows/argo-events/workflowtemplates/nautobot-api.yaml | 2 +- workflows/argo-events/workflowtemplates/node-events.yaml | 2 +- .../argo-events/workflowtemplates/obm-firmware-update.yaml | 2 +- workflows/argo-events/workflowtemplates/obm-sync-creds.yaml | 2 +- .../workflowtemplates/sync-interfaces-to-ironic.yaml | 2 +- .../workflowtemplates/sync-interfaces-to-nautobot.yaml | 2 +- .../argo-events/workflowtemplates/sync-nb-server-to-ironic.yaml | 2 +- workflows/argo-events/workflowtemplates/sync-obm-creds.yaml | 2 +- .../workflowtemplates/sync-provision-state-to-nautobot.yaml | 2 +- .../argo-events/workflowtemplates/sync-server-to-ironic.yaml | 2 +- .../workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml | 2 +- workflows/argo-events/workflowtemplates/undersync-device.yaml | 2 +- workflows/argo-events/workflowtemplates/undersync-switch.yaml | 2 +- workflows/openstack/sensor-keystone-event-project.yaml | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/workflows/argo-events/sensors/debug-sensor.yaml b/workflows/argo-events/sensors/debug-sensor.yaml index 40725306..cac6dc68 100644 --- a/workflows/argo-events/sensors/debug-sensor.yaml +++ b/workflows/argo-events/sensors/debug-sensor.yaml @@ -5,7 +5,7 @@ metadata: namespace: argo-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/sensors/debug-sensor.yaml` + Defined in `workflows/argo-events/sensors/debug-sensor.yaml` spec: dependencies: - eventName: interface-update diff --git a/workflows/argo-events/sensors/ironic-node-update.yaml b/workflows/argo-events/sensors/ironic-node-update.yaml index aee04a93..6c3c39a7 100644 --- a/workflows/argo-events/sensors/ironic-node-update.yaml +++ b/workflows/argo-events/sensors/ironic-node-update.yaml @@ -10,7 +10,7 @@ metadata: namespace: argo-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/sensors/ironic-node-update.yaml` + Defined in `workflows/argo-events/sensors/ironic-node-update.yaml` spec: dependencies: - eventName: openstack diff --git a/workflows/argo-events/sensors/nb-oob-interface-update.yaml b/workflows/argo-events/sensors/nb-oob-interface-update.yaml index 33a96efc..053bee46 100644 --- a/workflows/argo-events/sensors/nb-oob-interface-update.yaml +++ b/workflows/argo-events/sensors/nb-oob-interface-update.yaml @@ -9,7 +9,7 @@ metadata: namespace: argo-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/nb-oob-interface-update-sensor.yaml` + Defined in `workflows/argo-events/sensors/nb-oob-interface-update.yaml` spec: dependencies: - eventName: nautobot diff --git a/workflows/argo-events/workflowtemplates/get-device-nautobot.yaml b/workflows/argo-events/workflowtemplates/get-device-nautobot.yaml index 43d07c34..853fcd65 100644 --- a/workflows/argo-events/workflowtemplates/get-device-nautobot.yaml +++ b/workflows/argo-events/workflowtemplates/get-device-nautobot.yaml @@ -7,7 +7,7 @@ metadata: annotations: workflows.argoproj.io/title: Output JSON blob of Nautobot data for given device hostname workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/get-device-nautobot.yaml`. Return Device Information from Nautobot + Defined in `workflows/argo-events/workflowtemplates/get-device-nautobot.yaml`. Return Device Information from Nautobot spec: serviceAccountName: workflow entrypoint: main diff --git a/workflows/argo-events/workflowtemplates/get-obm-creds.yaml b/workflows/argo-events/workflowtemplates/get-obm-creds.yaml index 2ae4bde3..18022f59 100644 --- a/workflows/argo-events/workflowtemplates/get-obm-creds.yaml +++ b/workflows/argo-events/workflowtemplates/get-obm-creds.yaml @@ -6,7 +6,7 @@ metadata: annotations: workflows.argoproj.io/title: Create a k8s secret containing OBM creds for given device hostname workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/get-obm-creds.yaml`. + Defined in `workflows/argo-events/workflowtemplates/get-obm-creds.yaml`. An example template to return the name of a Kubernetes Secret which containing device's OBM credentials. spec: # garbage collection on the secret is tied to this pod. we remove this pod only after workflow completion to diff --git a/workflows/argo-events/workflowtemplates/get-obm-ip.yaml b/workflows/argo-events/workflowtemplates/get-obm-ip.yaml index e94e53dc..75d498fa 100644 --- a/workflows/argo-events/workflowtemplates/get-obm-ip.yaml +++ b/workflows/argo-events/workflowtemplates/get-obm-ip.yaml @@ -6,7 +6,7 @@ metadata: annotations: workflows.argoproj.io/title: Output OBM IP address for the Device with the given hostname workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/get-obm-ip.yaml`. + Defined in `workflows/argo-events/workflowtemplates/get-obm-ip.yaml`. Get OBM IP address for target Device spec: serviceAccountName: workflow diff --git a/workflows/argo-events/workflowtemplates/idrac-enable-network-boot.yaml b/workflows/argo-events/workflowtemplates/idrac-enable-network-boot.yaml index b11114d3..643488cd 100644 --- a/workflows/argo-events/workflowtemplates/idrac-enable-network-boot.yaml +++ b/workflows/argo-events/workflowtemplates/idrac-enable-network-boot.yaml @@ -7,7 +7,7 @@ metadata: annotations: workflows.argoproj.io/title: Enable network boot in Dell iDrac BIOS workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/idrac-enable-network-boot.yaml` + Defined in `workflows/argo-events/workflowtemplates/idrac-enable-network-boot.yaml` spec: arguments: parameters: diff --git a/workflows/argo-events/workflowtemplates/keystone-event-project.yaml b/workflows/argo-events/workflowtemplates/keystone-event-project.yaml index a2772b2a..0b492029 100644 --- a/workflows/argo-events/workflowtemplates/keystone-event-project.yaml +++ b/workflows/argo-events/workflowtemplates/keystone-event-project.yaml @@ -3,7 +3,7 @@ metadata: name: keystone-event-project annotations: workflows.argoproj.io/description: | - Defined in `apps/understack-workflows/workflowtemplates/wf-keystone-event-project.yaml` + Defined in `workflows/argo-events/workflowtemplates/wf-keystone-event-project.yaml` kind: WorkflowTemplate spec: entrypoint: sync-keystone diff --git a/workflows/argo-events/workflowtemplates/nautobot-api.yaml b/workflows/argo-events/workflowtemplates/nautobot-api.yaml index 3d4c57c4..3b8c65fe 100644 --- a/workflows/argo-events/workflowtemplates/nautobot-api.yaml +++ b/workflows/argo-events/workflowtemplates/nautobot-api.yaml @@ -7,7 +7,7 @@ metadata: annotations: workflows.argoproj.io/title: HTTP Template Workflow to query the Nautobot API workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/nautobot-api.yaml`. + Defined in `workflows/argo-events/workflowtemplates/nautobot-api.yaml`. HTTP Template Workflow to query the Nautobot API spec: serviceAccountName: workflow diff --git a/workflows/argo-events/workflowtemplates/node-events.yaml b/workflows/argo-events/workflowtemplates/node-events.yaml index 23cff392..a2a12ca5 100644 --- a/workflows/argo-events/workflowtemplates/node-events.yaml +++ b/workflows/argo-events/workflowtemplates/node-events.yaml @@ -4,7 +4,7 @@ metadata: name: node-events annotations: workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/node-events.yaml` + Defined in `workflows/argo-events/workflowtemplates/node-events.yaml` spec: volumes: - name: argo-secrets diff --git a/workflows/argo-events/workflowtemplates/obm-firmware-update.yaml b/workflows/argo-events/workflowtemplates/obm-firmware-update.yaml index 23205f32..ea19a3ab 100644 --- a/workflows/argo-events/workflowtemplates/obm-firmware-update.yaml +++ b/workflows/argo-events/workflowtemplates/obm-firmware-update.yaml @@ -6,7 +6,7 @@ metadata: annotations: workflows.argoproj.io/title: Update OBM firmware on target Device workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/obm-firmware-update.yaml` + Defined in `workflows/argo-events/workflowtemplates/obm-firmware-update.yaml` spec: serviceAccountName: workflow entrypoint: main diff --git a/workflows/argo-events/workflowtemplates/obm-sync-creds.yaml b/workflows/argo-events/workflowtemplates/obm-sync-creds.yaml index 4852ef72..e854e774 100644 --- a/workflows/argo-events/workflowtemplates/obm-sync-creds.yaml +++ b/workflows/argo-events/workflowtemplates/obm-sync-creds.yaml @@ -7,7 +7,7 @@ metadata: annotations: workflows.argoproj.io/title: Sync's a devices OBM password with what we have on record workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/obm-sync-creds.yaml` + Defined in `workflows/argo-events/workflowtemplates/obm-sync-creds.yaml` spec: arguments: parameters: diff --git a/workflows/argo-events/workflowtemplates/sync-interfaces-to-ironic.yaml b/workflows/argo-events/workflowtemplates/sync-interfaces-to-ironic.yaml index 93b49a14..78952f6c 100644 --- a/workflows/argo-events/workflowtemplates/sync-interfaces-to-ironic.yaml +++ b/workflows/argo-events/workflowtemplates/sync-interfaces-to-ironic.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Sync Nautobot information about a Device's interfaces to Ironic workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/sync-interfaces-to-ironic.yaml` + Defined in `workflows/argo-events/workflowtemplates/sync-interfaces-to-ironic.yaml` kind: WorkflowTemplate spec: arguments: diff --git a/workflows/argo-events/workflowtemplates/sync-interfaces-to-nautobot.yaml b/workflows/argo-events/workflowtemplates/sync-interfaces-to-nautobot.yaml index 3a6a380a..a7564291 100644 --- a/workflows/argo-events/workflowtemplates/sync-interfaces-to-nautobot.yaml +++ b/workflows/argo-events/workflowtemplates/sync-interfaces-to-nautobot.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Sync Redfish interface data to Nautobot workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/sync-interfaces-to-nautobot.yaml` + Defined in `workflows/argo-events/workflowtemplates/sync-interfaces-to-nautobot.yaml` kind: WorkflowTemplate spec: arguments: diff --git a/workflows/argo-events/workflowtemplates/sync-nb-server-to-ironic.yaml b/workflows/argo-events/workflowtemplates/sync-nb-server-to-ironic.yaml index 83528a87..c87d27d6 100644 --- a/workflows/argo-events/workflowtemplates/sync-nb-server-to-ironic.yaml +++ b/workflows/argo-events/workflowtemplates/sync-nb-server-to-ironic.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Sync Server Information from Nautobot to Ironic workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/sync-nb-server-to-ironic.yaml` + Defined in `workflows/argo-events/workflowtemplates/sync-nb-server-to-ironic.yaml` kind: WorkflowTemplate spec: entrypoint: main diff --git a/workflows/argo-events/workflowtemplates/sync-obm-creds.yaml b/workflows/argo-events/workflowtemplates/sync-obm-creds.yaml index 85077aa8..a508d493 100644 --- a/workflows/argo-events/workflowtemplates/sync-obm-creds.yaml +++ b/workflows/argo-events/workflowtemplates/sync-obm-creds.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Update a Device's BMC (redfish) username/password in Ironic workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/sync-obm-creds.yaml` + Defined in `workflows/argo-events/workflowtemplates/sync-obm-creds.yaml` kind: WorkflowTemplate spec: entrypoint: main diff --git a/workflows/argo-events/workflowtemplates/sync-provision-state-to-nautobot.yaml b/workflows/argo-events/workflowtemplates/sync-provision-state-to-nautobot.yaml index cfd2c771..1c6f74e5 100644 --- a/workflows/argo-events/workflowtemplates/sync-provision-state-to-nautobot.yaml +++ b/workflows/argo-events/workflowtemplates/sync-provision-state-to-nautobot.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Update Nautobot Device status and custom field ironic_provision_state workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/sync-provision-state-to-nautobot.yaml` + Defined in `workflows/argo-events/workflowtemplates/sync-provision-state-to-nautobot.yaml` kind: WorkflowTemplate spec: serviceAccountName: workflow diff --git a/workflows/argo-events/workflowtemplates/sync-server-to-ironic.yaml b/workflows/argo-events/workflowtemplates/sync-server-to-ironic.yaml index a807dfe2..93e7678a 100644 --- a/workflows/argo-events/workflowtemplates/sync-server-to-ironic.yaml +++ b/workflows/argo-events/workflowtemplates/sync-server-to-ironic.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Update a Device name, driver and BMC URL in Ironic workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/sync-server-to-ironic.yaml` + Defined in `workflows/argo-events/workflowtemplates/sync-server-to-ironic.yaml` kind: WorkflowTemplate spec: arguments: diff --git a/workflows/argo-events/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml b/workflows/argo-events/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml index 527afb6d..c0ccbe80 100644 --- a/workflows/argo-events/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml +++ b/workflows/argo-events/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Sync Redfish interface data to Nautobot workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml` + Defined in `workflows/argo-events/workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml` kind: WorkflowTemplate spec: entrypoint: main diff --git a/workflows/argo-events/workflowtemplates/undersync-device.yaml b/workflows/argo-events/workflowtemplates/undersync-device.yaml index 0da4ae3a..d163a255 100644 --- a/workflows/argo-events/workflowtemplates/undersync-device.yaml +++ b/workflows/argo-events/workflowtemplates/undersync-device.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Updates Interface Status in Nautobot and triggers Undersync workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/undersync-device.yaml` + Defined in `workflows/argo-events/workflowtemplates/undersync-device.yaml` kind: WorkflowTemplate spec: entrypoint: trigger-undersync diff --git a/workflows/argo-events/workflowtemplates/undersync-switch.yaml b/workflows/argo-events/workflowtemplates/undersync-switch.yaml index f5b7aa32..ca44a399 100644 --- a/workflows/argo-events/workflowtemplates/undersync-switch.yaml +++ b/workflows/argo-events/workflowtemplates/undersync-switch.yaml @@ -4,7 +4,7 @@ metadata: annotations: workflows.argoproj.io/title: Requests an Undersync run on a pair of switches workflows.argoproj.io/description: | - Defined in `argo-workflows/workflowtemplates/undersync-switch.yaml` + Defined in `workflows/argo-events/workflowtemplates/undersync-switch.yaml` kind: WorkflowTemplate spec: entrypoint: undersync-switch diff --git a/workflows/openstack/sensor-keystone-event-project.yaml b/workflows/openstack/sensor-keystone-event-project.yaml index fa800dba..28ac2343 100644 --- a/workflows/openstack/sensor-keystone-event-project.yaml +++ b/workflows/openstack/sensor-keystone-event-project.yaml @@ -15,7 +15,7 @@ metadata: namespace: argo-events annotations: workflows.argoproj.io/description: | - Defined in `apps/understack-workflows/sensors/sensor-keystone-event-project.yaml` + Defined in `workflows/openstack/sensor-keystone-event-project.yaml` spec: dependencies: - eventName: notifications From 804d0009d795a186d59af246826e148df4540d26 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Tue, 10 Sep 2024 17:35:49 +0100 Subject: [PATCH 18/29] Update yamllint to reflect changes to workflow paths --- .github/workflows/yamllint.yaml | 12 ++++++++---- .../.workflow_with_description.schema.json | 0 2 files changed, 8 insertions(+), 4 deletions(-) rename {understack-workflows => workflows}/.workflow_with_description.schema.json (100%) diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml index f8648e17..5d477549 100644 --- a/.github/workflows/yamllint.yaml +++ b/.github/workflows/yamllint.yaml @@ -41,11 +41,15 @@ jobs: - uses: actions/checkout@v4 - uses: thiagodnf/yaml-schema-checker@v0.0.12 with: - jsonSchemaFile: argo-workflows/.workflow_with_description.schema.json + jsonSchemaFile: workflows/.workflow_with_description.schema.json yamlFiles: | - argo-workflows/workflowtemplates/*.y*ml - argo-workflows/sensors/*.y*ml - apps/understack-workflows/workflows/workflowtemplates/*.y*ml + workflows/argo-events/secrets/*.y*ml + workflows/argo-events/sensors/*.y*ml + workflows/argo-events/eventsources/*.y*ml + workflows/argo-events/roles/*.y*ml + workflows/argo-events/workflowtemplates/*.y*ml + workflows/openstack/*.y*ml + shellcheck: runs-on: ubuntu-latest steps: diff --git a/understack-workflows/.workflow_with_description.schema.json b/workflows/.workflow_with_description.schema.json similarity index 100% rename from understack-workflows/.workflow_with_description.schema.json rename to workflows/.workflow_with_description.schema.json From 9fb99e3fdd24fb5400c5fbf4fe9d8f2c99cccd92 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Wed, 11 Sep 2024 09:15:14 +0100 Subject: [PATCH 19/29] Update pre-commit config to reflect changes to workflow paths --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4bd6605b..412a1289 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: args: - --schemafile - https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json - files: "argo-workflows/(sensors|workflowtemplates)/.*.(yml|yaml)$" + files: "workflows/argo-events/(sensors|workflowtemplates)/.*.(yml|yaml)$" - repo: https://github.com/igorshubovych/markdownlint-cli rev: v0.37.0 hooks: From d2d6f33a35d81fbf23a84f8c75071e54fff27092 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Wed, 11 Sep 2024 10:09:58 +0100 Subject: [PATCH 20/29] Update workflows.yaml to reflect new workflow paths --- apps/appsets/workflows.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/appsets/workflows.yaml b/apps/appsets/workflows.yaml index 94196232..527d368c 100644 --- a/apps/appsets/workflows.yaml +++ b/apps/appsets/workflows.yaml @@ -20,11 +20,10 @@ spec: sources: - repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}' targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}' - path: 'argo-workflows' + path: 'workflows/argo-events' directory: recurse: true - include: '{generic/deps/*.yaml,shared-sensors/*.yaml,*/sensors/*.yaml,*/workflowtemplates/*.yaml}' - exclude: '{example-feature/*,*/*/*example*}' + include: '{roles/*.yaml,secrets/*.yaml,sensors/*yaml,eventsources/*.yaml,workflowtemplates/*.yaml}' - repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}' targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}' path: 'argo-workflows' From c51bc9899f5c99c8c9b96bf91d4b51b27dc0a7e7 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Wed, 11 Sep 2024 10:32:58 +0100 Subject: [PATCH 21/29] Fix doc link to reflect new path to workflows --- docs/component-argo-workflows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/component-argo-workflows.md b/docs/component-argo-workflows.md index d1f79080..40d6d848 100644 --- a/docs/component-argo-workflows.md +++ b/docs/component-argo-workflows.md @@ -53,7 +53,7 @@ the Pod's uid can be passed via the `KUBERNETES_POD_UID` environment variable. T completion of the Workflow `.spec.podGC.strategy` can be set to `OnWorkflowCompletion`. An example WorkflowTemplate demonstrating argo-python usage can be found -[here](https://github.com/rackerlabs/understack/blob/main/argo-workflows/generic/workflowtemplates/get-obm-creds.yaml). +[here](https://github.com/rackerlabs/understack/blob/main/workflows/argo-events/workflowtemplates/get-obm-creds.yaml). ### Argo CLI From 550ea9a289c815c561316ceca642011553d36d9b Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Wed, 11 Sep 2024 10:36:22 +0100 Subject: [PATCH 22/29] Fix up Dockerfiles to reflect change to container directory structure --- containers/dnsmasq/Dockerfile.dnsmasq | 2 +- containers/obm-utils/Dockerfile.obm_utils | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/containers/dnsmasq/Dockerfile.dnsmasq b/containers/dnsmasq/Dockerfile.dnsmasq index 3e011417..e0af1170 100644 --- a/containers/dnsmasq/Dockerfile.dnsmasq +++ b/containers/dnsmasq/Dockerfile.dnsmasq @@ -42,7 +42,7 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/*.deb -COPY containers/common/helpers.sh /helpers.sh +COPY containers/dnsmasq/common/helpers.sh /helpers.sh COPY containers/dnsmasq/entry-point.sh /entry-point.sh RUN chmod +x /entry-point.sh COPY containers/dnsmasq/dnsmasq.conf.j2 /etc/dnsmasq.conf.j2 diff --git a/containers/obm-utils/Dockerfile.obm_utils b/containers/obm-utils/Dockerfile.obm_utils index 2b1c0a6c..228d1fe5 100644 --- a/containers/obm-utils/Dockerfile.obm_utils +++ b/containers/obm-utils/Dockerfile.obm_utils @@ -8,7 +8,7 @@ ARG APP_GROUP=appgroup ARG APP_USER_UID=1000 ARG APP_GROUP_GID=1000 -COPY --chown=${APP_USER}:${APP_GROUP} containers/requirements.txt /app +COPY --chown=${APP_USER}:${APP_GROUP} requirements.txt /app RUN --mount=type=cache,target=/root/.cache/.pip pip install --no-cache-dir -r /app/requirements.txt FROM ${BASE} as prod From 055ae0dd84a002694eb7b4fe85b26fbc3d7d291a Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Wed, 11 Sep 2024 10:46:33 +0100 Subject: [PATCH 23/29] Break workflow role into one yaml file per object for yamllint --- .github/workflows/yamllint.yaml | 1 + apps/appsets/workflows.yaml | 2 +- workflows/argo-events/kustomization.yaml | 1 + .../openstack-sensor-submit-workflow.yaml | 13 +++++++++++++ .../roles/sensor-submit-workflow-role.yaml | 13 ------------- workflows/openstack/kustomization.yaml | 1 + .../openstack/sensor-keystone-event-project.yaml | 5 ----- .../serviceaccount-sensor-submit-workflow.yaml | 5 +++++ 8 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 workflows/argo-events/rolebindings/openstack-sensor-submit-workflow.yaml create mode 100644 workflows/openstack/serviceaccount-sensor-submit-workflow.yaml diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml index 5d477549..c95e0f94 100644 --- a/.github/workflows/yamllint.yaml +++ b/.github/workflows/yamllint.yaml @@ -47,6 +47,7 @@ jobs: workflows/argo-events/sensors/*.y*ml workflows/argo-events/eventsources/*.y*ml workflows/argo-events/roles/*.y*ml + workflows/argo-events/rolebindings/*.y*ml workflows/argo-events/workflowtemplates/*.y*ml workflows/openstack/*.y*ml diff --git a/apps/appsets/workflows.yaml b/apps/appsets/workflows.yaml index 527d368c..561d9e8a 100644 --- a/apps/appsets/workflows.yaml +++ b/apps/appsets/workflows.yaml @@ -23,7 +23,7 @@ spec: path: 'workflows/argo-events' directory: recurse: true - include: '{roles/*.yaml,secrets/*.yaml,sensors/*yaml,eventsources/*.yaml,workflowtemplates/*.yaml}' + include: '{roles/*.yaml,rolebindings/*.yaml,secrets/*.yaml,sensors/*yaml,eventsources/*.yaml,workflowtemplates/*.yaml}' - repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}' targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}' path: 'argo-workflows' diff --git a/workflows/argo-events/kustomization.yaml b/workflows/argo-events/kustomization.yaml index 327f73de..b016af52 100644 --- a/workflows/argo-events/kustomization.yaml +++ b/workflows/argo-events/kustomization.yaml @@ -17,6 +17,7 @@ resources: - sensors/nb-oob-interface-update.yaml - eventsources/nautobot-webhook.yaml - roles/sensor-submit-workflow-role.yaml + - rolebindings/openstack-sensor-submit-workflow.yaml - workflowtemplates/nautobot-api.yaml - workflowtemplates/get-device-nautobot.yaml - workflowtemplates/sync-interfaces-to-nautobot.yaml diff --git a/workflows/argo-events/rolebindings/openstack-sensor-submit-workflow.yaml b/workflows/argo-events/rolebindings/openstack-sensor-submit-workflow.yaml new file mode 100644 index 00000000..ea14f197 --- /dev/null +++ b/workflows/argo-events/rolebindings/openstack-sensor-submit-workflow.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: openstack-sensor-submit-workflow +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: sensor-submit-workflow-role +subjects: + - kind: ServiceAccount + name: sensor-submit-workflow + namespace: openstack diff --git a/workflows/argo-events/roles/sensor-submit-workflow-role.yaml b/workflows/argo-events/roles/sensor-submit-workflow-role.yaml index f5f69a16..f31d064f 100644 --- a/workflows/argo-events/roles/sensor-submit-workflow-role.yaml +++ b/workflows/argo-events/roles/sensor-submit-workflow-role.yaml @@ -25,16 +25,3 @@ rules: - patch resources: - workflows ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: openstack-sensor-submit-workflow -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: sensor-submit-workflow-role -subjects: - - kind: ServiceAccount - name: sensor-submit-workflow - namespace: openstack diff --git a/workflows/openstack/kustomization.yaml b/workflows/openstack/kustomization.yaml index 6828ca22..f868905a 100644 --- a/workflows/openstack/kustomization.yaml +++ b/workflows/openstack/kustomization.yaml @@ -8,3 +8,4 @@ resources: - eventbus-default.yaml - openstack-event-source.yaml - sensor-keystone-event-project.yaml + - serviceaccount-sensor-submit-workflow.yaml diff --git a/workflows/openstack/sensor-keystone-event-project.yaml b/workflows/openstack/sensor-keystone-event-project.yaml index 28ac2343..d653a6b3 100644 --- a/workflows/openstack/sensor-keystone-event-project.yaml +++ b/workflows/openstack/sensor-keystone-event-project.yaml @@ -1,9 +1,4 @@ --- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: sensor-submit-workflow ---- apiVersion: argoproj.io/v1alpha1 kind: Sensor metadata: diff --git a/workflows/openstack/serviceaccount-sensor-submit-workflow.yaml b/workflows/openstack/serviceaccount-sensor-submit-workflow.yaml new file mode 100644 index 00000000..6a475dc8 --- /dev/null +++ b/workflows/openstack/serviceaccount-sensor-submit-workflow.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: sensor-submit-workflow From bed01ffe264c4bfa0cd63cbb62bdff6bd28e5094 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Wed, 11 Sep 2024 10:48:52 +0100 Subject: [PATCH 24/29] Update docs paths to refelct changes to workflow directory structure --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 740e3d89..bb526115 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ $(ACTIVATE): requirements-docs.txt docs/workflows: $(ACTIVATE) @mkdir -p docs/workflows - @$(PYTHON) scripts/argo-workflows-to-mkdocs.py argo-workflows docs/workflows + @$(PYTHON) scripts/argo-workflows-to-mkdocs.py workflows docs/workflows .PHONY: docs docs: $(ACTIVATE) docs/workflows ## Builds the documentation From 286e942ea073ad798cc9b2d6717780c955f13555 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Wed, 11 Sep 2024 10:55:49 +0100 Subject: [PATCH 25/29] Use dynamic github repository name instead of hardcoding rackerlabs When CI runs on a fork it doesn't have permissions to push there --- .github/workflows/build-container-images.yaml | 8 ++++---- .github/workflows/containers.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-container-images.yaml b/.github/workflows/build-container-images.yaml index 5d44971f..c640877c 100644 --- a/.github/workflows/build-container-images.yaml +++ b/.github/workflows/build-container-images.yaml @@ -52,7 +52,7 @@ jobs: file: containers/python311_alpine/Dockerfile.python311_alpine # push for all main branch commits push: ${{ github.event_name != 'pull_request' }} - tags: ghcr.io/rackerlabs/understack/argo-python3.11.8-alpine3.19:latest,ghcr.io/rackerlabs/understack/argo-python3.11.8-alpine3.19:${{ env.VERSION_PYTHON311 }} + tags: ghcr.io/${{ github.repository }}/argo-python3.11.8-alpine3.19:latest,ghcr.io/${{ github.repository }}/argo-python3.11.8-alpine3.19:${{ env.VERSION_PYTHON311 }} labels: | org.opencontainers.image.version=${{ env.VERSION_PYTHON311 }} @@ -63,7 +63,7 @@ jobs: file: containers/python312_alpine/Dockerfile.python312_alpine # push for all main branch commits push: ${{ github.event_name != 'pull_request' }} - tags: ghcr.io/rackerlabs/understack/argo-python3.12.2-alpine3.19:latest,ghcr.io/rackerlabs/understack/argo-python3.12.2-alpine3.19:${{ env.VERSION_PYTHON312 }} + tags: ghcr.io/${{ github.repository }}/argo-python3.12.2-alpine3.19:latest,ghcr.io/${{ github.repository }}/argo-python3.12.2-alpine3.19:${{ env.VERSION_PYTHON312 }} labels: | org.opencontainers.image.version=${{ env.VERSION_PYTHON312 }} @@ -74,7 +74,7 @@ jobs: file: containers/argo_utils/Dockerfile.argo_utils # push for all main branch commits push: ${{ github.event_name != 'pull_request' }} - tags: ghcr.io/rackerlabs/understack/argo-utils-python3.11.8:latest,ghcr.io/rackerlabs/understack/argo-utils-python3.11.8:${{ env.VERSION_ARGO_UTILS }} + tags: ghcr.io/${{ github.repository }}/argo-utils-python3.11.8:latest,ghcr.io/${{ github.repository }}/argo-utils-python3.11.8:${{ env.VERSION_ARGO_UTILS }} labels: | org.opencontainers.image.version=${{ env.VERSION_ARGO_UTILS }} @@ -85,6 +85,6 @@ jobs: file: containers/obm-utils/Dockerfile.obm_utils # push for all main branch commits push: ${{ github.event_name != 'pull_request' }} - tags: ghcr.io/rackerlabs/understack/argo-obm-utils-python3.11.8:latest,ghcr.io/rackerlabs/understack/argo-obm-utils-python3.11.8:${{ env.VERSION_OBM_UTILS }} + tags: ghcr.io/${{ github.repository }}/argo-obm-utils-python3.11.8:latest,ghcr.io/${{ github.repository }}/argo-obm-utils-python3.11.8:${{ env.VERSION_OBM_UTILS }} labels: | org.opencontainers.image.version=${{ env.VERSION_OBM_UTILS }} diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 9264a064..8b11693f 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -53,7 +53,7 @@ jobs: # that are arch specific so populate them at the index as well. DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index - - name: build and deploy container image to registry + - name: build and deploy openstack container image to registry uses: docker/build-push-action@v5 with: file: containers/${{ matrix.project }}/Dockerfile.${{ matrix.project }} From e1c2647ff296565a3d009184c2aaf340ece72bfb Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Wed, 11 Sep 2024 12:50:31 +0100 Subject: [PATCH 26/29] Fix dnsmasq container build to reflect changed path of Dockerfile --- .github/workflows/containers.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 8b11693f..4d24120d 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -99,7 +99,7 @@ jobs: uses: docker/build-push-action@v5 with: context: "{{defaultContext}}:containers/dnsmasq" - file: containers/Dockerfile.dnsmasq + file: containers/dnsmasq/Dockerfile.dnsmasq push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 92e4c91741a968358eb5af02c2bbf11e9450a2db Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Wed, 11 Sep 2024 12:56:30 +0100 Subject: [PATCH 27/29] Break into one object per yaml file to appease yamllint --- .github/workflows/yamllint.yaml | 1 - workflows/openstack/argo-rabbitmq.yaml | 41 ------------------- workflows/openstack/eventbus-default.yaml | 11 ----- ...yaml => eventsource-openstack-ironic.yaml} | 36 ---------------- .../eventsource-openstack-keystone.yaml | 36 ++++++++++++++++ workflows/openstack/kustomization.yaml | 8 +++- ...disruptionbudget-eventbus-default-pdb.yaml | 11 +++++ ...-permission-argo-to-ironic-permission.yaml | 16 ++++++++ ...ermission-argo-to-keystone-permission.yaml | 16 ++++++++ workflows/openstack/rabbitmq-user-argo.yaml | 9 ++++ 10 files changed, 94 insertions(+), 91 deletions(-) delete mode 100644 workflows/openstack/argo-rabbitmq.yaml rename workflows/openstack/{openstack-event-source.yaml => eventsource-openstack-ironic.yaml} (50%) create mode 100644 workflows/openstack/eventsource-openstack-keystone.yaml create mode 100644 workflows/openstack/poddisruptionbudget-eventbus-default-pdb.yaml create mode 100644 workflows/openstack/rabbitmq-permission-argo-to-ironic-permission.yaml create mode 100644 workflows/openstack/rabbitmq-permission-argo-to-keystone-permission.yaml create mode 100644 workflows/openstack/rabbitmq-user-argo.yaml diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml index c95e0f94..afde2891 100644 --- a/.github/workflows/yamllint.yaml +++ b/.github/workflows/yamllint.yaml @@ -43,7 +43,6 @@ jobs: with: jsonSchemaFile: workflows/.workflow_with_description.schema.json yamlFiles: | - workflows/argo-events/secrets/*.y*ml workflows/argo-events/sensors/*.y*ml workflows/argo-events/eventsources/*.y*ml workflows/argo-events/roles/*.y*ml diff --git a/workflows/openstack/argo-rabbitmq.yaml b/workflows/openstack/argo-rabbitmq.yaml deleted file mode 100644 index 373926ed..00000000 --- a/workflows/openstack/argo-rabbitmq.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -apiVersion: rabbitmq.com/v1beta1 -kind: User -metadata: - name: argo -spec: - rabbitmqClusterReference: - name: rabbitmq # rabbitmqCluster must exist in the same namespace as this resource - namespace: openstack ---- -apiVersion: rabbitmq.com/v1beta1 -kind: Permission -metadata: - name: argo-to-ironic-permission -spec: - vhost: "ironic" - userReference: - name: "argo" # name of a user.rabbitmq.com in the same namespace; must specify either spec.userReference or spec.user - permissions: - write: ".*" - configure: ".*" - read: ".*" - rabbitmqClusterReference: - name: rabbitmq # rabbitmqCluster must exist in the same namespace as this resource - namespace: openstack ---- -apiVersion: rabbitmq.com/v1beta1 -kind: Permission -metadata: - name: argo-to-keystone-permission -spec: - vhost: "keystone" - userReference: - name: "argo" # name of a user.rabbitmq.com in the same namespace; must specify either spec.userReference or spec.user - permissions: - write: ".*" - configure: ".*" - read: ".*" - rabbitmqClusterReference: - name: rabbitmq # rabbitmqCluster must exist in the same namespace as this resource - namespace: openstack diff --git a/workflows/openstack/eventbus-default.yaml b/workflows/openstack/eventbus-default.yaml index 59cbf64f..d9412a00 100644 --- a/workflows/openstack/eventbus-default.yaml +++ b/workflows/openstack/eventbus-default.yaml @@ -25,14 +25,3 @@ spec: # storageClassName: standard # accessMode: ReadWriteOnce # volumeSize: 10Gi ---- -apiVersion: policy/v1 -kind: PodDisruptionBudget -metadata: - name: eventbus-default-pdb -spec: - maxUnavailable: 1 - selector: - matchLabels: - controller: eventbus-controller - eventbus-name: default diff --git a/workflows/openstack/openstack-event-source.yaml b/workflows/openstack/eventsource-openstack-ironic.yaml similarity index 50% rename from workflows/openstack/openstack-event-source.yaml rename to workflows/openstack/eventsource-openstack-ironic.yaml index 4e71dfe5..be6db402 100644 --- a/workflows/openstack/openstack-event-source.yaml +++ b/workflows/openstack/eventsource-openstack-ironic.yaml @@ -33,39 +33,3 @@ spec: password: name: argo-user-credentials key: password ---- -apiVersion: argoproj.io/v1alpha1 -kind: EventSource -metadata: - name: openstack-keystone -spec: - amqp: - notifications: - # amqp server url - url: amqp://rabbitmq-server-0.rabbitmq-nodes.openstack.svc.cluster.local:5672/keystone - # jsonBody specifies that all event body payload coming from this - # source will be JSON - jsonBody: true - # name of the exchange. - exchangeName: keystone - exchangeType: topic - exchangeDeclare: - durable: false - # routing key for messages within the exchange - routingKey: 'notifications.info' - # optional consume settings - # if not provided, default values will be used - consume: - consumerTag: "argo-events" - autoAck: true - exclusive: false - noLocal: false - # username and password for authentication - # use secret selectors - auth: - username: - name: argo-user-credentials - key: username - password: - name: argo-user-credentials - key: password diff --git a/workflows/openstack/eventsource-openstack-keystone.yaml b/workflows/openstack/eventsource-openstack-keystone.yaml new file mode 100644 index 00000000..86d1d445 --- /dev/null +++ b/workflows/openstack/eventsource-openstack-keystone.yaml @@ -0,0 +1,36 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: EventSource +metadata: + name: openstack-keystone +spec: + amqp: + notifications: + # amqp server url + url: amqp://rabbitmq-server-0.rabbitmq-nodes.openstack.svc.cluster.local:5672/keystone + # jsonBody specifies that all event body payload coming from this + # source will be JSON + jsonBody: true + # name of the exchange. + exchangeName: keystone + exchangeType: topic + exchangeDeclare: + durable: false + # routing key for messages within the exchange + routingKey: 'notifications.info' + # optional consume settings + # if not provided, default values will be used + consume: + consumerTag: "argo-events" + autoAck: true + exclusive: false + noLocal: false + # username and password for authentication + # use secret selectors + auth: + username: + name: argo-user-credentials + key: username + password: + name: argo-user-credentials + key: password diff --git a/workflows/openstack/kustomization.yaml b/workflows/openstack/kustomization.yaml index f868905a..3085c5a4 100644 --- a/workflows/openstack/kustomization.yaml +++ b/workflows/openstack/kustomization.yaml @@ -4,8 +4,12 @@ kind: Kustomization namespace: openstack resources: - - argo-rabbitmq.yaml - eventbus-default.yaml - - openstack-event-source.yaml + - eventsource-openstack-ironic.yaml + - eventsource-openstack-keystone.yaml + - poddisruptionbudget-eventbus-default-pdb.yaml + - rabbitmq-permission-argo-to-ironic-permission.yaml + - rabbitmq-permission-argo-to-keystone-permission.yaml + - rabbitmq-user-argo.yaml - sensor-keystone-event-project.yaml - serviceaccount-sensor-submit-workflow.yaml diff --git a/workflows/openstack/poddisruptionbudget-eventbus-default-pdb.yaml b/workflows/openstack/poddisruptionbudget-eventbus-default-pdb.yaml new file mode 100644 index 00000000..90bb443e --- /dev/null +++ b/workflows/openstack/poddisruptionbudget-eventbus-default-pdb.yaml @@ -0,0 +1,11 @@ +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: eventbus-default-pdb +spec: + maxUnavailable: 1 + selector: + matchLabels: + controller: eventbus-controller + eventbus-name: default diff --git a/workflows/openstack/rabbitmq-permission-argo-to-ironic-permission.yaml b/workflows/openstack/rabbitmq-permission-argo-to-ironic-permission.yaml new file mode 100644 index 00000000..be96937b --- /dev/null +++ b/workflows/openstack/rabbitmq-permission-argo-to-ironic-permission.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: rabbitmq.com/v1beta1 +kind: Permission +metadata: + name: argo-to-ironic-permission +spec: + vhost: "ironic" + userReference: + name: "argo" # name of a user.rabbitmq.com in the same namespace; must specify either spec.userReference or spec.user + permissions: + write: ".*" + configure: ".*" + read: ".*" + rabbitmqClusterReference: + name: rabbitmq # rabbitmqCluster must exist in the same namespace as this resource + namespace: openstack diff --git a/workflows/openstack/rabbitmq-permission-argo-to-keystone-permission.yaml b/workflows/openstack/rabbitmq-permission-argo-to-keystone-permission.yaml new file mode 100644 index 00000000..ba1bc606 --- /dev/null +++ b/workflows/openstack/rabbitmq-permission-argo-to-keystone-permission.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: rabbitmq.com/v1beta1 +kind: Permission +metadata: + name: argo-to-keystone-permission +spec: + vhost: "keystone" + userReference: + name: "argo" # name of a user.rabbitmq.com in the same namespace; must specify either spec.userReference or spec.user + permissions: + write: ".*" + configure: ".*" + read: ".*" + rabbitmqClusterReference: + name: rabbitmq # rabbitmqCluster must exist in the same namespace as this resource + namespace: openstack diff --git a/workflows/openstack/rabbitmq-user-argo.yaml b/workflows/openstack/rabbitmq-user-argo.yaml new file mode 100644 index 00000000..bbcccd9b --- /dev/null +++ b/workflows/openstack/rabbitmq-user-argo.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: rabbitmq.com/v1beta1 +kind: User +metadata: + name: argo +spec: + rabbitmqClusterReference: + name: rabbitmq # rabbitmqCluster must exist in the same namespace as this resource + namespace: openstack From 51a3372f993d63fe4a2c7ed1dd7c329535f9109a Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Wed, 11 Sep 2024 13:09:41 +0100 Subject: [PATCH 28/29] Fix broken dockerfile path in container build script --- .github/workflows/containers.yaml | 2 +- containers/dnsmasq/Dockerfile.dnsmasq | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 4d24120d..3a29bf66 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -99,7 +99,7 @@ jobs: uses: docker/build-push-action@v5 with: context: "{{defaultContext}}:containers/dnsmasq" - file: containers/dnsmasq/Dockerfile.dnsmasq + file: Dockerfile.dnsmasq push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/containers/dnsmasq/Dockerfile.dnsmasq b/containers/dnsmasq/Dockerfile.dnsmasq index e0af1170..e4ba368a 100644 --- a/containers/dnsmasq/Dockerfile.dnsmasq +++ b/containers/dnsmasq/Dockerfile.dnsmasq @@ -22,7 +22,7 @@ RUN apt-get -y build-dep dnsmasq RUN apt-get -y source dnsmasq WORKDIR /src/dnsmasq-2.89 RUN mkdir -p debian/patches -COPY containers/dnsmasq/dhcp-allowed-srvids.patch /src/dnsmasq-2.89/debian/patches/ +COPY dnsmasq/dhcp-allowed-srvids.patch /src/dnsmasq-2.89/debian/patches/ RUN echo dhcp-allowed-srvids.patch > debian/patches/series RUN quilt push -a RUN dch -v 2.89-2 "patched for dhcp-allowed-srvids" @@ -42,10 +42,10 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/*.deb -COPY containers/dnsmasq/common/helpers.sh /helpers.sh -COPY containers/dnsmasq/entry-point.sh /entry-point.sh +COPY common/helpers.sh /helpers.sh +COPY dnsmasq/entry-point.sh /entry-point.sh RUN chmod +x /entry-point.sh -COPY containers/dnsmasq/dnsmasq.conf.j2 /etc/dnsmasq.conf.j2 +COPY dnsmasq/dnsmasq.conf.j2 /etc/dnsmasq.conf.j2 # let our entry point write out the script RUN ln -sf /etc/dnsmasq.d/dnsmasq.conf /etc/dnsmasq.conf From f8dc624d19b20d12b82a040de966e5f850484a67 Mon Sep 17 00:00:00 2001 From: Steve Keay Date: Thu, 12 Sep 2024 15:02:30 +0100 Subject: [PATCH 29/29] Have yamllint allow templates without annotations Annotations should only be required on kind: WorkflowTemplate and kind: CronWorkflowTemplate --- .github/workflows/yamllint.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml index afde2891..f8e205e7 100644 --- a/.github/workflows/yamllint.yaml +++ b/.github/workflows/yamllint.yaml @@ -44,11 +44,7 @@ jobs: jsonSchemaFile: workflows/.workflow_with_description.schema.json yamlFiles: | workflows/argo-events/sensors/*.y*ml - workflows/argo-events/eventsources/*.y*ml - workflows/argo-events/roles/*.y*ml - workflows/argo-events/rolebindings/*.y*ml workflows/argo-events/workflowtemplates/*.y*ml - workflows/openstack/*.y*ml shellcheck: runs-on: ubuntu-latest