From d8b35be72cf6c047de84ed65689a96b35ef92bf3 Mon Sep 17 00:00:00 2001 From: pruthvidhodda Date: Tue, 11 Aug 2020 10:51:36 -0700 Subject: [PATCH] Replace deprecated cli options and k8s annotations --- examples/demo_actor/README.md | 2 +- examples/demo_actor/deploy/demo_actor_client.yml | 2 +- examples/demo_actor/deploy/demo_actor_service.yml | 4 ++-- examples/invoke-binding/README.md | 4 ++-- examples/invoke-custom-data/README.md | 4 ++-- examples/invoke-simple/README.md | 4 ++-- .../kubernetes/invoke-simple/Deploy/demo-grpc-client.yaml | 4 ++-- .../kubernetes/invoke-simple/Deploy/demo-grpc-server.yaml | 6 +++--- examples/kubernetes/invoke-simple/Server/server.py | 2 +- examples/pubsub-simple/README.md | 4 ++-- examples/secret_store/README.md | 2 +- examples/state_store/example.py | 2 +- examples/state_store/state_store.py | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/demo_actor/README.md b/examples/demo_actor/README.md index bc9b7db86..ecf93888e 100644 --- a/examples/demo_actor/README.md +++ b/examples/demo_actor/README.md @@ -37,7 +37,7 @@ export PYTHONPATH=`pwd` ```bash $ cd examples/demo_actor -$ dapr run --app-id demo-actor --app-port 3000 -- uvicorn --port 3000 demo_actor_service:app +$ dapr run --app-id demo-actor --app-port 3000 -- uvicorn --dapr-http-port 3000 demo_actor_service:app ... == APP == Activate DemoActor actor! == APP == 127.0.0.1 - - [01/Mar/2020 18:50:27] "POST /actors/DemoActor/1 HTTP/1.1" 200 - diff --git a/examples/demo_actor/deploy/demo_actor_client.yml b/examples/demo_actor/deploy/demo_actor_client.yml index 7ea451860..5ee7affea 100644 --- a/examples/demo_actor/deploy/demo_actor_client.yml +++ b/examples/demo_actor/deploy/demo_actor_client.yml @@ -18,7 +18,7 @@ spec: app: demoactor-client annotations: dapr.io/enabled: "true" - dapr.io/id: "demoactor-client" + dapr.io/app-id: "demoactor-client" spec: containers: - name: demoactor-client diff --git a/examples/demo_actor/deploy/demo_actor_service.yml b/examples/demo_actor/deploy/demo_actor_service.yml index eb46f16d7..548249f8f 100644 --- a/examples/demo_actor/deploy/demo_actor_service.yml +++ b/examples/demo_actor/deploy/demo_actor_service.yml @@ -18,8 +18,8 @@ spec: app: demoactor annotations: dapr.io/enabled: "true" - dapr.io/id: "demoactor" - dapr.io/port: "3000" + dapr.io/app-id: "demoactor" + dapr.io/app-port: "3000" spec: containers: - name: demoactor diff --git a/examples/invoke-binding/README.md b/examples/invoke-binding/README.md index 5fd75c011..021948214 100644 --- a/examples/invoke-binding/README.md +++ b/examples/invoke-binding/README.md @@ -13,10 +13,10 @@ To run this example, the following code can be utilized: docker-compose -f ./docker-compose-single-kafka.yml up -d # 2. Start Receiver (expose gRPC server receiver on port 50051) -dapr run --app-id receiver --protocol grpc --app-port 50051 --components-path ./components python3 invoke-input-binding.py +dapr run --app-id receiver --app-protocol grpc --app-port 50051 --components-path ./components python3 invoke-input-binding.py # 3. Start Publisher -dapr run --app-id publisher --protocol grpc --components-path ./components python3 invoke-output-binding.py +dapr run --app-id publisher --app-protocol grpc --components-path ./components python3 invoke-output-binding.py ``` ## Cleanup diff --git a/examples/invoke-custom-data/README.md b/examples/invoke-custom-data/README.md index eea2a5ed5..e50c9c6e2 100644 --- a/examples/invoke-custom-data/README.md +++ b/examples/invoke-custom-data/README.md @@ -13,8 +13,8 @@ To run this example, the following steps should be followed: python -m grpc_tools.protoc --proto_path=./proto/ --python_out=./proto/ --grpc_python_out=./proto/ ./proto/response.proto # 2. Start Receiver (expose gRPC server receiver on port 50051) -dapr run --app-id invoke-receiver --protocol grpc --app-port 50051 python3 invoke-receiver.py +dapr run --app-id invoke-receiver --app-protocol grpc --app-port 50051 python3 invoke-receiver.py # 3. Start Caller -dapr run --app-id invoke-caller --protocol grpc python invoke-caller.py +dapr run --app-id invoke-caller --app-protocol grpc python invoke-caller.py ``` diff --git a/examples/invoke-simple/README.md b/examples/invoke-simple/README.md index ba1cb5325..ebd7e739a 100644 --- a/examples/invoke-simple/README.md +++ b/examples/invoke-simple/README.md @@ -10,8 +10,8 @@ To run this example, the following code can be utilized: ```bash # 1. Start Receiver (expose gRPC server receiver on port 50051) -dapr run --app-id invoke-receiver --protocol grpc --app-port 50051 python3 invoke-receiver.py +dapr run --app-id invoke-receiver --app-protocol grpc --app-port 50051 python3 invoke-receiver.py # 2. Start Caller -dapr run --app-id invoke-caller --protocol grpc python3 invoke-caller.py +dapr run --app-id invoke-caller --app-protocol grpc python3 invoke-caller.py ``` \ No newline at end of file diff --git a/examples/kubernetes/invoke-simple/Deploy/demo-grpc-client.yaml b/examples/kubernetes/invoke-simple/Deploy/demo-grpc-client.yaml index 98f2609bb..e3a284216 100644 --- a/examples/kubernetes/invoke-simple/Deploy/demo-grpc-client.yaml +++ b/examples/kubernetes/invoke-simple/Deploy/demo-grpc-client.yaml @@ -6,8 +6,8 @@ metadata: name: demo-grpc-client annotations: dapr.io/enabled: "true" # Do we inject a sidecar into this pod? - dapr.io/id: "id-demo-grpc-client" # Unique ID or Name for Dapr APP (so we can communicate with it) - dapr.io/protocol: "grpc" + dapr.io/app-id: "id-demo-grpc-client" # Unique ID or Name for Dapr APP (so we can communicate with it) + dapr.io/app-protocol: "grpc" spec: containers: - name: c-demo-grpc-client # Name of our container, e.g. `kubectl logs -c c-rw-...` diff --git a/examples/kubernetes/invoke-simple/Deploy/demo-grpc-server.yaml b/examples/kubernetes/invoke-simple/Deploy/demo-grpc-server.yaml index ec32f4441..721663254 100644 --- a/examples/kubernetes/invoke-simple/Deploy/demo-grpc-server.yaml +++ b/examples/kubernetes/invoke-simple/Deploy/demo-grpc-server.yaml @@ -15,9 +15,9 @@ spec: app: p-demo-grpc-server # pod-roadwork-... annotations: dapr.io/enabled: "true" # Do we inject a sidecar to this deployment? - dapr.io/id: "id-demo-grpc-server" # Unique ID or Name for Dapr App (so we can communicate with it) - dapr.io/protocol: "grpc" - dapr.io/port: "50050" + dapr.io/app-id: "id-demo-grpc-server" # Unique ID or Name for Dapr App (so we can communicate with it) + dapr.io/app-protocol: "grpc" + dapr.io/app-port: "50050" spec: containers: - name: c-demo-grpc-server # Name of our container, e.g. `kubectl logs -c c-rw-...` diff --git a/examples/kubernetes/invoke-simple/Server/server.py b/examples/kubernetes/invoke-simple/Server/server.py index 7889b5964..6cad02acf 100644 --- a/examples/kubernetes/invoke-simple/Server/server.py +++ b/examples/kubernetes/invoke-simple/Server/server.py @@ -16,7 +16,7 @@ logging.basicConfig(level=logging.INFO, format='%(message)s') logger = logging.getLogger(__name__) -APP_PORT_GRPC = os.getenv('APP_GRPC_PORT', 50050) # Note: this we need to expose in .yaml through dapr.io/port +APP_PORT_GRPC = os.getenv('APP_GRPC_PORT', 50050) # Note: this we need to expose in .yaml through dapr.io/app-port DAPR_PORT_HTTP = os.getenv('DAPR_HTTP_PORT', 3500) DAPR_PORT_GRPC = os.getenv('DAPR_GRPC_PORT', 50001) # Note: currently 50001 is always default diff --git a/examples/pubsub-simple/README.md b/examples/pubsub-simple/README.md index c0914f6c9..fb1d54060 100644 --- a/examples/pubsub-simple/README.md +++ b/examples/pubsub-simple/README.md @@ -12,8 +12,8 @@ To run this example, the following code can be utilized: ```bash # 1. Start Subscriber (expose gRPC server receiver on port 50051) -dapr run --app-id python-subscriber --protocol grpc --app-port 50051 python3 subscriber.py +dapr run --app-id python-subscriber --app-protocol grpc --app-port 50051 python3 subscriber.py # 2. Start Publisher -dapr run --app-id python-publisher --protocol grpc python3 publisher.py +dapr run --app-id python-publisher --app-protocol grpc python3 publisher.py ``` \ No newline at end of file diff --git a/examples/secret_store/README.md b/examples/secret_store/README.md index 05eddaf71..7676cc80c 100644 --- a/examples/secret_store/README.md +++ b/examples/secret_store/README.md @@ -10,7 +10,7 @@ It creates a dapr client and calls the `get_secret` method in the `DaprClient`. To run this example, use the following command: ```bash -dapr run --app-id=secretsapp --protocol grpc --components-path components/ python3 example.py +dapr run --app-id=secretsapp --app-protocol grpc --components-path components/ python3 example.py ``` You should be able to see the following output: diff --git a/examples/state_store/example.py b/examples/state_store/example.py index cdb22e4b1..1d62a6858 100644 --- a/examples/state_store/example.py +++ b/examples/state_store/example.py @@ -1,6 +1,6 @@ """ -dapr run --protocol grpc --grpc-port=50001 python example.py +dapr run --app-protocol grpc --dapr-grpc-port=50001 python example.py """ import grpc diff --git a/examples/state_store/state_store.py b/examples/state_store/state_store.py index 74a2245ef..9c999ded4 100644 --- a/examples/state_store/state_store.py +++ b/examples/state_store/state_store.py @@ -1,6 +1,6 @@ """ -dapr run --protocol grpc --grpc-port=50001 python example.py +dapr run --app-protocol grpc --dapr-grpc-port=50001 python example.py """ from dapr.clients import DaprClient