Skip to content

Commit

Permalink
Merge branch 'main' into validate-arguments-of-public-methods#aspire-…
Browse files Browse the repository at this point in the history
…hosting-nodejs
  • Loading branch information
sebastienros authored Aug 9, 2024
2 parents 7cccc3a + ea10ec2 commit bba4495
Show file tree
Hide file tree
Showing 111 changed files with 3,844 additions and 165 deletions.
26 changes: 25 additions & 1 deletion Aspire.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "playground", "playground",
playground\README.md = playground\README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServiceDefaults", "playground\TestShop\ServiceDefaults\ServiceDefaults.csproj", "{C7B2309C-073A-4552-A508-A69768B64C6F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestShop.ServiceDefaults", "playground\TestShop\TestShop.ServiceDefaults\TestShop.ServiceDefaults.csproj", "{C7B2309C-073A-4552-A508-A69768B64C6F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CatalogService", "playground\TestShop\CatalogService\CatalogService.csproj", "{6D04BB34-1CC6-4FF3-A02A-1FFAC2A7A4F3}"
EndProject
Expand Down Expand Up @@ -507,6 +507,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "python", "python", "{7123AB
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.AppHost", "playground\python\Python.AppHost\Python.AppHost.csproj", "{173BDA6E-F175-4457-BF64-58CD184E9A81}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Playground.Tests", "tests\Aspire.Playground.Tests\Aspire.Playground.Tests.csproj", "{8C07B9BF-87F4-450D-92FA-E03CF763013B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Elasticsearch.Tests", "tests\Aspire.Hosting.Elasticsearch.Tests\Aspire.Hosting.Elasticsearch.Tests.csproj", "{62D8C73C-DAB3-4B9E-A508-34C886C374F9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Components", "Components", "{C424395C-1235-41A4-BF55-07880A04368C}"
Expand Down Expand Up @@ -569,6 +571,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Hosting.NodeJs.Tests
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Hosting.RabbitMQ.Tests", "tests\Aspire.Hosting.RabbitMQ.Tests\Aspire.Hosting.RabbitMQ.Tests.csproj", "{872AC635-B880-4FAC-BB43-4FD97D7B1209}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BrowserTelemetry", "BrowserTelemetry", "{15966C27-17FA-4A46-A172-55985411540A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrowserTelemetry.AppHost", "playground\BrowserTelemetry\BrowserTelemetry.AppHost\BrowserTelemetry.AppHost.csproj", "{29946391-F2E9-4DEA-92A2-6FAAC1508446}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrowserTelemetry.Web", "playground\BrowserTelemetry\BrowserTelemetry.Web\BrowserTelemetry.Web.csproj", "{091EA540-355B-4763-9980-5F83F0BB6F11}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1387,6 +1395,10 @@ Global
{173BDA6E-F175-4457-BF64-58CD184E9A81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{173BDA6E-F175-4457-BF64-58CD184E9A81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{173BDA6E-F175-4457-BF64-58CD184E9A81}.Release|Any CPU.Build.0 = Release|Any CPU
{8C07B9BF-87F4-450D-92FA-E03CF763013B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C07B9BF-87F4-450D-92FA-E03CF763013B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C07B9BF-87F4-450D-92FA-E03CF763013B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C07B9BF-87F4-450D-92FA-E03CF763013B}.Release|Any CPU.Build.0 = Release|Any CPU
{62D8C73C-DAB3-4B9E-A508-34C886C374F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62D8C73C-DAB3-4B9E-A508-34C886C374F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62D8C73C-DAB3-4B9E-A508-34C886C374F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -1499,6 +1511,14 @@ Global
{872AC635-B880-4FAC-BB43-4FD97D7B1209}.Debug|Any CPU.Build.0 = Debug|Any CPU
{872AC635-B880-4FAC-BB43-4FD97D7B1209}.Release|Any CPU.ActiveCfg = Release|Any CPU
{872AC635-B880-4FAC-BB43-4FD97D7B1209}.Release|Any CPU.Build.0 = Release|Any CPU
{29946391-F2E9-4DEA-92A2-6FAAC1508446}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{29946391-F2E9-4DEA-92A2-6FAAC1508446}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29946391-F2E9-4DEA-92A2-6FAAC1508446}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29946391-F2E9-4DEA-92A2-6FAAC1508446}.Release|Any CPU.Build.0 = Release|Any CPU
{091EA540-355B-4763-9980-5F83F0BB6F11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{091EA540-355B-4763-9980-5F83F0BB6F11}.Debug|Any CPU.Build.0 = Debug|Any CPU
{091EA540-355B-4763-9980-5F83F0BB6F11}.Release|Any CPU.ActiveCfg = Release|Any CPU
{091EA540-355B-4763-9980-5F83F0BB6F11}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1742,6 +1762,7 @@ Global
{D5B392A4-29CD-41F9-8847-0C211C832713} = {C424395C-1235-41A4-BF55-07880A04368C}
{7123AB7A-A4FD-4F64-8B05-D2DD0C3E2ABC} = {D173887B-AF42-4576-B9C1-96B9E9B3D9C0}
{173BDA6E-F175-4457-BF64-58CD184E9A81} = {7123AB7A-A4FD-4F64-8B05-D2DD0C3E2ABC}
{8C07B9BF-87F4-450D-92FA-E03CF763013B} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60}
{62D8C73C-DAB3-4B9E-A508-34C886C374F9} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{C424395C-1235-41A4-BF55-07880A04368C} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60}
{830A89EC-4029-4753-B25A-068BAE37DEC7} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60}
Expand Down Expand Up @@ -1773,6 +1794,9 @@ Global
{1419BDCB-47EB-43EB-9149-C935B7208A72} = {90A70EFA-F26A-49E0-A375-DB461E4E0E25}
{50450FBB-CD10-4281-B22C-7FF86CEE9D9F} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{872AC635-B880-4FAC-BB43-4FD97D7B1209} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{15966C27-17FA-4A46-A172-55985411540A} = {D173887B-AF42-4576-B9C1-96B9E9B3D9C0}
{29946391-F2E9-4DEA-92A2-6FAAC1508446} = {15966C27-17FA-4A46-A172-55985411540A}
{091EA540-355B-4763-9980-5F83F0BB6F11} = {15966C27-17FA-4A46-A172-55985411540A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6DCEDFEC-988E-4CB3-B45B-191EB5086E0C}
Expand Down
6 changes: 4 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Import Project="eng/Versions.props" Condition="'$(MajorVersion)' == '' and Exists('eng/Versions.props')" />
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<TestcontainersPackageVersion>3.9.0</TestcontainersPackageVersion>
</PropertyGroup>
<ItemGroup>
Expand All @@ -21,7 +22,6 @@
<PackageVersion Include="Azure.AI.OpenAI" Version="2.0.0-beta.2" />
<PackageVersion Include="Azure.Data.Tables" Version="12.9.0" />
<PackageVersion Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.1" />
<PackageVersion Include="Azure.Identity" Version="1.12.0" />
<PackageVersion Include="Azure.Messaging.EventHubs.Processor" Version="5.11.4" />
<PackageVersion Include="Azure.Messaging.ServiceBus" Version="7.18.1" />
<PackageVersion Include="Azure.Search.Documents" Version="11.6.0" />
Expand Down Expand Up @@ -168,6 +168,8 @@
<PackageVersion Include="Microsoft.Orleans.Server" Version="8.2.0" />
<PackageVersion Include="Microsoft.Orleans.Sdk" Version="8.2.0" />
<!-- Pinned version for Component Governance - Remove when root dependencies are updated -->
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Azure.Core" Version="1.42.0" />
<PackageVersion Include="Azure.Identity" Version="1.12.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" /> <!-- https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3313 -->
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
.WithExternalHttpEndpoints()
.WithReference(blobs);

#if !SKIP_DASHBOARD_REFERENCE
// This project is only added in playground projects to support development/debugging
// of the dashboard. It is not required in end developer code. Comment out this code
// to test end developer dashboard launch experience. Refer to Directory.Build.props
// for the path to the dashboard binary (defaults to the Aspire.Dashboard bin output
// in the artifacts dir).
// or build with `/p:SkipDashboardReference=true`, to test end developer
// dashboard launch experience, Refer to Directory.Build.props for the path to
// the dashboard binary (defaults to the Aspire.Dashboard bin output in the
// artifacts dir).
builder.AddProject<Projects.Aspire_Dashboard>(KnownResourceNames.AspireDashboard);
#endif

builder.Build().Run();

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireHost>true</IsAspireHost>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\KnownResourceNames.cs" Link="KnownResourceNames.cs" />
</ItemGroup>

<ItemGroup>
<AspireProjectOrPackageReference Include="Aspire.Hosting.AppHost" />
<ProjectReference Include="..\BrowserTelemetry.Web\BrowserTelemetry.Web.csproj" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions playground/BrowserTelemetry/BrowserTelemetry.AppHost/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

var builder = DistributedApplication.CreateBuilder(args);

builder.AddProject<Projects.BrowserTelemetry_Web>("web")
.WithExternalHttpEndpoints();

// This project is only added in playground projects to support development/debugging
// of the dashboard. It is not required in end developer code. Comment out this code
// to test end developer dashboard launch experience. Refer to Directory.Build.props
// for the path to the dashboard binary (defaults to the Aspire.Dashboard bin output
// in the artifacts dir).
builder.AddProject<Projects.Aspire_Dashboard>(KnownResourceNames.AspireDashboard);

builder.Build().Run();
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:15887;http://localhost:15888",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_HTTP_ENDPOINT_URL": "https://localhost:16175",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:17037",
"DOTNET_ASPIRE_SHOW_DASHBOARD_RESOURCES": "true"
}
},
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:15888",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_HTTP_ENDPOINT_URL": "http://localhost:16175",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:17037",
"DOTNET_ASPIRE_SHOW_DASHBOARD_RESOURCES": "true",
"ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true"
}
},
"generate-manifest": {
"commandName": "Project",
"launchBrowser": true,
"dotnetRunMessages": true,
"commandLineArgs": "--publisher manifest --output-path aspire-manifest.json",
"applicationUrl": "http://localhost:15888",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16175"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.Dcp": "Warning"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Playground.ServiceDefaults\Playground.ServiceDefaults.csproj" />
</ItemGroup>

<Target Name="NpmInstall" Inputs="package.json" Outputs="node_modules/.install-stamp">
<!--
Use npm install or npm ci depending on RestorePackagesWithLockFile value.
Uncomment the following lines if you want to use this feature:
<PropertyGroup>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>
-->
<Exec Command="npm ci" Condition="'$(RestorePackagesWithLockFile)' == 'true'" />
<Exec Command="npm install" Condition="'$(RestorePackagesWithLockFile)' != 'true'" />

<!-- Write the stamp file, so incremental builds work -->
<Touch Files="node_modules/.install-stamp" AlwaysCreate="true" />
</Target>

<!--
2. Run npm run build before building the .NET project.
MSBuild runs NpmInstall before this task because of the DependsOnTargets attribute.
-->
<Target Name="NpmRunBuild" DependsOnTargets="NpmInstall" BeforeTargets="BeforeBuild" Condition="'$(Configuration)' == 'Debug' ">
<Exec Command="npm run build" />
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@page
<div class="container">
<p>Hello world</p>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace BrowserTelemetry.Web.Pages;

public class IndexModel : PageModel
{
private readonly ILogger<IndexModel> _logger;

public IndexModel(ILogger<IndexModel> logger)
{
_logger = logger;
}

public void OnGet()
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@using System.Diagnostics
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - BrowserTelemetry</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />

@if (Activity.Current is { } currentActivity)
{
<meta name="traceparent" content="@currentActivity.Id" />
}
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-page="/Index">BrowserTelemetry</a>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
@await RenderSectionAsync("Scripts", required: false)
<script src="scripts/bundle.js"></script>
@if (Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT") is { Length: > 0 } endpointUrl)
{
var headers = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_HEADERS");
var attributes = Environment.GetEnvironmentVariable("OTEL_RESOURCE_ATTRIBUTES");
<script>
BrowserTelemetry.initializeTelemetry('@endpointUrl', '@headers', '@attributes');
</script>
}
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */

a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}

a {
color: #0077cc;
}

.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}

.border-top {
border-top: 1px solid #e5e5e5;
}
.border-bottom {
border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

button.accept-policy {
font-size: 1rem;
line-height: inherit;
}

.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@using BrowserTelemetry.Web
@namespace BrowserTelemetry.Web.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@{
Layout = "_Layout";
}
Loading

0 comments on commit bba4495

Please sign in to comment.