fresh2dev/ShinyStudio

State of play for Windows 10

Closed this issue ยท 7 comments

Hi!

So I've been following this work progress for a while and seeing the VS Code and InfluxDB lifted into the environment really brings this up to an 'out of the ordinary' offering. Thank you very much. I've been letting everybody know
[tweet]https://twitter.com/KevinWang009/status/1137553921935724544
In the first version of ShinyStudio you indicated that you had not tested it on a Windows 10 environment. You probably had a chance, or someone else has. I've had success on my mac, and would like to get it going on my Windows 10 OS laptop too, as this will take it one step further into my work environment where it will be valued the most :)
I've had a go of it, switching to Linux containers and just running it into a Master boot. It loads into the environment for admin, but fails when I attempt to go in any of the options.

Looks like the main error for each of them stems from how the volume is being set in the dockerfiles (?)

If you have a suggestion on an edit in the docker compose or dockerfiles please let me know.

Many thanks
Michael

`Error
Status code: 500

Message: Failed to start container

Stack Trace:
eu.openanalytics.containerproxy.ContainerProxyException: Failed to start container
at eu.openanalytics.containerproxy.backend.AbstractContainerBackend.startProxy(AbstractContainerBackend.java:113)
at eu.openanalytics.containerproxy.service.ProxyService.startProxy(ProxyService.java:213)
at eu.openanalytics.shinyproxy.controllers.AppController.getOrStart(AppController.java:109)
at eu.openanalytics.shinyproxy.controllers.AppController.startApp(AppController.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:870)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:776)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:881)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:64)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:94)
at eu.openanalytics.containerproxy.util.ProxyMappingManager$ProxyPathHandler.handleRequest(ProxyMappingManager.java:159)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:336)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.spotify.docker.client.exceptions.DockerRequestException: Request error: POST unix://localhost:80/containers/create: 500, body: {"message":"invalid volume specification: 'C:/Users/mkras/OneDrive/Documents/GitHub/ShinyStudio/content/sites/Site1/_apps:/srv/shiny-server:z'"}

at com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:2838)
at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2721)
at com.spotify.docker.client.DefaultDockerClient.createContainer(DefaultDockerClient.java:740)
at com.spotify.docker.client.DefaultDockerClient.createContainer(DefaultDockerClient.java:722)
at eu.openanalytics.containerproxy.backend.docker.DockerEngineBackend.startContainer(DockerEngineBackend.java:83)
at eu.openanalytics.containerproxy.backend.AbstractContainerBackend.doStartProxy(AbstractContainerBackend.java:129)
at eu.openanalytics.containerproxy.backend.AbstractContainerBackend.startProxy(AbstractContainerBackend.java:110)
... 95 more
Caused by: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:1098)
at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:883)
at org.glassfish.jersey.client.JerseyInvocation.access$500(JerseyInvocation.java:99)
at org.glassfish.jersey.client.JerseyInvocation$2.completed(JerseyInvocation.java:840)
at org.glassfish.jersey.client.ClientRuntime.processResponse(ClientRuntime.java:227)
at org.glassfish.jersey.client.ClientRuntime.access$200(ClientRuntime.java:85)
at org.glassfish.jersey.client.ClientRuntime$2.lambda$response$0(ClientRuntime.java:178)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:312)
at org.glassfish.jersey.client.ClientRuntime$2.response(ClientRuntime.java:178)
at org.glassfish.jersey.apache.connector.ApacheConnector$1.run(ApacheConnector.java:491)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at jersey.repackaged.com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at jersey.repackaged.com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:50)
at jersey.repackaged.com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:37)
at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:487)
at org.glassfish.jersey.client.ClientRuntime.lambda$null$3(ClientRuntime.java:187)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:312)
at org.glassfish.jersey.client.ClientRuntime.lambda$createRunnableForAsyncProcessing$4(ClientRuntime.java:163)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 3 more`

Thanks for spreading the word on this stack! I've not had access to a Windows box, but I'll see about spinning up a VM to test this further. The pertinent part of the error above seems to be:

invalid volume specification: 'C:/Users/mkras/OneDrive/Documents/GitHub/ShinyStudio/content/sites/Site1/_apps:/srv/shiny-server:z

You can try removing all instances of the :z flag, which is only for compatibility with SELinux. Let me know if you have any luck. I'll do my own exploration and let you know what comes up.

Thanks,
Donald

Okay, I think I have a suitable solution. I tried the following in a Windows 10 VM:

  • Docker for Windows (would not start)
  • Docker Toolbox (blue-screened my VM)
  • Docker in WSL (couldn't get Docker service to start)
  • Docker Machine w/ Hyper-V (works!)

Below are the steps I followed in an elevated Powershell session. Please let me know if it works for you and I will add it to the documentation.

# Enable and start Hyper-V, if necessary.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Start-Service vmms -ErrorAction 'Continue'

# Inspect available network adapters and note the name of the desired adapter.
Get-NetAdapter -Physical

# Create external virtual network interface in Hyper-V based on desired net adapter name.
New-VMSwitch -name "Docker Network" -NetAdapterName "<Adapter Name>" -AllowManagementOs $true

# Download Docker Machine.
Invoke-WebRequest 'https://github.com/docker/machine/releases/download/v0.16.1/docker-machine-Windows-x86_64.exe' -OutFile 'docker-machine.exe' -UseBasicParsing

# Create a Docker Machine named "default".
.\docker-machine.exe create --driver hyperv --hyperv-virtual-switch "Docker Network" default

# Provision the new Hyper-V VM as desired.
Get-VM -Name "default" | Set-VM -ProcessorCount 2 -DynamicMemory -MemoryStartupBytes 2gb -MemoryMinimumBytes 1gb -MemoryMaximumBytes 4gb

# SSH into Docker Machine, forwarding port 8080.
.\docker-machine ssh default -L 8080:localhost:8080

# Within the VM, install docker-compose.
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

# Within the VM, setup and run ShinyStudio.
git clone https://www.github.com/dm3ll3n/ShinyStudio
cd ./ShinyStudio
./control.sh setup

You should now be able to access ShinyStudio at http://localhost:8080.

If you want to access the content on the host machine (outside of the VM):

# Install WinFSP and SSHFS
'https://github.com/billziss-gh/winfsp/releases/download/v1.2POST1/winfsp-1.2.17346.msi',
'https://github.com/billziss-gh/sshfs-win/releases/download/v2.7.17334/sshfs-win-2.7.17334-x64.msi' |
ForEach-Object {
    $tmp_file = [System.IO.Path]::GetTempFileName()
    Invoke-WebRequest $_ -OutFile $tmp_file -UseBasicParsing
    $null = Start-Process "msiexec.exe" "/norestart /qb /i $tmp_file" -Wait
}

# Map ShinyStudio content to drive letter using SSHFS.
$docker_vm_ip = .\docker-machine.exe ip default
net.exe use S: "\\sshfs\docker@$docker_vm_ip\ShinyStudio" /USER:docker tcuser /PERSISTENT:YES

Great work Donald! Works well for me. I also tested out the follow-up script to provide a drive that persists with new content.
It seems a little strange that you had to resort to docker-machine. It makes me think of issues relating to updates and maintaining work in a production environment. Its suitable for my work environment though as they haven't upgraded from Windows 7 enterprise and therefore cannot use Docker for Windows. Thanks again

Yeah, for the reasons you mentioned, I would use a Linux server for a shared production environment. I'm glad to hear the above will work well if you're playing with an isolated instance on your local Windows 10 box.

No worries I will keep that in mind. You can close this issue.

To add to this...

Using a non-VM Windows 10 system and the latest Docker Desktop for Windows, there is a better approach to ShinyStudio on Windows.

I added steps to the doc, here:

https://github.com/dm3ll3n/ShinyStudio#windows-powershell

I also wrote "control" scripts in powershell in order to use the more enhanced setup, here:

https://github.com/dm3ll3n/ShinyStudio#setup-from-github

Please let me know if this also works for you.

Cheers,
Donald

Please see the latest release that should be 100% compatible with Docker Desktop for Windows & Mac, and let me know if you have any remaining concerns.

Thanks,
Donald