Skip to content

Commit e131616

Browse files
committed
Encode build options as base64
1 parent c23c1d5 commit e131616

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/Machine/src/Serval.Machine.Shared/Services/NmtClearMLBuildJobFactory.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ public async Task<string> CreateJobScriptAsync(
4141
+ $" 'trg_lang': '{trgLang}',\n"
4242
+ $" 'shared_file_uri': '{baseUri}',\n"
4343
+ $" 'shared_file_folder': '{folder}',\n"
44-
+ (buildOptions is not null ? $" 'build_options': '''{buildOptions}''',\n" : "")
44+
+ (
45+
buildOptions is not null
46+
? $" 'build_options': '''{Convert.ToBase64String(Encoding.UTF8.GetBytes(buildOptions))}''',\n"
47+
: ""
48+
)
4549
// buildRevision + 1 because the build revision is incremented after the build job
4650
// is finished successfully but the file should be saved with the new revision number
4751
+ (engine.IsModelPersisted ? $" 'save_model': '{engineId}_{engine.BuildRevision + 1}',\n" : $"")

src/Machine/src/Serval.Machine.Shared/Services/SmtTransferClearMLBuildJobFactory.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ public async Task<string> CreateJobScriptAsync(
3535
+ $" 'build_id': '{buildId}',\n"
3636
+ $" 'shared_file_uri': '{baseUri}',\n"
3737
+ $" 'shared_file_folder': '{folder}',\n"
38-
+ (buildOptions is not null ? $" 'build_options': '''{buildOptions}''',\n" : "")
38+
+ (
39+
buildOptions is not null
40+
? $" 'build_options': '''{Convert.ToBase64String(Encoding.UTF8.GetBytes(buildOptions))}''',\n"
41+
: ""
42+
)
3943
+ $" 'clearml': True\n"
4044
+ "}\n"
4145
+ "run(args)\n";

src/Machine/src/Serval.Machine.Shared/Services/StatisticalClearMLBuildJobFactory.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ public async Task<string> CreateJobScriptAsync(
3535
+ $" 'build_id': '{buildId}',\n"
3636
+ $" 'shared_file_uri': '{baseUri}',\n"
3737
+ $" 'shared_file_folder': '{folder}',\n"
38-
+ (buildOptions is not null ? $" 'build_options': '''{buildOptions}''',\n" : "")
38+
+ (
39+
buildOptions is not null
40+
? $" 'build_options': '''{Convert.ToBase64String(Encoding.UTF8.GetBytes(buildOptions))}''',\n"
41+
: ""
42+
)
3943
+ $" 'clearml': True\n"
4044
+ "}\n"
4145
+ "run(args)\n";

0 commit comments

Comments
 (0)