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

Devcontainer improvements #1456

Merged
merged 10 commits into from
Nov 23, 2023
Merged
10 changes: 3 additions & 7 deletions .devcontainer/DockerfileUpstream
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
ENV PATH="${WDIR}/.cabal/bin:${WDIR}/.ghcup/bin:${PATH}:${WDIR}/.local/bin:${PATH}"

ARG GHC=8.10.7
ARG CABAL=3.10.1.0
ARG HLS=2.0.0.1
ARG CABAL=3.6.2.0
ARG HLS=2.2.0.0
ARG STACK=2.11.1

# install GHC and cabal
Expand Down Expand Up @@ -99,11 +99,7 @@ ENV PATH="${WDIR}/.cabal/bin:${WDIR}/.ghcup/bin:${WDIR}/.local/bin:${PATH}"
COPY ./package.yaml ${WDIR}/package.yaml
COPY ./stack.yaml ${WDIR}/stack.yaml

RUN groupadd --gid $USER_GID $USERNAME && \
useradd -ms /bin/bash -K MAIL_DIR=/dev/null --uid $USER_UID --gid $USER_GID -m $USERNAME && \
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME

RUN stack setup ${GHC}
ENV DEBIAN_FRONTEND=dialog

ENTRYPOINT ["/bin/bash"]
26 changes: 26 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# On the use of the ampersand .devcontainer stuff

## Purpose

The purpose of the .devcontainer is to provide a common development environment for the Haskellers among the developers of Ampersand.

## What is in this directory

`DockerfileUpstream` is a Dockerfile to build an image. That image should be [available at dockerhub](https://hub.docker.com/repository/docker/ampersandtarski/ampersand-devcontainer/general).
`devcontainer.json` contains the information to properly launch a remote container for the developer.

## Usage

To use this devcontainer, simply open vscode in the Ampersand workspace. It should ask to reopen in a container. The first time might take quite a while, but it is worth the wait. All Haskell goodies will be at your fingertips.

## Maintenance of the upstream image

NB: This action is currently done by Han, no need for other people to do so. It can be seen as regular maintenance of the image

Sometimes there are updates of the Haskell toolchain we use. For instance whenever a new version of the Haskell Language Server is made available, the `DockerfileUpstream` should be updated accordingly. Then, the new image should be built and published at dockerhub. To do so, go to the ampersand root directory and run the following commands:

```
docker build -f .devcontainer/DockerfileUpstream -t ampersandtarski/ampersand-devcontainer:latest .
docker push ampersandtarski/ampersand-devcontainer:latest

```
2 changes: 2 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"context": "..",
"dockerfile": "Dockerfile"
},
"postStartCommand": "stack build",
"customizations": {
"vscode": {
"extensions": [
"haskell.haskell",
"justusadam.language-haskell",
"phoityne.phoityne-vscode",
"eriksik2.vscode-ghci",
"jcanero.hoogle-vscode",
Expand Down
2 changes: 1 addition & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* [Issue #1419](https://github.com/AmpersandTarski/Ampersand/issues/1419) added a test, to be activated in the regression after resolving #1419.
* [Issue #1420](https://github.com/AmpersandTarski/Ampersand/issues/1420) added a test, to be activated in the regression after resolving #1420.
* [Issue #1421](https://github.com/AmpersandTarski/Ampersand/issues/1421) added easier development through Docker image at dockerhub: [ampersandtarski/ampersand-devcontainer](https://hub.docker.com/repository/docker/ampersandtarski/ampersand-devcontainer/general). Also fixes https://github.com/AmpersandTarski/Ampersand/issues/1359

* Development of Ampersand generator can now be done with codespaces.
## v4.7.6 (26 february 2023)

## v4.7.5 (25 february 2023)
Expand Down
Loading