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

Persist $HOME contents and move init to dockerfile #4

Merged
merged 7 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
FROM gitpod/workspace-full:latest
# Image source code: https://github.com/axonasif/workspace-images/tree/tmp
# Also see https://github.com/gitpod-io/workspace-images/issues/1071
FROM axonasif/workspace-base@sha256:8c057b1d13bdfe8c279c68aef8242d32110c8d5310f9a393f9c0417bc61367d9

USER gitpod

# Persist ~ due to the requirements of this project
RUN echo 'create-overlay $HOME' > "$HOME/.runonce/1-home_persist"

# or git will keep prompting
RUN git config --global pull.ff only

# ~/.stack, ~/.ghcup will be lost across Gitpod workspace restarts,
# use /workspace/ so it is persisted as part of prebuilt workspace
ENV STACK_ROOT=/workspace/.stack
ENV GHCUP_INSTALL_BASE_PREFIX=/workspace

# Add ghcup to path
ENV PATH=/workspace/bin:/workspace/.ghcup/bin:${PATH}

# create toolhome
RUN mkdir -p /workspace/bin
# add /workspace/bin and ghcup to PATH
ENV PATH="/workspace/bin:$HOME/.ghcup/bin:$PATH"

# install ghcup, then stack and hls via it
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | env BOOTSTRAP_HASKELL_NONINTERACTIVE=1 sh
RUN ghcup install stack
RUN ghcup install hls
RUN ghcup install stack && \
ghcup install hls
# populate stack's cache, this takes minutes & GBs
RUN stack update

# install latest epm
RUN mkdir -p $HOME/.local/bin; \
curl -o $HOME/.local/bin/epm -L https://github.com/e-wrks/epm/raw/latest/epm && \
chmod +x $HOME/.local/bin/epm
12 changes: 6 additions & 6 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
image:
file: .gitpod.Dockerfile

workspaceLocation: tour/main.code-workspace # Relative to /workspace dir

ports:
- port: 1024-6000
onOpen: ignore

tasks:
- name: Build Đ Tooling
init: |
# /workspace/bin should have been created per Dockerfile, and added to $PATH
curl -o /workspace/bin/epm -L https://github.com/e-wrks/epm/raw/latest/epm
chmod a+x /workspace/bin/epm
# update epm to latest version
curl -o $HOME/.local/bin/epm -L https://github.com/e-wrks/epm/raw/latest/epm
# prepare /workspace as an epm home
cd /workspace
epm init \
Expand All @@ -19,17 +20,16 @@ tasks:
-B http://github.com/complyue \
nedh els sedh eas hasdim haskit
cd /workspace/edh-universe
# build & install executables from Edh packages
# build & install executables from Edh packages,
# this takes minutes & GBs
stack update
stack install
command: |
# update packages in root epm home
cd /workspace/edh-universe
epm up
epm i
epm x gen-hie > hie.yaml
# update executables from Edh packages
stack update
stack install

vscode:
Expand Down
2 changes: 0 additions & 2 deletions .rebuild-gitpod

This file was deleted.

12 changes: 12 additions & 0 deletions main.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// All paths are relative to your main repo
// The additional repos are cloned inside /workspace dir
"folders": [
{
"path": "." // Main repo that you will open in Gitpod (e.g. frontend)
},
{
"path": "/workspace/edh-universe" // Additional repo
}
]
}