diff --git a/.vscode/launch.json b/.vscode/launch.json index 0470d666079a49810f1eda959fe12b8d3f04b8a4..451f53a862bd28c13b15cf99e7a39eb126ac22de 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 c537a2497bb778cbabe6742bec59e91dc40b5d10..5b5353ce0bf637b68fb0942152094dcd0fc6cfc9 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 a708ccb29804592ec56a9d3759b1c24a47498586..4f66e9539c3058e0480ba614a4a3ee164e32c54f 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 937cd40bb00a7d2f20364c4132db136ed0643124..f67e8453dd340cadea642a8ae81c8b6403d58aca 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 4c6dfaba0410e3161ffea49ed141a7398d1ed677..daae3148eebdcfa04aac1eb0e2e8a8f1e766c004 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 d1f12de6414dec2ed87ac885d2c6f2968e4e9f09..8569c6dd3aef6bba15d3c91350b5dccd1e4b2bbd 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 346dbe210fb688654685949f965848d2c3867c7f..90d6ced6c30477015b2c4c9c21c8a9c2cfc24408 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 1736d402143060d2d3250301f955c91959e1bd42..8aeea7af2f4ac1500733fc4311b45943c96445a2 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 2073a95cab0c3ae060045b9d34468bbf4a5dafaa..f217b96b3287c12f85b96f8dddc28571ca9f7b0f 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 23e801076b122e53aee09ba1ee8c907b16da5e43..f217b96b3287c12f85b96f8dddc28571ca9f7b0f 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 05d7609f59c8a59ec8c8de4559e0cd531baeb597..e816a74cb07efd0365fb9f37dcf03df51d892927 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 5c693db0559d8929a4a7920d28681b0241db4525..8aeea7af2f4ac1500733fc4311b45943c96445a2 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 3dfff95bb70f1f7671f90a35ae18789ecee69915..8dbb2b6bea674f78dfe55f272ca560e3b5957358 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 ce547970996be648bd1e5cd987500dc7006fe4d1..8dbb2b6bea674f78dfe55f272ca560e3b5957358 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 7f07547acd7372aec0207f26bdd06fab826796e8..e816a74cb07efd0365fb9f37dcf03df51d892927 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 21fb247f4990d997a6c7d670b3d4ae951fc30bb8..0000000000000000000000000000000000000000 --- 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 d0e21821093a5582359c9ec464b2f6f436d24431..0000000000000000000000000000000000000000 --- 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 a43e54e79b08cf0461d488e984bc60659a48d232..ce3f145ffc0090ca3d1455ce2b6c4f21005ec23d 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 cc0cdc0ecd327071f3d3b1e098c62c6875d33f45..5270a6f1b1eef25ace4d9bd39b1636a9dabc0b36 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 0000000000000000000000000000000000000000..cd6e9f54eca38cc06143fe93bd5326a519fe9479 --- /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 0000000000000000000000000000000000000000..df8fec42cdc8c0dab2fdfb68cc0be7220d99ed21 --- /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 8b6a2065cf08a18af138cf396297f5d02843f8b4..779623eb7c7d01822ad495587a6cfe5990b9f2e6 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 5b9e158a6802e1d2bf5b94c9071df12369f8b8d3..e2cf0c11512b8de64ae7b046b30be4a86c663a5d 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 f687f743687dc9d33a9467afe1becac7cbe83b9c..7af6b0ecccb49871229b40d754f4db3e4f8b8e44 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) } }