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

Support read-only default mounts #3061

Merged
merged 6 commits into from Aug 3, 2020
Merged

Conversation

alex-peck
Copy link
Contributor

Allow default container mounts to be set to read-only.

Changes made to NuGet packages are a result of bumping vss-api-netcore. Tests removed from ChunkerTests.cs is a result of MinPushBufferSize being removed in a BuildXL update.

[InlineData(Chunker.MinPushBufferSize + 0, "3C7D506720601D668D8AD9DE23112591876F3021D411D51F377BF6CF7B2A453C")]
[InlineData(Chunker.MinPushBufferSize + 1, "39FB7E365F622543D01DE46F1BE4F51E870E9CDF4C93A633BD29EE4A24BEDBB0")]
[InlineData(2 * Chunker.MinPushBufferSize - 1, "63B06CEB8ECAA6747F974450446E5072A48E3F26B4AE0192FEC41DDF61B83364")]
[InlineData(2 * Chunker.MinPushBufferSize + 0, "27032B90442309EE9C4098F64AECC9BACD9B481C7A969EECFE2C56D2BDD7CA2B")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on this removal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mentioned it in the description. MinPushBufferSize was removed as a constant in the BuildXL package.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't expect us to have any negative consequences with that but it's good to be cautious of

@@ -4,9 +4,10 @@
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="restsdk" value="https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/nugetvssprivate/nuget/v3/index.json" />
<add key="BuildXL.Selfhost" value="https://pkgs.dev.azure.com/ms/BuildXL/_packaging/BuildXL.Selfhost/nuget/v3/index.json" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this the special library that needed to be added? Can you elaborate on why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vss-api-netcore (the API contracts for ADO) depends on something called BuildXL. BuildXL depends on RocksDbSharp. I published a new version of BuildXL because vss-api-netcore depended on it. However, that new version of BuildXL depended on a new version of RocksDbSharp that was not available in our existing set of NuGet feeds. This new feed allows us to get the newest versions of these packages.

@@ -10,7 +10,7 @@
<OSPlatform>OS_UNKNOWN</OSPlatform>
<OSArchitecture>ARCH_UNKNOWN</OSArchitecture>
<DebugConstant></DebugConstant>
<VssApiVersion>0.5.151-private</VssApiVersion>
<VssApiVersion>0.5.153-private</VssApiVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guessing this was the API change to include getting the isreadyonly vars?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This is the API update the makes the change to the container contract.

@@ -56,6 +57,7 @@ public ContainerInfo(Pipelines.ContainerResource container, Boolean isJobContain
this.MapDockerSocket = container.Properties.Get<bool>("mapDockerSocket", !PlatformUtil.RunningOnWindows);
this._imageOS = PlatformUtil.HostOS;
_pathMappings = new Dictionary<string, string>( PlatformUtil.RunningOnWindows ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal);
this._readOnlyVolumes = container.ReadOnlyMounts != null ? new List<string>(container.ReadOnlyMounts) : null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd consider

this._readOnlyVolumes = container.ReadOnlyMounts != null 
     ? new List<string>(container.ReadOnlyMounts) 
      : new List<string>();

To make the isReadOnlyVolume simpler

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this

@@ -7,7 +7,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" Condition="$(CodeAnalysis)=='true'" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.4.0" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious why we had to upgrade this. The functionality wasn't available in the previous version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Errors were being thrown in the build process because the updated version of BuildXL depended on higher versions of these packages.

@jeschu1
Copy link
Member

jeschu1 commented Jul 31, 2020

@alex-peck the changes LGTM. How hard would it be to add a few unit tests?

@alex-peck
Copy link
Contributor Author

@alex-peck the changes LGTM. How hard would it be to add a few unit tests?

There are no unit tests currently for the container code. There is some more work to be done to be able to test this section. I will track that as a separate feature.

@stephenmichaelf
Copy link
Member

@alex-peck Do we have Build Canary tests that can cover these changes?

@jeschu1
Copy link
Member

jeschu1 commented Aug 3, 2020

@alex-peck Do we have Build Canary tests that can cover these changes?

This would be a good idea. We'd have to do it once the change is deployed though, otherwise the canary tests would fail. What do you think @alex-peck?

@alex-peck
Copy link
Contributor Author

@alex-peck Do we have Build Canary tests that can cover these changes?

Sounds like a good idea

@alex-peck alex-peck merged commit 0f49f54 into master Aug 3, 2020
@alex-peck alex-peck deleted the users/alpeck/readonly_mounts branch August 3, 2020 14:26
mjroghelia pushed a commit that referenced this pull request Aug 20, 2020
This fixes the release build following the latest
update of vss-api-netcore in #3061.

Also updates the release pipeline to support a
"buildStageOnly" flag that makes it easier
to test such changes in the future without having
to temporarily comment out parts of the build.
mjroghelia added a commit that referenced this pull request Aug 20, 2020
This fixes the release build following the latest
update of vss-api-netcore in #3061.

Also updates the release pipeline to support a
"buildStageOnly" flag that makes it easier
to test such changes in the future without having
to temporarily comment out parts of the build.

Co-authored-by: maroghel <maroghel@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants