Skip to content
Snippets Groups Projects
Commit 509fcade authored by Neil-Jocelyn Schark's avatar Neil-Jocelyn Schark
Browse files

Improve all debug setups and add qkdn-controller


See merge request !159

Co-authored-by: default avatarNeil Schark <gitlab@schark.eu>
parent 926c458e
Branches 37-improve-hostname-ip-handling
No related tags found
1 merge request!159Improve all debug setups and add qkdn-controller
Pipeline #221335 passed
Showing
with 339 additions and 152 deletions
...@@ -25,3 +25,5 @@ gostructs.go ...@@ -25,3 +25,5 @@ gostructs.go
*.lof *.lof
*.log *.log
*.out *.out
.gosdnc.toml
stages: stages:
- build - build
- build-integration-test
- test - test
- analyze - analyze
- build-latest - build-latest
variables: variables:
IMAGE_PATH: "${CI_REGISTRY_IMAGE}" IMAGE_PATH: "${CI_REGISTRY_IMAGE}"
DQ_REGISTRY_PATH: "registry.code.fbi.h-da.de/demoquandt/qkdn-controller"
DQ_QUANT_INTEGRATION_REGISTRY_PATH: $DQ_REGISTRY_PATH/quant-integration
GOLANG_VERSION: "1.22" GOLANG_VERSION: "1.22"
GOLANG_MINOR_VERSION: "${GOLANG_VERSION}.6"
DOCKER_TLS_CERTDIR: "/certs" DOCKER_TLS_CERTDIR: "/certs"
...@@ -67,6 +71,31 @@ build-binaries: ...@@ -67,6 +71,31 @@ build-binaries:
script: script:
- make build - make build
# Integration test stage preparations
.build-integration-test: &build-integration-test
stage: build-integration-test
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:latest
services:
- name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:latest
alias: docker
needs: []
before_script:
- apk add git
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker login -u $CI_DEPENDENCY_PROXY_USER -p $CI_DEPENDENCY_PROXY_PASSWORD $CI_DEPENDENCY_PROXY_SERVER
- docker login -u $QKDN_REPO_USERNAME -p $QKDN_REPO_TOKEN $CI_REGISTRY
patch-qkdn-controller:
script:
- docker buildx build --push -t ${DQ_QUANT_INTEGRATION_REGISTRY_PATH}/qkdn-controller:${CI_COMMIT_REF_SLUG} -f integration-tests/Dockerfiles/integration.Dockerfile --build-arg "BASEIMAGE=$DQ_REGISTRY_PATH" integration-tests
<<: *build-integration-test
patch-routing-app:
script:
- docker buildx build --push -t ${DQ_QUANT_INTEGRATION_REGISTRY_PATH}/routing-app:${CI_COMMIT_REF_SLUG} -f integration-tests/Dockerfiles/integration.Dockerfile --build-arg "BASEIMAGE=$DQ_REGISTRY_PATH/routing-app:qkdn-main" integration-tests
<<: *build-integration-test
# Build latest stage # Build latest stage
.build-latest: &build-latest .build-latest: &build-latest
...@@ -108,8 +137,8 @@ build-etsi14module-latest: ...@@ -108,8 +137,8 @@ build-etsi14module-latest:
- docker buildx build --push -t "$IMAGE_NAME:$TAG" -f etsi14module/Dockerfile --build-arg "GITLAB_PROXY=${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/" --build-arg GITLAB_LOGIN=${GITLAB_LOGIN} --build-arg GITLAB_TOKEN=${GITLAB_TOKEN} --build-arg GOLANG_VERSION=${GOLANG_VERSION} . - docker buildx build --push -t "$IMAGE_NAME:$TAG" -f etsi14module/Dockerfile --build-arg "GITLAB_PROXY=${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/" --build-arg GITLAB_LOGIN=${GITLAB_LOGIN} --build-arg GITLAB_TOKEN=${GITLAB_TOKEN} --build-arg GOLANG_VERSION=${GOLANG_VERSION} .
<<: *build-latest <<: *build-latest
# Analyze stage
# Analyze stage
lint: lint:
stage: analyze stage: analyze
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/golangci/golangci-lint:v1.60.1-alpine image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/golangci/golangci-lint:v1.60.1-alpine
...@@ -146,61 +175,20 @@ unit-tests: ...@@ -146,61 +175,20 @@ unit-tests:
path: coverage.xml path: coverage.xml
needs: [] needs: []
integration-test-kms:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/golang:$GOLANG_VERSION-bookworm integration-test:
needs: tags:
- ["build-quantumlayer", "build-akms-simulator", "build-kms"] - shell
needs: []
variables: variables:
FF_NETWORK_PER_BUILD: 1 DEPENDENCY_PROXY: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/
INTEGRATION_TEST_KMS1_URL: kms_1:7030
INTEGRATION_TEST_KMS2_URL: kms_2:7030
INTEGRATION_TEST_KMS1_AKMS_URL: kms_1:9696
INTEGRATION_TEST_LOG_FILE1_URL: akms-simulator_1:4444
INTEGRATION_TEST_LOG_FILE2_URL: akms-simulator_2:4444
INTEGRATION_TEST_KMS1_ETSI14_URL: kms_1:1414
INTEGRATION_TEST_KMS2_ETSI14_URL: kms_2:1414
services:
- name: $IMAGE_PATH/akms-simulator:$CI_COMMIT_REF_SLUG
alias: akms-simulator_1
- name: $IMAGE_PATH/akms-simulator:$CI_COMMIT_REF_SLUG
alias: akms-simulator_2
- name: $IMAGE_PATH/gokms:${CI_COMMIT_REF_SLUG}_integration-test
alias: kms_1
command:
[
"--log",
"debug",
"--kms_config",
"/config/kms/kms_1.yaml",
]
- name: $IMAGE_PATH/gokms:${CI_COMMIT_REF_SLUG}_integration-test
alias: kms_2
command:
[
"--log",
"debug",
"--kms_config",
"/config/kms/kms_2.yaml",
]
- name: $IMAGE_PATH/quantumlayer:${CI_COMMIT_REF_SLUG}_integration-test
alias: quantumlayer_1
command:
[
"--log",
"debug",
"--config",
"/config/quantumlayer/quantumlayer_1.yaml",
]
- name: $IMAGE_PATH/quantumlayer:${CI_COMMIT_REF_SLUG}_integration-test
alias: quantumlayer_2
command:
[
"--log",
"debug",
"--config",
"/config/quantumlayer/quantumlayer_2.yaml",
]
before_script: before_script:
- bash -c "$(curl -sL https://get-gnmic.openconfig.net)" - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker login -u $CI_DEPENDENCY_PROXY_USER -p $CI_DEPENDENCY_PROXY_PASSWORD $CI_DEPENDENCY_PROXY_SERVER
- ./scripts/install_go_as_user.sh $GOLANG_MINOR_VERSION
- export PATH="$HOME/go/go/bin:$PATH"
- export GOROOT="$HOME/go/go"
- export GOPATH=$HOME/go_projects
- go version
script: script:
- go test -p 1 ./integration-tests/code/getKSAKeyTest - make integration-test
...@@ -5,33 +5,110 @@ ...@@ -5,33 +5,110 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Launch file", "name": "kms01-debug",
"type": "go", "type": "go",
"request": "launch", "request": "attach",
"mode": "auto", "mode": "remote",
"program": "${file}" "remotePath": "",
"port": 4401,
"host": "127.0.0.1",
"showLog": true,
"trace": "log",
"logOutput": "rpc",
"preLaunchTask": "compose-debug-up",
}, },
{ {
"name": "kms", "name": "kms02-debug",
"type": "go", "type": "go",
"request": "launch", "request": "attach",
"mode": "auto", "mode": "remote",
"program": "${workspaceFolder}/goKMS/main.go", "remotePath": "",
"env": {}, "port": 4402,
"args": [ "host": "127.0.0.1",
"--log", "debug", "--kms_config", "${workspaceFolder}/debug_configs/config/kms/kms_1.yaml" "showLog": true,
] "trace": "log",
"logOutput": "rpc",
"preLaunchTask": "compose-debug-up",
},
{
"name": "kms03-debug",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "",
"port": 4403,
"host": "127.0.0.1",
"showLog": true,
"trace": "log",
"logOutput": "rpc",
"preLaunchTask": "compose-debug-up",
},
{
"name": "kms04-debug",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "",
"port": 4404,
"host": "127.0.0.1",
"showLog": true,
"trace": "log",
"logOutput": "rpc",
"preLaunchTask": "compose-debug-up",
}, },
{ {
"name": "kms-debug", "name": "integration-test-kms01-debug",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "",
"port": 4401,
"host": "127.0.0.1",
"showLog": true,
"trace": "log",
"logOutput": "rpc",
"preLaunchTask": "integration-test-debug-kms-up",
},
{
"name": "integration-test-kms02-debug",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "",
"port": 4402,
"host": "127.0.0.1",
"showLog": true,
"trace": "log",
"logOutput": "rpc",
"preLaunchTask": "integration-test-debug-kms-up",
},
{
"name": "Launch currently open test",
"type": "go", "type": "go",
"request": "launch", "request": "launch",
"mode": "auto", "mode": "auto",
"program": "${workspaceFolder}/goKMS/main.go", "program": "${file}"
"env": {},
"args": [
"--log", "debug", "--kms_config", "${workspaceFolder}/dev_env_data/debug_configs/config/kms/kms_1.yaml"
]
}, },
],
"compounds": [
{
"name": "Debug all kms parallel",
"configurations": [
"kms01-debug",
"kms02-debug",
"kms03-debug",
"kms04-debug"
],
"stopAll": true
},
{
"name": "Debug open integration test and kms",
"configurations": [
"integration-test-kms01-debug",
"integration-test-kms02-debug",
"Launch currently open test"
],
"stopAll": true
}
] ]
} }
{
"version": "2.0.0",
"tasks": [
{
"label": "integration-test-debug-kms-up",
"command": "make integration-test-debug-compose-up",
"type": "shell",
},
{
"label": "compose-debug-up",
"command": "make compose-debug-up",
"type": "shell",
}
]
}
...@@ -23,7 +23,7 @@ all: build ...@@ -23,7 +23,7 @@ all: build
pre: pre:
mkdir -p $(BUILD_ARTIFACTS_PATH) mkdir -p $(BUILD_ARTIFACTS_PATH)
install-tools: install-tools: pre
@echo Install development tooling @echo Install development tooling
mkdir -p $(GOSDN_PRG) mkdir -p $(GOSDN_PRG)
export GOBIN=$(GOSDN_PRG) &&\ export GOBIN=$(GOSDN_PRG) &&\
...@@ -32,6 +32,9 @@ install-tools: ...@@ -32,6 +32,9 @@ install-tools:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
@echo Finished installing development tooling @echo Finished installing development tooling
install-gosdnc:
./scripts/install_gosdnc.sh
ci-lint: install-tools ci-lint: install-tools
./$(TOOLS_DIR)/golangci-lint run --config .golangci.yml ./$(TOOLS_DIR)/golangci-lint run --config .golangci.yml
...@@ -59,10 +62,10 @@ build-akms-simulator: pre ...@@ -59,10 +62,10 @@ build-akms-simulator: pre
$(GOBUILD) -o $(BUILD_ARTIFACTS_PATH)/akms-simulator ./akms-simulator/akms-simulator.go $(GOBUILD) -o $(BUILD_ARTIFACTS_PATH)/akms-simulator ./akms-simulator/akms-simulator.go
quantumlayer-container: quantumlayer-container:
docker buildx build --rm -t quantumlayer --load -f ./quantumlayer/Dockerfile --build-arg GITLAB_LOGIN=${GITLAB_LOGIN} --build-arg GITLAB_TOKEN=${GITLAB_TOKEN} --build-arg GOLANG_VERSION=${GOLANG_VERSION} . docker buildx build --rm -t quantumlayer --load -f ./quantumlayer/Dockerfile --build-arg GITLAB_LOGIN=${GITLAB_LOGIN} --build-arg GITLAB_TOKEN=${GITLAB_TOKEN} --build-arg GOLANG_VERSION=${GOLANG_VERSION} --build-arg GITLAB_PROXY=${DEPENDENCY_PROXY} .
etsi14module-container: etsi14module-container:
docker buildx build --rm -t etsi14module --load -f ./etsi14module/Dockerfile --build-arg GOLANG_VERSION=${GOLANG_VERSION} . docker buildx build --rm -t etsi14module --load -f ./etsi14module/Dockerfile --build-arg GOLANG_VERSION=${GOLANG_VERSION} --build-arg GITLAB_PROXY=${DEPENDENCY_PROXY} .
gokms-build-debug: pre gokms-build-debug: pre
$(GOBUILD) -gcflags="all=-N -l" -o $(BUILD_ARTIFACTS_PATH)/goKMS ./goKMS/main.go $(GOBUILD) -gcflags="all=-N -l" -o $(BUILD_ARTIFACTS_PATH)/goKMS ./goKMS/main.go
...@@ -73,56 +76,47 @@ generate-yang-models: install-tools ...@@ -73,56 +76,47 @@ generate-yang-models: install-tools
go generate go generate
gokms-container: gokms-container:
docker buildx build --rm -t gokms --load -f ./goKMS/Dockerfile --build-arg GITLAB_LOGIN=${GITLAB_LOGIN} --build-arg GITLAB_TOKEN=${GITLAB_TOKEN} --build-arg GOLANG_VERSION=${GOLANG_VERSION} . docker buildx build --rm -t gokms_debug --load -f ./goKMS/Dockerfile --target debug --build-arg GITLAB_LOGIN=${GITLAB_LOGIN} --build-arg GITLAB_TOKEN=${GITLAB_TOKEN} --build-arg GOLANG_VERSION=${GOLANG_VERSION} --build-arg GITLAB_PROXY=${DEPENDENCY_PROXY} .
docker buildx build --rm -t gokms --load -f ./goKMS/Dockerfile --build-arg GITLAB_LOGIN=${GITLAB_LOGIN} --build-arg GITLAB_TOKEN=${GITLAB_TOKEN} --build-arg GOLANG_VERSION=${GOLANG_VERSION} --build-arg GITLAB_PROXY=${DEPENDENCY_PROXY} .
gokms-container-debug:
docker buildx build --rm -t gokms-debug --load -f ./goKMS/Dockerfile.debug --build-arg GITLAB_LOGIN=${GITLAB_LOGIN} --build-arg GITLAB_TOKEN=${GITLAB_TOKEN} --build-arg GOLANG_VERSION=${GOLANG_VERSION} .
akms-simulator-container: akms-simulator-container:
docker buildx build --rm -t akms-simulator --load -f ./akms-simulator/Dockerfile --build-arg GOLANG_VERSION=${GOLANG_VERSION} . docker buildx build --rm -t akms-simulator --load -f ./akms-simulator/Dockerfile --build-arg GOLANG_VERSION=${GOLANG_VERSION} --build-arg GITLAB_PROXY=${DEPENDENCY_PROXY} .
build-images: gokms-container quantumlayer-container akms-simulator-container build-images: gokms-container quantumlayer-container akms-simulator-container
compose-up: generate-gokms-certs build-images compose-up: generate-gokms-certs build-images install-gosdnc
docker-compose up -d docker compose down
docker compose up -d
echo "Will add devices, can take a while"
./config/controller/add_devices.sh
compose-down: compose-down:
docker-compose down docker compose down
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: compose-debug-up: generate-gokms-certs build-images install-gosdnc
docker-compose -f dev_env_data/docker-compose/docker-compose_debug_kms.yml down docker compose -f docker-compose.yml -f docker-compose.override.debug.yml down
docker compose -f docker-compose.yml -f docker-compose.override.debug.yml up -d
echo "compose debug setup done. You have to manually add the devices to the controller by using './config/controller/add_devices_no_sleep.sh'"
integration-test-debug-up: generate-integration-test-certs build-images compose-debug-down:
docker-compose -f integration-tests/docker-compose_integration_test.yml down docker compose -f docker-compose.yml -f docker-compose.override.debug.yml down
docker-compose -f integration-tests/docker-compose_integration_test.yml up
integration-test-debug-down: integration-test: install-gosdnc generate-integration-test-certs build-images
docker-compose -f integration-tests/docker-compose_integration_test.yml down docker compose -f integration-tests/docker-compose.yml down
docker compose -f integration-tests/docker-compose.yml up -d
integration-test: generate-integration-test-certs build-images
docker-compose -f integration-tests/docker-compose_integration_test.yml down
docker-compose -f integration-tests/docker-compose_integration_test.yml up -d
echo "Will sleep for the quantumlayers to get ready" echo "Will sleep for the quantumlayers to get ready"
sleep 25 sleep 45
go test -p 1 -count=1 -v ./integration-tests/code/* go test -p 1 -count=1 -v ./integration-tests/code/*
docker-compose -f integration-tests/docker-compose_integration_test.yml down docker compose -f integration-tests/docker-compose.yml down
playground-start: generate-certs build-images
sudo containerlab deploy --reconfigure --topo dev_env_data/containerlab/playground.clab.yaml
playground-stop: integration-test-debug-compose-up: generate-integration-test-certs build-images install-gosdnc
sudo containerlab destroy --topo dev_env_data/containerlab/playground.clab.yaml docker compose -f integration-tests/docker-compose.yml -f integration-tests/docker-compose.override.debug.yml down
docker compose -f integration-tests/docker-compose.yml -f integration-tests/docker-compose.override.debug.yml up -d
playground-graph: integration-test-debug-compose-down:
sudo containerlab graph --topo dev_env_data/containerlab/playground.clab.yaml docker compose -f integration-tests/docker-compose.yml -f integration-tests/docker-compose.override.debug.yml down
generate-certs: generate-root-ca generate-gokms-certs generate-debug-certs generate-integration-test-certs generate-certs: generate-root-ca generate-gokms-certs generate-integration-test-certs
generate-root-ca: pre generate-root-ca: pre
if [ ! -d "$(BUILD_ARTIFACTS_PATH)/ssl" ]; then \ if [ ! -d "$(BUILD_ARTIFACTS_PATH)/ssl" ]; then \
...@@ -135,9 +129,6 @@ generate-root-ca: pre ...@@ -135,9 +129,6 @@ generate-root-ca: pre
generate-gokms-certs: generate-root-ca generate-gokms-certs: generate-root-ca
./config/goKMS/generate-kms-certs.sh ./config/goKMS/generate-kms-certs.sh
generate-debug-certs: generate-root-ca
./dev_env_data/debug_configs/config/kms/generate-debug-certs.sh
generate-integration-test-certs: generate-root-ca generate-integration-test-certs: generate-root-ca
./integration-tests/config/kms/generate-certs.sh ./integration-tests/config/kms/generate-certs.sh
......
...@@ -29,6 +29,7 @@ InterComAddr: 0.0.0.0:50910 # IP and port to bind the local gRPC server for inte ...@@ -29,6 +29,7 @@ InterComAddr: 0.0.0.0:50910 # IP and port to bind the local gRPC server for inte
QuantumAddr: 0.0.0.0:50911 # IP and port to bind the local gRPC server for QKD modules to reach the KMS to (optional, only used for specific emulated or experimental QKD modules) QuantumAddr: 0.0.0.0:50911 # IP and port to bind the local gRPC server for QKD modules to reach the KMS to (optional, only used for specific emulated or experimental QKD modules)
AkmsURL: "http://172.100.20.22:4444/api/v1/keys/push_ksa_key" # address of the rest endpoint of a connected AKMS (used for sending KSA key to the AKMS). AkmsURL: "http://172.100.20.22:4444/api/v1/keys/push_ksa_key" # address of the rest endpoint of a connected AKMS (used for sending KSA key to the AKMS).
AkmsCkmsServerPort: "9696" # Port of connected AKMS AkmsCkmsServerPort: "9696" # Port of connected AKMS
GRPCTimeoutInSeconds: 10 # Time in seconds for timeout of gRPC connections as a client. Defaults to 10 seconds. Should not be set to 0 or negative values.
GnmiTLS: # Settings for TLS for gNMI endpoint. Can be overwritten with cli parameters. GnmiTLS: # Settings for TLS for gNMI endpoint. Can be overwritten with cli parameters.
TLS: true # Whether TLS is enabled TLS: true # Whether TLS is enabled
CAFile: "ssl/ca.crt" # Path to ca CAFile: "ssl/ca.crt" # Path to ca
...@@ -194,12 +195,12 @@ The key exchange can also be triggered by sending a `GetKey` request as defined ...@@ -194,12 +195,12 @@ The key exchange can also be triggered by sending a `GetKey` request as defined
### Debug setup ### Debug setup
For goKMS there is a debug setup available for VS Code. For goKMS there is a debug setup available for VS Code. It uses the standard `docker-compose.yml` setup and simply adds the debugger to it in the `docker-compose.override.yaml`
1. Set your breakpoints 1. Set your breakpoints for the goKMS (akms-simulator and quantumlayer currently not supported)
2. To use it run `make debug-kms-up` and wait for the build to complete. 2. Go to the debugger tab in vscode and select `Debug all kms parallel`. The single KMS options may work for certain things, but are not guaranteed to work because of how the debugging setup works.
3. If you see the first log outputs from the running docker setup start the debugger in VS Code named `kms-debug`. 3. Wait for it to start. At the end you can follow the instruction printed in your terminal to add the devices to the qkdn-controller.
If you are finished stop the debugger and run `make debug-kms-down` to stop the environment. If you are finished stop the debugger and run `make compose-debug-down` to stop the environment.
## Quantumlayer ## Quantumlayer
...@@ -272,7 +273,7 @@ used as quantum modules. ...@@ -272,7 +273,7 @@ used as quantum modules.
#### Start and Stop #### Start and Stop
By running `make compose-up` and `make compose-down` the setup can be started By running `make compose-up` and `make compose-down` the setup can be started
or stopped with its default config. or stopped with its default config. Please note that you need access to private QKDN repos to do this. If you don"t have this access, you can use the small examples in `/dev_env_data`.
The default config is based on the configuration files provided in the The default config is based on the configuration files provided in the
[config/goKMS](config/goKMS) and [config/quantumlayer](config/quantumlayer) folder. [config/goKMS](config/goKMS) and [config/quantumlayer](config/quantumlayer) folder.
...@@ -338,6 +339,16 @@ Below is a short demo video of this setup in combination with the ...@@ -338,6 +339,16 @@ Below is a short demo video of this setup in combination with the
![](figures/gosdn-kms-example.mp4) ![](figures/gosdn-kms-example.mp4)
## Integration Tests
Everything needed for the integration tests is found in the `integration-tests` folder.
You can run them by simply using `make integration-tests` in the project root.
If you need to debug the integration tests you can use vscode and provided configurations.
Open the integration test file you want to debug and set your breakpoints in the test and the kms code (a breakpoint before the tests add the devices to the controller is nearly always required), then go to VSCodes debug tab and start `Debug open integration test and kms`.
After all images are build and started wait around 25 seconds before starting to progress through the test.
You can switch between stepping through the test and each kms. Stepping through the quantum layer, controller, routing app and akms-simulator is currently not supported.
## Contributing ## Contributing
Contributions are welcome! Please follow these guidelines: Contributions are welcome! Please follow these guidelines:
......
...@@ -2,7 +2,7 @@ ARG GOLANG_VERSION=1.22 ...@@ -2,7 +2,7 @@ ARG GOLANG_VERSION=1.22
ARG BUILDARGS ARG BUILDARGS
ARG GITLAB_PROXY ARG GITLAB_PROXY
FROM ${GITLAB_PROXY}golang:$GOLANG_VERSION-bookworm as builder FROM ${GITLAB_PROXY}golang:$GOLANG_VERSION-bookworm AS builder
RUN apt-get update && apt-get upgrade -y RUN apt-get update && apt-get upgrade -y
WORKDIR /app/ WORKDIR /app/
...@@ -11,7 +11,7 @@ RUN --mount=type=cache,target=/root/go/pkg/mod \ ...@@ -11,7 +11,7 @@ RUN --mount=type=cache,target=/root/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/root/.cache/go-build \
make build-akms-simulator make build-akms-simulator
FROM ${GITLAB_PROXY}debian:12-slim as debian FROM ${GITLAB_PROXY}debian:12-slim AS debian
RUN apt-get update && apt-get upgrade -y RUN apt-get update && apt-get upgrade -y
COPY --from=builder app/artifacts/akms-simulator /usr/bin/akms-simulator COPY --from=builder app/artifacts/akms-simulator /usr/bin/akms-simulator
......
#!/bin/sh
## Note: This script does not clean up network elements already existing in the storage. Running it repeatedly will
## create a garbage storage.
GOSDNC_PATH="./artifacts/gosdnc"
GOSDN_ADDRESS="127.0.0.1:55055"
ADMINPW="TestPassword"
KMS_PLUGIN="823aad29-69be-42f0-b279-90f2c1b6a94d"
PND_UUID="5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d"
## Adjust this if timer is to short.
SLEEP_TIMER=20
echo 'Logging in via gosdnc and setting up KMS in controller...'
## Sleep is needed to give gosdn some time to start correctly.
echo "Sleeping for $SLEEP_TIMER before starting"
sleep $SLEEP_TIMER
# TODO: Add --tls when adding certs to this!
## Call login and create entries for all the network elements.
## Could be a bit more automated in the future, but fine for now.
$GOSDNC_PATH login --controller $GOSDN_ADDRESS --u admin --p $ADMINPW
$GOSDNC_PATH pnd use $PND_UUID
$GOSDNC_PATH mne create --address "kms01:7030" --name kms01 --password admin --plugin-id $KMS_PLUGIN --username admin --uuid 0ff33c82-7fe1-482b-a0ca-67565806ee4b
$GOSDNC_PATH mne create --address "kms02:7030" --name kms02 --password admin --plugin-id $KMS_PLUGIN --username admin --uuid 5e41c291-6121-4335-84f6-41e04b8bdaa2
$GOSDNC_PATH mne create --address "kms03:7030" --name kms03 --password admin --plugin-id $KMS_PLUGIN --username admin --uuid f80db2c0-2480-46b9-b7d1-b63f954e8227
$GOSDNC_PATH mne create --address "kms04:7030" --name kms03 --password admin --plugin-id $KMS_PLUGIN --username admin --uuid 968fd594-b0e7-41f0-ba4b-de259047a933
#!/bin/sh
## Note: This script does not clean up network elements already existing in the storage. Running it repeatedly will
## create a garbage storage.
GOSDNC_PATH="./artifacts/gosdnc"
GOSDN_ADDRESS="127.0.0.1:55055"
ADMINPW="TestPassword"
KMS_PLUGIN="823aad29-69be-42f0-b279-90f2c1b6a94d"
PND_UUID="5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d"
echo 'Logging in via gosdnc and setting up KMS in controller...'
# TODO: Add --tls when adding certs to this!
## Call login and create entries for all the network elements.
## Could be a bit more automated in the future, but fine for now.
$GOSDNC_PATH login --controller $GOSDN_ADDRESS --u admin --p $ADMINPW
$GOSDNC_PATH pnd use $PND_UUID
$GOSDNC_PATH mne create --address "kms01:7030" --name kms01 --password admin --plugin-id $KMS_PLUGIN --username admin --uuid 0ff33c82-7fe1-482b-a0ca-67565806ee4b
$GOSDNC_PATH mne create --address "kms02:7030" --name kms02 --password admin --plugin-id $KMS_PLUGIN --username admin --uuid 5e41c291-6121-4335-84f6-41e04b8bdaa2
$GOSDNC_PATH mne create --address "kms03:7030" --name kms03 --password admin --plugin-id $KMS_PLUGIN --username admin --uuid f80db2c0-2480-46b9-b7d1-b63f954e8227
$GOSDNC_PATH mne create --address "kms04:7030" --name kms03 --password admin --plugin-id $KMS_PLUGIN --username admin --uuid 968fd594-b0e7-41f0-ba4b-de259047a933
create-route-requests
\ No newline at end of file
amqphost = 'rabbitmq'
amqppassword = 'guest'
amqpport = '5672'
amqpprefix = 'amqp://'
amqpuser = 'guest'
basepnduuid = '5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d'
config = './configs/qkdn-gosdn.toml'
csbi-orchestrator = 'localhost:55056'
databaseconnection = 'mongodb://root:example@mongodb:27017'
defaultjwtduration = 24
filesystempathtostores = 'stores'
gnmisubscriptionspath = 'configs/gNMISubscriptions.txt'
help = false
log-level = 'debug'
nogrpcpassthrough = false
plugin-folder = 'plugins'
plugin-registry = 'plugin-registry:55057'
security = 'secure'
socket = ':55055'
ControllerAddress: "qkdn-controller:55055"
PndID: "5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d"
UserName: "admin"
UserPW: "TestPassword"
AppName: "dq-routing"
RegistrationToken: "SecurePresharedToken"
GrpcAddress: ":54321"
#!/bin/bash
echo "Sleeping for 10 before starting"
sleep 10
echo "Done sleeping"
./routing --config /new/routing-config.yaml
Id: "0ff33c82-7fe1-482b-a0ca-67565806ee4b" Id: "0ff33c82-7fe1-482b-a0ca-67565806ee4b"
Name: kms01 Name: kms01
InterComAddr: 172.100.20.10:50910 InterComAddr: 0.0.0.0:50910
QuantumAddr: 172.100.20.10:50911 QuantumAddr: 0.0.0.0:50911
AkmsURL: "http://172.100.20.22:4444/api/v1/keys/push_ksa_key" GRPCAddr: 0.0.0.0:50900
AkmsURL: "http://akms-receiver01:4444/api/v1/keys/push_ksa_key"
AkmsCkmsServerPort: "9696" AkmsCkmsServerPort: "9696"
GRPCTimeoutInSeconds: 600
KmsTLS: KmsTLS:
TLS: false TLS: false
CAFile: "ssl/ca.crt" CAFile: "ssl/ca.crt"
...@@ -17,20 +19,22 @@ QuantumModuleTLS: ...@@ -17,20 +19,22 @@ QuantumModuleTLS:
Peers: Peers:
# peer to kms02 # peer to kms02
- PeerId: "5e41c291-6121-4335-84f6-41e04b8bdaa2" - PeerId: "5e41c291-6121-4335-84f6-41e04b8bdaa2"
PeerInterComAddr: 172.100.20.11:50910 PeerInterComAddr: kms02:50910
Sync: true
Type: danet Type: danet
# quantum module of type emulated at the given address # quantum module of type emulated at the given address
QuantumModule: QuantumModule:
Type: emulated Type: emulated
Address: 172.100.20.14 Hostname: qlayer01
# peer to kms03 # peer to kms03
- PeerId: "f80db2c0-2480-46b9-b7d1-b63f954e8227" - PeerId: "f80db2c0-2480-46b9-b7d1-b63f954e8227"
PeerInterComAddr: 172.100.20.12:50910 PeerInterComAddr: kms03:50910
Sync: false
Type: danet Type: danet
# quantum module of type emulated at the given address # quantum module of type emulated at the given address
QuantumModule: QuantumModule:
Type: emulated Type: emulated
Address: 172.100.20.18 Hostname: qlayer05
QkdnManagerServer: QkdnManagerServer:
Address: ":8090" Address: ":8090"
ETSI14Server: ETSI14Server:
......
Id: "5e41c291-6121-4335-84f6-41e04b8bdaa2" Id: "5e41c291-6121-4335-84f6-41e04b8bdaa2"
Name: kms02 Name: kms02
InterComAddr: 172.100.20.11:50910 InterComAddr: 0.0.0.0:50910
QuantumAddr: 172.100.20.11:50911 QuantumAddr: 0.0.0.0:50911
GRPCAddr: 0.0.0.0:50900
GRPCTimeoutInSeconds: 600
KmsTLS: KmsTLS:
TLS: false TLS: false
CAFile: "ssl/ca.crt" CAFile: "ssl/ca.crt"
...@@ -15,19 +17,21 @@ QuantumModuleTLS: ...@@ -15,19 +17,21 @@ QuantumModuleTLS:
Peers: Peers:
# peer to kms01 # peer to kms01
- PeerId: "0ff33c82-7fe1-482b-a0ca-67565806ee4b" - PeerId: "0ff33c82-7fe1-482b-a0ca-67565806ee4b"
PeerInterComAddr: 172.100.20.10:50910 PeerInterComAddr: kms01:50910
Sync: false
Type: danet Type: danet
# quantum module of type emulated at the given address # quantum module of type emulated at the given address
QuantumModule: QuantumModule:
Type: emulated Type: emulated
Address: 172.100.20.15 Hostname: qlayer02
# peer to kms04 # peer to kms04
- PeerId: "968fd594-b0e7-41f0-ba4b-de259047a933" - PeerId: "968fd594-b0e7-41f0-ba4b-de259047a933"
PeerInterComAddr: 172.100.20.13:50910 PeerInterComAddr: kms04:50910
Sync: true
Type: danet Type: danet
# quantum module of type emulated at the given address # quantum module of type emulated at the given address
QuantumModule: QuantumModule:
Type: emulated Type: emulated
Address: 172.100.20.16 Hostname: qlayer03
QkdnManagerServer: QkdnManagerServer:
Address: ":8090" Address: ":8090"
Id: "f80db2c0-2480-46b9-b7d1-b63f954e8227" Id: "f80db2c0-2480-46b9-b7d1-b63f954e8227"
Name: kms03 Name: kms03
InterComAddr: 172.100.20.12:50910 InterComAddr: 0.0.0.0:50910
QuantumAddr: 172.100.20.12:50911 QuantumAddr: 0.0.0.0:50911
GRPCAddr: 0.0.0.0:50900
GRPCTimeoutInSeconds: 600
KmsTLS: KmsTLS:
TLS: false TLS: false
CAFile: "ssl/ca.crt" CAFile: "ssl/ca.crt"
...@@ -15,19 +17,21 @@ QuantumModuleTLS: ...@@ -15,19 +17,21 @@ QuantumModuleTLS:
Peers: Peers:
# peer to kms01 # peer to kms01
- PeerId: "0ff33c82-7fe1-482b-a0ca-67565806ee4b" - PeerId: "0ff33c82-7fe1-482b-a0ca-67565806ee4b"
PeerInterComAddr: 172.100.20.10:50910 PeerInterComAddr: kms01:50910
Sync: true
Type: danet Type: danet
# quantum module of type emulated at the given address # quantum module of type emulated at the given address
QuantumModule: QuantumModule:
Type: emulated Type: emulated
Address: 172.100.20.19 Hostname: qlayer06
# peer to kms04 # peer to kms04
- PeerId: "968fd594-b0e7-41f0-ba4b-de259047a933" - PeerId: "968fd594-b0e7-41f0-ba4b-de259047a933"
PeerInterComAddr: 172.100.20.13:50910 PeerInterComAddr: kms04:50910
Sync: true
Type: danet Type: danet
# quantum module of type emulated at the given address # quantum module of type emulated at the given address
QuantumModule: QuantumModule:
Type: emulated Type: emulated
Address: 172.100.20.20 Hostname: qlayer07
QkdnManagerServer: QkdnManagerServer:
Address: ":8090" Address: ":8090"
Id: "968fd594-b0e7-41f0-ba4b-de259047a933" Id: "968fd594-b0e7-41f0-ba4b-de259047a933"
Name: kms04 Name: kms04
InterComAddr: 172.100.20.13:50910 InterComAddr: 0.0.0.0:50910
QuantumAddr: 172.100.20.13:50911 QuantumAddr: 0.0.0.0:50911
AkmsURL: "http://172.100.20.23:4444/api/v1/keys/push_ksa_key" GRPCAddr: 0.0.0.0:50900
AkmsURL: "http://akms-receiver02:4444/api/v1/keys/push_ksa_key"
AkmsCkmsServerPort: "9696" AkmsCkmsServerPort: "9696"
GRPCTimeoutInSeconds: 600
KmsTLS: KmsTLS:
TLS: false TLS: false
CAFile: "ssl/ca.crt" CAFile: "ssl/ca.crt"
...@@ -17,20 +19,22 @@ QuantumModuleTLS: ...@@ -17,20 +19,22 @@ QuantumModuleTLS:
Peers: Peers:
# peer to kms02 # peer to kms02
- PeerId: "5e41c291-6121-4335-84f6-41e04b8bdaa2" - PeerId: "5e41c291-6121-4335-84f6-41e04b8bdaa2"
PeerInterComAddr: 172.100.20.11:50910 PeerInterComAddr: kms02:50910
Sync: false
Type: danet Type: danet
# quantum module of type emulated at the given address # quantum module of type emulated at the given address
QuantumModule: QuantumModule:
Type: emulated Type: emulated
Address: 172.100.20.17 Hostname: qlayer04
# peer to kms03 # peer to kms03
- PeerId: "f80db2c0-2480-46b9-b7d1-b63f954e8227" - PeerId: "f80db2c0-2480-46b9-b7d1-b63f954e8227"
PeerInterComAddr: 172.100.20.12:50910 PeerInterComAddr: kms03:50910
Sync: false
Type: danet Type: danet
# quantum module of type emulated at the given address # quantum module of type emulated at the given address
QuantumModule: QuantumModule:
Type: emulated Type: emulated
Address: 172.100.20.21 Hostname: qlayer08
QkdnManagerServer: QkdnManagerServer:
Address: ":8090" Address: ":8090"
ETSI14Server: ETSI14Server:
......
KMSAddr: '172.100.20.10:50911' KMSAddr: 'kms01:50911'
KMSAddr: '172.100.20.11:50911' KMSAddr: 'kms02:50911'
KMSAddr: '172.100.20.11:50911' KMSAddr: 'kms02:50911'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment