Skip to content

Commit 817088c

Browse files
authored
Incorporate grid service websrv into program (#343)
#!components: grid-bot, grid-bot-recovery #!deployable-components: grid-bot * #342: Grid.Bot.Grpc ~ New assembly: Grid,.Bot.Web, pulls gRPC code out of utility and main app. ~ Remove gRPC server settings from Global and create new provider called Grpc (located grid-bot-settings/grpc) ~ Move custom MS logger adaptor to utility. * ~ Add new settings to avatar provider: 1. AvatarApiUrl -> Url for the avatar fetch API. 2. AvatarFetchCacheTraversalInterval -> Interval on which to traverse the avatar fetch cache to search for stale entries. 3. AvatarFetchCacheEntryTtl -> TTL for each avatar-fetch cache entry. 4. AvatarFetchShouldDowngradeBodyColorsFormat -> Determines whether or not body colors are downgraded to pre v2 (v1.1). ~ Drop client-settings-client ~ Add client-settings: 1. ClientSettingsViaVault -> Determines if data access should be via Vault or local JSON files. 2. ClientSettingsVaultMount -> Gets the Vault mount for the client settings. 3. ClientSettingsVaultPath -> Gets the Vault path for the client settings. 4. ClientSettingsVaultAddress -> Gets the vault address for the client settings. 5. ClientSettingsVaultToken -> Gets the vault token for the client settings. 6. ClientSettingsRefreshInterval -> Gets the interval for the refresh ahead within the client settings factory. 7. ClientSettingsFilePath -> Gets the absolute path to the client settings configuration file if ClientSettingsViaVaultis false. 8. ClientSettingsApplicationDependencies -> Resolves the dependency maps for specific application setting 9. PermissibleReadApplications -> A list of application names that can be read from the API endpoints. 10. Gets a command seperated list of API keys that can be used for reading non-permissable applications, as well as executing privalaged commands. ~ Update discord: 1. Update BotToken to not throw if DEBUG and empty. 2. DebugBotDisabled -> Disables logging into the bot. ~ Add web: 1. IsWebServerEnabled -> Determines if the web server is enabled 2. WebServerBindAddress -> Determines the bind address for the web server 3. IsWebServerBehindProxy -> Determines if the web server is nehind a proxy server (e.g. Traefik, HAProxy) 4. WebServerAllowedProxyRanges -> IP ranges that are permitted to set forwarded headers. 5. WebServerUseTls -> Determines if the web server should use TLS. 6. WebServerCertificatePath -> Path for web server cert. 7. WebServerCertificatePassword -> Password for server cert. 8. WebServerLoggerName -> Name for the web server logger 9. WebServerLoggerLevel -> Log level for the web server logger. ~ Bump Discord.Net version. * #340 #341: Shared.Utility ~ Client settings implementation 1. ClientSettingsFactory -> A factory that provides clients (Client, Grid Server) with sutiable settings from a source such as Vault, S3 or JSON. 2. ClientSettingsNameHelper -> Helper for determing filter statuses, extracting name information such as filter types and data types. 3. FilteredValues -> Normal client settings values, only they are an override to another value for specific places or datacenters. ~ Add utility classes like: 1. LazyWithRetry -> System.Lazy but with retry capabilities 2. RefreshAhead -> Class used for facilitating refresh ahead caching. ~ Add dictionary extensions for merging dictionaries. ~ Bump Discord.Net ~ Drop gRPC references. * #340 #341: Grid.Bot.Web ~ Very basic implementation of grid-service-websrv, it only supplies what grid servers require. 1. Avatar -> If rbx-thumbnails is disabled, and native grid server character rendering is enabled, this endpoint returns JSON information used for rendering characters (e.g. accoutrements, body colors). 2. Client Settings -> This contains endpoints for downloading crucial client settings onto grid-servers, this is technically the only required endpoint for grid-servers to function. 3. VersionCompatibility -> Returns an empty array, required otherwise grid-servers would crash. ~ Add middleware: 1. UnhandledExceptionMiddleware -> Similar to the recovery_middleware 2. Numerous metrics collection middleware. ~ Extensions: 1. HttpContext -> Extensions for HTTP context, HTTP requests and HTTP responses. 2. Service provider extensions. * #340 #341: Shared.Commands ~ Update client settings private command to use client settings factory instead of client settings client ~ Bump Discord.Net * Shared.Events ~ Bump Discord.Net * Grid.Bot.Recovery ~ Bump Discord.Net * ~ Clean up runner code by removing gRPC embedded. ~ Add client settings factory to the service provider. ~ Allow DEBUG builds to bypass token checks * #340 #341: Fix port conflicts
1 parent a712237 commit 817088c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2704
-381
lines changed

services/grid-bot/.component.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,40 @@ deployment:
4141
static: 8101
4242
grpc:
4343
static: 5000
44+
http:
45+
static: 8888
4446
services:
45-
- name: grid-bot-${{ env.NOMAD_SHORT_ENVIRONMENT }}
47+
- name: ${{ env.NOMAD_ENVIRONMENT }}-grid-bot
4648
port: metrics
4749
tags:
4850
- ${{ env.NOMAD_ENVIRONMENT }}
4951
checks:
5052
- type: http
5153
path: /metrics
54+
55+
- name: ${{ env.NOMAD_ENVIRONMENT }}-grid-bot-web
56+
port: http
57+
tags:
58+
- ${{ env.NOMAD_ENVIRONMENT }}
59+
- "traefik.enable=true"
60+
- "traefik.http.routers.${{ env.NOMAD_ENVIRONMENT }}-grid-bot-web-http.rule=(HostRegexp(`{host:[a-zA-Z]+}.sitetest4.robloxlabs.com`) || Host(`versioncompatibility.api.sitetest4.robloxlabs.com`))"
61+
- "traefik.http.routers.${{ env.NOMAD_ENVIRONMENT }}-grid-bot-web-http.entrypoints=http"
62+
checks:
63+
- type: http
64+
path: /health
65+
66+
- name: ${{ env.NOMAD_ENVIRONMENT }}-grid-bot-web-https
67+
port: http
68+
tags:
69+
- ${{ env.NOMAD_ENVIRONMENT }}
70+
- "traefik.enable=true"
71+
- "traefik.http.routers.${{ env.NOMAD_ENVIRONMENT }}-grid-bot-web-https.rule=(HostRegexp(`{host:[a-zA-Z]+}.sitetest4.robloxlabs.com`) || Host(`versioncompatibility.api.sitetest4.robloxlabs.com`))"
72+
- "traefik.http.routers.${{ env.NOMAD_ENVIRONMENT }}-grid-bot-web-https.entrypoints=https"
73+
- "traefik.http.routers.${{ env.NOMAD_ENVIRONMENT }}-grid-bot-web-https.tls=true"
74+
checks:
75+
- type: http
76+
path: /health
77+
5278
volumes:
5379
- '/var/run/docker.sock:/var/run/docker.sock'
5480
- '/tmp/.X11-unix:/tmp/.X11-unix'

services/grid-bot/grid-bot-bare.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared.Settings", "lib\sett
1717
EndProject
1818
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared.Utility", "lib\utility\Shared.Utility.csproj", "{AB0EF72D-505F-4F0E-94AD-BA236218CEB7}"
1919
EndProject
20+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grid.Bot.Grpc", "lib\grpc\Grid.Bot.Grpc.csproj", "{BDC40A33-FB7D-4B64-8FD1-662092858DA8}"
21+
EndProject
22+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grid.Bot.Web", "lib\web\Grid.Bot.Web.csproj", "{EDD50BF5-0E1D-48FB-9BBB-61A9B3CE7642}"
23+
EndProject
2024
Global
2125
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2226
Debug|Any CPU = Debug|Any CPU
@@ -43,6 +47,14 @@ Global
4347
{AB0EF72D-505F-4F0E-94AD-BA236218CEB7}.Debug|Any CPU.Build.0 = debug|Any CPU
4448
{AB0EF72D-505F-4F0E-94AD-BA236218CEB7}.Release|Any CPU.ActiveCfg = release|Any CPU
4549
{AB0EF72D-505F-4F0E-94AD-BA236218CEB7}.Release|Any CPU.Build.0 = release|Any CPU
50+
{BDC40A33-FB7D-4B64-8FD1-662092858DA8}.Debug|Any CPU.ActiveCfg = debug|Any CPU
51+
{BDC40A33-FB7D-4B64-8FD1-662092858DA8}.Debug|Any CPU.Build.0 = debug|Any CPU
52+
{BDC40A33-FB7D-4B64-8FD1-662092858DA8}.Release|Any CPU.ActiveCfg = release|Any CPU
53+
{BDC40A33-FB7D-4B64-8FD1-662092858DA8}.Release|Any CPU.Build.0 = release|Any CPU
54+
{EDD50BF5-0E1D-48FB-9BBB-61A9B3CE7642}.Debug|Any CPU.ActiveCfg = debug|Any CPU
55+
{EDD50BF5-0E1D-48FB-9BBB-61A9B3CE7642}.Debug|Any CPU.Build.0 = debug|Any CPU
56+
{EDD50BF5-0E1D-48FB-9BBB-61A9B3CE7642}.Release|Any CPU.ActiveCfg = release|Any CPU
57+
{EDD50BF5-0E1D-48FB-9BBB-61A9B3CE7642}.Release|Any CPU.Build.0 = release|Any CPU
4658
EndGlobalSection
4759
GlobalSection(SolutionProperties) = preSolution
4860
HideSolutionNode = FALSE
@@ -53,5 +65,7 @@ Global
5365
{67005F02-FE69-4DCF-8D29-07989E8B4C18} = {4FA0281C-7E8F-45E6-820E-97554DE934AE}
5466
{425ECFC3-749B-4725-AF7B-A2CC56A06E6B} = {4FA0281C-7E8F-45E6-820E-97554DE934AE}
5567
{AB0EF72D-505F-4F0E-94AD-BA236218CEB7} = {4FA0281C-7E8F-45E6-820E-97554DE934AE}
68+
{BDC40A33-FB7D-4B64-8FD1-662092858DA8} = {4FA0281C-7E8F-45E6-820E-97554DE934AE}
69+
{EDD50BF5-0E1D-48FB-9BBB-61A9B3CE7642} = {4FA0281C-7E8F-45E6-820E-97554DE934AE}
5670
EndGlobalSection
5771
EndGlobal

services/grid-bot/grid-bot.sln

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Configuration", "..\..\lib\
5757
EndProject
5858
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Configuration.Core", "..\..\lib\src\configuration\core\Configuration.Core.csproj", "{0F99E3B7-B8A2-4166-94DD-E14E10B82782}"
5959
EndProject
60-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientSettings.Client", "..\..\lib\src\clients\client-settings-client\ClientSettings.Client.csproj", "{FDE94473-0D43-4FBC-9CDD-E29A3938BC1E}"
61-
EndProject
6260
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Thumbnails.Client", "..\..\lib\src\clients\thumbnails-client\Thumbnails.Client.csproj", "{067AC4F9-F1E9-435B-B837-9A9B05DDD621}"
6361
EndProject
6462
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Users.Client", "..\..\lib\src\clients\users-client\Users.Client.csproj", "{8702A9B1-8180-41FE-A639-AFE807B08512}"
6563
EndProject
64+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grid.Bot.Grpc", "lib\grpc\Grid.Bot.Grpc.csproj", "{C4BAE13A-0315-4B1F-A40F-10CAAD7F184C}"
65+
EndProject
66+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grid.Bot.Web", "lib\web\Grid.Bot.Web.csproj", "{3AC6957F-78D6-4872-A0F1-C927FD545033}"
67+
EndProject
6668
Global
6769
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6870
Debug|Any CPU = Debug|Any CPU
@@ -169,10 +171,6 @@ Global
169171
{0F99E3B7-B8A2-4166-94DD-E14E10B82782}.Debug|Any CPU.Build.0 = debug|Any CPU
170172
{0F99E3B7-B8A2-4166-94DD-E14E10B82782}.Release|Any CPU.ActiveCfg = release|Any CPU
171173
{0F99E3B7-B8A2-4166-94DD-E14E10B82782}.Release|Any CPU.Build.0 = release|Any CPU
172-
{FDE94473-0D43-4FBC-9CDD-E29A3938BC1E}.Debug|Any CPU.ActiveCfg = debug|Any CPU
173-
{FDE94473-0D43-4FBC-9CDD-E29A3938BC1E}.Debug|Any CPU.Build.0 = debug|Any CPU
174-
{FDE94473-0D43-4FBC-9CDD-E29A3938BC1E}.Release|Any CPU.ActiveCfg = release|Any CPU
175-
{FDE94473-0D43-4FBC-9CDD-E29A3938BC1E}.Release|Any CPU.Build.0 = release|Any CPU
176174
{067AC4F9-F1E9-435B-B837-9A9B05DDD621}.Debug|Any CPU.ActiveCfg = debug|Any CPU
177175
{067AC4F9-F1E9-435B-B837-9A9B05DDD621}.Debug|Any CPU.Build.0 = debug|Any CPU
178176
{067AC4F9-F1E9-435B-B837-9A9B05DDD621}.Release|Any CPU.ActiveCfg = release|Any CPU
@@ -181,6 +179,14 @@ Global
181179
{8702A9B1-8180-41FE-A639-AFE807B08512}.Debug|Any CPU.Build.0 = debug|Any CPU
182180
{8702A9B1-8180-41FE-A639-AFE807B08512}.Release|Any CPU.ActiveCfg = release|Any CPU
183181
{8702A9B1-8180-41FE-A639-AFE807B08512}.Release|Any CPU.Build.0 = release|Any CPU
182+
{C4BAE13A-0315-4B1F-A40F-10CAAD7F184C}.Debug|Any CPU.ActiveCfg = debug|Any CPU
183+
{C4BAE13A-0315-4B1F-A40F-10CAAD7F184C}.Debug|Any CPU.Build.0 = debug|Any CPU
184+
{C4BAE13A-0315-4B1F-A40F-10CAAD7F184C}.Release|Any CPU.ActiveCfg = release|Any CPU
185+
{C4BAE13A-0315-4B1F-A40F-10CAAD7F184C}.Release|Any CPU.Build.0 = release|Any CPU
186+
{3AC6957F-78D6-4872-A0F1-C927FD545033}.Debug|Any CPU.ActiveCfg = debug|Any CPU
187+
{3AC6957F-78D6-4872-A0F1-C927FD545033}.Debug|Any CPU.Build.0 = debug|Any CPU
188+
{3AC6957F-78D6-4872-A0F1-C927FD545033}.Release|Any CPU.ActiveCfg = release|Any CPU
189+
{3AC6957F-78D6-4872-A0F1-C927FD545033}.Release|Any CPU.Build.0 = release|Any CPU
184190
EndGlobalSection
185191
GlobalSection(SolutionProperties) = preSolution
186192
HideSolutionNode = FALSE
@@ -211,8 +217,9 @@ Global
211217
{67C7D321-75F2-4ADC-9C24-BC02E345E0E0} = {6A79B4E5-D433-4FCF-9E6E-AED94F97099D}
212218
{689B303F-6238-4F1A-8F24-2C8B4FE6C8BD} = {6A79B4E5-D433-4FCF-9E6E-AED94F97099D}
213219
{0F99E3B7-B8A2-4166-94DD-E14E10B82782} = {6A79B4E5-D433-4FCF-9E6E-AED94F97099D}
214-
{FDE94473-0D43-4FBC-9CDD-E29A3938BC1E} = {6A79B4E5-D433-4FCF-9E6E-AED94F97099D}
215220
{067AC4F9-F1E9-435B-B837-9A9B05DDD621} = {6A79B4E5-D433-4FCF-9E6E-AED94F97099D}
216221
{8702A9B1-8180-41FE-A639-AFE807B08512} = {6A79B4E5-D433-4FCF-9E6E-AED94F97099D}
222+
{C4BAE13A-0315-4B1F-A40F-10CAAD7F184C} = {4FA0281C-7E8F-45E6-820E-97554DE934AE}
223+
{3AC6957F-78D6-4872-A0F1-C927FD545033} = {4FA0281C-7E8F-45E6-820E-97554DE934AE}
217224
EndGlobalSection
218225
EndGlobal

0 commit comments

Comments
 (0)