Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Enable buildpipeline build and add test apps for 4.7 and 4.7.1 #16

Merged

Conversation

rakeshsinghranchi
Copy link
Member

This takes care of the following :

  1. Adding missing 4.7 and 4.7.1 test cases
  2. Simplifies dockerfile using multi-stage feature
  3. Enables ltsc2016 and 1709 tagging
  4. Enables buildpipeline
  5. Enables manifest based tagging

This makes PR #15 obsolete.

Pipeline build definition : https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_apps/hub/ms.vss-ciworkflow.build-ci-hub?_a=edit-build-definition&id=7948

@@ -0,0 +1,26 @@
FROM microsoft/dotnet-framework:4.7 as builder
Copy link
Member

Choose a reason for hiding this comment

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

Last week microsoft/dotnet-framework-docker#37 was merged. These new build images should be used here. It would greatly simplify the Dockerfiles and the time to build them. Should be as simple as:

microsoft/dotnet-framework-build:4.7.1
WORKDIR /app
COPY . ./
RUN ["msbuild.exe", "dotnetapp-4.7.csproj", "/p:Configuration=Release"]

This applies to all the samples except 3.5.

manifest.json Outdated
{
"sharedTags": {
},
"platforms": [
Copy link
Member

Choose a reason for hiding this comment

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

This manifest doesn't look correct? Have you run the image builder tool on this manifest? I think it will fail the validation phase.

Each .NET version should be listed as a separate Image. 3.5 and 4.7.1 should each have two platforms and the 3.5 and 4.7.1 tags should be shared tags and not platform tags. Furthermore, I would consider the standalone versions to be shared tags for all versions even though we are not building them for both server versions. This would better support adding both versions if needed in the future.

- [`4.7-windowsservercore-ltsc2016`, `4.7` (*dotnetapp-4.7/Dockerfile*)](https://github.com/Microsoft/dotnet-framework-docker-samples/blob/dockerhub/dotnetapp-4.7/Dockerfile)
- [`4.6.2-windowsservercore-ltsc2016`, `4.6.2` (*dotnetapp-4.6.2/Dockerfile*)](https://github.com/Microsoft/dotnet-framework-docker-samples/blob/dockerhub/dotnetapp-4.7.1/Dockerfile)
- [`3.5-windowsservercore-ltsc2016`, `3.5` (*dotnetapp-3.5/Dockerfile*)](https://github.com/Microsoft/dotnet-framework-docker-samples/blob/dockerhub/dotnetapp-3.5/Dockerfile)

Copy link
Member

Choose a reason for hiding this comment

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

I think the following comment should be added which exists in our other repos (e.g. https://github.com/Microsoft/dotnet-framework-docker/blob/master/README.md).

Note: .NET Core multi-arch tags, such as 2.0-runtime, have been updated to use nanoserver-1709 images if your host is Windows Server 1709 or higher or Windows 10 Fall Creators Update (Version 1709) or higher. You need Docker 17.10 or later to take advantage of these updated tags.

@rakeshsinghranchi
Copy link
Member Author

rakeshsinghranchi commented Nov 28, 2017

@MichaelSimons , updated the PR with code review comments. PTAL. Test pipe build : https://devdiv.visualstudio.com/DevDiv/_build/index?buildId=1175441&_a=summary

@@ -1,4 +1,4 @@
FROM microsoft/dotnet-framework:3.5
FROM microsoft/dotnet-framework:3.5 as builder
Copy link
Member

@richlander richlander Nov 28, 2017

Choose a reason for hiding this comment

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

This suggests to me that we need to create a 3.5 builder as well. I don't want to ship our asymmetric samples between 3.5 and 4.x (not that these samples are the decision maker!).

Copy link
Member

Choose a reason for hiding this comment

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

I agree

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed . Issue: #17 tracks the related work.

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Member

Choose a reason for hiding this comment

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

I am wondering if we should switch all of our projects to SDK style. That would seem to be a good idea.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a good idea. Issue : #18 tracks this issue now.

@MichaelSimons ,Does this also require updating the build image ?

@rakeshsinghranchi
Copy link
Member Author

@MichaelSimons @richlander , do you have any further comments for this PR ?

@richlander
Copy link
Member

That's it for me. What's your game plan?

@rakeshsinghranchi
Copy link
Member Author

I plan to complete this PR as is and enable the build pipeline ASAP. Next step will be working on improvements as noted in review comments and tracked by issues. Let me know if you have any suggestions.

@richlander
Copy link
Member

By "complete", I assume you mean "merge". Is having these changes in master useful as part of enabling the build pipeline?

@rakeshsinghranchi
Copy link
Member Author

rakeshsinghranchi commented Nov 29, 2017

Yes, I meant "merge". These changes are for dockerhub branch specifically for producing dotnet-framework-samples images. Yes,having single branch will greatly improve the discoverability of the source code. Having these changes in master will also increase & require sample apps parity ( including aspnet,wcf apps ) . I would suggest bringing these changes in phases instead of the major overhaul.

@MichaelSimons
Copy link
Member

With the addition of multi-stage builds and the introduction of the build images, I think we should reconsider the need for the separate dockerhub branch. I think it would be beneficial to have the images we publish on Docker Hub come from the main examples. This is beneficial for customers as well as us (less maintenance). This is the pattern used by the .NET Core samples.

I also am not sure it is necessary to have a sample on Docker Hub for each version. For .NET Core, we only push the latest version.

@rakeshsinghranchi
Copy link
Member Author

Master branch examples are Sdk styled projects for 4.x sample apps. Do we know build images have necessary toolset to build these Sdk based projects?

@richlander
Copy link
Member

Yes, one sample for 4.latest and one for 3.5 is sufficient.

@richlander
Copy link
Member

Question: Now that we're supporting multiple DH repos in the dotnet-framework-docker GH repo, should we just collapse this one into it, too?

@rakeshsinghranchi
Copy link
Member Author

Do you mean enabling dotnet-framework-docker GH repo to build dotnet-framework-docker-samples images or follow the same suggested pattern for dotnet-docker & dotnet-docker-samples as well ? To me , building multiple DH repo images is not very intuitive for users and may complicate the manifest file layout.

@MichaelSimons
Copy link
Member

Question: Now that we're supporting multiple DH repos in the dotnet-framework-docker GH repo, should we just collapse this one into it, too?

My initial reaction is no.

  1. Like @rakeshsinghranchi mentions I think it will complicate the official repo and potentially make it more confusing. It will certainly compound the current issue we are trying to solve on limiting the number of times images get build which are triggered by source changes.
  2. The samples repo contains samples that span the Full Fx/.Net Core. For example the Full Fx samples repo contains a wcfapp sample. The .NET Core samples contain an ASP.NET Core sample. I think an ASP.NET sample should be added to the Full Fx samples.

@MichaelSimons
Copy link
Member

Master branch examples are Sdk styled projects for 4.x sample apps. Do we know build images have necessary toolset to build these Sdk based projects?

The build images currently don't include the .NET Core sdk. The SDK will add another 282 MB assuming we skip the local package cache which I don't think would be needed in this full fx context. Are there other parts of the the sdk which could be trimmed down for this usage? This is where the work to break down the .NET Core sdk into components would be desirable.

@MichaelSimons
Copy link
Member

I logged microsoft/dotnet-framework-docker#49 to track support for Sdk styled projects.

@rakeshsinghranchi
Copy link
Member Author

My understanding is as follow :

  1. Publish .NET 3.5 and .NET 4.7.1 samples image only in DH . Does keeping .NET 4.latest mean deleting older .NET 4.x versions? If not, we will end up leaving images that are not patched.
  2. Preference is to have single branch ( move away from dockerhub to master ) . This will require updating the existing SDK styled samples to old styled samples. Eventually,we want to move to SDK styled samples once Build images don't support building SDK styled projects dotnet-framework-docker#49 is resolved.
  3. We do not want to consolidate dotnet-framework-docker-samples images built from dotnet-framework-docker GH. This will be complicate official repo and confuse users.

What is your take on #1 and #2 ? If we all agree, I will go ahead and merge this PR as is and once microsoft/dotnet-framework-docker#49 is available, will switch from dockerhub to master then.

@MichaelSimons
Copy link
Member

Publish .NET 3.5 and .NET 4.7.1 samples image only in DH . Does keeping .NET 4.latest mean deleting older .NET 4.x versions? If not, we will end up leaving images that are not patched.

I was thinking that once a new .NET Fx version is available, we would publish a new sample image to DH, tag it with a new tag that matches the runtime, add it to the readme and remove the previous tag from the readme. The tag would still exist as is for eternity. My view is this is reasonable behavior for samples.

Preference is to have single branch ( move away from dockerhub to master ) . This will require updating the existing SDK styled samples to old styled samples. Eventually,we want to move to SDK styled samples once microsoft/dotnet-framework-docker#49 is resolved.

We should defer the branch consolidation until the build image supports the SDK based projects. We shouldn't be changing the samples in master to the old style. I think this is what you are proposing If we all agree, I will go ahead and merge this PR as is and once Microsoft/dotnet-framework-docker#49 is available, will switch from dockerhub to master then.

@rakeshsinghranchi
Copy link
Member Author

We should defer the branch consolidation until the build image supports the SDK based projects. We shouldn't be changing the samples in master to the old style. I think this is what you are proposing If we all agree, I will go ahead and merge this PR as is and once microsoft/dotnet-framework-docker#49 is available, will switch from dockerhub to master then.
Yes. @MichaelSimons, do you have any further comments. Will wait for your sign-off before merging this.

@MichaelSimons
Copy link
Member

@rakeshsinghranchi - were you going to update the PR to only contain the 3.5 and 4.7.1 samples?

@rakeshsinghranchi
Copy link
Member Author

@rakeshsinghranchi - were you going to update the PR to only contain the 3.5 and 4.7.1 samples?
Pushed another commit to remove 4.6.2 and 4.7 samples

Copy link
Member

@MichaelSimons MichaelSimons left a comment

Choose a reason for hiding this comment

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

Looks good - just one minor comment.

FROM microsoft/dotnet-framework:3.5

WORKDIR /app

Copy link
Member

Choose a reason for hiding this comment

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

Nit: I don't think all of the white space between every instruction is necessary. Consider reducing and making it consistent with the 4.7.1 Dockerfile.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants