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

Provide cygwin docker images for Windows #25805

Closed
saraedum opened this issue Jul 9, 2018 · 16 comments
Closed

Provide cygwin docker images for Windows #25805

saraedum opened this issue Jul 9, 2018 · 16 comments

Comments

@saraedum
Copy link
Member

saraedum commented Jul 9, 2018

I have been playing with Windows (!) containers for docker on Windows recently. I would like to see whether it's feasible to provide a Dockerfile for such an environment similar to what we have in #24655.

For the end user this would probably not be very useful. I believe that one would need at least Windows 2k16 Server (probably the Standard Edition) to run these containers. The main use case would probably be in the CI context.

So far my impression is that native Windows containers are not as nice to work with as their Linux counterparts. They are really heavyweight and take quite a while to start up.

Depends on #24655

CC: @embray @slel

Component: docker

Author: Julian Rüth

Issue created by migration from https://trac.sagemath.org/ticket/25805

@saraedum saraedum added this to the sage-8.3 milestone Jul 9, 2018
@embray
Copy link
Contributor

embray commented Jul 9, 2018

comment:1

Not having had access to such a server I've not yet even played with Windows native containers yet. I still need to get an Azure account to try that out, as I think it will also work better for the Windows patchbot...

@saraedum
Copy link
Member Author

saraedum commented Jul 9, 2018

comment:2

I found (docker on) azure to be completely useless. It takes much longer than I am willing to wait to launch VMs there and I never got docker to work, apparently due to disabled virtualization options on the virtual machines.

I am now running Win2k16 Server Standard on QEMU and after some tweaking I am quite happy with the performance.

@embray
Copy link
Contributor

embray commented Jul 9, 2018

comment:3

I had just assumed that Microsoft would have put effort into making that work well, given the resources they've put into helping Docker implement it. If it's useless then why would the push it at all?

How did you even get this Windows Server, or is it unlicensed?

@embray
Copy link
Contributor

embray commented Jul 9, 2018

comment:4

But the question is, does Cygwin perform well? I have still never been able to get good Cygwin performance in a Windows VM on a Linux host (due mostly to fork, or at least that's my suspicion).

@saraedum
Copy link
Member Author

saraedum commented Jul 9, 2018

comment:5

Replying to @embray:

I had just assumed that Microsoft would have put effort into making that work well, given the resources they've put into helping Docker implement it.

Azure is imho only nice to work with when using Linux VMs (maybe dedicated Windows hosts are also good, I have not tried.) They did not support docker on Azure at all when I tried a few months ago. I found this quite frustrating as I had assumed that everything should work out of the box there. Curiously enough, they recommend Linux/Docker in some .NET Core tutorials for Azure…

If it's useless then why would they push it at all?

I have no clue.

How did you even get this Windows Server, or is it unlicensed?

It's a 180 day trial.

@saraedum
Copy link
Member Author

saraedum commented Jul 9, 2018

comment:6

Replying to @embray:

But the question is, does Cygwin perform well? I have still never been able to get good Cygwin performance in a Windows VM on a Linux host (due mostly to fork, or at least that's my suspicion).

The idea would be to run this with docker on a real Windows host eventually. I have not gotten far enough into the build process to make any statement about performance. If you have an easy benchmark (that does not require a built Sage) I am happy to try it out.

@embray
Copy link
Contributor

embray commented Jul 9, 2018

comment:7

Replying to @saraedum:

Replying to @embray:

How did you even get this Windows Server, or is it unlicensed?

It's a 180 day trial.

What happens after the trial period runs out?

@saraedum
Copy link
Member Author

comment:8

Replying to @embray:

Replying to @saraedum:

Replying to @embray:

How did you even get this Windows Server, or is it unlicensed?

It's a 180 day trial.

What happens after the trial period runs out?

I am not sure. I could move my containers to another trial I guess. I had a look at the license a few months ago. I don't remember the details, but I took away that I could play with it for as long as I wanted but could not use it for actual testing in production.

@saraedum
Copy link
Member Author

comment:9

I did some benchmarks of forks with the following forkit.c. I ran the program on my Laptop (with a early 2015 i5) natively in Linux, on Windows 2k16 Server running on QEMU on Linux, in windowsservercore running on docker on Windows 2k16 Server running on QEMU on Linux. I also ran this on a native Windows 2k12 that runs on a somewhat aged Xeon processor for comparison.

invocation native Linux 2k16/QEMU docker/2k16/QEMU native 2k12 (different hardware)
./forkit 1024 1024 .8s 13s 50s 6s
./forkit 1024 10240000 1.2s 50s 80s 41s
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>

int main(int argc, char**argv){
  int F=atoi(argv[1]);
  int RAM=atoi(argv[2]);
  int* A=malloc(sizeof(int)*RAM);
  assert(A);
  for (int f=0;f<F;f++){
    int pid=fork();
    if (pid){
      printf("%d\n", f);
      int w;
      wait(&w);
    }else{
      for (int j=0;j<128;j++){
        A[rand()%RAM] = pid;
      }
      break;
    }
  }
}

So, what's going on here? I am not completely sure. QEMU looks quite reasonable to me. docker seems to have trouble spawning processes quickly which might mean that we should abandon the docker/windows ideas.

embray, what do you think?

@saraedum
Copy link
Member Author

Author: Julian Rüth

@saraedum
Copy link
Member Author

comment:10

I propose to close this ticket as there is not really a point anymore in having these docker containers it seems.

@saraedum saraedum removed this from the sage-8.3 milestone Jul 31, 2018
@embray
Copy link
Contributor

embray commented Jul 31, 2018

comment:11

I think it's still desirable, and might be more feasible in the future. It's just not clear right now that it's feasible or useful.

@saraedum
Copy link
Member Author

comment:12

I'm not even sure it's desirable. But sure, let's leave the ticket around.

@embray
Copy link
Contributor

embray commented Jul 31, 2018

comment:13

I assume the Windows benchmarks imply also that the test is being run on Cygwin in Windows, right? I assume so but that wasn't exactly clear. Anyways, I'm not surprised it's so much slower in Docker. I'm not exactly sure how the native docker engine works on Windows, and it would be interesting to also benchmark various Windows system calls directly (some calls involved with Cygwin's fork include:

  • CreateProcessW (duh)
  • ReadProcessMemory
  • WriteProcessMemory
  • CreateEvent
  • WaitForSingleObject
  • CreatePipe

among numerous others).

I don't think we should waste a lot of time benchmarking Docker for Windows right now because there's nothing much we can do about it if it's slow.

My point is just that if there's even a little bit more overhead to system calls in a Windows native container, then that will add up even more for fork.

@saraedum
Copy link
Member Author

comment:14

Yes, I was running cygwin inside the docker container.

Can you set this ticket back to "new" somehow?

@embray
Copy link
Contributor

embray commented Aug 1, 2018

comment:15

I think I need to close and reopen it

@embray embray closed this as completed Aug 1, 2018
@embray embray reopened this Aug 1, 2018
@mkoeppe mkoeppe closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants