#Thanks @Courtcircuits for the write-up
1 messages · Page 1 of 1 (latest)
Thank you so much for sharing! By the way, big kudos to @buoyant fern and @limber granite for being such skilled team mates during the hackathon !
@oblique jetty kudos on participating in the hackathon with such a creative idea. You poked my interest in making the full demo work. What's missing to take it all the way?
Actually the main issue we have is that dagger has hard time loading large files so we need to find a way to make a real mount point between the host and the container (that’s why the other day I asked questions about the privileged option)
That's to mount the StarCraft ROM in the VM, right?
And I think that it could be feasable by
- mounting the docker socket to the dagger container running qemu
- create a volume within a container launched from the dagger container and mount that volume in the dagger container
- Finally mount the same docker container to the host
I haven't tested that yet so not sure if it works but it is my best lead so far. I'm really interested on how you would manage that
If you mount the iso in a loop device on the host I think dagger should see that if you run an exec in privileged mode
The starcraft ROM but also the qcow2 image. The thing is that the original qcow2 image that I use to run starcraft weigh 16Go
I'd assume the image includes windows + StarCraft?
Hmmm that's really interesting. Don't you think that the container domains would isolate the container from seeing the host devices ? I mean I think that privileged mode only activate all the kernel capabilities (maybe I got that wrong)
Yep that's it. Starcraft ISO is only an installation media
Also maybe related. I did this quite some time ago: https://x.com/marcosnils/status/1813675549614866683?t=p6KUWRBYuLUoE_nEiOeVwA&s=19
Wednesday hacking moment. @dagger_io module to run WindowsXP as a service and connect to it using VNC. Everything automated and you can customize the VM windows version, disk, cpu and ram size.
https://t.co/L3BP47swUt
Wow that's crazy ! That is exactly what we did but you picked VNC instead of spice for the KV protocol thats so cool
I think it should see the host devices also. I'll double check this
Ctr: dag.Container().From("dockurr/windows").
WithExposedPort(8006).
WithEnvVariable("VERSION", version).
WithEnvVariable("RAM_SIZE", ram).
WithEnvVariable("CPU_CORES", cpu).
WithEnvVariable("DISK_SIZE", disk).
WithMountedTemp("/storage").
WithExec([]string{"/usr/bin/tini", "-s", "/run/entry.sh"}, dagger.ContainerWithExecOpts{InsecureRootCapabilities: true}),
}
Is the WithMountedTemp method creating a real mount point or doest it also perform a file copy ?
It also performs a file copy
Okay it looks like that dockurr/windows creates the qcow2 image when the container is launched sooo we no longer need to import a huge qcow2 image in the container so it could do the job !
Yep
I'll test it right away. I'll keep you updated if I manage to run starcraft 😉
It's very likely it'll work
A different approach could be to setup a dagger module which runs StarCraft via wine or proton so you don't have to virtualize
Yep definitely but I think it's less fun
That way the base docker image could be extremely small
Lol, true 🙂
Also our goal was to see how dagger behaves when handling a huge workload like an entire OS
In that sense it's the same as running docker
It's just containers in the end
Now that I checked some part of the source code I saw that but tbh we didn't know anything about dagger when entering the hackathon so we just tried that as a benchmark ahah
@oblique jetty one thing that I think could be a killer feature could be to create a dagger pipeline so you launch a windows VM as a service and then somehow use it to run something inside of it with other parts of the pipeline
This way it could be super useful for CI/CD windows workloads
GHA has windows VMs but there's no way to run them locally
That's something I wanted to do a while back but priorities....
Hmm yep I see what you mean. Honestly I'm far from a windows expert so I don't know how to execute windows workloads but since github does it must be possible.
I had this to my backlog but don't get high hopes on that haha
how are you planning to copy the game under this mode? Do you have zipped version of the game that you'll download in the windows machine somehow?
Or just boot into windows and manually download it via VNC?
Actually StarCraft ISO weigh around 1GO so it’s okay to mount it using dagger SDK
So yesterday I tried to use your dagger module but dockurr/windows doesn’t have an option to mount ISO images unfortunately so I’ll need to make my own custom container image inspired by them
You could just pass the ISO as a raw file and mount it in Windows directly?
Can we play multiplayer already? 😛
Not yet, actually I’m working on a qemus/qemu (qemu in docker) clone with dagger 😬. Dagger is just perfect to replace what they did in bash
nice! what are you looking forward to use qemu in dagger for?
I think that most bash scripts of qemu in docker could be written with dagger. Basically they use these scripts to build qemu arguments depending on the host available memory, the env args provided when starting the container etc.
And also I find bash particularly hard to read and work with 🙈
Couldn't agree more
Were you able to finally install StarCraft?
I'm a huge SC fan, diamond 3 zerg here
Not yet I had a lot of work lately and also I needed to mount starcraft with a CDROM, it wouldn't install otherwise. I managed to pass the good arguments to qemu to add a new cdrom but windows doesn't detect it for some reason. I'll be working on it this evening !
Here is the compose I use to iterate :
services:
windows:
image: dockurr/windows
container_name: windows
environment:
VERSION: "xp"
ARGUMENTS: "-drive file=/cdrom/STARCRAFT.ISO,media=cdrom -cdrom /cdrom/STARCRAFT.ISO"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 3389:3389/tcp
- 3389:3389/udp
volumes:
- ./windows:/storage
- ./cdrom:/cdrom
- ./en_windows_xp_professional_with_service_pack_3_x86_cd_x14-80428.iso:/boot.iso
stop_grace_period: 2m
Nice ! Zerg are the best IMO
I'll spend sometime tomorrow working on this
We did it !