Skip to content

Commit

Permalink
Add burn server
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkStega committed Jul 5, 2024
1 parent 365f8d1 commit 37b8098
Show file tree
Hide file tree
Showing 86 changed files with 26,357 additions and 266 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/GithubActionsWIP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'main'

env:
appNameBURN: 'icebg.web.burn.wip'
appNameDS: 'icebg.web.ds.wip'
appNameUI: 'icebg.web.ui.wip'
containerRegistry: 'cricebg.azurecr.io'
Expand Down Expand Up @@ -61,6 +62,50 @@ jobs:
run: echo "LocalUnifiedVersion=$(date +'%Y-%m-%d--%H-%M-%S')--WIP" >> $GITHUB_OUTPUT
shell: bash

############################################################################################################
# Build and deploy blazor BURN image
############################################################################################################
build-deploy-burn:
name: Build and deploy ICEBG BURN
needs: [set-unified-version]
runs-on: ubuntu-latest

steps:
- name: Retrieve the global UnifiedVersion
run: echo "unifiedVersion=${{needs.set-unified-version.outputs.unifiedVersion}}" >> $GITHUB_ENV
shell: bash

- name: Checkout repository under $GITHUB_WORKSPACE so the job can access it 🛎️
uses: actions/checkout@v4

- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'

- name: Docker login
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Publish tagged BURN image
run: >
dotnet publish ICEBG.Web.Burn/ICEBG.Web.Burn.csproj
--arch x64
--os linux
--configuration Azure
--no-self-contained
-p:ContainerImageTag=${{ env.unifiedVersion }}
-p:ContainerRegistry=${{env.containerRegistry}}
-p:ContainerRepository=${{env.appNameBURN}}
-p:PublishProfile=DefaultContainer
-p:Version=${{ env.unifiedVersion }}
- name: Display package output for brotli & gzip compressed files
run: find ${{ github.workspace }} -type f \( -iname "*.br" -o -iname "*.gz" \) | sort

############################################################################################################
# Build and deploy blazor DS image
############################################################################################################
Expand Down
10 changes: 0 additions & 10 deletions CalculatePi/CalculatePi.csproj

This file was deleted.

56 changes: 0 additions & 56 deletions CalculatePi/Program.cs

This file was deleted.

11 changes: 11 additions & 0 deletions ICEBG.Client.Burn/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": [
"@babel/plugin-transform-runtime",
"@babel/plugin-transform-class-properties",
"@babel/plugin-transform-object-rest-spread"
],
"presets": [
"@babel/preset-env",
"@babel/preset-typescript"
]
}
14 changes: 14 additions & 0 deletions ICEBG.Client.Burn/App.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<MBAnchor />

<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
20 changes: 20 additions & 0 deletions ICEBG.Client.Burn/Attributes/BuildDateAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;

namespace ICEBG.Client;

/// <summary>
/// Adds an assembly attribute enabling the build process to pass in the build date.
/// </summary>
[AttributeUsage(AttributeTargets.Assembly)]
public class BuildDateAttribute : Attribute
{
/// <summary>
/// The calculated build date.
/// </summary>
public readonly string DateString;

public BuildDateAttribute(string dateString)
{
DateString = dateString;
}
}
7 changes: 7 additions & 0 deletions ICEBG.Client.Burn/Attributes/IMessage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using System.Text.Json;

namespace ICEBG.Client;
public interface IMessage
{
string GetMessageCardJson(JsonSerializerOptions jsonSerializerOptions);
}
39 changes: 39 additions & 0 deletions ICEBG.Client.Burn/Attributes/SitemapAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;

namespace ICEBG.Client;

/// <summary>
/// Indicates that a razor page should be added to the sitemap. Priority must be within the range zero to one.
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class SitemapAttribute : Attribute
{
/// <summary>
/// Indicates the change frequency to be shown in the sitemap.
/// </summary>
public enum eChangeFreqType { Always, Hourly, Daily, Weekly, Monthly, Yearly, Never };


/// <summary>
/// The user selected change frequency.
/// </summary>
public readonly eChangeFreqType ChangeFreq;


/// <summary>
/// The user selected priority.
/// </summary>
public double Priority;


public SitemapAttribute(eChangeFreqType changeFreq, double priority)
{
if (priority < 0 || priority > 1)
{
throw new ArgumentException($"Priority cannot be {priority} - must be between 0 and 1.");
}

ChangeFreq = changeFreq;
Priority = priority;
}
}
71 changes: 71 additions & 0 deletions ICEBG.Client.Burn/Components/FlowLabeledText2.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
@namespace ICEBG.Client.Components

<h2>Time is @time</h2>
<h2>Duration is @duration</h2>
@if (statisticsReportResult == null)
{
<h2>Loading...</h2>
}
else
{
@if (statisticsReportResult.pSuccess)
{
<table class="table">
<tbody>
<tr>
<td><b>SelectStatisticsReport result</b></td>
<td>true</td>
</tr>
<br/>
<tr>
<td><b>Pi start time</b></td>
<td>@statisticsReportResult.pResult.pPiStartTime</td>
</tr>
<tr>
<td><b>Pi last heartbeat</b></td>
<td>@statisticsReportResult.pResult.pPiHeartbeat</td>
</tr>
<tr>
<td><b>Pi average execution time</b></td>
<td>@statisticsReportResult.pResult.pPiAverageSpan</td>
</tr>
<tr>
<td><b>Pi iterations</b></td>
<td>@statisticsReportResult.pResult.pPiIterations</td>
</tr>
@* <br/>
<tr>
<td><b>Sql start time</b></td>
<td>@statisticsReportResult.pResult.pSqlStartTime</td>
</tr>
<tr>
<td><b>Sql last heartbeat</b></td>
<td>@statisticsReportResult.pResult.pSqlHeartbeat</td>
</tr>
<tr>
<td><b>Sql average execution time</b></td>
<td>@statisticsReportResult.pResult.pSqlAverageSpan</td>
</tr>
<tr>
<td><b>Sql iterations</b></td>
<td>@statisticsReportResult.pResult.pSqlIterations</td>
</tr>
*@ </tbody>
</table>
}
else
{
<table class="table">
<tbody>
<tr>
<td><b>Success</b></td>
<td>false</td>
</tr>
<tr>
<td><b>pError</b></td>
<td>@statisticsReportResult.pError</td>
</tr>
</tbody>
</table>
}
}
15 changes: 15 additions & 0 deletions ICEBG.Client.Burn/Components/FlowLabeledText2.razor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using ICEBG.AppConfig;
using ICEBG.DataTier.DataDefinitions;
using ICEBG.DataTier.HelperClasses;

using Microsoft.AspNetCore.Components;

namespace ICEBG.Client.Components;

public partial class FlowLabeledText2
{
[Parameter] public string duration { get; set; }
[Parameter] public string time { get; set; }
[Parameter] public ServiceResult<StatisticsReport_DD> statisticsReportResult { get; set; }
}

8 changes: 8 additions & 0 deletions ICEBG.Client.Burn/Data/Utilities.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace ICEBG.Client;
public static class Utilities
{
public const string NonInteraction = "non_interaction";
public const string EventLabel = "event_label";
public const string EventCategory = "event_category";
public const string DialogActions = "Dialog Actions";
}
16 changes: 16 additions & 0 deletions ICEBG.Client.Burn/Data/WeatherForecast.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;

namespace ICEBG.Client;

#nullable enable

public class WeatherForecast
{
public DateTime Date { get; set; }

public int TemperatureC { get; set; }

public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);

public string? Summary { get; set; }
}
26 changes: 26 additions & 0 deletions ICEBG.Client.Burn/Data/WeatherForecastService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Net.Http.Json;
using System.Threading.Tasks;

using ICEBG.AppConfig;
using ICEBG.SystemFramework;

namespace ICEBG.Client;

#nullable enable

public class WeatherForecastService
{

public async Task<WeatherForecast[]?> GetForecastAsync()
{
using (var client = new System.Net.Http.HttpClient())
{
var request = new System.Net.Http.HttpRequestMessage();
request.RequestUri = new Uri(ApplicationConfiguration.pDataServicesEndpointPrefix + ApplicationConfiguration.pWeatherEndpoint);
var response = await client.SendAsync(request);
var forecasts = await response.Content.ReadFromJsonAsync<WeatherForecast[]>();
return forecasts;
}
}
}
Loading

0 comments on commit 37b8098

Please sign in to comment.