-
-
Notifications
You must be signed in to change notification settings - Fork 580
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
feat: Add native lima Docker provider support #5892
Conversation
Download the artifacts for this pull request:
See Testing a PR |
Fails TestDdevAllDatabases on tb-macos-arm64-7 with non-writable filesystem: TestWritableFilesDirectory on tb-macos-arm64-6: https://buildkite.com/ddev/macos-lima/builds/18#018e2142-c31e-405c-9db3-3a416e2790f1 |
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.
just left a few comments early on. just after leaving comments on the colima quickstart i noticed that there are certain overlaps for those two and it might be a good thing to keep things consistent across quickstarts. and would it make sense since colima and rancher are based on lima to place lima in front of the two?
@@ -46,6 +45,27 @@ You’ll need a Docker provider on your system before you can [install DDEV](dde | |||
!!!warning "Colima can only work in your home directory unless you do further configuration" | |||
By default, Colima only mounts your home directory, so it’s easiest to use it in a subdirectory there. See the `~/.colima/default/colima.yaml` for more information, or notes in [colima.yaml](https://github.com/abiosoft/colima/blob/fc948f8f055600986f87e29e3e632daf56ac8774/embedded/defaults/colima.yaml#L130-L143). | |||
|
|||
### Lima | |||
|
|||
[Lima](https://github.com/lima-vm/lima) is a free and open-source project supported by the [Cloud Native Computing Foundation](https://cncf.io/). |
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.
one note. colima currently states that bundles a container management tool called [Lima](https://github.com/lima-vm/lima) with a Docker (Linux) backend.
. with lima not an option in this list it was ok to phrase it that way but as soon as lima is added i would rephrase it. and i would also add a note to rachner that it is based on lima. that has no note about that yet.
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.
Sorry, can't understand your question but feel free to propose something.
|
||
[Lima](https://github.com/lima-vm/lima) is a free and open-source project supported by the [Cloud Native Computing Foundation](https://cncf.io/). | ||
|
||
1. Install Lima with `brew install lima`. |
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.
I would make step 1 and 2 consistent with Colima.
- Run
docker help
to verify if the Docker client is installed. In case of an error, install it Homebrew by runningbrew install docker
(slightly altered the Colima version might be adjusted accordingly?) - Install Lima with
brew install lima
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.
I like it better this way, didn't like the other one as much.
2. Install the `docker` client if you don't already have it with `brew install docker`. | ||
3. Create a default Lima setup with 4 CPUs, 6GB memory, 100GB storage, and Cloudflare DNS, adjusting as needed: | ||
``` | ||
limactl create --vm-type=vz --mount-type=virtiofs --mount-writable --memory=6 --cpus=4 --disk=100 template://docker |
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.
i am cautious and a bit afraid of mounting the entire home directory, most of the lima maintainers share the same worry. That is the reason why out of the box only the lima temp directory is added. but the rancher maintainer is the only lima maintainer who mounts his entire homedirectory for convenience reasons. just as a note. i am ok with it but personally i only use --mount="~/Sites:w" (with Sites being the directory i store all my projects)
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.
I understand that your caution, but this is the default behavior and doing it otherwise creates enormous support problems.
3. Create a default Lima setup with 4 CPUs, 6GB memory, 100GB storage, and Cloudflare DNS, adjusting as needed: | ||
``` | ||
limactl create --vm-type=vz --mount-type=virtiofs --mount-writable --memory=6 --cpus=4 --disk=100 template://docker | ||
docker context create lima-default --docker "host=unix://$HOME/.lima/default/sock/docker.sock" |
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.
it probably should be noted that this command has only to be run once after the initial creation of the VM. and this line as well as the next (docker context use) are also output by default. they are part of the message
that is defined in the instances yaml file.
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.
This is shown as part of the first-time setup.
docker context create lima-default --docker "host=unix://$HOME/.lima/default/sock/docker.sock" | ||
docker context use lima-default | ||
``` | ||
After the initial run above, you can use `limactl start`. Run `limactl list` to see configured setup. |
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.
After the initial run above, you can use `limactl start`. Run `limactl list` to see configured setup. | |
After the initial setup, you can start your instance with `limactl start`. Run `limactl --help` to see the list of available commands. |
instead of adding the command to see the configured setup i think providing the help command to get the list of all available command might be more helpful (which also includes the list command)
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.
I like it as is. People have to branch out to learn more.
!!!warning "Docker contexts let the Docker client point at the right Docker server" | ||
The Docker provider you're using is selected with `docker context`. You can see the available contexts with `docker context ls` and the currently selected one with `docker context show`. With the setup above you'll want `docker context use lima-default`. | ||
|
||
!!!warning "Lima only mounts filesystems in your home directory unless you do further configuration" |
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.
same as for the colima quickstart. i think it would make sense to clarify that those mounts are not necessary for lima to run but for ddev projects to run?
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.
Here we're only interested in people running DDEV projects. People can do other things with Lima if they want to.
If people don't put their projects on a filesystem that Lima mounts then DDEV is nonfunctional. Most people put their projects somewhere in the homedir.
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.
Thanks for taking such a good look @rpkoller and thanks for all your expertise in this area!
2. Install the `docker` client if you don't already have it with `brew install docker`. | ||
3. Create a default Lima setup with 4 CPUs, 6GB memory, 100GB storage, and Cloudflare DNS, adjusting as needed: | ||
``` | ||
limactl create --vm-type=vz --mount-type=virtiofs --mount-writable --memory=6 --cpus=4 --disk=100 template://docker |
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.
I understand that your caution, but this is the default behavior and doing it otherwise creates enormous support problems.
3. Create a default Lima setup with 4 CPUs, 6GB memory, 100GB storage, and Cloudflare DNS, adjusting as needed: | ||
``` | ||
limactl create --vm-type=vz --mount-type=virtiofs --mount-writable --memory=6 --cpus=4 --disk=100 template://docker | ||
docker context create lima-default --docker "host=unix://$HOME/.lima/default/sock/docker.sock" |
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.
This is shown as part of the first-time setup.
docker context create lima-default --docker "host=unix://$HOME/.lima/default/sock/docker.sock" | ||
docker context use lima-default | ||
``` | ||
After the initial run above, you can use `limactl start`. Run `limactl list` to see configured setup. |
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.
I like it as is. People have to branch out to learn more.
!!!warning "Docker contexts let the Docker client point at the right Docker server" | ||
The Docker provider you're using is selected with `docker context`. You can see the available contexts with `docker context ls` and the currently selected one with `docker context show`. With the setup above you'll want `docker context use lima-default`. | ||
|
||
!!!warning "Lima only mounts filesystems in your home directory unless you do further configuration" |
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.
Here we're only interested in people running DDEV projects. People can do other things with Lima if they want to.
If people don't put their projects on a filesystem that Lima mounts then DDEV is nonfunctional. Most people put their projects somewhere in the homedir.
Co-authored-by: Ralf Koller <1665422+rpkoller@users.noreply.github.com>
The Issue
Colima has gotten quite unstable for lots of people, but it's just a wrapper on Lima, and so we should be able to use Lima directly as another open-source alternative.
How This PR Solves The Issue
It's worth considering whether we should do this at all, as adding more options doesn't necessarily help people or our support environment.
TODO
Manual Testing Instructions
Use the docs to start a lima instance, then do a simple quickstart test.
Automated Testing Overview
Related Issue Link(s)
Release/Deployment Notes