GithubHelp home page GithubHelp logo

aspire-samples's Introduction

dotnet/dotnet - Home of the .NET VMR

This repository is a Virtual Monolithic Repository (VMR) which includes all the source code and infrastructure needed to build the .NET SDK.

What this means:

  • Monolithic - a join of multiple repositories that make up the whole product, such as dotnet/runtime or dotnet/sdk.
  • Virtual - a mirror (not replacement) of product repos where sources from those repositories are synchronized into.

In the VMR, you can find:

Just like the development repositories, the VMR will have a release branch for every feature band (e.g. release/8.0.1xx). Similarly, VMR's main branch will follow main branches of product repositories (see Synchronization Based on Declared Dependencies).

More in-depth documentation about the VMR can be found in VMR Design And Operation. See also dotnet/source-build for more information about our whole-product source-build.

Goals

  • The main purpose of the dotnet/dotnet repository is to have all source code necessary to build the .NET product available in one repository and identified by a single commit.
  • The VMR also aims to become the place from which we release and service future versions of .NET to reduce the complexity of the product construction process. This should allow our partners and and 3rd parties to easily build, test and modify .NET using their custom infrastructure as well as make the process available to the community.
  • Lastly, we hope to solve other problems that the current multi-repo setup brings:
    • Enable the standard down-/up-stream open-source model.
    • Fulfill requirements of .NET distro builders such as RedHat or Canonical to natively include .NET in their distribution repositories.
    • Simplify scenarios such as client-run testing of bug fixes and improvements. The build should work in an offline environment too for certain platforms.
    • Enable developers to make and test changes spanning multiple repositories.
    • More efficient pipeline for security fixes during the CVE pre-disclosure process.

We will achieve these goals while keeping active coding work in the separate repos where it happens today. For example: ASP.NET features will continue to be developed in dotnet/aspnetcore and CLR features will be continue to be developed in dotnet/runtime. Each of these repos have their own distinct communities and processes, and aggregating development into a true mono-repo would work against that. Hence, the "virtual" monolithic repo: the VMR gives us the simplicity of a mono-repo for building and servicing the product, while active development of components of that product stays in its various existing repos. The day to day experience for typical contributors will not change.

Limitations

This is a work-in-progress. There are considerable limitations to what is possible at the moment. For an extensive list of current limitations, please see Temporary Mechanics.
See the Unified Build roadmap for more details.

Supported platforms

  • 8.0
    • source-build configuration on Linux
  • 9.0+ (WIP)
    • source-build configuration on Linux
    • non-source-build configuration on Linux, Mac, and Windows

For the latest information about Source-Build support for new .NET versions, please check our GitHub Discussions page for announcements.

Code flow

For the time being, the source code only flows one way - from the development repos into the VMR. More details on this process:

We expect the code flow to start working both ways in the .NET 9 timeframe. See the Unified Build roadmap for more details.

Contribution

At this time, the VMR will not accept any changes and is a read-only mirror of the development repositories only. Please, make the changes in the respective development repositories (e.g., dotnet/runtime or dotnet/sdk) and they will get synchronized into the VMR automatically.

Dev instructions

Please note that this repository is a work-in-progress and there are some usability issues connected to this. These can be nuisances such as some checked-in files getting modified by the build itself and similar. For the latest information about Source-Build support, please watch for announcements posted on our GitHub Discussions page.

Prerequisites

The dependencies for building can be found here. In case you don't want to / cannot prepare your environment per the requirements, consider using Docker.

Building

  1. Clone the repository

    git clone https://github.com/dotnet/dotnet dotnet-dotnet
    cd dotnet-dotnet
  2. Build the .NET SDK

    Choose one of the following build modes:

    • Microsoft based build

      For Unix:

      ./build.sh --clean-while-building

      For Windows:

      .\build.cmd -cleanWhileBuilding
    • Building from source

      # Prep the source to build on your distro.
      # This downloads a .NET SDK and a number of .NET packages needed to build .NET from source.
      ./prep-source-build.sh
      
      # Build the .NET SDK
      ./build.sh -sb --clean-while-building

    The resulting SDK is placed at artifacts/assets/Release/dotnet-sdk-9.0.100-[your-RID].tar.gz (for Unix) or artifacts/assets/Release/dotnet-sdk-9.0.100-[your-RID].zip (for Windows).

  3. (Optional) Unpack and install the .NET SDK

    For Unix:

    mkdir -p $HOME/dotnet
    tar zxf artifacts/assets/Release/dotnet-sdk-9.0.100-[your-RID].tar.gz -C $HOME/dotnet
    ln -s $HOME/dotnet/dotnet /usr/bin/dotnet

    For Windows:

    mkdir %userprofile%\dotnet
    tar -xf artifacts/assets/Release/dotnet-sdk-9.0.100-[your RID].zip -C %userprofile%\dotnet
    set "PATH=%userprofile%\dotnet;%PATH%"

    To test your built SDK, run the following:

    dotnet --info

Note

Run ./build.sh --help (for Unix) or .\build.cmd -help (for Windows) to see more information about supported build options.

Building using Docker

You can also build the repository using a Docker image which has the required prerequisites inside. The example below creates a Docker volume named vmr and clones and builds the VMR there.

docker run --rm -it -v vmr:/vmr -w /vmr mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8
git clone https://github.com/dotnet/dotnet .

# - Microsoft based build
./build.sh --clean-while-building

# - Building from source
./prep-source-build.sh && ./build.sh -sb --clean-while-building

mkdir -p $HOME/.dotnet
tar -zxf artifacts/assets/Release/dotnet-sdk-9.0.100-centos.8-x64.tar.gz -C $HOME/.dotnet
ln -s $HOME/.dotnet/dotnet /usr/bin/dotnet

Codespaces

You can also utilize GitHub Codespaces where you can find preset containers in this repository.

Building from released sources

You can also build from sources (and not from a context of a git repository), such as the ones you can acquire from a dotnet/dotnet release. In this case, you need to provide additional information which includes the original repository and commit hash the code was built from so that the SDK can provide a better debugging experience (think the Step into.. functionality). Usually, this means the dotnet/dotnet repository together with the commit the release tag is connected to.

In practice, this means that when calling the main build script, you need to provide additional arguments when building outside of a context of a git repository.
Alternatively, you can also provide a manifest file where this information can be read from. This file (release.json) can be found attached with the dotnet/dotnet release.

Synchronizing code into the VMR

Sometimes you want to make a change in a repository and test that change in the VMR. You could of course make the change in the VMR directly (locally, as the VMR is read-only for now) but in case it's already available in your repository, you can synchronize it into the VMR (again locally).

To do this, you can either start a dotnet/dotnet Codespace - you will see instructions right after it starts. Alternatively, you can clone the repository locally and use the vmr-sync.sh or vmr-sync.ps1 script to pull your changes in. Please refer to the documentation in the script for more details.

List of components

The full list of components synchronized into the VMR is here (Components.md).

The repository also contains a JSON manifest listing all components in a machine-readable format.

Filing Issues

This repo does not accept issues as of now. Please file issues to the appropriate development repos. For issues with the VMR itself, please use the source-build repository.

Useful Links

.NET Foundation

.NET Runtime is a .NET Foundation project.

License

.NET is licensed under the MIT license.

aspire-samples's People

Contributors

alexwolfmsft avatar antonfirsov avatar balachir avatar camsoper avatar damianedwards avatar danmoseley avatar davidfowl avatar depechie avatar dependabot[bot] avatar hishamco avatar ievangelist avatar jamesnk avatar layla-p avatar microsoft-github-operations[bot] avatar microsoftopensource avatar moljac avatar reubenbond avatar sebastienros avatar secpriano avatar sgbj avatar timdeschryver avatar vishipayyallore 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aspire-samples's Issues

Add sample to use Aspire with CosmosDB

I would appreciate if there was a sample showing how to use CosmosDB in Aspire since this simple setup isn't working and I have no clue on what's missing.

var builder = DistributedApplication.CreateBuilder(args);

var db = builder.AddAzureCosmosDB("db");

var api = builder.AddProject<Projects.API>("api")
    .WithReference(db);

builder.Build().Run();

See: dotnet/aspire#1502

Error Running AspireWithDapr Sample

Environment

Mac with Apple Silicon

Dapr Setup

  1. Run Docker Desktop
  2. Install Dapr CLI
  3. Initialize Dapr: dapr init

Steps

  1. Run AspireWithDapr.AppHost

Result

info: Aspire.Dashboard.DashboardWebApplication[0]
      Now listening on: http://localhost:15278
info: Aspire.Dashboard.DashboardWebApplication[0]
      OTLP server running at: http://localhost:16064
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      failed to start a process {"Controller": "usvc-dev.developer.microsoft.com/executable-reconciler", "Executable": {"name":"api"}, "Reconciliation": 8, "State": "", "ExecutionID": "", "error": "fork/exec /usr/local/bin/dapr: no such file or directory"}
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      failed to start Executable        {"Controller": "usvc-dev.developer.microsoft.com/executable-reconciler", "Executable": {"name":"api"}, "Reconciliation": 8, "State": "", "ExecutionID": "", "error": "fork/exec /usr/local/bin/dapr: no such file or directory"}
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      failed to start a process {"Controller": "usvc-dev.developer.microsoft.com/executable-reconciler", "Executable": {"name":"web"}, "Reconciliation": 9, "State": "", "ExecutionID": "", "error": "fork/exec /usr/local/bin/dapr: no such file or directory"}
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
      failed to start Executable        {"Controller": "usvc-dev.developer.microsoft.com/executable-reconciler", "Executable": {"name":"web"}, "Reconciliation": 9, "State": "", "ExecutionID": "", "error": "fork/exec /usr/local/bin/dapr: no such file or directory"}
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /Users/anthonysneed/Source/poc/aspire-samples/samples/AspireWithDapr/AspireWithDapr.AppHost

How to Aspire with 100s of services, Executables?

When creating an Aspire app host, I following this logic ...
builder.AddProject<Projects.NextWare_UI_Builder_EditServices_API>("nextwareuibuildereditservices");

For this I need to add a project reference to the NextWare_UI_Builder_EditServices_API project in the Aspire AppHost.

Does that mean that our Aspire AppHost project would need to have a project dependency on each of the 100+ service projects or is there another way to configure this?

And, what is meant by executables in the Dashboard?

Unable to view weather page in webfrontend endpoint when running AspireWithDapr solution with error 'CreateFile .dapr\components: The system cannot find the path specified

REGRESSION INFO: Worked fine with Aspire 8.0.0-preview.1.23557.2

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 Preview 2
  3. Install Aspire Preview 2 latest build 8.0.0-preview.2.23610.1
  4. Apply NuGet Feeds

REPRO STEPS

  1. Clone aspire-samples repo
  2. Checkout preview.2 branch
  3. Update NuGet.config to use the dotnet-tools feed
  4. Update Directory.Packages.props to use aspire version 8.0.0-preview.2.23610.1
  5. Open solution AspireWithDapr.sln
  6. Build and Ctrl+F5

ACTUAL
Initially, I ran the solution without installing dapr CLI. I get errors as shown below.

image

image

After I install dapr CLI from here, I now see the following error

image

EXPECTED
Able to successfully run the AspireWithDapr solution

.net aspire azd deploy timing out

I am trying to deploy the sample project for aspire. I am basically creating a simple aspire project using visual studios template and following the documentation step to deploy the project.
everything seems to work fine, until I reach the point where I do azd up. It created all the needed resources fine, but when it starts doing azd deploy it takes some time on pushing to container image and then gives an error saying ** failing invoking action 'deploy', publishing container: dotnet publish on project** and ** Failed to push to the output registry: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing**.

I check if I have permissions to push to acr in azure and I am the owner for the subscription.
I really don't know what's the issue here.

Example: Blazor Custom Elements and Storybook UI via Aspire

I noticed that Blazor allows you to create custom elements

https://learn.microsoft.com/en-us/aspnet/core/blazor/components/js-spa-frameworks?view=aspnetcore-8.0#blazor-custom-elements

And, then I noticed that storybook supports web components

image

ย 
So, I am thinking about attempting to try and see if I can use a blazor web app or component library to build custom elements and try and get storybook to show it in its ui. Wanting to find and acknowledge any roadblocks or pain points with this approach and see if I can get at least something working with this.

So basically, we have a

graph LR
    aspireAppHost[Aspire App Host]
    storybookNpmApp[Storybook NPM App]
    blazorWebApp[Blazor Web App]
    blazorComponentLibrary[Blazor Component Library]

    aspireAppHost --> blazorWebApp
    aspireAppHost --> storybookNpmApp
    storybookNpmApp --> blazorWebApp
    blazorWebApp --> blazorComponentLibrary

Dapr Actor Example?

I can't get a simple actor setup working but looking through some of the Dapr configuration DaprClient is not setup the same way as the ActorProxy class. Wondering if it should be working and I'm just not sure how to set it up correctly with an asp.net core web project hosting the actor proxy implementation and getting a simple console app to use the Proxy and make calls to the actors. The connection doesnt seem to work for me, but there's no starter sample using actors so I'm not sure if its me or if it's been an oversight with Actors being different to Sidecar web services or something?

Sample using qdrant and semantic kernel

This would enable us to show OpenAI, along with the ability for an Aspire app to pull in a containerized feature set like qdrant. I have this working in a larger-than-a-sample-sized app we could scale back for customers to see opportunities for Aspire and OpenAI.

Add samples for different patterns of composing services from multiple repositories into an AppHost project

From dotnet/aspire#829

We should investigate how we can add some samples of various patterns that could be used to orchestrate projects and services from multiple repos rather than mono-repo. It's common to split up service ownership by team or simply to put them in their own repos.

Some patterns I imagine might emerge:

  • git sub-modules for service repos and a parent repo with the .sln file and AppHost project, if you want to build and run all services locally
  • Services published as container images that are then composed into an AppHost project as containers, if you don't want to build the services locally but you do want to run them locally
  • Dev-instances of services deployed to dedicated environments and/or locally that are then composed into an AppHost project as dotnet/aspire#775, if you don't want to build or run the services locally

[WebToolsE2E][Aspire] Build AspireWithNode solution failed with "The call is ambiguous between the following methods or properties: ..." after updating to Aspire 8.0 preview 2

REGRESSION INFO: Worked fine with Aspire 8.0.0-preview.1.23557.2

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 Preview 2
  3. Install Aspire Preview 2 latest build 8.0.0-preview.2.23610.1
  4. Apply NuGet Feeds
  5. Install node from nodejs.org

REPRO STEPS

  1. Clone aspire-samples repo
  2. Checkout preview.2 branch
  3. Update NuGet.config to use the dotnet-tools feed
  4. Update Directory.Packages.props to use aspire version 8.0.0-preview.2.23610.1
  5. Open solution AspireWithNode.sln
  6. Build solution

ACTUAL
Failed to build solution with error: The call is ambiguous between the following methods or properties: 'Aspire.Hosting.NodeAppHostingExtension.AddNodeApp(Aspire.Hosting.IDistributedApplicationBuilder, string, string, string, string[]?)' and 'Aspire.Hosting.NodeAppHostingExtension.AddNodeApp(Aspire.Hosting.IDistributedApplicationBuilder, string, string, string?, string[]?)' AspireWithNode.AppHost

image

EXPECTED
Build solution successfully.

AspireWithDapr project Errors

AspireWithDapr sample dose not work properly and gets this error in apiservice-dapr and webfrontend-dapr resources :

Error: could not create Endpoint object {"Controller": "usvc-dev.developer.microsoft.com/executable-reconciler", "error": "service-producer annotation is invalid: missing information about the port to expose the service"}

invalid argument "{{- portForServing "apiservice-dapr_grpc" -}}" for "-G, --dapr-grpc-port" flag: strconv.ParseInt: parsing "{{- portForServing "apiservice-dapr_grpc" -}}": invalid syntax
Error: invalid argument "{{- portForServing "apiservice-dapr_grpc" -}}" for "-G, --dapr-grpc-port" flag: strconv.ParseInt: parsing "{{- portForServing "apiservice-dapr_grpc" -}}": invalid syntax

invalid argument "{{- portForServing "webfrontend-dapr_grpc" -}}" for "-G, --dapr-grpc-port" flag: strconv.ParseInt: parsing "{{- portForServing "webfrontend-dapr_grpc" -}}": invalid syntax
Error: invalid argument "{{- portForServing "webfrontend-dapr_grpc" -}}" for "-G, --dapr-grpc-port" flag: strconv.ParseInt: parsing "{{- portForServing "webfrontend-dapr_grpc" -}}": invalid syntax

Note : Dapr projects work properly standalone in my machine also other Aspire projects.

image

image

image

Initial Aspire Dapr Samples Communication Errors

When navigating to "Weather" on the client site, the weather forecast API is unable to be reached.

I've reproduced this on 2 Windows machines and on OS X with various configurations to ensure it wasn't a local network configuration issue.


Thanks for all the great work! Excited to play with this!

Dapr.Client.InvocationException: An exception occurred while invoking method: 'weatherforecast' on app-id: 'api'
---> System.Net.Http.HttpRequestException: An error occurred while sending the request.
---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer.
---> System.Net.Sockets.SocketException (54): Connection reset by peer
--- End of inner exception stack trace ---

Full Stack Trace:

Dapr.Client.InvocationException: An exception occurred while invoking method: 'weatherforecast' on app-id: 'api'
 ---> System.Net.Http.HttpRequestException: An error occurred while sending the request.
 ---> System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine..
 ---> System.Net.Sockets.SocketException (10053): An established connection was aborted by the software in your host machine.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.CreateException(SocketError error, Boolean forAsyncThrow)
   at System.Net.Sockets.NetworkStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1.SetResult(TResult result)
   at System.Net.Http.HttpConnectionPool.HttpConnectionWaiter`1.WaitForConnectionWithTelemetryAsync(HttpRequestMessage request, HttpConnectionPool pool, Boolean async, CancellationToken requestCancellationToken)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1.SetResult(TResult result)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecuteFromThreadPool(Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
--- End of stack trace from previous location ---

   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.Metrics.MetricsHandler.SendAsyncWithMetrics(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Dapr.Client.DaprClientGrpc.InvokeMethodWithResponseAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Dapr.Client.DaprClientGrpc.InvokeMethodWithResponseAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Dapr.Client.DaprClientGrpc.InvokeMethodAsync[TResponse](HttpRequestMessage request, CancellationToken cancellationToken)
   at AspireWithDapr.Web.WeatherApiClient.GetWeatherAsync() in C:\Users\RapidWeb\Code\DotNet8\AspireWithDapr\AspireWithDapr.Web\WeatherApiClient.cs:line 9
   at AspireWithDapr.Web.Components.Pages.Weather.OnInitializedAsync() in C:\Users\RapidWeb\Code\DotNet8\AspireWithDapr\AspireWithDapr.Web\Components\Pages\Weather.razor:line 47
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.<WaitForQuiescence>g__ProcessAsynchronousWork|54_0()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.WaitForQuiescence()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderRootComponentAsync(Int32 componentId, ParameterView initialParameters)
   at Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.SendStreamingUpdatesAsync(HttpContext httpContext, Task untilTaskCompleted, TextWriter writer)
   at Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.SendStreamingUpdatesAsync(HttpContext httpContext, Task untilTaskCompleted, TextWriter writer)
   at Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context)
   at Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.<<InvokeAsync>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.OutputCaching.OutputCacheMiddleware.<>c__DisplayClass11_0.<<InvokeAwaited>g__ExecuteResponseAsync|0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.OutputCaching.WorkDispatcher`2.ScheduleAsync(TKey key, Func`2 valueFactory)
   at Microsoft.AspNetCore.OutputCaching.OutputCacheMiddleware.InvokeAwaited(HttpContext httpContext, IReadOnlyList`1 policies)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
   at Microsoft.WebTools.BrowserLink.Net.BrowserLinkMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

Add CI build

Repo should have a CI build to validate that samples compile successfully.

--bind postgres is not working.

MANAULLY CREATE THE POSTGRES DATABASE BINDING

az containerapp update --name "catalogservice" --resource-group $RESOURCE_GROUP --bind postgres

Execluded the --bind then the command started working

az containerapp create --name bindingdebug --image mcr.microsoft.com/k8se/services/postgres:14 --environment $ENVIRONMENT --resource-group $RESOURCE_GROUP
--min-replicas 1 --max-replicas 1 --command "/bin/sleep" "infinity"

image

Inconsistent Database Behavior - 'DB does not exist' Error vs. Data Visibility in eShopLite UI

I'm encountering an unusual issue with the catalog database in our project. It manifests in several conflicting ways:

  1. Database Existence Error: The primary concern is an error message stating "database does not exist." This error appears in the logs, but the exact circumstances leading to this error are unclear. A screenshot of the error can be found here: Database Error Screenshot.

  2. Database Visibility in pgAdmin: Contradicting the error, when I inspect the database through pgAdmin, the database seems intact. This might indicate a permissions issue with PostgreSQL, but I'm not certain. Here's a screenshot of the pgAdmin view: pgAdmin View Screenshot.

  3. Data Seeding and UI Interaction: Further adding to the confusion, when I access the UI immediately after data seeding, the catalog data is present and correctly displayed in the eShopLite UI. This suggests that the database is not only created but also accessible by the catalog service.

Conclusion and Request for Assistance:
The logs in the Aspire dashboard are indicating a missing database, which is in direct conflict with both the pgAdmin view and the UI behavior. This inconsistency is perplexing, and I am seeking insights or suggestions on how to resolve or further diagnose this issue.

Add Dapr examples Used in the Main Aspire repo

I was looking at the aspire dapr sample in the main Aspire repo and noticed that the sample in the main repo seems to have a little bit more functionality than the one here in the samples directory. Wanting to see if the samples could add the extra functionality from the main repo and if some additional functionality could possibly be added to expand upon the one in the main repo.

Here is what I am referring to

image

This is the app host file in this repo

image

How do you load/define dapr components?

I'm not seeing it in the dapr sample, it seems to just start a sidecar that does nothing?

The sample could, for example, demonstrate using a cron binding

Edit:

This is how

    .WithDaprSidecar(new DaprSidecarOptions
    {
        AppId = "your-api",
        ResourcesPaths = [
            "../your/components",
        ],
    });

Example: Yarp Api Gateway & Ingress ๐Ÿ›œ

Noticed there were new yarp packages that dont seem to be mentioned anywhere the yarp or aspire docs, so I made a simple poc repo of yarp working with aspire (that can be used as a reference for now) here. I used the main aspire repo's sample project as a reference. This won't be exactly what it looks like in the pr for this issue, but it is a simple starting point and something similar to what I am wanting to be displayed for devs wanting to use yarp with aspire.

Deploying AspireWithNode to Azure using azd doesn't deploy the node frontend

I tried to deploy the AspireWithNode sample to azure using azd, as the ease of deployment was a highlighted feature of Aspire. From what I can tell it deployed the container with the redis cache and the webapi with the weatherforecast service, but not the frontend node app that connects to those two.

I was particularly interested in seeing how that project would deploy, since being able to deploy a node project makes sense for at lot of SPA applications that might be able to leverage frontend framework features like SSR if they ran from node directly, rather than deploying the static build files to azure static apps, or through a regular app service.

Steps:

  1. Clone this repo
  2. cd into \samples\AspireWithNode\AspireWithNode.AppHost
  3. azd init
  4. azd up

Additional note: the webapi project was deployed in a container. It would be nice to be able to deploy that as an app service instead.

eshoplite project dotnet publish error:

C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path: D:\cupertino\aspire-samples\samples\eShopLite\eShopLite.CatalogDb\appsettings.De
velopment.json, D:\cupertino\aspire-samples\samples\eShopLite\eShopLite.CatalogService\appsettings.Development.json, D:\cupertino\aspire-samples\samples\eShopLite\eShopLite.CatalogDb\appsettings.json, D:\cupertino\aspire-samples\samples\eShopLite\eShopLite.CatalogService\appsett
ings.json. [D:\cupertino\aspire-samples\samples\eShopLite\eShopLite.CatalogService\eShopLite.CatalogService.csproj]

It seems that both db and service project have appetting file. and output to the same folder/

[WebToolsE2E] Unable to load frontend endpoint when running AspireWithNode solution with error 'service-producer annotation is invalid'

REGRESSION INFO: Worked fine with Aspire 8.0.0-preview.1.23557.2

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 Preview 2
  3. Install Aspire Preview 2 latest build 8.0.0-preview.2.23607.7
  4. Apply NuGet Feeds
  5. Install node from nodejs.org

REPRO STEPS

  1. Clone aspire-samples repo
  2. Checkout preview.2 branch
  3. Update NuGet.config to use the dotnet-tools feed
  4. Update Directory.Packages.props to use aspire version 8.0.0-preview.2.23607.7
  5. Open solution AspireWithNode.sln
  6. Build and Ctrl+F5

ACTUAL
frontend endpoint does not load

fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
could not create Endpoint object {"Controller": "usvc-dev.developer.microsoft.com/executable-reconciler", "ServiceName": "frontend", "Workload": "/frontend", "error": "service-producer annotation is invalid: missing information about the port to expose the service"}

image

image

EXPECTED
Ctrl+F5 to work successfully

[eShopLite] Exception when navigating to cart

I'm not sure how functional the sample is supposed to be but...

  1. Run the eShopLite apphost
  2. Navigate to frontend
  3. add some things to cart
  4. Click cart
    OBSERVE: Cart goes from a count to 0
  5. Click cart again
    OBSERVE: exception
Grpc.Core.RpcException: Status(StatusCode="NotFound", Detail="Basket with buyer id user does not exist")
   at eShopLite.Frontend.Services.BasketServiceClient.CheckoutBasketAsync(String buyerId) in D:\GitHub\aspire-samples\samples\eShopLite\eShopLite.Frontend\Services\BasketServiceClient.cs:line 60
   at eShopLite.Frontend.Components.Cart.HandleCheckout() in D:\GitHub\aspire-samples\samples\eShopLite\eShopLite.Frontend\Components\Cart.razor:line 42
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.Forms.EditForm.HandleSubmitAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.<WaitForQuiescence>g__ProcessAsynchronousWork|54_0()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.WaitForQuiescence()
   at Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.SendStreamingUpdatesAsync(HttpContext httpContext, Task untilTaskCompleted, TextWriter writer)

[WebToolsE2E][Aspire] Failed to start container with running the Metrics solution: "Ports are not available: exposing port TCP 127.0.0.1:9090"

REGRESSION INFO: Worked fine with Aspire 8.0.0-preview.1.23557.2

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 Preview 2
  3. Install Aspire Preview 2 latest build 8.0.0-preview.2.23617.2
  4. Apply NuGet Feeds
  5. Install Docker Desktop

REPRO STEPS

  1. Clone aspire-samples repo
  2. Checkout preview.2 branch
  3. Open solution Metrics.sln
  4. Build and Ctrl+F5

ACTUAL
fail: Aspire.Hosting.Dcp.dcpctrl.ContainerReconciler[0]
could not start the container {"Controller": "usvc-dev.developer.microsoft.com/container-reconciler", "ContainerName": {"name":"prometheus"}, "Reconciliation": 5, "error": "RunContainer command returned error code 125 Stdout: '81cb928dcab9786e061fd2d083a1a2d7ea5d9f76fb6aa160fe184028d8536b9b\n' Stderr: 'docker: Error response from daemon: Ports are not available: exposing port TCP 127.0.0.1:9090 -> 0.0.0.0:0: listen tcp 127.0.0.1:9090: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.\n'"}
image
image

EXPECTED

image

Using a SQL Container with a Volume

We need an example about how to configure SQL Server container with a Volume using Aspire. I have tried using the method WithVolumeMount, but with no luck.

Example: Azure Functions ๐ŸŒฉ๏ธ

I'd like to propose the inclusion of Azure Functions projects as examples within the Aspire framework. This addition would be particularly beneficial for developers and aligns well with the cloud-native direction of Aspire.

Given that both the SDK and runtime for Azure Functions are open-source, integrating them as first-class citizens in the Aspire ecosystem seems a natural fit. Such integration would not only enhance the current offerings of Aspire but also provide practical, cloud-native examples that developers can leverage in their projects.

https://azure.microsoft.com/en-us/updates/ga-azure-functions-supports-net-8-in-the-isolated-worker-model/

Show composing a Python app into AppHost as a resource

Scenario:

  • ASP.NET Core API frontend (e.g. Blazor SSR)
  • Python (e.g. FastAPI) backend
  • Frontend talks to the backend
  • Backend talks to a PostgreSQL database
  • Both apps should be composed into AppHost project so that service endpoint from backend is injected into environment of frontend
  • Backend should have connection string of database injected into environment variables

Add samples showing how to use the support in Aspire.Hosting for database containers

Show how to use Aspire.Hosting support for well-known database containers like PostgreSQL and SQL Server (without Entity Framework Core) including how to initialize them using the features of the underlying container, e.g. to create the database (especially when not using EF Core) to ensure that the connection string provided for the AddDatabase call can actually be connected to.

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.