jib icon indicating copy to clipboard operation
jib copied to clipboard

Enable integration testing on Windows.

Open coollog opened this issue 7 years ago • 7 comments

This depends on the windows instance being able to run Docker.

coollog avatar Feb 14 '18 23:02 coollog

Windows instance can now run Docker - this can proceed.

coollog avatar Jul 30 '18 14:07 coollog

@chanseokoh feel free to take over #745 - I was trying to get it working there

coollog avatar Sep 05 '18 20:09 coollog

Does anyone know how to restart the docker daemon on the Kokoro Windows machine? I'm trying to reload daemon.json config. I tried Net stop com.docker.service and Net start com.docker.service, and although they seem to work, I'm having trouble making it reload the config.

chanseokoh avatar Sep 05 '18 21:09 chanseokoh

The Docker Daemon page notes:

CONFIGURATION RELOAD BEHAVIOR

Some options can be reconfigured when the daemon is running without requiring to restart the process. We use the SIGHUP signal in Linux to reload, and a global event in Windows with the key Global\docker-daemon-config-$PID.

briandealwis avatar Sep 06 '18 14:09 briandealwis

At first net start/stop com.docker.service seemed to work but doesn't really look like, and now I'm trying sc start/stop com.docker.service as told by the Kokoro folks. However, sc is asynchronous, so still digging into it.

chanseokoh avatar Sep 06 '18 15:09 chanseokoh

Just an update:

I think net start/stop and sc start/stop are effectively same except that sc simply makes a request and does not block. Although sc stop does stop the Docker service and I can verify its STOPPED state, I can still do docker images or docker pull, so I think either it's not really stopping the daemon or there is another daemon running. Waiting for the Kokoro folks for an answer.

BTW, the reason I'm doing this is to enable experimental features of the Docker daemon so that I can pass the --platform linux flag.

chanseokoh avatar Sep 06 '18 20:09 chanseokoh

Update:

On the Kokoro Windows machine, tasklist showed there were two processes com.docker.service and dockerd.exe running. I believe net|sc start|stop is supposed to work, but in reality, it only started/stopped com.docker.service and had no effect on dockerd.exe at all.

So I ended up doing below to turn on the experimental features of the Docker daemon:

  1. Manually kill dockerd.exe: Taskkill /IM dockerd.exe /F
  2. Update %ProgramData%\Docker\config\daemon.json to flip the value of experimental
    • Passing --experimental when starting dockerd won't work; it will complain you can't set it with both daemon.json and the flag.
    {
      "registry-mirrors":[],
      "insecure-registries":[],
      "experimental":true,
      "hosts":["tcp://0.0.0.0:2375","npipe://"]
    }
    
  3. Update %PATH% so that I can run dockerd.exe. (For some unknown reason on Kokoro, I can't access the binary directly.) set PATH=%ProgramFiles%\Docker\Docker\resources;%JAVA_HOME%\bin;%PATH%
  4. Manually start the Docker daemon: CMD /C START dockerd.

However, unfortunately, passing --platform linux to Docker did not work on Kokoro, returning the error invalid Platform OS "linux". Haven't looked into why in detail, but it appears that Linux Containers for Windows (LCOW) is not supported by the Windows OS in the Kokoro machine: https://github.com/docker/for-win/issues/2241#issuecomment-408444877 Seems like another dead end.

chanseokoh avatar Sep 11 '18 13:09 chanseokoh