-
Notifications
You must be signed in to change notification settings - Fork 17
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
Docker backend #75
Docker backend #75
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There shouldn't be any docker-specific stuff in build.ml. Can the sandbox API be extended to allow making all this generic?
Thinking on about this... the Build module creates a builder from a store and a sandbox. That will work on Linux (runc+btrfs), mac (users+zfs) and probably on FreeBSD (jails+zfs). But it doesn't work with Docker, because Docker already combines a store and a sandbox. So probably this should be an alternative to the build.ml module instead. |
Thanks for the review, I agree with your conclusion and will refactor the code to merge the Docker sandbox, A note regarding the use of the Docker Engine API: I wanted to replace the process calls to the
I'm putting this on hold for now, and I'll stay with the docker client until openapi-generator is fixed. |
52288a1
to
da98be5
Compare
fdaea39
to
1920afa
Compare
c8729ea
to
68e9084
Compare
Otherwise embedded text get crlf line endings.
Mounts are read-write to preserve current behaviour.
This allows to specify the entrypoint of a `Sandbox.run job`. This is only needed for the Docker sandbox, to override the Docker image entrypoint.
Granted, it's more difficult to read, but way easier to copy-paste to inspect manually what's happening.
This prevents errors on Windows where a file cannot be renamed, moved or deleted if it is open by another process. It also ensure that the database is left in a clean state.
…q-cmdliner', 'MisterDA/docker-windows-spec' and 'MisterDA/docker-windows-prerequisites' into docker
Checking the result for the Docker backend requires asynchronous calls to Docker.
With the Docker backend on Windows, it's easier to store logs in a location where they're not moved, as a directory cannot be renamed if it contains open file descriptors. For the btrfs and zfs backends, the original location is retained.
I lost the race to merge before macOS. The rebase wasn't easy, I've probably broken one or two new things in my code. |
CHANGES: - Add a Docker backend for Windows and Linux jobs. (@MisterDA ocurrent/obuilder#127 ocurrent/obuilder#75, reviewed by @talex5 and @tmcgilchrist) - Add FreeBSD sandbox backend using jail(8) (@dustanddreams ocurrent/obuilder#156 ocurrent/obuilder#174, reviewed by @tmcgilchrist, @MisterDA, and @mtelvers) - Add Macos ZFS sandbox (@mtelvers ocurrent/obuilder#164, reviewed by @tmcgilchrist) - Support XFS store (@mtelvers ocurrent/obuilder#170, reviewed by @tmcgilchrist) - Search for bash rather than assume it lies in /bin (@dustanddreams ocurrent/obuilder#159, reviewed by @tmcgilchrist) - Prune builds one at a time up to the limit (@mtelvers ocurrent/obuilder#157) - Specify upper bound on number of items in the store (@mtelvers ocurrent/obuilder#158, reviewed by @MisterDA) - Fix case where BTRFS is not fully allocated (@mtelvers ocurrent/obuilder#162) - Avoid pruning parent cache objects (@mtelvers ocurrent/obuilder#176, reviewed by @tmcgilchrist)
CHANGES: - Add a Docker backend for Windows and Linux jobs. (@MisterDA ocurrent/obuilder#127 ocurrent/obuilder#75, reviewed by @talex5 and @tmcgilchrist) - Add FreeBSD sandbox backend using jail(8) (@dustanddreams ocurrent/obuilder#156 ocurrent/obuilder#174, reviewed by @tmcgilchrist, @MisterDA, and @mtelvers) - Add Macos ZFS sandbox (@mtelvers ocurrent/obuilder#164, reviewed by @tmcgilchrist) - Support XFS store (@mtelvers ocurrent/obuilder#170, reviewed by @tmcgilchrist) - Search for bash rather than assume it lies in /bin (@dustanddreams ocurrent/obuilder#159, reviewed by @tmcgilchrist) - Prune builds one at a time up to the limit (@mtelvers ocurrent/obuilder#157) - Specify upper bound on number of items in the store (@mtelvers ocurrent/obuilder#158, reviewed by @MisterDA) - Fix case where BTRFS is not fully allocated (@mtelvers ocurrent/obuilder#162) - Avoid pruning parent cache objects (@mtelvers ocurrent/obuilder#176, reviewed by @tmcgilchrist)
This PR implements the Docker backend for OBuilder. It should support running on Windows with Docker for Windows, and on Linux with the usual Docker.
This PR contains a batch of prerequisites, and then the backend.
I have tested it on Windows and Linux, on basic examples.
is_blocking
indup
anddup2
to fixENOTSOCK
on Windows ocsigen/lwt#869?cloexec:bool
argument to wrappedUnix
functions inLwt_unix
ocsigen/lwt#901