-
Notifications
You must be signed in to change notification settings - Fork 38
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
Create an official devcontainer docker image with haskell-language-server #41
Comments
So I think if this were to live in an official Haskell image, it would be separate from the core image that is provided. Ie. it might live under The next question is should the image live in this repo and be an official Haskell image variant, or should it live in HLS repo? Personally, I'm inclined to think it should live with HLS and be published to a separate docker image ie. The reason is that such an image is tightly coupled to HLS itself. As HLS is developed, I would imagine that would impact what goes in this image. So you might adjust HLS code and update the image in a single PR (that CI can verify). Having said that, I know little about how HLS works 😅 I'm curious why it might be good for an HLS image to be an official Haskell image variant? Another question, would you want to embed the HLS executable in the image? Or would you just have it auto download? If it is the former, that would further tie it to the HLS release process. //cc @psftw |
totally agree
Well, host the hls image could have some interesting advantages:
|
Usually we are taking a look on what rust is doing and it seems they dont have a devcontainer in their docker official account: https://hub.docker.com/_/rust |
Maybe @Chuxel could help us with that? 🙂 |
Yes, this seems like the biggest benefit to me.
I think this doesn't work so well with the way the current images work. Each image tag is a specific version ie. I think for this to work you would want an image that just installs stack / ghcup, then ghc + hls versions can be installed as needed. I guess the downside of this approach is the user needs to install new ghc versions? Or perhaps ghc doesn't need to be in the container, just the hls executable? For https://github.com/vzarytovskii/haskell-dev-env/blob/master/.devcontainer/Dockerfile the image is hardcoded to a specific version. Alternatively it might be easier to just have hls docker image variants for different GHC versions and the user can switch between them as they change projects. BTW, I'm just a newbie maintainer on this repo, @psftw is the long time maintainer. EDIT: |
Mmm i see, thanks for noting it. |
The challenge with not baking everything you need into the container is you want to avoid re-downloading / installing additional stuff. Naively if you don't do anything, when the container shuts down it loses any changes that are not baked into the image. So you would need to reinstall other ghc versions / hls executables you had downloaded after starting the container. The way docker solves this is with volumes that persist data between container runs, but they can be finicky. So I'm not sure if this is a good option. I'd probably instead have something like:
|
Oh, yeah, i forgot containers dont persist anything by default, thanks for noting it
that sound sensible |
As a FYI, someone did contribute a PR on Haskel here: microsoft/vscode-dev-containers#685 If this is good, we could merge it and it would be in the "Add Dev Container Configuration Files" UX in VS Code and Codespaces. Or if you'd prefer a different image is used, we could add that. We bundle up everything in this repository once a month (if not more often) and publish it in the products and community contributions are welcome. There's also a "common-debian.sh" script we typically run that makes terminal a bit more user friendly since the typical production focused Docker image is intentionally thin. Any of this could be pre-built into an image. We do have a pre-built base image with this already done as well as a drop-in replacement for base debian or ubuntu. Generally we host images at mcr.microsoft.com if they're ones the VS Code and Codespaces teams are managing, but there's no requirement that it has to be here as long as the image comes from "official sources" rather than personal accounts. The way these work is that a bind mount or volume is used to map in source code so it survives an image build. |
@Chuxel many thanks for take care and your insights |
@jneira and @AlistairB the PR microsoft/vscode-dev-containers#685 I raised is based on the docker hub image '8.10.4' using tag '8'. Also I've adopted the "common-debian.sh" which @Chuxel mentioned to improve the terminal. |
Reviewed microsoft/vscode-dev-containers#685 and made some comments. I should also say that the discussion of pre-building some of this into an image is also a good one. That won't happen automatically for the vscode-dev-containers repo. That said, a Dockerfile build will happen automatically - it just is usually faster if an image is pulled instead. |
The PR above was merged, and based on a quick look, it seems reasonable to me. As mentioned above, VSCode handles the HLS install at runtime, so the diff between the official image and a "devcontainer" is a thin layer of common packages/configuration. This seems to be working as expected with the devcontainer being an independently maintained downstream image. Finding the right balance of what to publish under the |
@psftw thanks for take a look to the merged devcontainer.
Yeah and that downstream image already exists after the mentioned pr. I still see some value in host that downstream image in an place clearly associated with haskell like this and not only microsoft, to help its discovery.
Well, the idea was include ghc, hls matching version on PATH and vscode (or vscodium) with the extensions already installed. The extension honours the hls executable in PATH as first option and anyways, as there is only one ghc in the system, it would not need another hls version. |
//cc @ndmitchell @emilypi @hmemcpy
The text was updated successfully, but these errors were encountered: