diff --git a/workflows/ARCMount/FSharpArcCapsule.cwl b/workflows/ARCMount/FSharpArcCapsule.cwl new file mode 100644 index 0000000000000000000000000000000000000000..260293673e45d57e81855f73c708fd54e75de6af --- /dev/null +++ b/workflows/ARCMount/FSharpArcCapsule.cwl @@ -0,0 +1,26 @@ +cwlVersion: v1.2 +class: CommandLineTool +hints: + DockerRequirement: + dockerPull: mcr.microsoft.com/dotnet/sdk:6.0 +requirements: + - class: InitialWorkDirRequirement + listing: + - entryname: arc + entry: $(inputs.arcDirectory) + writable: true + - class: EnvVarRequirement + envDef: + - envName: DOTNET_NOLOGO + envValue: "true" + - class: NetworkAccess + networkAccess: true +baseCommand: [dotnet, fsi, "./arc/workflows/FSharpArcCapsule/script.fsx"] +inputs: + arcDirectory: + type: Directory +outputs: + output: + type: File + outputBinding: + glob: "./arc/runs/fsResult1/result.csv" \ No newline at end of file diff --git a/workflows/ARCMount/script.fsx b/workflows/ARCMount/script.fsx new file mode 100644 index 0000000000000000000000000000000000000000..155693f823fcdcccff9a5ac13dca26566792945d --- /dev/null +++ b/workflows/ARCMount/script.fsx @@ -0,0 +1,20 @@ +#r "nuget: FSharp.Data, 5.0.2" + +open FSharp.Data +open System.IO + +printfn "%A" (System.IO.Directory.GetCurrentDirectory()) + +let data = + CsvFile + .Load(Path.Combine(System.IO.Directory.GetCurrentDirectory(),"./arc/assays/measurement1/dataset/table.csv")) + .Cache() + +let r = + [ + yield "Sum_1-2" + for row in data.Rows do + yield sprintf "%f" ((row.["value_1"].AsFloat()) + (row.["value_2"].AsFloat())) + ] + +System.IO.File.WriteAllLines("./arc/runs/fsResult1/result.csv",r) \ No newline at end of file diff --git a/workflows/Devcontainer/.gitkeep b/workflows/Devcontainer/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/workflows/Devcontainer/FSharpArcCapsule.cwl b/workflows/Devcontainer/FSharpArcCapsule.cwl new file mode 100644 index 0000000000000000000000000000000000000000..c8c166c78eef9888993113911fde417a9f3dfc81 --- /dev/null +++ b/workflows/Devcontainer/FSharpArcCapsule.cwl @@ -0,0 +1,27 @@ +cwlVersion: v1.2 +class: CommandLineTool +hints: + DockerRequirement: + dockerImageId: "devcontainer" + dockerFile: {$include: "FSharpArcCapsule/Dockerfile"} +requirements: + - class: InitialWorkDirRequirement + listing: + - entryname: arc + entry: $(inputs.arcDirectory) + writable: true + - class: EnvVarRequirement + envDef: + - envName: DOTNET_NOLOGO + envValue: "true" + - class: NetworkAccess + networkAccess: true +baseCommand: [dotnet, fsi, "./arc/workflows/Devcontainer/FSharpArcCapsule/script.fsx"] +inputs: + arcDirectory: + type: Directory +outputs: + output: + type: File + outputBinding: + glob: "./arc/runs/fsResult1/result.csv" \ No newline at end of file diff --git a/workflows/Devcontainer/FSharpArcCapsule/.config/dotnet-tools.json b/workflows/Devcontainer/FSharpArcCapsule/.config/dotnet-tools.json new file mode 100644 index 0000000000000000000000000000000000000000..b0e38abdace3ec27cf077fc88770357028cf3bb6 --- /dev/null +++ b/workflows/Devcontainer/FSharpArcCapsule/.config/dotnet-tools.json @@ -0,0 +1,5 @@ +{ + "version": 1, + "isRoot": true, + "tools": {} +} \ No newline at end of file diff --git a/workflows/Devcontainer/FSharpArcCapsule/.devcontainer/devcontainer.json b/workflows/Devcontainer/FSharpArcCapsule/.devcontainer/devcontainer.json new file mode 100644 index 0000000000000000000000000000000000000000..71ac9e75d231e62f12ced7a5e95f7316bb345f71 --- /dev/null +++ b/workflows/Devcontainer/FSharpArcCapsule/.devcontainer/devcontainer.json @@ -0,0 +1,15 @@ +{ + "name": "F#ARC-Capsule", + "dockerFile": "../Dockerfile", + "appPort": [8080], + "extensions": [ + "ionide.ionide-fsharp", + "ms-vscode.csharp", + "editorconfig.editorconfig", + "ionide.ionide-paket", + "ionide.ionide-fake" + ], + "mounts": [ + "source=${localWorkspaceFolder}/../../,target=/arc,type=bind,consistency=cached" + ] +} \ No newline at end of file diff --git a/workflows/Devcontainer/FSharpArcCapsule/.devcontainer/settings.vscode.json b/workflows/Devcontainer/FSharpArcCapsule/.devcontainer/settings.vscode.json new file mode 100644 index 0000000000000000000000000000000000000000..5b238faefffe25e67dc04d1001fa101f2e7f55d1 --- /dev/null +++ b/workflows/Devcontainer/FSharpArcCapsule/.devcontainer/settings.vscode.json @@ -0,0 +1,3 @@ +{ + "FSharp.fsacRuntime":"netcore" +} \ No newline at end of file diff --git a/workflows/Devcontainer/FSharpArcCapsule/Dockerfile b/workflows/Devcontainer/FSharpArcCapsule/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..982b4cd63f891c635c7e9be78e8e0c6462935e9c --- /dev/null +++ b/workflows/Devcontainer/FSharpArcCapsule/Dockerfile @@ -0,0 +1,10 @@ +#FROM rocker/r-ver:3.4.4 +FROM mcr.microsoft.com/dotnet/sdk:6.0 +#FROM r-base +# Copy endpoint specific user settings into container to specify +# .NET Core should be used as the runtime. +COPY *.devcontainer/settings.vscode.json /root/.vscode-remote/data/Machine/settings.json + +# Install git, process tools +RUN apt-get update && apt-get -y install git procps + diff --git a/workflows/Devcontainer/FSharpArcCapsule/script.fsx b/workflows/Devcontainer/FSharpArcCapsule/script.fsx new file mode 100644 index 0000000000000000000000000000000000000000..155693f823fcdcccff9a5ac13dca26566792945d --- /dev/null +++ b/workflows/Devcontainer/FSharpArcCapsule/script.fsx @@ -0,0 +1,20 @@ +#r "nuget: FSharp.Data, 5.0.2" + +open FSharp.Data +open System.IO + +printfn "%A" (System.IO.Directory.GetCurrentDirectory()) + +let data = + CsvFile + .Load(Path.Combine(System.IO.Directory.GetCurrentDirectory(),"./arc/assays/measurement1/dataset/table.csv")) + .Cache() + +let r = + [ + yield "Sum_1-2" + for row in data.Rows do + yield sprintf "%f" ((row.["value_1"].AsFloat()) + (row.["value_2"].AsFloat())) + ] + +System.IO.File.WriteAllLines("./arc/runs/fsResult1/result.csv",r) \ No newline at end of file diff --git a/workflows/FixedScript/FSharpArcCapsule.cwl b/workflows/FixedScript/FSharpArcCapsule.cwl new file mode 100644 index 0000000000000000000000000000000000000000..e70401e2784c768cec1cb4f28a2c637bee19d733 --- /dev/null +++ b/workflows/FixedScript/FSharpArcCapsule.cwl @@ -0,0 +1,33 @@ +cwlVersion: v1.2 +class: CommandLineTool +hints: + DockerRequirement: + dockerPull: mcr.microsoft.com/dotnet/sdk:6.0 +requirements: + - class: InitialWorkDirRequirement + listing: + - entryname: script.fsx + entry: + $include: script.fsx + - class: EnvVarRequirement + envDef: + - envName: DOTNET_NOLOGO + envValue: "true" + - class: NetworkAccess + networkAccess: true +baseCommand: [dotnet, fsi, script.fsx] +inputs: + firstArg: + type: File + inputBinding: + position: 1 + secondArg: + type: string + inputBinding: + position: 2 + +outputs: + output: + type: File + outputBinding: + glob: "*.csv" \ No newline at end of file diff --git a/workflows/FixedScript/script.fsx b/workflows/FixedScript/script.fsx new file mode 100644 index 0000000000000000000000000000000000000000..581145dd3da657009c1e3c087cd95d756a9cc178 --- /dev/null +++ b/workflows/FixedScript/script.fsx @@ -0,0 +1,22 @@ +#r "nuget: FSharp.Data, 5.0.2" + +open FSharp.Data +open System.IO + +let args : string array = fsi.CommandLineArgs |> Array.tail +let first = args.[0] +let second = args.[1] + +let data = + CsvFile + .Load(first) + .Cache() + +let r = + [ + yield "Sum_1-2" + for row in data.Rows do + yield sprintf "%f" ((row.["value_1"].AsFloat()) + (row.["value_2"].AsFloat())) + ] + +System.IO.File.WriteAllLines(second,r) \ No newline at end of file