Skip to content

Commit cc75051

Browse files
Update repository URLs to new locations (#53)
* Update Crucible repository URLs to canonical names Updates repository URLs in scripts/repos.json to use the canonical GitHub repository names with proper casing. This eliminates redirect warnings during git operations and ensures consistency with actual repository names on GitHub. Updated repositories (19 total): - Alloy: alloy.api → Alloy.Api, alloy.ui → Alloy.Ui - Caster: caster.api → Caster.Api, caster.ui → Caster.Ui - Player group: console.ui → Console.Ui, player.api → Player.Api, player.ui → Player.Ui, vm.api → Vm.Api, vm.ui → Vm.Ui - Steamfitter: steamfitter.api → Steamfitter.Api, steamfitter.ui → Steamfitter.Ui - CITE: cite.api → CITE.Api, cite.ui → CITE.Ui - Gallery: gallery.api → Gallery.Api, gallery.ui → Gallery.Ui - Blueprint: blueprint.api → Blueprint.Api, blueprint.ui → Blueprint.Ui - Gameboard: gameboard → Gameboard - TopoMojo: TopoMojo-ui → topomojo-ui (corrected to actual lowercase repo name) * updates sync scritp with same login as clone script regarding repo locations * removes xdebug_filter.php since it is generated by generate-xdebug-filter.sh * Updates AppHost to run npm install for prod mode apps, updates CITE UI path to dist/browser * Make AWS credentials optional for Moodle and fix Steamfitter UI path - Update ReadAwsCredentials() to return null when credentials file doesn't exist - Conditionally set AWS Bedrock environment variables on Moodle container - Add console logging for AWS credential status (found/not found/error) - Fix Steamfitter UI production mode build path (dist/browser) * Skip AWS Bedrock configuration in Moodle when credentials are missing - post_configure.sh: Check for AWS credentials before calling configure_ai_bedrock - setup_environment.php: Fix syntax error (missing closing parenthesis on line 53) This prevents the error: "Failed to configure AWS Bedrock AI provider: Missing required parameters" when AWS credentials are not available. The configure_ai_bedrock section is now only executed if: - AWS_ACCESS_KEY_ID is set - AWS_SECRET_ACCESS_KEY is set - AWS_REGION is set This completes the AWS credentials optional changes started in commit 45ed60b. * fix sync-repos exiting on any repo failure --------- Co-authored-by: Andrew Schlackman <72105194+sei-aschlackman@users.noreply.github.com>
1 parent 84932f7 commit cc75051

File tree

6 files changed

+132
-132
lines changed

6 files changed

+132
-132
lines changed

Crucible.AppHost/AppHost.cs

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private static IResourceBuilder<ExecutableResource> AddAngularUI(
9595
else
9696
{
9797
var buildCommand = string.IsNullOrEmpty(buildArgs) ? "npm run build" : $"npm run build {buildArgs}";
98-
var serveProd = $"if [ ! -d {distPath} ] || [ -z \"$(ls -A {distPath} 2>/dev/null)\" ] || [ -n \"$(find src -newer {distPath} -print -quit)\" ]; then {buildCommand}; fi; npx serve -s {distPath} -l {port}";
98+
var serveProd = $"if [ ! -d {distPath} ] || [ -z \"$(ls -A {distPath} 2>/dev/null)\" ] || [ -n \"$(find src -newer {distPath} -print -quit)\" ]; then npm install && {buildCommand}; fi; npx serve -s {distPath} -l {port}";
9999
ui = builder.AddExecutable(name, "bash", appRoot, "-c", serveProd)
100100
.WithHttpEndpoint(port: port, isProxied: false);
101101
}
@@ -322,7 +322,7 @@ public static void AddCaster(this IDistributedApplicationBuilder builder, IResou
322322

323323
File.Copy($"{builder.AppHostDirectory}/resources/caster.ui.json", $"{casterUiRoot}/src/assets/config/settings.env.json", overwrite: true);
324324

325-
var casterUi = builder.AddAngularUI("caster-ui", casterUiRoot, port: 4310, casterMode);
325+
var casterUi = builder.AddAngularUI("caster-ui", casterUiRoot, port: 4310, casterMode, distPath: "dist/browser");
326326

327327
if (!IsEnabled(casterMode))
328328
{
@@ -433,7 +433,7 @@ public static void AddTopoMojo(this IDistributedApplicationBuilder builder, IRes
433433
// Prod/off mode with fixup-wmks check
434434
var distPath = "dist/topomojo-work/browser";
435435
var fixupCheck = "[ -e node_modules/vmware-wmks/css/css/wmks-all.css ] || [ -d node_modules/vmware-wmks/img/img ]";
436-
var serveProd = $"if {fixupCheck}; then bash tools/fixup-wmks.sh; fi; if [ ! -d {distPath} ] || [ -z \"$(ls -A {distPath} 2>/dev/null)\" ] || [ -n \"$(find src -newer {distPath} -print -quit)\" ]; then npm run build topomojo-work; fi; npx serve -s {distPath} -l 4201";
436+
var serveProd = $"if {fixupCheck}; then bash tools/fixup-wmks.sh; fi; if [ ! -d {distPath} ] || [ -z \"$(ls -A {distPath} 2>/dev/null)\" ] || [ -n \"$(find src -newer {distPath} -print -quit)\" ]; then npm install && npm run build topomojo-work; fi; npx serve -s {distPath} -l 4201";
437437
topoUi = builder.AddExecutable("topomojo-ui", "bash", topoUiRoot, "-c", serveProd)
438438
.WithHttpEndpoint(port: 4201, isProxied: false)
439439
.WithHttpHealthCheck();
@@ -510,7 +510,7 @@ public static void AddSteamfitter(this IDistributedApplicationBuilder builder, I
510510

511511
File.Copy($"{builder.AppHostDirectory}/resources/steamfitter.ui.json", $"{steamfitterUiRoot}/src/assets/config/settings.env.json", overwrite: true);
512512

513-
var steamfitterUi = builder.AddAngularUI("steamfitter-ui", steamfitterUiRoot, port: 4401, steamfitterMode);
513+
var steamfitterUi = builder.AddAngularUI("steamfitter-ui", steamfitterUiRoot, port: 4401, steamfitterMode, distPath: "dist/browser");
514514

515515
if (!IsEnabled(steamfitterMode))
516516
{
@@ -773,11 +773,19 @@ public static void AddMoodle(this IDistributedApplicationBuilder builder, IResou
773773
.WithEnvironment("DB_USER", postgres.Resource.UserNameReference)
774774
.WithEnvironment("DB_PASS", postgres.Resource.PasswordParameter)
775775
.WithEnvironment("DB_HOST", postgres.Resource.PrimaryEndpoint.Property(EndpointProperty.Host))
776-
.WithEnvironment("DB_NAME", moodleDb.Resource.DatabaseName)
777-
.WithEnvironment("AWS_ACCESS_KEY_ID", awsCreds["aws_access_key_id"])
778-
.WithEnvironment("AWS_SECRET_ACCESS_KEY", awsCreds["aws_secret_access_key"])
779-
.WithEnvironment("AWS_SESSION_TOKEN", awsCreds["aws_session_token"])
780-
.WithEnvironment("AWS_REGION", awsCreds["region"])
776+
.WithEnvironment("DB_NAME", moodleDb.Resource.DatabaseName);
777+
778+
// Only set AWS credentials if the credentials file exists
779+
if (awsCreds != null)
780+
{
781+
moodle
782+
.WithEnvironment("AWS_ACCESS_KEY_ID", awsCreds["aws_access_key_id"])
783+
.WithEnvironment("AWS_SECRET_ACCESS_KEY", awsCreds["aws_secret_access_key"])
784+
.WithEnvironment("AWS_SESSION_TOKEN", awsCreds["aws_session_token"])
785+
.WithEnvironment("AWS_REGION", awsCreds["region"]);
786+
}
787+
788+
moodle
781789
// Pass which Crucible services are enabled
782790
.WithEnvironment("CRUCIBLE_PLAYER_ENABLED", IsEnabled(playerMode) ? "1" : "0")
783791
.WithEnvironment("CRUCIBLE_CASTER_ENABLED", IsEnabled(casterMode) ? "1" : "0")
@@ -1024,8 +1032,17 @@ private static void ConfigureXApi<T>(IResourceBuilder<T> resource, string platfo
10241032
.WithEnvironment("XApiOptions__Platform", platform);
10251033
}
10261034

1027-
private static Dictionary<string, string> ReadAwsCredentials()
1035+
private static Dictionary<string, string>? ReadAwsCredentials()
10281036
{
1037+
var homeDir = Environment.GetEnvironmentVariable("HOME") ?? "";
1038+
var credentialsPath = Path.Combine(homeDir, ".aws", "sso-credentials");
1039+
1040+
if (!File.Exists(credentialsPath))
1041+
{
1042+
Console.WriteLine($"AWS credentials file not found at {credentialsPath}. AWS environment variables will not be set.");
1043+
return null;
1044+
}
1045+
10291046
var creds = new Dictionary<string, string>
10301047
{
10311048
["aws_access_key_id"] = "",
@@ -1034,11 +1051,6 @@ private static Dictionary<string, string> ReadAwsCredentials()
10341051
["region"] = "us-east-1"
10351052
};
10361053

1037-
var homeDir = Environment.GetEnvironmentVariable("HOME") ?? "";
1038-
var credentialsPath = Path.Combine(homeDir, ".aws", "sso-credentials");
1039-
1040-
if (!File.Exists(credentialsPath)) return creds;
1041-
10421054
try
10431055
{
10441056
var json = File.ReadAllText(credentialsPath);
@@ -1056,10 +1068,13 @@ private static Dictionary<string, string> ReadAwsCredentials()
10561068

10571069
if (root.TryGetProperty("Region", out var region))
10581070
creds["region"] = region.GetString() ?? "us-east-1";
1071+
1072+
Console.WriteLine($"AWS credentials loaded from {credentialsPath}");
10591073
}
10601074
catch (Exception ex)
10611075
{
10621076
Console.WriteLine($"Warning: Failed to parse AWS credentials from {credentialsPath}: {ex.Message}");
1077+
return null;
10631078
}
10641079

10651080
return creds;

Crucible.AppHost/resources/moodle/post_configure.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,14 @@ execute_section "xAPI Configuration" configure_xapi
390390
execute_section "Crucible Configuration" configure_crucible
391391
execute_section "TopoMojo Configuration" configure_topomojo
392392
execute_section "Course Creation" create_course
393-
execute_section "Configure AWS Bedrock AI Provider" configure_ai_bedrock
393+
394+
# Only configure AWS Bedrock if credentials are available
395+
if [ -n "$AWS_ACCESS_KEY_ID" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ] && [ -n "$AWS_REGION" ]; then
396+
log "AWS credentials found, configuring Bedrock AI provider..."
397+
execute_section "Configure AWS Bedrock AI Provider" configure_ai_bedrock
398+
else
399+
log "AWS credentials not found, skipping Bedrock AI provider configuration"
400+
fi
394401

395402
# On subsequent runs add admin user to the list of site admins
396403
ADMINUSERID=$(moosh user-list | grep admin@localhost | sed -e "s/admin.*(\([0-9]\)),.*/\1/")

Crucible.AppHost/resources/moodle/setup_environment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
enable_auth_oauth2();
5151
break;
5252
case 'configure_ai_bedrock':
53-
if (empty($options['accesskeyid']) || empty($options['secretaccesskey']) || empty($options['sessiontoken'] ||
54-
empty($options['region']) || empty($options['modelid']))) {
53+
if (empty($options['accesskeyid']) || empty($options['secretaccesskey']) || empty($options['sessiontoken']) ||
54+
empty($options['region']) || empty($options['modelid'])) {
5555
cli_error("Missing required parameters. Current values:\n" .
5656
" --accesskeyid={$options['accesskeyid']}\n" .
5757
" --secretaccesskey={$options['secretaccesskey']}\n" .

Crucible.AppHost/resources/moodle/xdebug_filter.php

Lines changed: 0 additions & 47 deletions
This file was deleted.

scripts/repos.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"repos": [
66
{
77
"name": "alloy.api",
8-
"url": "https://github.com/cmu-sei/alloy.api"
8+
"url": "https://github.com/cmu-sei/Alloy.Api"
99
},
1010
{
1111
"name": "alloy.ui",
12-
"url": "https://github.com/cmu-sei/alloy.ui"
12+
"url": "https://github.com/cmu-sei/Alloy.Ui"
1313
}
1414
]
1515
},
@@ -18,11 +18,11 @@
1818
"repos": [
1919
{
2020
"name": "caster.api",
21-
"url": "https://github.com/cmu-sei/caster.api"
21+
"url": "https://github.com/cmu-sei/Caster.Api"
2222
},
2323
{
2424
"name": "caster.ui",
25-
"url": "https://github.com/cmu-sei/caster.ui"
25+
"url": "https://github.com/cmu-sei/Caster.Ui"
2626
}
2727
]
2828
},
@@ -44,23 +44,23 @@
4444
"repos": [
4545
{
4646
"name": "console.ui",
47-
"url": "https://github.com/cmu-sei/console.ui"
47+
"url": "https://github.com/cmu-sei/Console.Ui"
4848
},
4949
{
5050
"name": "player.api",
51-
"url": "https://github.com/cmu-sei/player.api"
51+
"url": "https://github.com/cmu-sei/Player.Api"
5252
},
5353
{
5454
"name": "player.ui",
55-
"url": "https://github.com/cmu-sei/player.ui"
55+
"url": "https://github.com/cmu-sei/Player.Ui"
5656
},
5757
{
5858
"name": "vm.api",
59-
"url": "https://github.com/cmu-sei/vm.api"
59+
"url": "https://github.com/cmu-sei/Vm.Api"
6060
},
6161
{
6262
"name": "vm.ui",
63-
"url": "https://github.com/cmu-sei/vm.ui"
63+
"url": "https://github.com/cmu-sei/Vm.Ui"
6464
}
6565
]
6666
},
@@ -73,7 +73,7 @@
7373
},
7474
{
7575
"name": "topomojo-ui",
76-
"url": "https://github.com/cmu-sei/TopoMojo-ui"
76+
"url": "https://github.com/cmu-sei/topomojo-ui"
7777
}
7878
]
7979
},
@@ -82,11 +82,11 @@
8282
"repos": [
8383
{
8484
"name": "steamfitter.api",
85-
"url": "https://github.com/cmu-sei/steamfitter.api"
85+
"url": "https://github.com/cmu-sei/Steamfitter.Api"
8686
},
8787
{
8888
"name": "steamfitter.ui",
89-
"url": "https://github.com/cmu-sei/steamfitter.ui"
89+
"url": "https://github.com/cmu-sei/Steamfitter.Ui"
9090
}
9191
]
9292
},
@@ -95,11 +95,11 @@
9595
"repos": [
9696
{
9797
"name": "cite.api",
98-
"url": "https://github.com/cmu-sei/cite.api"
98+
"url": "https://github.com/cmu-sei/CITE.Api"
9999
},
100100
{
101101
"name": "cite.ui",
102-
"url": "https://github.com/cmu-sei/cite.ui"
102+
"url": "https://github.com/cmu-sei/CITE.Ui"
103103
}
104104
]
105105
},
@@ -108,11 +108,11 @@
108108
"repos": [
109109
{
110110
"name": "gallery.api",
111-
"url": "https://github.com/cmu-sei/gallery.api"
111+
"url": "https://github.com/cmu-sei/Gallery.Api"
112112
},
113113
{
114114
"name": "gallery.ui",
115-
"url": "https://github.com/cmu-sei/gallery.ui"
115+
"url": "https://github.com/cmu-sei/Gallery.Ui"
116116
}
117117
]
118118
},
@@ -121,11 +121,11 @@
121121
"repos": [
122122
{
123123
"name": "blueprint.api",
124-
"url": "https://github.com/cmu-sei/blueprint.api"
124+
"url": "https://github.com/cmu-sei/Blueprint.Api"
125125
},
126126
{
127127
"name": "blueprint.ui",
128-
"url": "https://github.com/cmu-sei/blueprint.ui"
128+
"url": "https://github.com/cmu-sei/Blueprint.Ui"
129129
}
130130
]
131131
},
@@ -134,7 +134,7 @@
134134
"repos": [
135135
{
136136
"name": "gameboard",
137-
"url": "https://github.com/cmu-sei/gameboard"
137+
"url": "https://github.com/cmu-sei/Gameboard"
138138
},
139139
{
140140
"name": "gameboard-ui",

0 commit comments

Comments
 (0)