From b15ae9d561b17783914f49addf12e29f0f9f99e0 Mon Sep 17 00:00:00 2001 From: Ryabin Sergey Date: Sun, 17 Sep 2023 11:23:33 +0200 Subject: [PATCH 1/7] Add tmux sesion name to vector environment --- inventory/targets/vector.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory/targets/vector.yml b/inventory/targets/vector.yml index 75904ad..d4d6c99 100644 --- a/inventory/targets/vector.yml +++ b/inventory/targets/vector.yml @@ -390,7 +390,7 @@ parameters: panes: # tmux list-windows -a -F '#{window_id} #{pane_id}' - - - tmux pipe-pane -IO "perl ${compiled_dir}/pipe-pane2hexstream.pl | VECTOR_UPSTREAM=`minikube ip`:${vector_aggregator_port} TMUX_PANE_ID='$TMUX_PANE' vector -q --config ${compiled_dir}/vector/tmux-bytestream.yaml" + - tmux pipe-pane -IO "perl ${compiled_dir}/pipe-pane2hexstream.pl | VECTOR_UPSTREAM=`minikube ip`:${vector_aggregator_port} TMUX_SESSION_NAME=`tmux display-message -p '#S'` TMUX_PANE_ID='$TMUX_PANE' vector -q --config ${compiled_dir}/vector/tmux-bytestream.yaml" - - vector_logs -f From 36711add67e6a7304f5419367e9886f1d71c41f8 Mon Sep 17 00:00:00 2001 From: Ryabin Sergey Date: Wed, 20 Sep 2023 18:16:41 +0200 Subject: [PATCH 2/7] Add workaround for calculating TMUX_PANE_ID when pipe-pane is called from a tmux set-hook --- inventory/classes/vector/tmux-bytestream-kafka.yml | 4 ++++ inventory/targets/vector.yml | 1 + 2 files changed, 5 insertions(+) diff --git a/inventory/classes/vector/tmux-bytestream-kafka.yml b/inventory/classes/vector/tmux-bytestream-kafka.yml index 81ebe85..73cceab 100644 --- a/inventory/classes/vector/tmux-bytestream-kafka.yml +++ b/inventory/classes/vector/tmux-bytestream-kafka.yml @@ -19,6 +19,10 @@ parameters: VECTOR_UPSTREAM=`minikube ip`:${vector_aggregator_port} TMUX_PANE_ID=`echo $TMUX_PANE | sed 's/[^0-9]//g'` + if [ -z "$TMUX_PANE_ID" ]; then + TMUX_PANE_ID=`tmux list-panes -t $TMUX_SESSION_NAME -F '#{pane_id} #{pane_active}' | awk '/1$/ {print $1}'` + fi + tmux pipe-pane -IO "perl ${compiled_dir}/pipe-pane2hexstream.pl | VECTOR_UPSTREAM='$VECTOR_UPSTREAM' SHELL_PID='$SHELL_PID' TMUX_SESSION_NAME='$TMUX_SESSION_NAME' TMUX_PANE_ID='$TMUX_PANE_ID' vector -q --config ${compiled_dir}/vector/tmux-bytestream.yaml" diff --git a/inventory/targets/vector.yml b/inventory/targets/vector.yml index d4d6c99..1aa4fe7 100644 --- a/inventory/targets/vector.yml +++ b/inventory/targets/vector.yml @@ -5,6 +5,7 @@ classes: - vim - tmuxinator - bash.kapitan + - bash.script - tmuxinator - tmuxinator.kapitan - logstash From 13927206d694fa16941da9d247ae021f551d0acd Mon Sep 17 00:00:00 2001 From: Ryabin Sergey Date: Wed, 20 Sep 2023 18:17:57 +0200 Subject: [PATCH 3/7] disable cache for freeplane build --- inventory/targets/freeplane_plugin_grpc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inventory/targets/freeplane_plugin_grpc.yml b/inventory/targets/freeplane_plugin_grpc.yml index 0408784..8b45a61 100644 --- a/inventory/targets/freeplane_plugin_grpc.yml +++ b/inventory/targets/freeplane_plugin_grpc.yml @@ -44,8 +44,8 @@ parameters: ( cd ${freeplane_root} # bash ./gRAdle.sh build - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gradle:7-jdk17 gradle build --no-build-cache --no-configuration-cache - # docker run --rm -v "$(pwd)":/app -w /app gradle:${gradle_version}-jdk${jdk_version} gradle build + #docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gradle:7-jdk17 gradle build --no-build-cache --no-configuration-cache + docker run --rm -v "$(pwd)":/app -w /app gradle:${gradle_version}-jdk${jdk_version} gradle build ) freeplane_clean: | cd ${freeplane_root} From a839212143ccac90398e0bc2f4297cad7f41a624 Mon Sep 17 00:00:00 2001 From: Ryabin Sergey Date: Sat, 23 Sep 2023 22:37:15 +0200 Subject: [PATCH 4/7] Minikube uses max cpu and max memory --- inventory/targets/kubernetes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory/targets/kubernetes.yml b/inventory/targets/kubernetes.yml index f082372..d64a1e9 100644 --- a/inventory/targets/kubernetes.yml +++ b/inventory/targets/kubernetes.yml @@ -20,7 +20,7 @@ parameters: kubectl get svc -n $* --output='jsonpath="{.spec.ports[0].nodePort}"' minikube_start: | - minikube start --driver=docker + minikube start --driver=docker --cpus max --memory max wtf: mods: From 148077d635fec5894de6455e31e0785c21dd3267 Mon Sep 17 00:00:00 2001 From: Ryabin Sergey Date: Sat, 23 Sep 2023 22:38:15 +0200 Subject: [PATCH 5/7] Normalize TMUX_PANE_ID --- inventory/classes/vector/tmux-bytestream-kafka.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inventory/classes/vector/tmux-bytestream-kafka.yml b/inventory/classes/vector/tmux-bytestream-kafka.yml index 73cceab..a716bc2 100644 --- a/inventory/classes/vector/tmux-bytestream-kafka.yml +++ b/inventory/classes/vector/tmux-bytestream-kafka.yml @@ -17,12 +17,15 @@ parameters: SHELL_PID=$$ TMUX_SESSION_NAME=`tmux display-message -p '#S'` VECTOR_UPSTREAM=`minikube ip`:${vector_aggregator_port} - TMUX_PANE_ID=`echo $TMUX_PANE | sed 's/[^0-9]//g'` + TMUX_PANE_ID=`echo $TMUX_PANE` if [ -z "$TMUX_PANE_ID" ]; then TMUX_PANE_ID=`tmux list-panes -t $TMUX_SESSION_NAME -F '#{pane_id} #{pane_active}' | awk '/1$/ {print $1}'` fi + TMUX_PANE_ID=`echo $TMUX_PANE_ID | sed 's/[^0-9]//g'` + + tmux pipe-pane -IO "perl ${compiled_dir}/pipe-pane2hexstream.pl | VECTOR_UPSTREAM='$VECTOR_UPSTREAM' SHELL_PID='$SHELL_PID' TMUX_SESSION_NAME='$TMUX_SESSION_NAME' TMUX_PANE_ID='$TMUX_PANE_ID' vector -q --config ${compiled_dir}/vector/tmux-bytestream.yaml" From fec492fafd956592e247e216ee912feef3415a05 Mon Sep 17 00:00:00 2001 From: Ryabin Sergey Date: Sat, 23 Sep 2023 22:39:01 +0200 Subject: [PATCH 6/7] Remove kafka sinks from vector --- inventory/targets/vector.yml | 302 +++++++++++++++++------------------ 1 file changed, 151 insertions(+), 151 deletions(-) diff --git a/inventory/targets/vector.yml b/inventory/targets/vector.yml index 1aa4fe7..a0daca0 100644 --- a/inventory/targets/vector.yml +++ b/inventory/targets/vector.yml @@ -93,23 +93,23 @@ parameters: acknowledgements: enabled: false - kafka-tmux-pane-io-context: - type: kafka - acknowledgements: - enabled: false - bootstrap_servers: "${kafka_cluster_name}-kafka-external-bootstrap.${kafka_k8s_namespace}:${kafka_port}" - group_id: vector_kafka - topics: - - ${kafka_topic_tmux_io_context} - - kafka-tmux-pane-linestream: - type: kafka - acknowledgements: - enabled: false - bootstrap_servers: "${kafka_cluster_name}-kafka-external-bootstrap.${kafka_k8s_namespace}:${kafka_port}" - group_id: vector_kafka - topics: - - ${kafka_topic_tmux_linestream} +# kafka-tmux-pane-io-context: +# type: kafka +# acknowledgements: +# enabled: false +# bootstrap_servers: "${kafka_cluster_name}-kafka-external-bootstrap.${kafka_k8s_namespace}:${kafka_port}" +# group_id: vector_kafka +# topics: +# - ${kafka_topic_tmux_io_context} +# +# kafka-tmux-pane-linestream: +# type: kafka +# acknowledgements: +# enabled: false +# bootstrap_servers: "${kafka_cluster_name}-kafka-external-bootstrap.${kafka_k8s_namespace}:${kafka_port}" +# group_id: vector_kafka +# topics: +# - ${kafka_topic_tmux_linestream} # _ __ # | | / _| @@ -121,29 +121,29 @@ parameters: # transforms: - kafka-io-context-to-elasticsearch: - type: "remap" - inputs: - - kafka-tmux-pane-io-context - source: | - msg, err = parse_json(.message) - .ps1_start = msg.message.ps1_start - .ps1_end = msg.message.ps1_end - .input = msg.message.input - .output = msg.message.output - .host = msg.host - del(.message) - - kafka-linestream-to-elasticsearch: - type: "remap" - inputs: - - kafka-tmux-pane-linestream - source: | - msg, err = parse_json(.message) - .line = msg.message - .host = msg.host - .tmux_pane_id = msg.tmux_pane.id - del(.message) +# kafka-io-context-to-elasticsearch: +# type: "remap" +# inputs: +# - kafka-tmux-pane-io-context +# source: | +# msg, err = parse_json(.message) +# .ps1_start = msg.message.ps1_start +# .ps1_end = msg.message.ps1_end +# .input = msg.message.input +# .output = msg.message.output +# .host = msg.host +# del(.message) +# +# kafka-linestream-to-elasticsearch: +# type: "remap" +# inputs: +# - kafka-tmux-pane-linestream +# source: | +# msg, err = parse_json(.message) +# .line = msg.message +# .host = msg.host +# .tmux_pane_id = msg.tmux_pane.id +# del(.message) tmux-stream-split-line: @@ -194,7 +194,7 @@ parameters: local function extract_ps(data) if (string.match(data, "^%S+@%S+:")) then - print("match") + --print("match") return data:gsub("^([^@]+)@([^:]+).*", "%1@%2") end return data @@ -219,8 +219,8 @@ parameters: event.log.message = { ps1_start = extract_ps((remove_unicode_ansi_sequences(ps1_data))), ps1_end = extract_ps((remove_unicode_ansi_sequences(line[tmux_pane_id]))), - input = input[tmux_pane_id], - output = table.concat(data[tmux_pane_id]), + input = remove_unicode_ansi_sequences(input[tmux_pane_id]), + output = remove_unicode_ansi_sequences(table.concat(data[tmux_pane_id])), } emit(event) end @@ -257,81 +257,81 @@ parameters: # sinks: - kafka-tmux-pane-bytestream: - type: kafka - inputs: - - tmux-pane-bytestream - bootstrap_servers: "${kafka_cluster_name}-kafka-external-bootstrap.${kafka_k8s_namespace}:${kafka_port}" - topic: "${kafka_topic_tmux_bytestream}" - compression: "none" - encoding: - codec: json - console: - type: console - inputs: - # - tmux-pane-bytestream - # - tmux-stream-split-line - # - kafka-linestream-to-elasticsearch - # - kafka-tmux-pane-linestream - - kafka-io-context-to-elasticsearch - encoding: - codec: json - kafka-tmux-pane-raw-linestream: - type: kafka - inputs: - - tmux-stream-split-line - bootstrap_servers: "${kafka_cluster_name}-kafka-external-bootstrap.${kafka_k8s_namespace}:${kafka_port}" - # topic: "${kafka_topic_tmux_linestream}" - topic: "${kafka_topic_tmux_raw_linestream}" # linestream with shell color codes - compression: "none" - encoding: - codec: json - opensearch-raw-tmux-lines: - type: elasticsearch - inputs: - - tmux-stream-split-line - endpoint: https://${opensearch_helm_release}-cluster-master.${opensearch_k8s_namespace}:9200 - api_version: "v7" # https://opensearch.org/faq/ - auth: # TODO (@metacoma) use opensearch credentials from opensearch class - user: ${opensearch_vector_user} - password: ${opensearch_vector_password} - strategy: basic - tls: - verify_certificate: false - verify_hostname: false - healthcheck: - enabled: false - bulk: - index: "${opensearch_raw_tmux_lines_index}-%F" +# kafka-tmux-pane-bytestream: +# type: kafka +# inputs: +# - tmux-pane-bytestream +# bootstrap_servers: "${kafka_cluster_name}-kafka-external-bootstrap.${kafka_k8s_namespace}:${kafka_port}" +# topic: "${kafka_topic_tmux_bytestream}" +# compression: "none" +# encoding: +# codec: json +# console: +# type: console +# inputs: +# # - tmux-pane-bytestream +# # - tmux-stream-split-line +# # - kafka-linestream-to-elasticsearch +# # - kafka-tmux-pane-linestream +# # - kafka-io-context-to-elasticsearch +# encoding: +# codec: json +# kafka-tmux-pane-raw-linestream: +# type: kafka +# inputs: +# - tmux-stream-split-line +# bootstrap_servers: "${kafka_cluster_name}-kafka-external-bootstrap.${kafka_k8s_namespace}:${kafka_port}" +# # topic: "${kafka_topic_tmux_linestream}" +# topic: "${kafka_topic_tmux_raw_linestream}" # linestream with shell color codes +# compression: "none" +# encoding: +# codec: json +# opensearch-raw-tmux-lines: +# type: elasticsearch +# inputs: +# - tmux-stream-split-line +# endpoint: https://${opensearch_helm_release}-cluster-master.${opensearch_k8s_namespace}:9200 +# api_version: "v7" # https://opensearch.org/faq/ +# auth: # TODO (@metacoma) use opensearch credentials from opensearch class +# user: ${opensearch_vector_user} +# password: ${opensearch_vector_password} +# strategy: basic +# tls: +# verify_certificate: false +# verify_hostname: false +# healthcheck: +# enabled: false +# bulk: +# index: "${opensearch_raw_tmux_lines_index}-%F" - opensearch-raw-tmux-io-context: - type: elasticsearch - inputs: - - tmux-pane-raw-io-context - endpoint: https://${opensearch_helm_release}-cluster-master.${opensearch_k8s_namespace}:9200 - api_version: "v7" # https://opensearch.org/faq/ - auth: # TODO (@metacoma) use opensearch credentials from opensearch class - user: ${opensearch_vector_user} - password: ${opensearch_vector_password} - strategy: basic - tls: - verify_certificate: false - verify_hostname: false - healthcheck: - enabled: false - bulk: - index: "${opensearch_raw_tmux_io_context_index}-%F" +# opensearch-raw-tmux-io-context: +# type: elasticsearch +# inputs: +# - tmux-pane-raw-io-context +# endpoint: https://${opensearch_helm_release}-cluster-master.${opensearch_k8s_namespace}:9200 +# api_version: "v7" # https://opensearch.org/faq/ +# auth: # TODO (@metacoma) use opensearch credentials from opensearch class +# user: ${opensearch_vector_user} +# password: ${opensearch_vector_password} +# strategy: basic +# tls: +# verify_certificate: false +# verify_hostname: false +# healthcheck: +# enabled: false +# bulk: +# index: "${opensearch_raw_tmux_io_context_index}-%F" - kafka-tmux-pane-raw-io-context: - type: kafka - inputs: - - tmux-pane-raw-io-context - # - tmux-pane-io-context - bootstrap_servers: "${kafka_cluster_name}-kafka-external-bootstrap.${kafka_k8s_namespace}:${kafka_port}" - topic: "${kafka_topic_tmux_raw_io_context}" - compression: "none" - encoding: - codec: json +# kafka-tmux-pane-raw-io-context: +# type: kafka +# inputs: +# - tmux-pane-raw-io-context +# # - tmux-pane-io-context +# bootstrap_servers: "${kafka_cluster_name}-kafka-external-bootstrap.${kafka_k8s_namespace}:${kafka_port}" +# topic: "${kafka_topic_tmux_raw_io_context}" +# compression: "none" +# encoding: +# codec: json rabbitmq-tmux-pane-raw-io-context: type: amqp @@ -345,41 +345,41 @@ parameters: codec: json - opensearch-tmux-io-context: - type: elasticsearch - inputs: - - kafka-io-context-to-elasticsearch - endpoint: https://${opensearch_helm_release}-cluster-master.${opensearch_k8s_namespace}:9200 - api_version: "v7" # https://opensearch.org/faq/ - auth: # TODO (@metacoma) use opensearch credentials from opensearch class - user: ${opensearch_vector_user} - password: ${opensearch_vector_password} - strategy: basic - tls: - verify_certificate: false - verify_hostname: false - healthcheck: - enabled: false - bulk: - index: "${opensearch_tmux_io_context_index}-%F" - - opensearch-tmux-pane-linestream: - type: elasticsearch - inputs: - - kafka-linestream-to-elasticsearch - endpoint: https://${opensearch_helm_release}-cluster-master.${opensearch_k8s_namespace}:9200 - api_version: "v7" # https://opensearch.org/faq/ - auth: # TODO (@metacoma) use opensearch credentials from opensearch class - user: ${opensearch_vector_user} - password: ${opensearch_vector_password} - strategy: basic - tls: - verify_certificate: false - verify_hostname: false - healthcheck: - enabled: false - bulk: - index: "${opensearch_tmux_lines_index}-%F" +# opensearch-tmux-io-context: +# type: elasticsearch +# inputs: +# - kafka-io-context-to-elasticsearch +# endpoint: https://${opensearch_helm_release}-cluster-master.${opensearch_k8s_namespace}:9200 +# api_version: "v7" # https://opensearch.org/faq/ +# auth: # TODO (@metacoma) use opensearch credentials from opensearch class +# user: ${opensearch_vector_user} +# password: ${opensearch_vector_password} +# strategy: basic +# tls: +# verify_certificate: false +# verify_hostname: false +# healthcheck: +# enabled: false +# bulk: +# index: "${opensearch_tmux_io_context_index}-%F" +# +# opensearch-tmux-pane-linestream: +# type: elasticsearch +# inputs: +# - kafka-linestream-to-elasticsearch +# endpoint: https://${opensearch_helm_release}-cluster-master.${opensearch_k8s_namespace}:9200 +# api_version: "v7" # https://opensearch.org/faq/ +# auth: # TODO (@metacoma) use opensearch credentials from opensearch class +# user: ${opensearch_vector_user} +# password: ${opensearch_vector_password} +# strategy: basic +# tls: +# verify_certificate: false +# verify_hostname: false +# healthcheck: +# enabled: false +# bulk: +# index: "${opensearch_tmux_lines_index}-%F" tmuxinator: windows: From 23ffd82bc26df97315a63be6a196bc14ff55bd95 Mon Sep 17 00:00:00 2001 From: Ryabin Sergey Date: Sat, 23 Sep 2023 22:39:58 +0200 Subject: [PATCH 7/7] add NodeNoteSet GRPC function --- .../freeplane_grpc/python/freeplane_pb2.py | 66 ++++++++++--------- .../freeplane_grpc/python/freeplane_pb2.pyi | 14 ++++ .../python/freeplane_pb2_grpc.py | 33 ++++++++++ .../freeplane_grpc/ruby/lib/freeplane_pb.rb | 9 +++ .../ruby/lib/freeplane_services_pb.rb | 1 + inventory/classes/freeplane/grpc.yml | 10 +++ inventory/targets/freeplane_plugin_grpc.yml | 6 +- 7 files changed, 105 insertions(+), 34 deletions(-) diff --git a/files/grpc/freeplane_grpc/python/freeplane_pb2.py b/files/grpc/freeplane_grpc/python/freeplane_pb2.py index 94d5ee3..a0d4244 100644 --- a/files/grpc/freeplane_grpc/python/freeplane_pb2.py +++ b/files/grpc/freeplane_grpc/python/freeplane_pb2.py @@ -13,7 +13,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0f\x66reeplane.proto\x12\tfreeplane\":\n\x12\x43reateChildRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x16\n\x0eparent_node_id\x18\x02 \x01(\t\"9\n\x13\x43reateChildResponse\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x11\n\tnode_text\x18\x02 \x01(\t\"%\n\x12\x44\x65leteChildRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\"&\n\x13\x44\x65leteChildResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"[\n\x17NodeAttributeAddRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61ttribute_name\x18\x02 \x01(\t\x12\x17\n\x0f\x61ttribute_value\x18\x03 \x01(\t\"+\n\x18NodeAttributeAddResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"3\n\x12NodeLinkSetRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04link\x18\x02 \x01(\t\"&\n\x13NodeLinkSetResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"9\n\x15NodeDetailsSetRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0f\n\x07\x64\x65tails\x18\x02 \x01(\t\")\n\x16NodeDetailsSetResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"$\n\rGroovyRequest\x12\x13\n\x0bgroovy_code\x18\x01 \x01(\t\"!\n\x0eGroovyResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"_\n\x13NodeColorSetRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0b\n\x03red\x18\x02 \x01(\x05\x12\r\n\x05green\x18\x03 \x01(\x05\x12\x0c\n\x04\x62lue\x18\x04 \x01(\x05\x12\r\n\x05\x61lpha\x18\x05 \x01(\x05\"\'\n\x14NodeColorSetResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"i\n\x1dNodeBackgroundColorSetRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0b\n\x03red\x18\x02 \x01(\x05\x12\r\n\x05green\x18\x03 \x01(\x05\x12\x0c\n\x04\x62lue\x18\x04 \x01(\x05\x12\r\n\x05\x61lpha\x18\x05 \x01(\x05\"1\n\x1eNodeBackgroundColorSetResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"*\n\x14StatusInfoSetRequest\x12\x12\n\nstatusInfo\x18\x01 \x01(\t\"(\n\x15StatusInfoSetResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"\x1e\n\x0eTextFSMRequest\x12\x0c\n\x04json\x18\x01 \x01(\t\"\"\n\x0fTextFSMResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"&\n\x16MindMapFromJSONRequest\x12\x0c\n\x04json\x18\x01 \x01(\t\"*\n\x17MindMapFromJSONResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"\x16\n\x14MindMapToJSONRequest\"6\n\x15MindMapToJSONResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0c\n\x04json\x18\x02 \x01(\t2\x84\x08\n\tFreeplane\x12N\n\x0b\x43reateChild\x12\x1d.freeplane.CreateChildRequest\x1a\x1e.freeplane.CreateChildResponse\"\x00\x12N\n\x0b\x44\x65leteChild\x12\x1d.freeplane.DeleteChildRequest\x1a\x1e.freeplane.DeleteChildResponse\"\x00\x12]\n\x10NodeAttributeAdd\x12\".freeplane.NodeAttributeAddRequest\x1a#.freeplane.NodeAttributeAddResponse\"\x00\x12N\n\x0bNodeLinkSet\x12\x1d.freeplane.NodeLinkSetRequest\x1a\x1e.freeplane.NodeLinkSetResponse\"\x00\x12W\n\x0eNodeDetailsSet\x12 .freeplane.NodeDetailsSetRequest\x1a!.freeplane.NodeDetailsSetResponse\"\x00\x12?\n\x06Groovy\x12\x18.freeplane.GroovyRequest\x1a\x19.freeplane.GroovyResponse\"\x00\x12Q\n\x0cNodeColorSet\x12\x1e.freeplane.NodeColorSetRequest\x1a\x1f.freeplane.NodeColorSetResponse\"\x00\x12o\n\x16NodeBackgroundColorSet\x12(.freeplane.NodeBackgroundColorSetRequest\x1a).freeplane.NodeBackgroundColorSetResponse\"\x00\x12T\n\rStatusInfoSet\x12\x1f.freeplane.StatusInfoSetRequest\x1a .freeplane.StatusInfoSetResponse\"\x00\x12\x42\n\x07TextFSM\x12\x19.freeplane.TextFSMRequest\x1a\x1a.freeplane.TextFSMResponse\"\x00\x12Z\n\x0fMindMapFromJSON\x12!.freeplane.MindMapFromJSONRequest\x1a\".freeplane.MindMapFromJSONResponse\"\x00\x12T\n\rMindMapToJSON\x12\x1f.freeplane.MindMapToJSONRequest\x1a .freeplane.MindMapToJSONResponse\"\x00\x42-\n\x19org.freeplane.plugin.grpcB\tfreeplaneP\x01\xa2\x02\x02\x46Pb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0f\x66reeplane.proto\x12\tfreeplane\":\n\x12\x43reateChildRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x16\n\x0eparent_node_id\x18\x02 \x01(\t\"9\n\x13\x43reateChildResponse\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x11\n\tnode_text\x18\x02 \x01(\t\"%\n\x12\x44\x65leteChildRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\"&\n\x13\x44\x65leteChildResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"[\n\x17NodeAttributeAddRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61ttribute_name\x18\x02 \x01(\t\x12\x17\n\x0f\x61ttribute_value\x18\x03 \x01(\t\"+\n\x18NodeAttributeAddResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"3\n\x12NodeLinkSetRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04link\x18\x02 \x01(\t\"&\n\x13NodeLinkSetResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"9\n\x15NodeDetailsSetRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0f\n\x07\x64\x65tails\x18\x02 \x01(\t\")\n\x16NodeDetailsSetResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"3\n\x12NodeNoteSetRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04note\x18\x02 \x01(\t\"&\n\x13NodeNoteSetResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"$\n\rGroovyRequest\x12\x13\n\x0bgroovy_code\x18\x01 \x01(\t\"!\n\x0eGroovyResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"_\n\x13NodeColorSetRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0b\n\x03red\x18\x02 \x01(\x05\x12\r\n\x05green\x18\x03 \x01(\x05\x12\x0c\n\x04\x62lue\x18\x04 \x01(\x05\x12\r\n\x05\x61lpha\x18\x05 \x01(\x05\"\'\n\x14NodeColorSetResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"i\n\x1dNodeBackgroundColorSetRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0b\n\x03red\x18\x02 \x01(\x05\x12\r\n\x05green\x18\x03 \x01(\x05\x12\x0c\n\x04\x62lue\x18\x04 \x01(\x05\x12\r\n\x05\x61lpha\x18\x05 \x01(\x05\"1\n\x1eNodeBackgroundColorSetResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"*\n\x14StatusInfoSetRequest\x12\x12\n\nstatusInfo\x18\x01 \x01(\t\"(\n\x15StatusInfoSetResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"\x1e\n\x0eTextFSMRequest\x12\x0c\n\x04json\x18\x01 \x01(\t\"\"\n\x0fTextFSMResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"&\n\x16MindMapFromJSONRequest\x12\x0c\n\x04json\x18\x01 \x01(\t\"*\n\x17MindMapFromJSONResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"\x16\n\x14MindMapToJSONRequest\"6\n\x15MindMapToJSONResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0c\n\x04json\x18\x02 \x01(\t2\xd4\x08\n\tFreeplane\x12N\n\x0b\x43reateChild\x12\x1d.freeplane.CreateChildRequest\x1a\x1e.freeplane.CreateChildResponse\"\x00\x12N\n\x0b\x44\x65leteChild\x12\x1d.freeplane.DeleteChildRequest\x1a\x1e.freeplane.DeleteChildResponse\"\x00\x12]\n\x10NodeAttributeAdd\x12\".freeplane.NodeAttributeAddRequest\x1a#.freeplane.NodeAttributeAddResponse\"\x00\x12N\n\x0bNodeLinkSet\x12\x1d.freeplane.NodeLinkSetRequest\x1a\x1e.freeplane.NodeLinkSetResponse\"\x00\x12N\n\x0bNodeNoteSet\x12\x1d.freeplane.NodeNoteSetRequest\x1a\x1e.freeplane.NodeNoteSetResponse\"\x00\x12W\n\x0eNodeDetailsSet\x12 .freeplane.NodeDetailsSetRequest\x1a!.freeplane.NodeDetailsSetResponse\"\x00\x12?\n\x06Groovy\x12\x18.freeplane.GroovyRequest\x1a\x19.freeplane.GroovyResponse\"\x00\x12Q\n\x0cNodeColorSet\x12\x1e.freeplane.NodeColorSetRequest\x1a\x1f.freeplane.NodeColorSetResponse\"\x00\x12o\n\x16NodeBackgroundColorSet\x12(.freeplane.NodeBackgroundColorSetRequest\x1a).freeplane.NodeBackgroundColorSetResponse\"\x00\x12T\n\rStatusInfoSet\x12\x1f.freeplane.StatusInfoSetRequest\x1a .freeplane.StatusInfoSetResponse\"\x00\x12\x42\n\x07TextFSM\x12\x19.freeplane.TextFSMRequest\x1a\x1a.freeplane.TextFSMResponse\"\x00\x12Z\n\x0fMindMapFromJSON\x12!.freeplane.MindMapFromJSONRequest\x1a\".freeplane.MindMapFromJSONResponse\"\x00\x12T\n\rMindMapToJSON\x12\x1f.freeplane.MindMapToJSONRequest\x1a .freeplane.MindMapToJSONResponse\"\x00\x42-\n\x19org.freeplane.plugin.grpcB\tfreeplaneP\x01\xa2\x02\x02\x46Pb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -42,34 +42,38 @@ _globals['_NODEDETAILSSETREQUEST']._serialized_end=516 _globals['_NODEDETAILSSETRESPONSE']._serialized_start=518 _globals['_NODEDETAILSSETRESPONSE']._serialized_end=559 - _globals['_GROOVYREQUEST']._serialized_start=561 - _globals['_GROOVYREQUEST']._serialized_end=597 - _globals['_GROOVYRESPONSE']._serialized_start=599 - _globals['_GROOVYRESPONSE']._serialized_end=632 - _globals['_NODECOLORSETREQUEST']._serialized_start=634 - _globals['_NODECOLORSETREQUEST']._serialized_end=729 - _globals['_NODECOLORSETRESPONSE']._serialized_start=731 - _globals['_NODECOLORSETRESPONSE']._serialized_end=770 - _globals['_NODEBACKGROUNDCOLORSETREQUEST']._serialized_start=772 - _globals['_NODEBACKGROUNDCOLORSETREQUEST']._serialized_end=877 - _globals['_NODEBACKGROUNDCOLORSETRESPONSE']._serialized_start=879 - _globals['_NODEBACKGROUNDCOLORSETRESPONSE']._serialized_end=928 - _globals['_STATUSINFOSETREQUEST']._serialized_start=930 - _globals['_STATUSINFOSETREQUEST']._serialized_end=972 - _globals['_STATUSINFOSETRESPONSE']._serialized_start=974 - _globals['_STATUSINFOSETRESPONSE']._serialized_end=1014 - _globals['_TEXTFSMREQUEST']._serialized_start=1016 - _globals['_TEXTFSMREQUEST']._serialized_end=1046 - _globals['_TEXTFSMRESPONSE']._serialized_start=1048 - _globals['_TEXTFSMRESPONSE']._serialized_end=1082 - _globals['_MINDMAPFROMJSONREQUEST']._serialized_start=1084 - _globals['_MINDMAPFROMJSONREQUEST']._serialized_end=1122 - _globals['_MINDMAPFROMJSONRESPONSE']._serialized_start=1124 - _globals['_MINDMAPFROMJSONRESPONSE']._serialized_end=1166 - _globals['_MINDMAPTOJSONREQUEST']._serialized_start=1168 - _globals['_MINDMAPTOJSONREQUEST']._serialized_end=1190 - _globals['_MINDMAPTOJSONRESPONSE']._serialized_start=1192 - _globals['_MINDMAPTOJSONRESPONSE']._serialized_end=1246 - _globals['_FREEPLANE']._serialized_start=1249 - _globals['_FREEPLANE']._serialized_end=2277 + _globals['_NODENOTESETREQUEST']._serialized_start=561 + _globals['_NODENOTESETREQUEST']._serialized_end=612 + _globals['_NODENOTESETRESPONSE']._serialized_start=614 + _globals['_NODENOTESETRESPONSE']._serialized_end=652 + _globals['_GROOVYREQUEST']._serialized_start=654 + _globals['_GROOVYREQUEST']._serialized_end=690 + _globals['_GROOVYRESPONSE']._serialized_start=692 + _globals['_GROOVYRESPONSE']._serialized_end=725 + _globals['_NODECOLORSETREQUEST']._serialized_start=727 + _globals['_NODECOLORSETREQUEST']._serialized_end=822 + _globals['_NODECOLORSETRESPONSE']._serialized_start=824 + _globals['_NODECOLORSETRESPONSE']._serialized_end=863 + _globals['_NODEBACKGROUNDCOLORSETREQUEST']._serialized_start=865 + _globals['_NODEBACKGROUNDCOLORSETREQUEST']._serialized_end=970 + _globals['_NODEBACKGROUNDCOLORSETRESPONSE']._serialized_start=972 + _globals['_NODEBACKGROUNDCOLORSETRESPONSE']._serialized_end=1021 + _globals['_STATUSINFOSETREQUEST']._serialized_start=1023 + _globals['_STATUSINFOSETREQUEST']._serialized_end=1065 + _globals['_STATUSINFOSETRESPONSE']._serialized_start=1067 + _globals['_STATUSINFOSETRESPONSE']._serialized_end=1107 + _globals['_TEXTFSMREQUEST']._serialized_start=1109 + _globals['_TEXTFSMREQUEST']._serialized_end=1139 + _globals['_TEXTFSMRESPONSE']._serialized_start=1141 + _globals['_TEXTFSMRESPONSE']._serialized_end=1175 + _globals['_MINDMAPFROMJSONREQUEST']._serialized_start=1177 + _globals['_MINDMAPFROMJSONREQUEST']._serialized_end=1215 + _globals['_MINDMAPFROMJSONRESPONSE']._serialized_start=1217 + _globals['_MINDMAPFROMJSONRESPONSE']._serialized_end=1259 + _globals['_MINDMAPTOJSONREQUEST']._serialized_start=1261 + _globals['_MINDMAPTOJSONREQUEST']._serialized_end=1283 + _globals['_MINDMAPTOJSONRESPONSE']._serialized_start=1285 + _globals['_MINDMAPTOJSONRESPONSE']._serialized_end=1339 + _globals['_FREEPLANE']._serialized_start=1342 + _globals['_FREEPLANE']._serialized_end=2450 # @@protoc_insertion_point(module_scope) diff --git a/files/grpc/freeplane_grpc/python/freeplane_pb2.pyi b/files/grpc/freeplane_grpc/python/freeplane_pb2.pyi index 9fb5155..134edff 100644 --- a/files/grpc/freeplane_grpc/python/freeplane_pb2.pyi +++ b/files/grpc/freeplane_grpc/python/freeplane_pb2.pyi @@ -76,6 +76,20 @@ class NodeDetailsSetResponse(_message.Message): success: bool def __init__(self, success: bool = ...) -> None: ... +class NodeNoteSetRequest(_message.Message): + __slots__ = ["node_id", "note"] + NODE_ID_FIELD_NUMBER: _ClassVar[int] + NOTE_FIELD_NUMBER: _ClassVar[int] + node_id: str + note: str + def __init__(self, node_id: _Optional[str] = ..., note: _Optional[str] = ...) -> None: ... + +class NodeNoteSetResponse(_message.Message): + __slots__ = ["success"] + SUCCESS_FIELD_NUMBER: _ClassVar[int] + success: bool + def __init__(self, success: bool = ...) -> None: ... + class GroovyRequest(_message.Message): __slots__ = ["groovy_code"] GROOVY_CODE_FIELD_NUMBER: _ClassVar[int] diff --git a/files/grpc/freeplane_grpc/python/freeplane_pb2_grpc.py b/files/grpc/freeplane_grpc/python/freeplane_pb2_grpc.py index 20f7463..734a4a0 100644 --- a/files/grpc/freeplane_grpc/python/freeplane_pb2_grpc.py +++ b/files/grpc/freeplane_grpc/python/freeplane_pb2_grpc.py @@ -34,6 +34,11 @@ def __init__(self, channel): request_serializer=freeplane__pb2.NodeLinkSetRequest.SerializeToString, response_deserializer=freeplane__pb2.NodeLinkSetResponse.FromString, ) + self.NodeNoteSet = channel.unary_unary( + '/freeplane.Freeplane/NodeNoteSet', + request_serializer=freeplane__pb2.NodeNoteSetRequest.SerializeToString, + response_deserializer=freeplane__pb2.NodeNoteSetResponse.FromString, + ) self.NodeDetailsSet = channel.unary_unary( '/freeplane.Freeplane/NodeDetailsSet', request_serializer=freeplane__pb2.NodeDetailsSetRequest.SerializeToString, @@ -103,6 +108,12 @@ def NodeLinkSet(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def NodeNoteSet(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def NodeDetailsSet(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -174,6 +185,11 @@ def add_FreeplaneServicer_to_server(servicer, server): request_deserializer=freeplane__pb2.NodeLinkSetRequest.FromString, response_serializer=freeplane__pb2.NodeLinkSetResponse.SerializeToString, ), + 'NodeNoteSet': grpc.unary_unary_rpc_method_handler( + servicer.NodeNoteSet, + request_deserializer=freeplane__pb2.NodeNoteSetRequest.FromString, + response_serializer=freeplane__pb2.NodeNoteSetResponse.SerializeToString, + ), 'NodeDetailsSet': grpc.unary_unary_rpc_method_handler( servicer.NodeDetailsSet, request_deserializer=freeplane__pb2.NodeDetailsSetRequest.FromString, @@ -292,6 +308,23 @@ def NodeLinkSet(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def NodeNoteSet(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/freeplane.Freeplane/NodeNoteSet', + freeplane__pb2.NodeNoteSetRequest.SerializeToString, + freeplane__pb2.NodeNoteSetResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def NodeDetailsSet(request, target, diff --git a/files/grpc/freeplane_grpc/ruby/lib/freeplane_pb.rb b/files/grpc/freeplane_grpc/ruby/lib/freeplane_pb.rb index fd54a8d..6682b88 100644 --- a/files/grpc/freeplane_grpc/ruby/lib/freeplane_pb.rb +++ b/files/grpc/freeplane_grpc/ruby/lib/freeplane_pb.rb @@ -40,6 +40,13 @@ add_message "freeplane.NodeDetailsSetResponse" do optional :success, :bool, 1 end + add_message "freeplane.NodeNoteSetRequest" do + optional :node_id, :string, 1 + optional :note, :string, 2 + end + add_message "freeplane.NodeNoteSetResponse" do + optional :success, :bool, 1 + end add_message "freeplane.GroovyRequest" do optional :groovy_code, :string, 1 end @@ -103,6 +110,8 @@ module Freeplane NodeLinkSetResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("freeplane.NodeLinkSetResponse").msgclass NodeDetailsSetRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("freeplane.NodeDetailsSetRequest").msgclass NodeDetailsSetResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("freeplane.NodeDetailsSetResponse").msgclass + NodeNoteSetRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("freeplane.NodeNoteSetRequest").msgclass + NodeNoteSetResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("freeplane.NodeNoteSetResponse").msgclass GroovyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("freeplane.GroovyRequest").msgclass GroovyResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("freeplane.GroovyResponse").msgclass NodeColorSetRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("freeplane.NodeColorSetRequest").msgclass diff --git a/files/grpc/freeplane_grpc/ruby/lib/freeplane_services_pb.rb b/files/grpc/freeplane_grpc/ruby/lib/freeplane_services_pb.rb index afa3f77..b70b27a 100644 --- a/files/grpc/freeplane_grpc/ruby/lib/freeplane_services_pb.rb +++ b/files/grpc/freeplane_grpc/ruby/lib/freeplane_services_pb.rb @@ -18,6 +18,7 @@ class Service rpc :DeleteChild, DeleteChildRequest, DeleteChildResponse rpc :NodeAttributeAdd, NodeAttributeAddRequest, NodeAttributeAddResponse rpc :NodeLinkSet, NodeLinkSetRequest, NodeLinkSetResponse + rpc :NodeNoteSet, NodeNoteSetRequest, NodeNoteSetResponse rpc :NodeDetailsSet, NodeDetailsSetRequest, NodeDetailsSetResponse rpc :Groovy, GroovyRequest, GroovyResponse rpc :NodeColorSet, NodeColorSetRequest, NodeColorSetResponse diff --git a/inventory/classes/freeplane/grpc.yml b/inventory/classes/freeplane/grpc.yml index 8726334..11f9f94 100644 --- a/inventory/classes/freeplane/grpc.yml +++ b/inventory/classes/freeplane/grpc.yml @@ -16,6 +16,7 @@ parameters: rpc DeleteChild (DeleteChildRequest) returns (DeleteChildResponse) {}; rpc NodeAttributeAdd (NodeAttributeAddRequest) returns (NodeAttributeAddResponse) {}; rpc NodeLinkSet (NodeLinkSetRequest) returns (NodeLinkSetResponse) {}; + rpc NodeNoteSet (NodeNoteSetRequest) returns (NodeNoteSetResponse) {}; rpc NodeDetailsSet (NodeDetailsSetRequest) returns (NodeDetailsSetResponse) {}; rpc Groovy (GroovyRequest) returns (GroovyResponse) {}; rpc NodeColorSet (NodeColorSetRequest) returns (NodeColorSetResponse) {}; @@ -71,6 +72,15 @@ parameters: bool success = 1; } + message NodeNoteSetRequest { + string node_id = 1; + string note = 2; + } + + message NodeNoteSetResponse { + bool success = 1; + } + message GroovyRequest { string groovy_code = 1; } diff --git a/inventory/targets/freeplane_plugin_grpc.yml b/inventory/targets/freeplane_plugin_grpc.yml index 8b45a61..2c1f6bc 100644 --- a/inventory/targets/freeplane_plugin_grpc.yml +++ b/inventory/targets/freeplane_plugin_grpc.yml @@ -44,8 +44,8 @@ parameters: ( cd ${freeplane_root} # bash ./gRAdle.sh build - #docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gradle:7-jdk17 gradle build --no-build-cache --no-configuration-cache - docker run --rm -v "$(pwd)":/app -w /app gradle:${gradle_version}-jdk${jdk_version} gradle build + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gradle:7-jdk17 gradle build --no-build-cache --no-configuration-cache + #docker run --rm -v "$(pwd)":/app -w /app gradle:${gradle_version}-jdk${jdk_version} gradle build ) freeplane_clean: | cd ${freeplane_root} @@ -163,4 +163,4 @@ parameters: - | cd grpc - cat ${kapitan_root}/files/github2/input3.json | docker run -i -v `pwd`:/host -w /host --network=host fullstorydev/grpcurl -proto ./freeplane.proto -d @ -plaintext localhost:50051 freeplane.Freeplane/MindMapFromJSON + # cat ${kapitan_root}/files/github2/input3.json | docker run -i -v `pwd`:/host -w /host --network=host fullstorydev/grpcurl -proto ./freeplane.proto -d @ -plaintext localhost:50051 freeplane.Freeplane/MindMapFromJSON