From f30f592312b3af7a105c1132b042e99b1a7b42f6 Mon Sep 17 00:00:00 2001 From: Neil-Jocelyn Schark <neil.schark@h-da.de> Date: Fri, 17 May 2024 13:15:42 +0000 Subject: [PATCH] Cleanup repo structure for tests and dev env data See merge request danet/quant!116 --- .vscode/launch.json | 4 +- Makefile | 20 ++++---- README.md | 10 ++++ config/goKMS/example01.yaml | 4 +- config/goKMS/example02.yaml | 4 +- config/goKMS/example03.yaml | 4 +- config/goKMS/example04.yaml | 4 +- config/quantumlayer/example01.yaml | 3 -- config/quantumlayer/example02.yaml | 3 -- config/quantumlayer/example03.yaml | 3 -- config/quantumlayer/example04.yaml | 3 -- config/quantumlayer/example05.yaml | 3 -- config/quantumlayer/example06.yaml | 3 -- config/quantumlayer/example07.yaml | 3 -- config/quantumlayer/example08.yaml | 3 -- .../config/quantumlayer/quantumlayer_1.yaml | 4 -- .../config/quantumlayer/quantumlayer_2.yaml | 4 -- .../containerlab/playground.clab.yaml | 48 +++++++++---------- .../config/kms/generate-debug-certs.sh | 2 +- .../debug_configs}/config/kms/kms_1.json | 0 .../debug_configs}/config/kms/kms_1.yaml | 0 .../debug_configs}/config/kms/kms_2.json | 0 .../debug_configs}/config/kms/kms_2.yaml | 0 .../config/kms/tlsConfigs/ekms01ReqConfig.txt | 0 .../config/kms/tlsConfigs/ekms02ReqConfig.txt | 0 .../config/quantumlayer/quantumlayer_1.yaml | 1 + .../config/quantumlayer/quantumlayer_2.yaml | 1 + .../docker-compose_debug_kms.yml | 8 ++-- .../docker-compose_small_random.yml | 0 .../docker-compose_small_replay.yml | 0 docker-compose.yml | 8 ++-- goKMS/main.go | 14 ++++-- 32 files changed, 75 insertions(+), 89 deletions(-) delete mode 100644 debug_configs/config/quantumlayer/quantumlayer_1.yaml delete mode 100644 debug_configs/config/quantumlayer/quantumlayer_2.yaml rename playground.clab.yaml => dev_env_data/containerlab/playground.clab.yaml (69%) rename {debug_configs => dev_env_data/debug_configs}/config/kms/generate-debug-certs.sh (88%) rename {debug_configs => dev_env_data/debug_configs}/config/kms/kms_1.json (100%) rename {debug_configs => dev_env_data/debug_configs}/config/kms/kms_1.yaml (100%) rename {debug_configs => dev_env_data/debug_configs}/config/kms/kms_2.json (100%) rename {debug_configs => dev_env_data/debug_configs}/config/kms/kms_2.yaml (100%) rename {debug_configs => dev_env_data/debug_configs}/config/kms/tlsConfigs/ekms01ReqConfig.txt (100%) rename {debug_configs => dev_env_data/debug_configs}/config/kms/tlsConfigs/ekms02ReqConfig.txt (100%) create mode 100644 dev_env_data/debug_configs/config/quantumlayer/quantumlayer_1.yaml create mode 100644 dev_env_data/debug_configs/config/quantumlayer/quantumlayer_2.yaml rename docker-compose_debug_kms.yml => dev_env_data/docker-compose/docker-compose_debug_kms.yml (81%) rename docker-compose_small_random.yml => dev_env_data/docker-compose/docker-compose_small_random.yml (100%) rename docker-compose_small_replay.yml => dev_env_data/docker-compose/docker-compose_small_replay.yml (100%) diff --git a/.vscode/launch.json b/.vscode/launch.json index 0470d666..451f53a8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -19,7 +19,7 @@ "program": "${workspaceFolder}/goKMS/main.go", "env": {}, "args": [ - "start", "--log", "debug", "--kms_config", "${workspaceFolder}/debug_configs/config/kms/kms_1.yaml", "--insecure" + "--log", "debug", "--kms_config", "${workspaceFolder}/debug_configs/config/kms/kms_1.yaml" ] }, { @@ -30,7 +30,7 @@ "program": "${workspaceFolder}/goKMS/main.go", "env": {}, "args": [ - "start", "--log", "debug", "--kms_config", "${workspaceFolder}/config/goKMS/example_debug.yaml", "--insecure" + "--log", "debug", "--kms_config", "${workspaceFolder}/dev_env_data/debug_configs/config/kms/kms_1.yaml" ] }, ] diff --git a/Makefile b/Makefile index c537a249..5b5353ce 100644 --- a/Makefile +++ b/Makefile @@ -89,12 +89,14 @@ compose-up: generate-gokms-certs build-images compose-down: docker-compose down -debug-kms-up: build-images generate-debug-certs - docker-compose -f docker-compose_debug_kms.yml down - docker-compose -f docker-compose_debug_kms.yml up +debug-kms-up: generate-debug-certs build-images + echo "After running this please start the debugger setup for KMS_1" + docker-compose -f dev_env_data/docker-compose/docker-compose_debug_kms.yml down + docker-compose -f dev_env_data/docker-compose/docker-compose_debug_kms.yml up + echo "Setup available, please start the debug configuration for KMS_1" debug-kms-down: - docker-compose -f docker-compose_debug_kms.yml down + docker-compose -f dev_env_data/docker-compose/docker-compose_debug_kms.yml down integration-test-debug-up: generate-integration-test-certs build-images docker-compose -f integration-tests/docker-compose_integration_test.yml down @@ -111,14 +113,14 @@ integration-test: generate-integration-test-certs build-images go test -p 1 -count=1 -v ./integration-tests/code/* docker-compose -f integration-tests/docker-compose_integration_test.yml down -playground-start: - sudo containerlab deploy --reconfigure --topo playground.clab.yaml +playground-start: generate-certs build-images + sudo containerlab deploy --reconfigure --topo dev_env_data/containerlab/playground.clab.yaml playground-stop: - sudo containerlab destroy --topo playground.clab.yaml + sudo containerlab destroy --topo dev_env_data/containerlab/playground.clab.yaml playground-graph: - sudo containerlab graph --topo playground.clab.yaml + sudo containerlab graph --topo dev_env_data/containerlab/playground.clab.yaml generate-certs: generate-root-ca generate-gokms-certs generate-debug-certs generate-integration-test-certs @@ -134,7 +136,7 @@ generate-gokms-certs: generate-root-ca ./config/goKMS/generate-kms-certs.sh generate-debug-certs: generate-root-ca - ./debug_configs/config/kms/generate-debug-certs.sh + ./dev_env_data/debug_configs/config/kms/generate-debug-certs.sh generate-integration-test-certs: generate-root-ca ./integration-tests/config/kms/generate-certs.sh diff --git a/README.md b/README.md index a708ccb2..4f66e953 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,16 @@ it is possible to manage (GET/SET/subscribe) configuration data of the KMS. Currently we use the [temp.yang](goKMS/models/danet/temp.yang) file for this and only a part of it is implemented yet. + +### Debug setup + +For goKMS there is a debug setup available for VS Code. +1. Set your breakpoints +2. To use it run `make debug-kms-up` and wait for the build to complete. +3. If you see the first log outputs from the running docker setup start the debugger in VS Code named `kms-debug`. + +If you are finished stop the debugger and run `make debug-kms-down` to stop the environment. + ## Quantumlayer An implementation of an emulated quantum module. It has two possible operation modes: diff --git a/config/goKMS/example01.yaml b/config/goKMS/example01.yaml index 937cd40b..f67e8453 100644 --- a/config/goKMS/example01.yaml +++ b/config/goKMS/example01.yaml @@ -6,12 +6,12 @@ GRPCAddr: 172.100.20.10:50900 AkmsURL: "http://172.100.20.22:4444/api/v1/keys/push_ksa_key" AkmsCkmsServerPort: "9696" KmsTLS: - TLS: true + TLS: false CAFile: "ssl/ca.crt" CertFile: "ssl/kms/kms1-selfsigned.crt" KeyFile: "ssl/kms/kms1-selfsigned.key" QuantumModuleTLS: - TLS: true + TLS: false CAFile: "ssl/ca.crt" CertFile: "ssl/kms/kms1-selfsigned.crt" KeyFile: "ssl/kms/kms1-selfsigned.key" diff --git a/config/goKMS/example02.yaml b/config/goKMS/example02.yaml index 4c6dfaba..daae3148 100644 --- a/config/goKMS/example02.yaml +++ b/config/goKMS/example02.yaml @@ -4,12 +4,12 @@ InterComAddr: 172.100.20.11:50910 QuantumAddr: 172.100.20.11:50911 GRPCAddr: 172.100.20.11:50900 KmsTLS: - TLS: true + TLS: false CAFile: "ssl/ca.crt" CertFile: "ssl/kms/kms2-selfsigned.crt" KeyFile: "ssl/kms/kms2-selfsigned.key" QuantumModuleTLS: - TLS: true + TLS: false CAFile: "ssl/ca.crt" CertFile: "ssl/kms/kms2-selfsigned.crt" KeyFile: "ssl/kms/kms2-selfsigned.key" diff --git a/config/goKMS/example03.yaml b/config/goKMS/example03.yaml index d1f12de6..8569c6dd 100644 --- a/config/goKMS/example03.yaml +++ b/config/goKMS/example03.yaml @@ -4,12 +4,12 @@ InterComAddr: 172.100.20.12:50910 QuantumAddr: 172.100.20.12:50911 GRPCAddr: 172.100.20.12:50900 KmsTLS: - TLS: true + TLS: false CAFile: "ssl/ca.crt" CertFile: "ssl/kms/kms3-selfsigned.crt" KeyFile: "ssl/kms/kms3-selfsigned.key" QuantumModuleTLS: - TLS: true + TLS: false CAFile: "ssl/ca.crt" CertFile: "ssl/kms/kms3-selfsigned.crt" KeyFile: "ssl/kms/kms3-selfsigned.key" diff --git a/config/goKMS/example04.yaml b/config/goKMS/example04.yaml index 346dbe21..90d6ced6 100644 --- a/config/goKMS/example04.yaml +++ b/config/goKMS/example04.yaml @@ -6,12 +6,12 @@ GRPCAddr: 172.100.20.13:50900 AkmsURL: "http://172.100.20.23:4444/api/v1/keys/push_ksa_key" AkmsCkmsServerPort: "9696" KmsTLS: - TLS: true + TLS: false CAFile: "ssl/ca.crt" CertFile: "ssl/kms/kms4-selfsigned.crt" KeyFile: "ssl/kms/kms4-selfsigned.key" QuantumModuleTLS: - TLS: true + TLS: false CAFile: "ssl/ca.crt" CertFile: "ssl/kms/kms4-selfsigned.crt" KeyFile: "ssl/kms/kms4-selfsigned.key" diff --git a/config/quantumlayer/example01.yaml b/config/quantumlayer/example01.yaml index 1736d402..8aeea7af 100644 --- a/config/quantumlayer/example01.yaml +++ b/config/quantumlayer/example01.yaml @@ -1,4 +1 @@ KMSAddr: '172.100.20.10:50911' -UDPAddr: '172.100.20.14:50901' -PeerUDPAddr: '172.100.20.15:50901' -GenerateKeys: true diff --git a/config/quantumlayer/example02.yaml b/config/quantumlayer/example02.yaml index 2073a95c..f217b96b 100644 --- a/config/quantumlayer/example02.yaml +++ b/config/quantumlayer/example02.yaml @@ -1,4 +1 @@ KMSAddr: '172.100.20.11:50911' -UDPAddr: '172.100.20.15:50901' -PeerUDPAddr: '172.100.20.14:50901' -GenerateKeys: false diff --git a/config/quantumlayer/example03.yaml b/config/quantumlayer/example03.yaml index 23e80107..f217b96b 100644 --- a/config/quantumlayer/example03.yaml +++ b/config/quantumlayer/example03.yaml @@ -1,4 +1 @@ KMSAddr: '172.100.20.11:50911' -UDPAddr: '172.100.20.16:50901' -PeerUDPAddr: '172.100.20.17:50901' -GenerateKeys: true diff --git a/config/quantumlayer/example04.yaml b/config/quantumlayer/example04.yaml index 05d7609f..e816a74c 100644 --- a/config/quantumlayer/example04.yaml +++ b/config/quantumlayer/example04.yaml @@ -1,4 +1 @@ KMSAddr: '172.100.20.13:50911' -UDPAddr: '172.100.20.17:50901' -PeerUDPAddr: '172.100.20.16:50901' -GenerateKeys: false diff --git a/config/quantumlayer/example05.yaml b/config/quantumlayer/example05.yaml index 5c693db0..8aeea7af 100644 --- a/config/quantumlayer/example05.yaml +++ b/config/quantumlayer/example05.yaml @@ -1,4 +1 @@ KMSAddr: '172.100.20.10:50911' -UDPAddr: '172.100.20.18:50901' -PeerUDPAddr: '172.100.20.19:50901' -GenerateKeys: true diff --git a/config/quantumlayer/example06.yaml b/config/quantumlayer/example06.yaml index 3dfff95b..8dbb2b6b 100644 --- a/config/quantumlayer/example06.yaml +++ b/config/quantumlayer/example06.yaml @@ -1,4 +1 @@ KMSAddr: '172.100.20.12:50911' -UDPAddr: '172.100.20.19:50901' -PeerUDPAddr: '172.100.20.18:50901' -GenerateKeys: false diff --git a/config/quantumlayer/example07.yaml b/config/quantumlayer/example07.yaml index ce547970..8dbb2b6b 100644 --- a/config/quantumlayer/example07.yaml +++ b/config/quantumlayer/example07.yaml @@ -1,4 +1 @@ KMSAddr: '172.100.20.12:50911' -UDPAddr: '172.100.20.20:50901' -PeerUDPAddr: '172.100.20.21:50901' -GenerateKeys: true diff --git a/config/quantumlayer/example08.yaml b/config/quantumlayer/example08.yaml index 7f07547a..e816a74c 100644 --- a/config/quantumlayer/example08.yaml +++ b/config/quantumlayer/example08.yaml @@ -1,4 +1 @@ KMSAddr: '172.100.20.13:50911' -UDPAddr: '172.100.20.21:50901' -PeerUDPAddr: '172.100.20.20:50901' -GenerateKeys: false diff --git a/debug_configs/config/quantumlayer/quantumlayer_1.yaml b/debug_configs/config/quantumlayer/quantumlayer_1.yaml deleted file mode 100644 index 21fb247f..00000000 --- a/debug_configs/config/quantumlayer/quantumlayer_1.yaml +++ /dev/null @@ -1,4 +0,0 @@ -KMSAddr: 'host.docker.internal:50911' -UDPAddr: '0.0.0.0:50901' -PeerUDPAddr: 'quantumlayer_2:50901' -GenerateKeys: true diff --git a/debug_configs/config/quantumlayer/quantumlayer_2.yaml b/debug_configs/config/quantumlayer/quantumlayer_2.yaml deleted file mode 100644 index d0e21821..00000000 --- a/debug_configs/config/quantumlayer/quantumlayer_2.yaml +++ /dev/null @@ -1,4 +0,0 @@ -KMSAddr: 'kms_2:50911' -UDPAddr: '0.0.0.0:50901' -PeerUDPAddr: 'quantumlayer_1:50901' -GenerateKeys: false diff --git a/playground.clab.yaml b/dev_env_data/containerlab/playground.clab.yaml similarity index 69% rename from playground.clab.yaml rename to dev_env_data/containerlab/playground.clab.yaml index a43e54e7..ce3f145f 100644 --- a/playground.clab.yaml +++ b/dev_env_data/containerlab/playground.clab.yaml @@ -14,7 +14,7 @@ topology: - 8080:8080 - 40000:40000 binds: - - ./config/quant-gosdn.toml:/app/configs/quant-gosdn.toml + - ../../config/quant-gosdn.toml:/app/configs/quant-gosdn.toml cmd: --config ./configs/quant-gosdn.toml mgmt-ipv4: 172.100.20.2 env: @@ -30,13 +30,13 @@ topology: image: registry.code.fbi.h-da.de/danet/gosdn/gosdnc:latest mgmt-ipv4: 172.100.20.4 binds: - - ./config/kms01-a.json:/kms01-a.json - - ./config/kms02-a.json:/kms02-a.json - - ./config/kms03-a.json:/kms03-a.json - - ./config/kms01-b.json:/kms01-b.json - - ./config/kms02-b.json:/kms02-b.json - - ./config/kms03-b.json:/kms03-b.json - - ./config/scripts/add_kms_to_controller.sh:/scripts/add_kms_to_controller.sh + - ../../config/kms01-a.json:/kms01-a.json + - ../../config/kms02-a.json:/kms02-a.json + - ../../config/kms03-a.json:/kms03-a.json + - ../../config/kms01-b.json:/kms01-b.json + - ../../config/kms02-b.json:/kms02-b.json + - ../../config/kms03-b.json:/kms03-b.json + - ../../config/scripts/add_kms_to_controller.sh:/scripts/add_kms_to_controller.sh exec: - bash /scripts/add_kms_to_controller.sh @@ -45,39 +45,39 @@ topology: image: registry.code.fbi.h-da.de/danet/quant/gokms:latest mgmt-ipv4: 172.100.20.10 binds: - - ./config/kms/example01.yaml:/tmp/kms/config/kms01.yaml - cmd: --log debug --kms_config /tmp/kms/config/kms01.yaml --insecureGNMI + - ../../config/goKMS/example01.yaml:/tmp/kms/config/kms01.yaml + cmd: --log debug --kms_config /tmp/kms/config/kms01.yaml kms2: kind: linux image: registry.code.fbi.h-da.de/danet/quant/gokms:latest mgmt-ipv4: 172.100.20.11 binds: - - ./config/kms/example02.yaml:/tmp/kms/config/kms02.yaml - cmd: --log debug --kms_config /tmp/kms/config/kms02.yaml --insecureGNMI + - ../../config/goKMS/example02.yaml:/tmp/kms/config/kms02.yaml + cmd: --log debug --kms_config /tmp/kms/config/kms02.yaml kms3: kind: linux image: registry.code.fbi.h-da.de/danet/quant/gokms:latest mgmt-ipv4: 172.100.20.12 binds: - - ./config/kms/example03.yaml:/tmp/kms/config/kms03.yaml - cmd: --log debug --kms_config /tmp/kms/config/kms03.yaml --insecureGNMI + - ../../config/goKMS/example03.yaml:/tmp/kms/config/kms03.yaml + cmd: --log debug --kms_config /tmp/kms/config/kms03.yaml kms4: kind: linux image: registry.code.fbi.h-da.de/danet/quant/gokms:latest mgmt-ipv4: 172.100.20.13 binds: - - ./config/kms/example04.yaml:/tmp/kms/config/kms04.yaml - cmd: --log debug --kms_config /tmp/kms/config/kms04.yaml --insecureGNMI + - ../../config/goKMS/example04.yaml:/tmp/kms/config/kms04.yaml + cmd: --log debug --kms_config /tmp/kms/config/kms04.yaml qlayer01: kind: linux image: registry.code.fbi.h-da.de/danet/quant/quantumlayer:master mgmt-ipv4: 172.100.20.14 binds: - - ./config/quantumlayer/example01.yaml:/tmp/quantumlayer/config/quantumlayer01.yaml + - ../../config/quantumlayer/example01.yaml:/tmp/quantumlayer/config/quantumlayer01.yaml cmd: --config /tmp/quantumlayer/config/quantumlayer01.yaml qlayer02: @@ -85,7 +85,7 @@ topology: image: registry.code.fbi.h-da.de/danet/quant/quantumlayer:master mgmt-ipv4: 172.100.20.15 binds: - - ./config/quantumlayer/example02.yaml:/tmp/quantumlayer/config/quantumlayer02.yaml + - ../../config/quantumlayer/example02.yaml:/tmp/quantumlayer/config/quantumlayer02.yaml cmd: --config /tmp/quantumlayer/config/quantumlayer02.yaml qlayer03: @@ -93,7 +93,7 @@ topology: image: registry.code.fbi.h-da.de/danet/quant/quantumlayer:master mgmt-ipv4: 172.100.20.16 binds: - - ./config/quantumlayer/example03.yaml:/tmp/quantumlayer/config/quantumlayer03.yaml + - ../../config/quantumlayer/example03.yaml:/tmp/quantumlayer/config/quantumlayer03.yaml cmd: --config /tmp/quantumlayer/config/quantumlayer03.yaml qlayer04: @@ -101,7 +101,7 @@ topology: image: registry.code.fbi.h-da.de/danet/quant/quantumlayer:master mgmt-ipv4: 172.100.20.17 binds: - - ./config/quantumlayer/example04.yaml:/tmp/quantumlayer/config/quantumlayer04.yaml + - ../../config/quantumlayer/example04.yaml:/tmp/quantumlayer/config/quantumlayer04.yaml cmd: --config /tmp/quantumlayer/config/quantumlayer04.yaml qlayer05: @@ -109,7 +109,7 @@ topology: image: registry.code.fbi.h-da.de/danet/quant/quantumlayer:master mgmt-ipv4: 172.100.20.18 binds: - - ./config/quantumlayer/example05.yaml:/tmp/quantumlayer/config/quantumlayer05.yaml + - ../../config/quantumlayer/example05.yaml:/tmp/quantumlayer/config/quantumlayer05.yaml cmd: --config /tmp/quantumlayer/config/quantumlayer05.yaml qlayer06: @@ -117,7 +117,7 @@ topology: image: registry.code.fbi.h-da.de/danet/quant/quantumlayer:master mgmt-ipv4: 172.100.20.19 binds: - - ./config/quantumlayer/example06.yaml:/tmp/quantumlayer/config/quantumlayer06.yaml + - ../../config/quantumlayer/example06.yaml:/tmp/quantumlayer/config/quantumlayer06.yaml cmd: --config /tmp/quantumlayer/config/quantumlayer06.yaml qlayer07: @@ -125,7 +125,7 @@ topology: image: registry.code.fbi.h-da.de/danet/quant/quantumlayer:master mgmt-ipv4: 172.100.20.20 binds: - - ./config/quantumlayer/example07.yaml:/tmp/quantumlayer/config/quantumlayer07.yaml + - ../../config/quantumlayer/example07.yaml:/tmp/quantumlayer/config/quantumlayer07.yaml cmd: --config /tmp/quantumlayer/config/quantumlayer07.yaml qlayer08: @@ -133,7 +133,7 @@ topology: image: registry.code.fbi.h-da.de/danet/quant/quantumlayer:master mgmt-ipv4: 172.100.20.21 binds: - - ./config/quantumlayer/example08.yaml:/tmp/quantumlayer/config/quantumlayer08.yaml + - ../../config/quantumlayer/example08.yaml:/tmp/quantumlayer/config/quantumlayer08.yaml cmd: --config /tmp/quantumlayer/config/quantumlayer08.yaml akms-receiver-01: diff --git a/debug_configs/config/kms/generate-debug-certs.sh b/dev_env_data/debug_configs/config/kms/generate-debug-certs.sh similarity index 88% rename from debug_configs/config/kms/generate-debug-certs.sh rename to dev_env_data/debug_configs/config/kms/generate-debug-certs.sh index cc0cdc0e..5270a6f1 100755 --- a/debug_configs/config/kms/generate-debug-certs.sh +++ b/dev_env_data/debug_configs/config/kms/generate-debug-certs.sh @@ -4,7 +4,7 @@ dirPath="artifacts/ssl" if [ ! -d "${dirPath}/debug-kms" ]; then mkdir $dirPath/debug-kms counter=1 - for FILE in ./debug_configs/config/kms/tlsConfigs/*.txt; + for FILE in dev_env_data/debug_configs/config/kms/tlsConfigs/*.txt; do openssl req -x509 -nodes -days 365 -newkey rsa:4096 -config $FILE \ -CA $dirPath/ca.crt -CAkey $dirPath/ca.key \ -keyout "$dirPath/debug-kms/kms$counter-selfsigned.key" -out "$dirPath/debug-kms/kms$counter-selfsigned.crt"; \ diff --git a/debug_configs/config/kms/kms_1.json b/dev_env_data/debug_configs/config/kms/kms_1.json similarity index 100% rename from debug_configs/config/kms/kms_1.json rename to dev_env_data/debug_configs/config/kms/kms_1.json diff --git a/debug_configs/config/kms/kms_1.yaml b/dev_env_data/debug_configs/config/kms/kms_1.yaml similarity index 100% rename from debug_configs/config/kms/kms_1.yaml rename to dev_env_data/debug_configs/config/kms/kms_1.yaml diff --git a/debug_configs/config/kms/kms_2.json b/dev_env_data/debug_configs/config/kms/kms_2.json similarity index 100% rename from debug_configs/config/kms/kms_2.json rename to dev_env_data/debug_configs/config/kms/kms_2.json diff --git a/debug_configs/config/kms/kms_2.yaml b/dev_env_data/debug_configs/config/kms/kms_2.yaml similarity index 100% rename from debug_configs/config/kms/kms_2.yaml rename to dev_env_data/debug_configs/config/kms/kms_2.yaml diff --git a/debug_configs/config/kms/tlsConfigs/ekms01ReqConfig.txt b/dev_env_data/debug_configs/config/kms/tlsConfigs/ekms01ReqConfig.txt similarity index 100% rename from debug_configs/config/kms/tlsConfigs/ekms01ReqConfig.txt rename to dev_env_data/debug_configs/config/kms/tlsConfigs/ekms01ReqConfig.txt diff --git a/debug_configs/config/kms/tlsConfigs/ekms02ReqConfig.txt b/dev_env_data/debug_configs/config/kms/tlsConfigs/ekms02ReqConfig.txt similarity index 100% rename from debug_configs/config/kms/tlsConfigs/ekms02ReqConfig.txt rename to dev_env_data/debug_configs/config/kms/tlsConfigs/ekms02ReqConfig.txt diff --git a/dev_env_data/debug_configs/config/quantumlayer/quantumlayer_1.yaml b/dev_env_data/debug_configs/config/quantumlayer/quantumlayer_1.yaml new file mode 100644 index 00000000..cd6e9f54 --- /dev/null +++ b/dev_env_data/debug_configs/config/quantumlayer/quantumlayer_1.yaml @@ -0,0 +1 @@ +KMSAddr: 'host.docker.internal:50911' diff --git a/dev_env_data/debug_configs/config/quantumlayer/quantumlayer_2.yaml b/dev_env_data/debug_configs/config/quantumlayer/quantumlayer_2.yaml new file mode 100644 index 00000000..df8fec42 --- /dev/null +++ b/dev_env_data/debug_configs/config/quantumlayer/quantumlayer_2.yaml @@ -0,0 +1 @@ +KMSAddr: 'kms_2:50911' diff --git a/docker-compose_debug_kms.yml b/dev_env_data/docker-compose/docker-compose_debug_kms.yml similarity index 81% rename from docker-compose_debug_kms.yml rename to dev_env_data/docker-compose/docker-compose_debug_kms.yml index 8b6a2065..779623eb 100644 --- a/docker-compose_debug_kms.yml +++ b/dev_env_data/docker-compose/docker-compose_debug_kms.yml @@ -12,8 +12,8 @@ services: image: gokms command: ["--log", "debug", "--kms_config", "/tmp/kms/config/kms_2.yaml"] volumes: - - ./debug_configs/config/kms/kms_2.yaml:/tmp/kms/config/kms_2.yaml - - ./artifacts/ssl:/ssl + - ../debug_configs/config/kms/kms_2.yaml:/tmp/kms/config/kms_2.yaml + - ../../artifacts/ssl:/ssl ports: - "127.0.0.1:7031:7030" - "127.0.0.1:51910:50910" @@ -27,7 +27,7 @@ services: image: quantumlayer command: ["--log", "debug", "--config", "/tmp/quantumlayer/config/quantumlayer_1.yaml"] volumes: - - ./debug_configs/config/quantumlayer/quantumlayer_1.yaml:/tmp/quantumlayer/config/quantumlayer_1.yaml + - ../debug_configs/config/quantumlayer/quantumlayer_1.yaml:/tmp/quantumlayer/config/quantumlayer_1.yaml extra_hosts: - "host.docker.internal:host-gateway" networks: @@ -38,7 +38,7 @@ services: image: quantumlayer command: ["--log", "debug", "--config", "/tmp/quantumlayer/config/quantumlayer_2.yaml"] volumes: - - ./debug_configs/config/quantumlayer/quantumlayer_2.yaml:/tmp/quantumlayer/config/quantumlayer_2.yaml + - ../debug_configs/config/quantumlayer/quantumlayer_2.yaml:/tmp/quantumlayer/config/quantumlayer_2.yaml networks: kms-debug-net: diff --git a/docker-compose_small_random.yml b/dev_env_data/docker-compose/docker-compose_small_random.yml similarity index 100% rename from docker-compose_small_random.yml rename to dev_env_data/docker-compose/docker-compose_small_random.yml diff --git a/docker-compose_small_replay.yml b/dev_env_data/docker-compose/docker-compose_small_replay.yml similarity index 100% rename from docker-compose_small_replay.yml rename to dev_env_data/docker-compose/docker-compose_small_replay.yml diff --git a/docker-compose.yml b/docker-compose.yml index 5b9e158a..e2cf0c11 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: kms_1: image: gokms - command: ["--log", "debug", "--kms_config", "/tmp/kms/config/kms01.yaml", "--insecureGNMI"] + command: ["--log", "debug", "--kms_config", "/tmp/kms/config/kms01.yaml"] volumes: - ./config/goKMS/example01.yaml:/tmp/kms/config/kms01.yaml - ./artifacts/ssl:/ssl @@ -11,7 +11,7 @@ services: kms_2: image: gokms - command: ["--log", "debug", "--kms_config", "/tmp/kms/config/kms02.yaml", "--insecureGNMI"] + command: ["--log", "debug", "--kms_config", "/tmp/kms/config/kms02.yaml"] volumes: - ./config/goKMS/example02.yaml:/tmp/kms/config/kms02.yaml - ./artifacts/ssl:/ssl @@ -21,7 +21,7 @@ services: kms_3: image: gokms - command: ["--log", "debug", "--kms_config", "/tmp/kms/config/kms03.yaml", "--insecureGNMI"] + command: ["--log", "debug", "--kms_config", "/tmp/kms/config/kms03.yaml"] volumes: - ./config/goKMS/example03.yaml:/tmp/kms/config/kms03.yaml - ./artifacts/ssl:/ssl @@ -31,7 +31,7 @@ services: kms_4: image: gokms - command: ["--log", "debug", "--kms_config", "/tmp/kms/config/kms04.yaml", "--insecureGNMI"] + command: ["--log", "debug", "--kms_config", "/tmp/kms/config/kms04.yaml"] volumes: - ./config/goKMS/example04.yaml:/tmp/kms/config/kms04.yaml - ./artifacts/ssl:/ssl diff --git a/goKMS/main.go b/goKMS/main.go index f687f743..7af6b0ec 100644 --- a/goKMS/main.go +++ b/goKMS/main.go @@ -72,7 +72,8 @@ func main() { log.Debugf("current config path: %s", *configPath) file, err := os.ReadFile(*configPath) if err != nil { - log.Fatal(err) + currentFolder, _ := os.Getwd() + log.Fatalf("error reading config file: %s, current folder: %s", *configPath, currentFolder) } if err := yaml.Unmarshal(file, kmsConfig); err != nil { log.Fatal(err) @@ -123,24 +124,27 @@ func main() { } func outputTlsSettings(config *config.Config) { + currentDirectory, _ := os.Getwd() + log.Debugf("current relative file path: %s", currentDirectory) + log.Infof("TLS enabled for gNMIC: %t", config.GnmiTLS.TLS) if config.GnmiTLS.TLS { - log.Infof("TLS filepaths for gNMIC; ca: %s, cert: %s, key: %s", config.GnmiTLS.CAFile, config.GnmiTLS.CertFile, config.GnmiTLS.KeyFile) + log.Infof("TLS filepaths for gNMIC: ca: %s, cert: %s, key: %s", config.GnmiTLS.CAFile, config.GnmiTLS.CertFile, config.GnmiTLS.KeyFile) } log.Infof("TLS enabled for KMS: %t", config.KmsTLS.TLS) if config.KmsTLS.TLS { - log.Infof("TLS filepaths for KMS; ca: %s, cert: %s, key: %s", config.KmsTLS.CAFile, config.KmsTLS.CertFile, config.KmsTLS.KeyFile) + log.Infof("TLS filepaths for KMS: ca: %s, cert: %s, key: %s", config.KmsTLS.CAFile, config.KmsTLS.CertFile, config.KmsTLS.KeyFile) } log.Infof("TLS enabled for Quantum Module: %t", config.QuantumModuleTLS.TLS) if config.QuantumModuleTLS.TLS { - log.Infof("TLS filepaths for Quantum Module; ca: %s, cert: %s, key: %s", config.QuantumModuleTLS.CAFile, config.QuantumModuleTLS.CertFile, config.QuantumModuleTLS.KeyFile) + log.Infof("TLS filepaths for Quantum Module: ca: %s, cert: %s, key: %s", config.QuantumModuleTLS.CAFile, config.QuantumModuleTLS.CertFile, config.QuantumModuleTLS.KeyFile) } log.Infof("TLS enabled for AKMS-CKMS interface: %t", config.AkmsCkmsTLS.TLS) if config.AkmsCkmsTLS.TLS { - log.Infof("TLS filepaths for AKMS-CKMS interface; ca: %s, cert: %s, key: %s", config.AkmsCkmsTLS.CAFile, config.AkmsCkmsTLS.CertFile, config.AkmsCkmsTLS.KeyFile) + log.Infof("TLS filepaths for AKMS-CKMS interface: ca: %s, cert: %s, key: %s", config.AkmsCkmsTLS.CAFile, config.AkmsCkmsTLS.CertFile, config.AkmsCkmsTLS.KeyFile) } } -- GitLab