Пример #1
0
        //[Test]
        public async void SimpleWorkflowTest()
        {
            if (!File.Exists("batch-config.json") || !File.Exists("storage-config.json"))
            {
                return;
            }

            var batchConfig =
                JsonConvert.DeserializeObject <Configuration.BatchConfiguration>(File.ReadAllText("batch-config.json"));
            var storageConfig =
                JsonConvert.DeserializeObject <Configuration.StorageConfiguration>(
                    File.ReadAllText("storage-config.json"));

            var simpleCommand = Command.NewSimpleCommand("echo 'Hello World'");

            var simpleWorkload =
                new WorkloadSpecification(
                    new FSharpList <WorkloadUnitTemplate>(
                        new WorkloadUnitTemplate(
                            new CommandSet(
                                new FSharpList <CommandWithErrorHandler>(
                                    new CommandWithErrorHandler(simpleCommand, FSharpOption <Command> .None),
                                    FSharpList <CommandWithErrorHandler> .Empty),
                                FSharpList <Command> .Empty),
                            LocalFiles.Zero,
                            false),
                        FSharpList <WorkloadUnitTemplate> .Empty),
                    LocalFiles.Zero,
                    WorkloadArguments.Zero);

            await
            WorkloadOperations.SubmitWorkloadToPoolAsync(
                batchConfig,
                storageConfig,
                Pool.NewNamedPool(
                    new NamedPool(PoolName.NewPoolName("john"), PoolOperations.GetDefaultPoolSpecification)),
                simpleWorkload);
        }
Пример #2
0
        //[Test]
        public async void SimpleWorkflowTest()
        {
            if (!File.Exists("batch-config.json") || !File.Exists("storage-config.json"))
            {
                return;
            }

            var batchConfig =
                JsonConvert.DeserializeObject<Configuration.BatchConfiguration>(File.ReadAllText("batch-config.json"));
            var storageConfig =
                JsonConvert.DeserializeObject<Configuration.StorageConfiguration>(
                    File.ReadAllText("storage-config.json"));

            var simpleCommand = Command.NewSimpleCommand("echo 'Hello World'");

            var simpleWorkload =
                new WorkloadSpecification(
                    new FSharpList<WorkloadUnitTemplate>(
                        new WorkloadUnitTemplate(
                            new CommandSet(
                                new FSharpList<CommandWithErrorHandler>(
                                    new CommandWithErrorHandler(simpleCommand, FSharpOption<Command>.None),
                                    FSharpList<CommandWithErrorHandler>.Empty),
                                FSharpList<Command>.Empty),
                            LocalFiles.Zero,
                            false),
                        FSharpList<WorkloadUnitTemplate>.Empty),
                    LocalFiles.Zero,
                    WorkloadArguments.Zero);

            await
                WorkloadOperations.SubmitWorkloadToPoolAsync(
                    batchConfig,
                    storageConfig,
                    Pool.NewNamedPool(
                        new NamedPool(PoolName.NewPoolName("john"), PoolOperations.GetDefaultPoolSpecification)),
                    simpleWorkload);
        }