Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[439] File renaming refactoring #453

Merged
merged 4 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,21 @@
</ConvertNoneToPublishDir>
<ItemGroup>
<IntermediateAssembly Remove="@(IntermediateAssembly)" />
<__tRunnerPath Include="@(__PublishDirs)" Condition="Exists('%(__PublishDirs.Identity)/tRunner') and '%(__PublishDirs.TargetPath)' == 'tRunner'" />
<__tRunnerPath Include="@(__PublishDirs)" Condition="Exists('%(__PublishDirs.Identity)/tes-runner') and '%(__PublishDirs.TargetPath)' == 'tes-runner'" />
<__tRunnerFiles Include="%(__tRunnerPath.FullPath)\**\*" />
<__tesapiScriptsPath Include="@(__PublishDirs->'%(FullPath)\scripts')" Condition="Exists('%(__PublishDirs.Identity)/tesapi.dll') and '%(__PublishDirs.TargetPath)' == 'tesapi.dll'" />
</ItemGroup>
<Copy SourceFiles="@(__tRunnerFiles)"
DestinationFolder="@(__tesapiScriptsPath)"
SkipUnchangedFiles="false"
Condition=" '%(__tRunnerFiles.Filename)%(__tRunnerFiles.Extension)' == 'tRunner' "/>
<GenerateMD5 InputFile="@(__tesapiScriptsPath->'%(FullPath)\tRunner')">
Condition=" '%(__tRunnerFiles.Filename)%(__tRunnerFiles.Extension)' == 'tes-runner' "/>
<GenerateMD5 InputFile="@(__tesapiScriptsPath->'%(FullPath)\tes-runner')">
<Output TaskParameter="MD5Hash" PropertyName="__TRunnerMD5Hash" />
</GenerateMD5>
<WriteLinesToFile Lines="$(__TRunnerMD5Hash)" File="@(__tesapiScriptsPath->'%(FullPath)\TRunnerMD5Hash.txt')" WriteOnlyWhenDifferent="true" Overwrite="true" />
<WriteLinesToFile Lines="$(__TRunnerMD5Hash)" File="@(__tesapiScriptsPath->'%(FullPath)\tes-runnerMD5hash.txt')" WriteOnlyWhenDifferent="true" Overwrite="true" />
<ItemGroup>
<FileWrites Include="@(__tesapiScriptsPath->'%(FullPath)\TRunnerMD5Hash.txt')" />
<FileWrites Include="@(__tesapiScriptsPath->'%(FullPath)\tRunner')" />
<FileWrites Include="@(__tesapiScriptsPath->'%(FullPath)\tes-runnerMD5hash.txt')" />
<FileWrites Include="@(__tesapiScriptsPath->'%(FullPath)\tes-runner')" />
</ItemGroup>
</Target>

Expand Down
2 changes: 1 addition & 1 deletion src/Tes.Runner/Events/EventsPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class EventsPublisher : IAsyncDisposable
public const string DownloadEndEvent = "downloadEnd";
public const string UploadStartEvent = "uploadStart";
public const string UploadEndEvent = "uploadEnd";
public const string ExecutorStartEvent = "executorStar";
public const string ExecutorStartEvent = "executorStart";
public const string ExecutorEndEvent = "executorEnd";
public const string TaskCompletionEvent = "taskCompleted";

Expand Down
2 changes: 1 addition & 1 deletion src/Tes.RunnerCLI/Commands/CommandFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Tes.RunnerCLI.Commands
{
internal class CommandFactory
{
const string DefaultTaskDefinitionFile = "TesTask.json";
const string DefaultTaskDefinitionFile = "runner-task.json";

private static readonly Uri DefaultDockerUri = new("unix:///var/run/docker.sock");

Expand Down
10 changes: 5 additions & 5 deletions src/Tes.RunnerCLI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ The TES Node Runner is a command line executable that takes several arguments. I
The following command executes the TES task in the default location - the same directory as the executable.

```bash
./tRunner
./tes-runner
```

There are several options that can be provided:

```bash

Options:
-f, --file <file> (REQUIRED) The file with the task definition [default: TesTask.json]
-f, --file <file> (REQUIRED) The file with the task definition [default: runner-task.json]
-b, --blockSize <blockSize> Blob block size in bytes [default: 10485760]
-w, --writers <writers> Number of concurrent writers [default: 10]
-r, --readers <readers> Number of concurrent readers [default: 10]
Expand Down Expand Up @@ -116,16 +116,16 @@ The download and upload operations are optimized for performance and large files

```bash
Usage:
tRunner download | upload [options]
tes-runner download | upload [options]

Options:
-f, --file <file> (REQUIRED) The file with the task definition [default: TesTask.json]
-f, --file <file> (REQUIRED) The file with the task definition [default: runner-task.json]
-b, --blockSize <blockSize> Blob block size in bytes [default: 10485760]
-w, --writers <writers> Number of concurrent writers [default: 10]
-r, --readers <readers> Number of concurrent readers [default: 10]
-c, --bufferCapacity <bufferCapacity> Pipeline buffer capacity [default: 10]
-v, --apiVersion <apiVersion> Azure Storage API version [default: 2020-10-02]
-f, --file <file> (REQUIRED) The file with the task definition [default: TesTask.json]
-f, --file <file> (REQUIRED) The file with the task definition [default: runner-task.json]
-b, --blockSize <blockSize> Blob block size in bytes [default: 10485760]
-w, --writers <writers> Number of concurrent writers [default: 10]
-r, --readers <readers> Number of concurrent readers [default: 10]
Expand Down
4 changes: 2 additions & 2 deletions src/Tes.RunnerCLI/Tes.RunnerCLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>tRunner</AssemblyName>
<AssemblyName>tes-runner</AssemblyName>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifiers>linux-x64</RuntimeIdentifiers>
</PropertyGroup>
Expand All @@ -19,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<None Update="TesTask.json">
<None Update="runner-task.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions src/TesApi.Tests/BatchSchedulerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
using TesApi.Web.Management;
using TesApi.Web.Management.Models.Quotas;
using TesApi.Web.Storage;
using ResourceFile = Microsoft.Azure.Batch.ResourceFile;

namespace TesApi.Tests
{
Expand Down Expand Up @@ -1785,7 +1784,7 @@ private static Func<IEnumerable<(string Key, string Value)>> GetMockConfig(bool

private static IEnumerable<FileToDownload> GetFilesToDownload(Mock<IAzureProxy> azureProxy)
{
var downloadFilesScriptContent = (string)azureProxy.Invocations.FirstOrDefault(i => i.Method.Name == nameof(IAzureProxy.UploadBlobAsync) && i.Arguments[0].ToString().Contains("/TesTask.json"))?.Arguments[1];
var downloadFilesScriptContent = (string)azureProxy.Invocations.FirstOrDefault(i => i.Method.Name == nameof(IAzureProxy.UploadBlobAsync) && i.Arguments[0].ToString().Contains("/runner-task.json"))?.Arguments[1];

if (string.IsNullOrEmpty(downloadFilesScriptContent))
{
Expand Down
4 changes: 2 additions & 2 deletions src/TesApi.Web/BatchNodeScriptBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ public class BatchNodeScriptBuilder
/// <summary>
/// Name of the TES runner binary file
/// </summary>
public const string NodeTaskRunnerFilename = "tRunner";
public const string NodeTaskRunnerFilename = "tes-runner";
/// <summary>
/// Name of the TES runner task definition file
/// </summary>
public const string NodeRunnerTaskDefinitionFilename = "TesTask.json";
public const string NodeRunnerTaskDefinitionFilename = "runner-task.json";

private readonly StringBuilder batchScript;
private bool useMetricsFile;
Expand Down
4 changes: 2 additions & 2 deletions src/TesApi.Web/BatchScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public partial class BatchScheduler : IBatchScheduler
private const string TesExecutionsPathPrefix = "/tes-internal";
private const string CromwellScriptFileName = "script";
private const string StartTaskScriptFilename = "start-task.sh";
private const string NodeTaskRunnerFilename = "tRunner";
private const string NodeTaskRunnerMD5HashFilename = "TRunnerMD5Hash.txt";
private const string NodeTaskRunnerFilename = "tes-runner";
private const string NodeTaskRunnerMD5HashFilename = "tes-runnerMD5hash.txt";
private static readonly Regex queryStringRegex = GetQueryStringRegex();
private readonly string dockerInDockerImageName;
private readonly string cromwellDrsLocalizerImageName;
Expand Down
6 changes: 3 additions & 3 deletions src/TesApi.Web/Runner/TaskExecutionScriptingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ namespace TesApi.Web.Runner
/// </summary>
public class TaskExecutionScriptingManager
{
private const string NodeTaskFilename = "TesTask.json";
private const string NodeTaskRunnerFilename = "tRunner";
private const string NodeTaskFilename = "runner-task.json";
private const string NodeTaskRunnerFilename = "tes-runner";
private const string BatchScriptFileName = "batch_script";

private readonly IStorageAccessProvider storageAccessProvider;
Expand Down Expand Up @@ -84,7 +84,7 @@ private async Task TryUploadServerTesTask(TesTask tesTask, CancellationToken can
DefaultValueHandling = DefaultValueHandling.Ignore
});

await UploadContentAsBlobToInternalTesLocationAsync(tesTask, severTesTaskContent, "ServerTesTask.json",
await UploadContentAsBlobToInternalTesLocationAsync(tesTask, severTesTaskContent, "server-tes-task.json",
cancellationToken);
}
catch (Exception e)
Expand Down
Loading