Giter Site home page Giter Site logo

edwinvw / dapr-workshop Goto Github PK

View Code? Open in Web Editor NEW
178.0 6.0 79.0 16.16 MB

Workshop that teaches how to apply Dapr to an existing .NET, Java or Python based microservices application.

dapr dotnet java microservices workshop hands-on-lab learning-exercise c-sharp python

dapr-workshop's People

Contributors

amolenk avatar ankurbhambri avatar edwinvw avatar humorme avatar jarnevanaerde avatar mattsonlyattack avatar mthmulders avatar wmeints avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dapr-workshop's Issues

Add a bonus objective to combine different languages?

Not sure if this is a really good idea.

Since we have the same HTTP contracts everywhere we could ask people to change things up and combine a bit of Java with .NET (and python when that's ready).

I would add this as a bonus objective as this requires people to know a bit about running apps for different languages.

[Python] Instruction to assign license_key from secret is wrong in assignment - 07

In assignment - 07 one of the instruction is to initialize the lincense_key variable by reading the secret from the secret store is not working.

The current form of the instruction simply asks us to assign the secret directly to the license_key variable as shown below.

with DaprClient() as dapr_client:
    license_key = dapr_client.get_secret("trafficcontrol-secrets", "finecalculator.licensekey").secret

However, this won't work as the returned value is a dict and the FineCalculator expects a string license key (code).
Changing the code to the following works in my case.

with DaprClient() as client:
    license_key = client.get_secret("trafficcontrol-secrets", "finecalculator.licensekey").secret["finecalculator.licensekey"]

This needs to be verified and updated in the instruction for assignment-07 [Python].

BTW, thanks for this wonderful workshop.. ๐Ÿ˜„

Error in Assignment2

I have dapr version (CLI version: 1.7.1 , Runtime version: 1.7.3) & dotnet version 6.0.300
I bumped into the workshop, which is very well-created.

Erroring out on assignment with the first change of changing proxy URL to "http://localhost:3601/v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/{licenseNumber}");

Both vehicleregistration and finecollection service are in run state. The finecollection error out calling vehicleregistration

== APP == info: System.Net.Http.HttpClient.Default.LogicalHandler[100]
== APP == Start processing HTTP request GET http://localhost:3601/v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/TX-TS-79
== APP == info: System.Net.Http.HttpClient.Default.ClientHandler[100]
== APP == Sending HTTP request GET http://localhost:3601/v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/TX-TS-79
== APP == info: System.Net.Http.HttpClient.Default.ClientHandler[101]
== APP == Received HTTP response headers after 1001.5905ms - 500
== APP == info: System.Net.Http.HttpClient.Default.LogicalHandler[101]
== APP == End processing HTTP request after 1001.7241ms - 500
== APP == fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
== APP == An unhandled exception has occurred while executing the request.
== APP == System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
== APP == at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
== APP == at System.Net.Http.Json.HttpClientJsonExtensions.GetFromJsonAsyncCore[T](Task1 taskResponse, JsonSerializerOptions options, CancellationToken cancellationToken) == APP == at FineCollectionService.Proxies.VehicleRegistrationService.GetVehicleInfo(String licenseNumber) in /Users/manrawat1/projects/daprwork/dapr-workshop-csharp/FineCollectionService/Proxies/VehicleRegistrationService.cs:line 14 == APP == at FineCollectionService.Controllers.CollectionController.CollectFine(SpeedingViolation speedingViolation) in /Users/manrawat1/projects/daprwork/dapr-workshop-csharp/FineCollectionService/Controllers/CollectionController.cs:line 33 == APP == at lambda_method4(Closure , Object ) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
== APP == at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
== APP == at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Use appropriate screenshots in Java assignment

Context
In the step-by-step instructions for Assignment 1, screenhots are used to show how to open a new terminal window (step 2.2) and select a different terminal window (step 3.8) in VS Code.

Issue
Although these screenshots indicate the right buttons to click, they show dotnet as the running process. This might confuse Java devs following the instructions.

Proposed solution
Make new screenshots that show the correct running process (probably mvn??).

Upgrade code to .NET 6

  • Upgrade projects to target .NET 6
  • Use C# 10 features
    • Global usings
    • Top-level statements
    • File-scoped namespaces
  • Use minimal APIs (as much as possible without losing focus on learning Dapr)

A11Y Images with lots of content are not really accessible

Noticed this issue while reviewing @mthmulders Java merge request, but goes for the .NET side as well.

The workshop contains quite a few images which contain code/logs which can't be read by screenreaders.
The general moto in the A11Y world seems to be "Code blocks, not screenshots". This would also make it easier to version (in case some of the examples ever change, we don't need to create new screenshots.

Very open to discuss this further and contribute.

Update to Dapr 1.4

Dapr v1.4 is now available. I think it would be good to update the workshop instructions so the latest bits are pulled in. Let's keep this one as an umbrella issue and have pull requests for the separate tracks?

Mosquitto container changes ownership of directory on disk

I've run into this on my Linux machine, where I'm developing the Java track for this workshop. After starting the Mosquitto container, I noticed that the ownership of the Mosquitto folder would have changed to 1883:1883.

The Mosquitto container is started with the current directory mounted into the container as /mosquitto/config/. As I understand from eclipse/mosquitto/issues/1078, the container will indeed change ownership of /mosquitto to mosquitto:mosquitto (to be precise, it happens in the docker-entrypoint.sh script.

I'm not sure if this is actually something that you can observe on Windows (I hardly ever use that operating system) but at least it happens on Linux and probably also on macOS, and I consider it a bit annoying. Would you be accepting a PR that addresses this, e.g. by copying over the configuration files to a temporary directory and then mounting that one into the Mosquitto container?

Fabulous

The best place to learn Dapr that I have found.

Thank you

Line endings in mosquitto when working with WSL2

I'm using WSL2 as the backend for my docker desktop installation. When I boot the mosquitto container it fails because it can't parse the configuration file. After some debugging I found that the line endings are CRLF instead of LF. This causes issues in WSL2.

Pub sub for Java SDK

Hi and thanks alot for the work shop! To code along with the instructions for the Java SDK is a joy and it's a very fun way to explore Dapr.

A suggestion is to clarify the below section a bit though.

(image)

After the instrcution I suggest that the whole method should
shown to avoid any missunderstanding.

I guess it should look something like this?

@Topic(name = "speedingviolations", pubsubName = "pubsub")
    public ResponseEntity<Void> registerViolation(@RequestBody final CloudEvent<SpeedingViolation> event) {
        violationProcessor.processSpeedingViolation(event.getData());
        return ResponseEntity.ok().build();
    }

Thanks again,

Regards
Dan

Java track lacks distributed tracing

The Dapr SDK for Java does not support distributed tracing out of the box (see dapr/java-sdk#650). That's why it wasn't working in this workshop, either. I feel we should show attendees how to get it working - even if it's not the cleanest approach.

I will propose a few textual changes that go with mthmulders/dapr-workshop-java@8f99f85. This will make sure that when people follow this workshop, they will be able to see how distributed tracing works with Zipkin.

Upgrade to Dapr 1.3

  • Upgrade instructions to use Dapr CLI and runtime 1.3.
  • Upgrade code + instructions to use Dapr SDK for .NET 1.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.