Update Dapr in Your Development Environment on Windows 10

Update Dapr in Your Development Environment on Windows 10

Update Dapr in your development environment on Windows 10 By Philippe Beraud, Microsoft France Distributed Application Runtime, a.k.a. Dapr, is a portable, event-driven runtime that makes it easy for enterprise developers to build resilient, microservice stateless and stateful applications that run on the cloud and edge and embraces the diversity of languages and developer frameworks. As of this writing, Dapr is currently under community development in alpha phase. Dapr is thus NOT expected to be used for production workloads until its 1.0 stable release. Consequently, you can thus expect continuous releases of new versions of the Dapr runtime as well as the Dapr Command Line Interface (CLI). And such, these releases can (potentially) introduce a series of breaking changes. As a direct illustration, Dapr 0.4.0 has been released on February 13th 2020. As stated on the Dapr repo at https://github.com/dapr/dapr/releases, this release of Dapr not only includes new components, security improvements, API level enhancements, new CLI features, stability and bug fixes, a richer Java SDK, docs and samples updates, but it also contains breaking changes. If you're upgrading from an older version of Dapr to 0.4.0, this walkthrough will guide you through the upgrade of Dapr on your Windows 10 local machine to ensure a smooth upgrade. You know, the one where you don't get red errors on the terminal. We all hate that, right? For the sake of this walkthrough, the below assumes that you completed with an older version of Dapr, here the previous one 0.3.0, all the relevant step-by-step instructions as per: • The walkthrough Set up on Windows 10 a development environment for Dapr. -or- • The guide Understanding and leveraging the Distributed Application Runtime (Dapr) – A starter guide for developers. (This guide is part of the series New perspectives for cloud-native applications with the Open Application Model (OAM), and the Distributed Application Runtime (Dapr) available on the Microsoft Download Center (https://aka.ms/CloudNativeAppsFuture). Also ensure to check out Upgrading to Dapr 0.4.0 on the Dapr repo. Updating Dapr CLI on Windows 10 Updating Dapr CLI locally To update Dapr CLI locally with the latest version available, perform the following steps: 1. Open a PowerShell console prompt: 2. Navigate to the previously created Dapr directory: PS C:\> cd C:\dapr: 3. Uninstall Dapr using the CLI you currently have. For example, version 0.3.0 in our illustration: PS C:\> dapr uninstall --all 4. Get the latest Dapr CLI: C:\> powershell -Command "iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1 | iex" WARNING: Dapr is detected - c:\dapr\dapr.exe CLI version: 0.3.0 Runtime version: 0.3.0 Reinstalling Dapr... Creating c:\dapr directory Downloading c:\dapr\dapr_windows_amd64.zip ... Extracting c:\dapr\dapr_windows_amd64.zip... CLI version: 0.4.1 Runtime version: 0.3.0 Clean up c:\dapr\dapr_windows_amd64.zip... Try to add c:\dapr to User Path Environment variable... Skipping to add c:\dapr to User Path - C:\Users\philber\AppData\Local\Programs\Python\Python38- 32\Scripts\;C:\Users\philber\AppData\Local\Programs\Python\Python38- 32\;C:\Users\philber\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\philber\AppDa ta\Local\Programs\Python\Python37\;C:\Users\philber\AppData\Local\Microsoft\WindowsApps;C:\ Users\philber\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\philber\AppData\Local\GitHubDesktop\bin;c:\dapr;C:\Users\philber\go\bin;C :\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin;C:\Users\philber\AppData\Local \Microsoft\WindowsApps;C:\Users\philber\AppData\Local\Programs\Azure Data Studio\bin;C:\Program Files\Multipass\bin;C:\Users\philber\AppData\Roaming\npm; Dapr CLI is installed successfully. To get started with Dapr, please visit https://github.com/dapr/docs/tree/master/getting- started . Ensure that Docker Desktop is set to Linux containers mode when you run Dapr in self hosted mode. Updating Dapr CLI on WSL2 If you previously opted to configure WSL2 along with Docker Desktop WSL2 backend, perform the following steps: 1. From your Windows 10 local machine, open a Windows command line prompt. 2. List the installed Linux distros: C:\> wsl -l 3. Open a Bash terminal console on the installed Linux distro integrated with Docker Desktop. For example, Ubuntu-18.04 in our illustration: C:\> wsl -d Ubuntu-18.04 4. Uninstall Dapr using the CLI you currently have. For example, version 0.3.0 in our illustration: $ dapr uninstall --all 5. Get the latest Dapr CLI: $ cd /usr/local/bin $ wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash Your system is linux_amd64 Dapr CLI is detected: CLI version: 0.3.0 Runtime version: 0.3.0 Reinstalling Dapr CLI - /usr/local/bin/dapr... Downloading https://github.com/dapr/cli/releases/download/v0.4.1/dapr_linux_amd64.tar.gz ... tar: dapr: time stamp 2020-02-14 07:39:09 is 26206.8134531 s in the future [sudo] password for philber: dapr installed into /usr/local/bin successfully. CLI version: 0.4.1 Runtime version: 0.3.0 To get started with Dapr, please visit https://github.com/dapr/docs/tree/master/getting- started So let’s new update the Dapr runtime. Updating the Dapr runtime Updating Dapr runtime in standalone mode locally Perform the following steps: 1. Open a PowerShell console as an Administrator. 2. Run the following command: PS C:\> dapr init Making the jump to hyperspace... Downloading binaries and setting up components... Installing Dapr to c:\dapr Success! Dapr is up and running. To get started, go here: https://aka.ms/dapr-getting- started Wait for the update to complete, and you're good to go! You are now running the new version of Dapr, here version 0.4.0. To see the various commands it supports, run the following command: PS C:\> dapr help __ ____/ /___ _____ _____ / __ / __ '/ __ \/ ___/ / /_/ / /_/ / /_/ / / \__,_/\__,_/ .___/_/ /_/ ====================================================== A serverless runtime for hyperscale, distributed systems Usage: dapr [command] Available Commands: components List all Dapr components configurations List all Dapr configurations help Help about any command init Setup dapr in Kubernetes or Standalone modes invoke Invokes a Dapr app with an optional payload (deprecated, use invokePost) invokeGet Issue HTTP GET to Dapr app invokePost Issue HTTP POST to Dapr app with an optional payload list List all Dapr instances logs Gets Dapr sidecar logs for an app in Kubernetes mtls Check if mTLS is enabled in a Kubernetes cluster publish Publish an event to multiple consumers run Launches Dapr and your app side by side stop Stops a running Dapr instance and its associated app uninstall Removes a Dapr installation Flags: -h, --help help for dapr Use "dapr [command] --help" for more information about a command. Note the new command mtls with the newly introduced supported of automatic mTLS between Dapr instances. You can uninstall Dapr if you want to: PS C:\> dapr uninstall Updating Dapr runtime in standalone mode in WSL2 Conversely, from the Bash terminal console, run the following commands: $ sudo dapr init ⌛ Making the jump to hyperspace... ↘ ↘ Downloading binaries and setting up components... Installing Dapr to /usr/local/bin ✅ Downloading binaries and setting up components... ✅ Success! Dapr is up and running. To get started, go here: https://aka.ms/dapr-getting- started Likewise, wait for the update to complete. You are now running the new version of Dapr, here version 0.4.0. To uninstall Dapr if you want to, run the following commands: $ dapr uninstall Verifying Dapr runtime on a Kubernetes cluster with Dapr CLI Installing Dapr runtime with Dapr CLi is intended for a Dev/Test setup. The default namespace on a Kubernetes cluster will indeed be used. To now verify the installation of Dapr runtime with Dapr CLI, perform the following steps: 1. Connect to your cluster environment. See section § Connecting to a Kubernetes cluster of the walkthrough Set up on Windows 10 a development environment for Dapr. 2. From the Bash terminal console, if you previously installed Dapr on your Kubernetes cluster using the Dapr CLI, run the following command: $ dapr uninstall –kubernetes It's fine to ignore any errors that might show up. Wait until Dapr is uninstalled. 3. Now install Dapr in a dev/test setup: $ sudo dapr init --kubernetes ⌛ Making the jump to hyperspace... ℹ️ Note: this installation is recommended for testing purposes. For production environments, please use Helm ✅ Deploying the Dapr Operator to your cluster... ✅ Success! Dapr has been installed. To verify, run 'kubectl get pods -w' in your terminal. To get started, go here: https://aka.ms/dapr-getting-started 4. Now verify that Dapr is successfully installed. Ensure that the dapr-operator, dapr- placement, dapr-sentry, and dapr-sidecar-injector pods are running in the default namespace: $ kubectl get pods -w NAME READY STATUS RESTARTS AGE dapr-operator-67f46f77d6-62h7j 1/1 Running 0 106s dapr-placement-8565b98564-llprm 1/1 Running 0 106s dapr-sentry-77fd797cd5-xnxsx 1/1 Running 0 106s dapr-sidecar-injector-b4f8b8d68-6hrc6 1/1 Running 0 106s Note the presence of the new dapr-sentry pod with version 0.4.0. You are now running the new version of Dapr. To uninstall Dapr if you want to, run the following command: $ dapr uninstall --kubernetes Verifying Dapr runtime on a Kubernetes cluster with Helm 3 Whenever you need a non-default namespace for your applications or want to test Dapr on non- default namespace, Helm, the Kubernetes package manager opening up to the world of all available charts, i.e. curated applications for Kubernetes, has to be used instead.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    11 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us