microsoft / service-fabric-issues

This repo is for the reporting of issues found with Azure Service Fabric.
168 stars 21 forks source link

Error installing Service Fabric Runtime in windowsservercore:1709 docker container #711

Closed lurock closed 5 years ago

lurock commented 6 years ago

Here is my docker file:

FROM microsoft/windowsservercore:1709
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# Install visual c++ 2012 SP1 redistributable package
RUN Invoke-WebRequest "http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU1/vcredist_x64.exe" -OutFile "C:\vcredist.exe" -UseBasicParsing; \
    Start-Process "C:\vcredist.exe" -ArgumentList '/install', '/passive' -NoNewWindow -Wait; \
    rm "C:\vcredist.exe"

# Install Service Fabric Runtime
RUN Invoke-WebRequest "http://download.microsoft.com/download/3/2/1/3217654F-6882-4CEA-BD51-49287EDECE9B/MicrosoftServiceFabric.6.0.232.9494.exe" -OutFile "C:\ServiceFabricRuntime.exe" -UseBasicParsing; \
    Start-Process "C:\ServiceFabricRuntime.exe" -ArgumentList '/AcceptEULA', '/QUIET' -NoNewWindow -Wait; \
    rm "C:\ServiceFabricRuntime.exe"

# Install Service Fabric SDK
RUN Invoke-WebRequest "http://download.microsoft.com/download/3/2/1/3217654F-6882-4CEA-BD51-49287EDECE9B/MicrosoftServiceFabricSDK.2.8.232.msi" -OutFile "C:\ServiceFabricSDK.msi" -UseBasicParsing; \
    Start-Process "msiexec" -ArgumentList '/i', 'C:\ServiceFabricSDK.msi', '/passive', '/quiet', '/norestart', '/qn' -NoNewWindow -Wait; \
    rm "C:\ServiceFabricSDK.msi"

The build of this container is failing on installing the Service Fabric Runtime. Here is the FabricSetupLog.log output from installing the Service Fabric Runtime:

FabricSetup.exe invoked with arguments (C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\FabricSetup.exe /operation:install). Current Exe version 6.0.232.9494
Environment information Data Root C:\ProgramData\Microsoft Service Fabric, Log Root C:\ProgramData\Microsoft Service Fabric\Log
Starting service eventlog
Starting service pla
Starting UserGroupManager::Install
UserGroupManager::Install successful
Starting VCRedistManager::Install
VC++ is already installed; returning success.
VCRedistManager::Install successful
Starting RegistryManager::Install
Creating the registry key Software\Microsoft\Service Fabric
Setting the ACLs for the registry key Software\Microsoft\Service Fabric
lockFileName:Service Fabric.lock
Obtained exclusive file Service Fabric.lock
Released exclusive file Service Fabric.lock
Creating the registry key SYSTEM\CurrentControlSet\Services\ESE\Performance
RegistryManager::Install successful
Starting FolderACLManager::Install
Obtained exclusive file C:\ProgramData\Microsoft Service Fabric\daclupdate.lock
Released exclusive file C:\ProgramData\Microsoft Service Fabric\daclupdate.lock
Obtained exclusive file C:\ProgramData\Microsoft Service Fabric\Log\daclupdate.lock
Released exclusive file C:\ProgramData\Microsoft Service Fabric\Log\daclupdate.lock
FolderACLManager::Install successful
Starting EnvironmentManager::Install
EnvironmentManager::Install successful
Starting EventTraceInstaller::Install
EventTraceInstaller::Install successful
Starting CrashDumps::Install
CrashDumps::Install successful
Starting EventLogManager::Install
CreateProcess Successful for CommandLine:wevtutil um "C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\Microsoft-ServiceFabric-Events.man". ProcessId:2808 MainThreadId:2812 ProcessHandle:194
CreateProcess Successful for CommandLine:wevtutil im "C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\Microsoft-ServiceFabric-Events.man" /rf:"C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\FabricResources.dll" /mf:"C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\FabricResources.dll". ProcessId:2844 MainThreadId:2848 ProcessHandle:188
CreateProcess Successful for CommandLine:wevtutil um "C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\Microsoft-ServiceFabric-LeaseEvents.man". ProcessId:2888 MainThreadId:2892 ProcessHandle:1dc
CreateProcess Successful for CommandLine:wevtutil im "C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\Microsoft-ServiceFabric-LeaseEvents.man" /rf:"C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\leaslayr.sys" /mf:"C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\leaslayr.sys". ProcessId:2924 MainThreadId:2928 ProcessHandle:194
CreateProcess Successful for CommandLine:wevtutil um "C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\Microsoft-ServiceFabric-KtlEvents.man". ProcessId:2960 MainThreadId:2964 ProcessHandle:188
CreateProcess Successful for CommandLine:wevtutil im "C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\Microsoft-ServiceFabric-KtlEvents.man" /rf:"C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\KtlEvents.dll" /mf:"C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\KtlEvents.dll". ProcessId:2996 MainThreadId:3000 ProcessHandle:1cc
EventLogManager::Install successful
Starting GACManager::Install
Removing System.Fabric from gac
Adding C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\System.Fabric.dll to gac
Removing Policy.1.0.System.Fabric from gac
Adding C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\Policy.1.0.System.Fabric.dll to gac
Removing Policy.2.0.System.Fabric from gac
Adding C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\Policy.2.0.System.Fabric.dll to gac
Removing Policy.3.0.System.Fabric from gac
Adding C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\Policy.3.0.System.Fabric.dll to gac
Removing Policy.4.0.System.Fabric from gac
Adding C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\Policy.4.0.System.Fabric.dll to gac
Removing Policy.5.0.System.Fabric from gac
Adding C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\Policy.5.0.System.Fabric.dll to gac
Removing System.Fabric.Strings from gac
Adding C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\System.Fabric.Strings.dll to gac
Removing System.Fabric.Dca.Validator from gac
Adding C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\System.Fabric.Dca.Validator.dll to gac
Removing DcaStandardPluginValidator from gac
Adding C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\DcaStandardPluginValidator.dll to gac
Removing System.Fabric.dSTSClient from gac
Adding C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\System.Fabric.dSTSClient.dll to gac
Removing Microsoft.ServiceFabric.Data.Interfaces from gac
Adding C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\Microsoft.ServiceFabric.Data.Interfaces.dll to gac
GACManager::Install successful
Starting DriverInstallManager::Install
Uninstalling Driver: LeasLayr.
Stopping Driver: LeasLayr.
Driver stop exited with permissible errorcode 0x80070424.
Installing Driver: LeasLayr from C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\LeasLayr.sys.
Driver uninstall timed out. This may have downstream impact.
rishirsinha commented 6 years ago

We do not support running SF inside a container as container does not support driver installation. This is why installation failed in the driver install step.

vipul-modi commented 6 years ago

@lurock - could you provide some information on your scenario? Do you want to run service fabric inside the container or you want to deploy / connect to another cluster from the container?

lurock commented 6 years ago

I would like to use the container on my build server to build the package, connect to the cluster and deploy to the package to the cluster. I would rather not install the SDK on my build server directly.

strtdusty commented 6 years ago

This is the same direction we (and I assume many others) are going. Building in docker containers! @lurock doesn't seem to be advocating actually running from the container, just needing the SDK. Unfortunately you need the runtime installed in order to install the SDK.

We have several teams running different versions of the SF SDK. Docker build agents make it simple for us to provide precise build environments tailored to their needs and SDK version without disrupting other teams.

Flern commented 6 years ago

My teams also have a need to build SF applications in Docker containers. Our build servers are limited on VMs due to VM overhead but can spin up containers on demand to meet load. The whole CI pipeline is Docker-based and we are having difficulty supporting SF builds. Ideally we'd like to be able to stand up a dev cluster in a Docker container as well for integration / acceptance testing.

bryanlikes commented 6 years ago

Any movement on this?

Flern commented 6 years ago

@bryanlikes I've been able to stand up Docker containers to perform builds, but that's because I am building with the .NET Core CLI. It seems the SDK is largely needed for the runtime and deployment activities. I do have some unit tests that are failing (we run these on the containers) due to missing FabricCommon.dll. I haven't spent time to try to get past that hurdle.

So we are currently running our CI containers for the builds of individual Actor/Service projects and have VMs assigned for builds / tests / deployment with the .sfproj targets. It's not ideal to say the least. Any feedback from the Service Fabric team would be great.

bryanlikes commented 6 years ago

@Flern, thanks for the reply. That solution seems to miss the benefits of containerized build environments.
We actually had this working great with older version of ServiceFabric and SDK at 5.5.216.0 and 2.5.216. New requirements forced us to move to latest versions of SF and this caused our existing build infrastructure based on containers to be essentially scrapped since we could not create docker images with the newer SF SDK. We also had to use a separate windows server for service fabric app builds which costs more and is less flexible.

Flern commented 6 years ago

@rishirsinha and @VipulM-MSFT Has any discussion taken place on the SF team regarding the desires of many people to deploy SF applications using our container-based CI pipelines? A new version of the SDK and runtime are out and I see no mention of changes to support this in the release notes.

petertiedemann commented 6 years ago

@rishirsinha You mention you don't support installation inside docker containers, but apparently that only goes for windows and not linux, because a "onebox" cluster docker image is available here:

https://hub.docker.com/r/microsoft/service-fabric-onebox/

Are you seriously telling me that i have to move my CI to a Linux based system? We are currently using Appveyor which can only run Windows containers. But apparently i would be able to run my SF tests against a local cluster in say Wercker (linux container based CI)?

rishirsinha commented 6 years ago

@petertiedemann

Yes, my apologies on that. The non-support of SF runtime install inside container is limited to windows. The reason for that is the presence of kernel drivers in windows which are not easy to move away from. We have looked at containerizing SF runtime for windows as well, but the timeline for that is not finalized.

bryanlikes commented 6 years ago

@rishirsinha Is there anyway to install SF sdk without the runtime kernel drivers (I assume they are not needed for building and deploying SF applications). I have no desire to run the SF applications in a docker container, just build and deploy.

rishirsinha commented 6 years ago

Adding @VipulM-MSFT who is working on enabling this soon.

bryanlikes commented 6 years ago

@VipulM-MSFT Do you have any estimate on when it will be possible to install SF SDK in a windows docker container?

bryanlikes commented 6 years ago

@VipulM-MSFT @rishirsinha

Any updates?

Flern commented 6 years ago

@VipulM-MSFT @rishirsinha

Any updates?

bryanlikes commented 6 years ago

@VipulM-MSFT @rishirsinha

Any updates?

ghost commented 6 years ago

I would love to see some progress on this, since we are looking into moving our website (currently around 40 servers) over to Service Fabric and our build/deployment system is Docker based. We don't need to run Service Fabric in Docker, so the runtime isn't a requirement for us. It would be fantastic to be able to install the SDK and be able to deploy to an Azure SF cluster (basically run Publish-NewServiceFabricApplication) from a container.

I'm curious if anyone has found a work around, perhaps bypassing the installer and manually copying the SDK into a container. I'm also wondering if Service Fabric Mesh would help in this scenario, since we are considering moving over to that once it's stable.

ghost commented 6 years ago

Hi all. I've posted my manual solution up on Stack Overflow. Hope this unblocks people until Microsoft is able to improve their installer.

vipul-modi commented 6 years ago

Thank you for your patience on this. We are working on improving the CI/CD scenarios. Today CI/CD is possible through Azure DevOps (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-tutorial-deploy-app-with-cicd-vsts); however the SDK cannot be installed in the container.

We are making investments on various fronts:

A) Ensure that Service Fabric runtime can be installed in the container. (Work items identified and in progress)

B) Separate the Service Fabric SDK from the Runtime (Investigations phase to identify the full set of work items) While this item is in progress, we are considering providing a pre-baked image with Service Fabric SDK (without the runtime) installed that allows you to build and deploy Service Fabric apps.

C) Separate the client library and tools (including the PowerShell) from the runtime requirements.

This allows deploying and managing Service Fabric applications without requiring runtime. We now have following components:

vipul-modi commented 6 years ago

@MikkelHegn and @raunakpandya

mikkelhegn commented 6 years ago

I'm labelling this as a set of enhancements and will follow-up when we have a milestone for the set of features defined above.

vipul-modi commented 5 years ago

Service Fabric SDK 3.3.617 released as part of Service Fabric 6.4 can now be installed in container to build and deploy Service Fabric projects.

The example Dockerfile based on the VS 2017 build tools is available at: https://github.com/VipulM-MSFT/service-fabric-sdk-container/blob/master/3.3.617/Dockerfile

vipul-modi commented 5 years ago

Here is an example repository configured with AppVeyor https://github.com/VipulM-MSFT/service-fabric-windows-patch-installer to build Service Fabric project.

MikeChristensen commented 5 years ago

@VipulM-MSFT Tested this and it's working for us! Thanks so much for fixing this!