-
Notifications
You must be signed in to change notification settings - Fork 106
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
chore: add .gitpod.yml and .docker/gitpod/Dockerfile #732
Merged
kim-em
merged 2 commits into
leanprover-community:main
from
austinletson:add-docker-gitpod-565
Apr 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# This is the Dockerfile for leanprover/std4 | ||
# This file is mostly copied from [mathlib4](https://github.com/leanprover-community/mathlib4/blob/master/.docker/gitpod/Dockerfile) | ||
|
||
# gitpod doesn't support multiple FROM statements, (or rather, you can't copy from one to another) | ||
# so we just install everything in one go | ||
FROM ubuntu:jammy | ||
|
||
USER root | ||
|
||
RUN apt-get update && apt-get install sudo git curl git bash-completion python3 python3-requests gcc make -y && apt-get clean | ||
|
||
RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod \ | ||
# passwordless sudo for users in the 'sudo' group | ||
&& sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers | ||
USER gitpod | ||
WORKDIR /home/gitpod | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
# gitpod bash prompt | ||
RUN { echo && echo "PS1='\[\033[01;32m\]\u\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\$(__git_ps1 \" (%s)\") $ '" ; } >> .bashrc | ||
|
||
# install elan | ||
RUN curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain none | ||
|
||
# install whichever toolchain std4 is currently using | ||
RUN . ~/.profile && elan toolchain install $(curl https://raw.githubusercontent.com/leanprover/std4/main/lean-toolchain) | ||
|
||
# install neovim (for any lean.nvim user), via tarball since the appimage doesn't work for some reason, and jammy's version is ancient | ||
RUN curl -s -L https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz | tar xzf - && sudo mv nvim-linux64 /opt/nvim | ||
|
||
ENV PATH="/home/gitpod/.local/bin:/home/gitpod/.elan/bin:/opt/nvim/bin:${PATH}" | ||
|
||
# fix the infoview when the container is used on gitpod: | ||
ENV VSCODE_API_VERSION="1.50.0" | ||
|
||
# ssh to github once to bypass the unknown fingerprint warning | ||
RUN ssh -o StrictHostKeyChecking=no github.com || true | ||
|
||
# run sudo once to suppress usage info | ||
RUN sudo echo finished |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
image: | ||
file: .docker/gitpod/Dockerfile | ||
|
||
vscode: | ||
extensions: | ||
- leanprover.lean4 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think we should need any python3 anymore. (Ideally we'd also remove this on the mathlib side).
There's also a repeated
git
here.Could you test without?
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 have removed
git
andpython3
and ran everything again successfully.I didn't remove
python3-requests
. We still need that right? If you remove it you can't runpython3 -m http.server
to expose the documentation.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 guess --- I've never done that. I guess it doesn't hurt too much having python bundled in.
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.
Alright, my thinking was that all the commands in the README.md should work out of the box.
I just launched Gitpod successfully from https://github.com/leanprover/std4 and built std4. Thanks!