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

Update Azure Batch C# library to version 5.0 #2226

Merged
merged 30 commits into from
Jul 29, 2016

Conversation

matthchr
Copy link
Member

  • Add FileHelpers library
  • Add support for PATCH

@matthchr
Copy link
Member Author

matthchr commented Jul 27, 2016

Note to reviewers: We have already squashed a bunch of commits, so ideally we don't have to squash any more (there really are ~30 commits worth of work done here).

If that's not okay let us know and we can figure out what we need to do

matthchr and others added 28 commits July 27, 2016 12:44
* Fixed spelling error in Batch behavior manager comments

* Removed obsolete comment in regarding Batch CloudJob committal

* Removed comment about not having a CancellationToken (since we now do)
* Fix RoslynParser dll copies

* Regenerate Batch protocol layer with latest AutoRest
-  Also remove unneeded ConfigureAwait false unit test.
* Azure Batch file conventions library

* Added portable build config (no-op)

* Added NuGet packaging info

* Renamed UnitTests assembly to Tests to work with Azure SDK test discoverer

* Renamed directory to remove redundant prefix
* Regenerated protocol layer from the vnext swagger branch

* updated autorest version

* Fix RegenerateBatch script

* Add NetworkConfiguration and update required constructors

  - Updated the required constructors for the following classes:
    - JobManagerTask
    - JobPreparationTask
    - JobReleaseTask
    - JobSpecification
    - StartTask
  - Add test which ensures Swagger file has right version
  - Update OM code generator constructor order logic
  - Remove extra commas from BatchProperties.json

* Skip BatchClientVersionIsNot9999 test for now
- Remove overload of WhenAllAsync to WhenAll
  - The WhenAll method and its overloads had a weird ambiguity where
    depending on if you included a CancellationToken or not, the return type was
    either Task<bool> or Task.  Removed the Task<bool> overload in order to
    remove this ambiguity.
  - Removed previously Obsolete method WaitAllAsync.
  - Removed WaitAll which returns Task<bool>.
  - Update documentation strings for the WhenAll/WaitAll methods.
  - Refactored existing methods to provide an overload which takes a cancellation token,
    and an overload which takes a timeout.  Removed the overload which takes both.
Termination Reason should be TaskFailed instead of CriticalTaskFailure.
TestUtil new error message  + last observed {cloudJob.State}");
- Reduce integration test runtime by refactoring certificate
   tests.
   - Split certificate test into 2 integration tests and some new
     unit tests as well.
   - Stopped the test from allocating a real VM (which reduces test
     run time).
 - Update InterceptorFactory methods to return a collection in order to
   more easily enable usage.
  - Also change test target VM family type to Dv2
  - Remove unneeded RegenerateBatch command script (the correct one
    lives under the Client folder.
  - Fix some minor test issues.
* Added CloudJob extension method to calculate a SAS URL for the container name (suitable for passing to tasks as an environment variable)

* Added helper for uploading text to a blob (will be handy for task parameter JSON)

* Removed borked comment

* Update Batch file conventions library NuGet package version

* Shorten a long line
* Update documentation in C# generated protocol

* Add script to regenerate batch protocol (Azure#7)

* Add Roslyn parser/code generator (Azure#8)

Add Roslyn parser/code generation

* Regenerate generated protocol with latest AutoRest (Azure#9)

* Batch Add CommitChanges support in object model (Azure#11)

* Comment tidying (Azure#10)

* Fixed spelling error in Batch behavior manager comments

* Removed obsolete comment in regarding Batch CloudJob committal

* Removed comment about not having a CancellationToken (since we now do)

* Regenerate Batch protocol based on newest version of AutoRest (Azure#12)

* Fix RoslynParser dll copies

* Regenerate Batch protocol layer with latest AutoRest

* Added APR to a few Tasks in the BatchProperites file

* Add support for job autocomplete

Squashed commit of the following:

commit 9cc1a68afb1090185fd2c9f006beccc0acfeadf2
Author: Matthew Rollitt <[email protected]>
Date:   Thu Jun 9 09:22:12 2016 +1200

    Started cleaning up a few doc strings

commit a9ebcd69754b81af7db0ed3026feea037ab283d9
Author: Matthew Rollitt <[email protected]>
Date:   Wed Jun 8 13:44:50 2016 +1200

    Updated a few swagger generated files with autorest.0.17.0-Nightly20160601 build

commit 93b3e8be890cd487070fc92c526a4fd3f8ac3b2b
Author: Matthew Rollitt <[email protected]>
Date:   Wed Jun 8 13:28:05 2016 +1200

    Splitting up tests in the BindingStateConstraintUnitTests.

commit 46cb5eb34f8142d25b197c4153885f9a19cc0218
Merge: fbb1e78 17badc2
Author: Matthew Rollitt <[email protected]>
Date:   Tue Jun 7 13:01:27 2016 +1200

    Merge branch 'batch/develop' into batch/feature/job-autocomplete

    # Conflicts:
    #	src/Batch/Src/GeneratedProtocol/Models/CloudJob.cs
    #	src/Batch/Src/GeneratedProtocol/Models/CloudTask.cs
    #	src/Batch/Src/GeneratedProtocol/Models/JobAddParameter.cs
    #	src/Batch/Src/GeneratedProtocol/Models/JobUpdateParameter.cs

commit fbb1e78ad96efd9a730bd89c6fe7e2de25255541
Author: Matthew Rollitt <[email protected]>
Date:   Tue Jun 7 12:44:24 2016 +1200

    First Code review changes,

commit 76d7e242db5742da96d904aff33ba5c56228177e
Author: Matthew Rollitt <[email protected]>
Date:   Tue May 31 13:06:01 2016 +1200

    removed remarksComment = null from batchProperties.json

commit 915c2d48a60ff7b45b640fafccc87f52a39285d8
Author: Matthew Rollitt <[email protected]>
Date:   Tue May 31 13:02:11 2016 +1200

    Forgot copyright notice

commit afc3cb84034ae53047ac86740219591c32605b01
Author: Matthew Rollitt <[email protected]>
Date:   Tue May 31 12:38:06 2016 +1200

    Added /// into BatchProperties.json file

commit 759d973308ca0da59d43f43040ccec9cc8ad5c62
Author: Matthew Rollitt <[email protected]>
Date:   Tue May 31 11:56:54 2016 +1200

    Used the most recent autorest build

commit 22bb4a9772de67d4d70627c9d589ef90e620aa05
Author: Matthew Rollitt <[email protected]>
Date:   Tue May 31 10:59:44 2016 +1200

    Updated generated protocol layer

commit dc678a2bdcb20423358def2893ae1afd98af3919
Merge: 3e01884 8bb4302
Author: Matthew Rollitt <[email protected]>
Date:   Tue May 31 09:43:51 2016 +1200

    Merge branch 'batch/develop' into batch/feature/job-autocomplete

    Conflicts:
    	src/Batch/Src/GeneratedProtocol/Models/AccountListNodeAgentSkusNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/AccountListNodeAgentSkusOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/AffinityInformation.cs
    	src/Batch/Src/GeneratedProtocol/Models/ApplicationGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ApplicationListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ApplicationListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ApplicationPackageReference.cs
    	src/Batch/Src/GeneratedProtocol/Models/AutoScaleRun.cs
    	src/Batch/Src/GeneratedProtocol/Models/AutoScaleRunError.cs
    	src/Batch/Src/GeneratedProtocol/Models/Certificate.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateAddOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateAddParameter.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateCancelDeletionOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateDeleteOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateReference.cs
    	src/Batch/Src/GeneratedProtocol/Models/CloudJob.cs
    	src/Batch/Src/GeneratedProtocol/Models/CloudPool.cs
    	src/Batch/Src/GeneratedProtocol/Models/CloudTask.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeAddUserOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeDeleteUserOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeDisableSchedulingOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeEnableSchedulingOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeError.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeGetRemoteDesktopOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeRebootOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeReimageOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeUpdateUserOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/DeleteCertificateError.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileDeleteFromComputeNodeOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileDeleteFromTaskOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileGetFromComputeNodeOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileGetFromTaskOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileGetNodeFilePropertiesFromComputeNodeOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileGetNodeFilePropertiesFromTaskOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileListFromComputeNodeNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileListFromComputeNodeOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileListFromTaskNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileListFromTaskOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobAddOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobAddParameter.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobDeleteOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobDisableOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobEnableOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobGetAllJobsLifetimeStatisticsOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobListFromJobScheduleNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobListFromJobScheduleOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobManagerTask.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobPatchOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobPatchParameter.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobReleaseTask.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleAddOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleDeleteOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleDisableOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleEnableOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleExistsOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobSchedulePatchOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleStatistics.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleTerminateOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleUpdateOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobSchedulingError.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobSpecification.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobStatistics.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobTerminateOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobUpdateOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolAddOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolAddParameter.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolDeleteOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolDisableAutoScaleOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolEnableAutoScaleOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolEvaluateAutoScaleOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolExistsOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolGetAllPoolsLifetimeStatisticsOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolListPoolUsageMetricsNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolListPoolUsageMetricsOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolPatchOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolRemoveNodesOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolResizeOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolStopResizeOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolUpdatePropertiesOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolUpgradeOSOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolUsageMetrics.cs
    	src/Batch/Src/GeneratedProtocol/Models/ResizeError.cs
    	src/Batch/Src/GeneratedProtocol/Models/Schedule.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskAddCollectionOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskAddOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskAddParameter.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskDeleteOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskListSubtasksOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskSchedulingError.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskStatistics.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskTerminateOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskUpdateOptions.cs

commit 3e01884e53f3d581b98cedef5b8b521af8bde9cf
Author: Matthew Rollitt <[email protected]>
Date:   Mon May 30 16:49:06 2016 +1200

    Job auto termination code generated code and unit tests added

commit d43eb9291281c3b60885a08a7cfcf2f92aba5009
Author: Matthew Rollitt <[email protected]>
Date:   Wed May 25 14:44:32 2016 +1200

    Job auto termination all objects generating and mock tests working, still need to fix all the doc strings

commit 1ce64d2c6dd234b6096d8f89814cee3ca0d53a45
Author: Matthew Rollitt <[email protected]>
Date:   Tue May 24 10:55:43 2016 +1200

    Job auto termination all objects generating, still need to fix read write access and docs.

commit 3ad10ca111acd11fac71a5e2c4922c7d3ceae4f6
Author: Matthew Rollitt <[email protected]>
Date:   Mon May 23 14:28:58 2016 +1200

    Partial commit: Generated some of the OM code for exitConditions and add job

commit 7e8f3fdedc1b3cb4df9907b849cfea30d1fadc74
Author: Matthew Rollitt <[email protected]>
Date:   Fri May 13 12:25:29 2016 +1200

    Updated generated files with the new /// comments, error codes also added to the generated files

commit 1d88be3207cf5b4ed5d72ff1f3a51960d1d67b17
Merge: 3650344 d5f52e5
Author: Matthew Rollitt <[email protected]>
Date:   Thu May 12 15:20:26 2016 +1200

    Merge branch 'batch/develop' into batch/feature/job-autocomplete

* Documentation string consistency pass

* APR is only on CloudTask and JobManagerTask

* fixed /// comments and a few tests

* Updated a few doc strings and made a few small changes to the UnitTests

* Updated a few docs and tests

* Updating some doc strings

* A few small changes to the tests

* Small doc changes

* regenerated APR.cs

* more doc clean up and  some code changes

* reversed code path in /program.cs

* cleaning up test methods

* started working on int tests for APR on tasks

* Added integration tests.

* reverted spacing

* small clean up of tests before a CR

* code changes from a CR

* rename test name

* Refactoring a few tests

* void to async signatures

* Code review changes

* just a quick clean up

* WaitForJobStateAsync will now just throw an error if it goes over time

* Regenerated protocol layer from the vnext swagger branch

* Revert "Regenerated protocol layer from the vnext swagger branch"

This reverts commit 4e09b33ff630d1bb3e33155fea1c08c737280bd5.

* Regenerated protocol layer based on v0.17.0-Nightly20160629

* updated autorest version

* Fix RegenerateBatch script

* updated doc strings

* Apr on tasks tests

* Re-worked Integration tests

* A few CR changes

* fixing patch tests

* Small clean up

* cleaned up /// comment on JobAction.cs

* few changes based on matt-c suggestions

* removed commented out code

* Removed src/Batch/RegenerateBatch.cmd

* Regenerated the protocol layer from the swagger spec
* Delete accidentally duplicated files

* Fix integration tests

* Regenerate protocol based on final Swagger spec
@hovsepm
Copy link
Contributor

hovsepm commented Jul 27, 2016

@matthchr Please add license header to all the source files.

@matthchr
Copy link
Member Author

Good eye @hovsepm -- will do.

@matthchr
Copy link
Member Author

@hovsepm The test files too?

@matthchr
Copy link
Member Author

@hovsepm License added to the top of the CS files and removed the file you pointed out where we had a comment suggesting that it shouldn't exist.

@kirthik
Copy link
Contributor

kirthik commented Jul 29, 2016

test this please

@matthchr
Copy link
Member Author

@hovsepm Looks like everything is passing now. Thanks @kirthik

@hovsepm hovsepm merged commit 0c67eb5 into Azure:AutoRest Jul 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants