Giter Site home page Giter Site logo

Comments (4)

matthchr avatar matthchr commented on August 17, 2024

Hi,
Which solution are you talking about specifically?

We will update the samples to 5.0.0 shortly, but in the meantime they are not targeting 5.0.0 they are targeting 4.0.1 (and thus they should all compile).

from azure-batch-samples.

alpinemountain avatar alpinemountain commented on August 17, 2024

Thanks. It's this one:

https://github.com/Azure/azure-batch-samples/tree/master/CSharp/ArticleProjects/DotNetTutorial

https://azure.microsoft.com/en-us/documentation/articles/batch-dotnet-get-started/

In 5.0.0, how should this line be re-written?

bool timedOut = await taskStateMonitor.WhenAllAsync(tasks, TaskState.Completed, timeout);

from azure-batch-samples.

matthchr avatar matthchr commented on August 17, 2024

Generally speaking we don't have the samples track the most up to date release immediately (it usually lags by a few days). During this time period the samples should still work against the version of the Azure.Batch package specified in their packages.config (which right now is 4.0.1).

Azure.Batch 5.0.0 just shipped last week, and we haven't updated the samples yet because there is a 5.0.1 coming (today). Once 5.0.1 drops later today we'll move all of the samples to 5.0.1, but that might not fully merge in for a few days because we have to coordinate an article update as well (otherwise the getting started article would get out of sync with its backing sample)

So in the interim I think your question really is, what should you change the broken line(s) to?

The code was this:

            TaskStateMonitor taskStateMonitor = batchClient.Utilities.CreateTaskStateMonitor();
            bool timedOut = await taskStateMonitor.WhenAllAsync(tasks, TaskState.Completed, timeout);

            if (timedOut)
            {
                allTasksSuccessful = false;

                await batchClient.JobOperations.TerminateJobAsync(jobId, failureMessage);

                Console.WriteLine(failureMessage);
            }
            else
            {
...

it should now be this in Azure.Batch 5.0.0:

            TaskStateMonitor taskStateMonitor = batchClient.Utilities.CreateTaskStateMonitor();
            try
            {
                await taskStateMonitor.WhenAll(tasks, TaskState.Completed, timeout);
            }
            catch (TimeoutException)
            {
                allTasksSuccessful = false;
                await batchClient.JobOperations.TerminateJobAsync(jobId, failureMessage);
                Console.WriteLine(failureMessage);
            }

            if (allTasksSuccessful)
            {
...

As for your question 2, I believe that between Azure.Storage 6.2.0 and Azure.Storage 7.1.2 there was a breaking change which makes the two incompatible (see their release notes for more details but the key one is here):

  • Blobs: Removed FileMode parameter for UploadFromFile* and AppendFromFile* APIs since there is only 1 valid option (FileMode.Open).

So I would suggest rolling back your Storage dll version to 6.2.0 unless there's a major need to use 7.1.2.

If you really do need 7.1.2 let us know and we can give some suggestions.

from azure-batch-samples.

alpinemountain avatar alpinemountain commented on August 17, 2024

Thanks very much.

The storage line affected is this:

await blobData.UploadFromFileAsync(filePath, FileMode.Open);

It can be fixed by changing this to:

await blobData.UploadFromFileAsync(filePath);

from azure-batch-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.