-
Notifications
You must be signed in to change notification settings - Fork 256
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!: Set up gitpod IDE - a browser-based/zero-install VSCode clone - #591
base: master
Are you sure you want to change the base?
Conversation
for the Dafny online tutorial.
If the
to:
the initial time to spin up the instances is reduced from a few minutes to 20-30 seconds. However, it adds an additional dependency (to my custom docker image). |
#594 should fix the SSL-related build failure once it's merged |
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 an awesome approach! I love being able to leverage the VS Code plugin for this.
A few top-level suggestions:
- Can we add the "Ready to Code" link to the readme as gitpod suggests too?
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/dafny-lang/dafny)
- It would be good to address a couple additional gaps between what's in the repo and whats on rise4fun.com as well (this could be in a follow-up PR though):
- https://rise4fun.com/Dafny/tutorial/Guide has links at the bottom to the additional tutorial files (Lemmas.md etc.)
- https://rise4fun.com/Dafny has several nice, simple Dafny samples linked in the bottom left corner (e.g. Hello.dfy) which would be good to include
- It's unfortunate that the gitpod preview window doesn't highlight Dafny code correctly, but that's something I happen to be investigating right now anyway. :)
- command: gp open Docs/OnlineTutorial/guide.md | ||
- command: gp open Docs/OnlineTutorial/guide.dfy |
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 a good start, but can we go a little further and open the guide.md preview automatically as well? Ideally I'd love for the initial state to be guide.dfy on the left and the preview on the right.
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 pinged the authors of gitpod and they say neither is currently supported.
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.
That's too bad. I would suggest we add some instructions at the top of guide.dfy for opening the preview then.
Alternatively, we could render the content with a markdown engine that supports Dafny syntax (I'm about to add a KDE syntax definition which pandoc can use) and commit the result, just as we do for the Dafny reference.
@@ -0,0 +1,11 @@ | |||
image: lemmster/gitpod-dafny:latest |
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.
Let's just use the dockerfile for now as you suggested, to avoid the dependency. I'm assuming you only have to wait for the instance spin-up the first time you open a repo in gitpod?
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'd assume they have clever caching for all users, but I actually don't know. Here is what I did to create the image:
sudo apt install docker.io
## login with your docker hub credentials.
docker login
## in the local git repository:
docker build -t lemmster/gitpod-dafny -f .gitpod.dockerfile .
## Publish on docker hub.
docker push lemmster/gitpod-dafny
In other words, you could create your own pre-build image.
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.
Cool - I'd be happy to consider maintaining such an image under the dafny-lang umbrella in the future. Are you comfortable with deferring that for now?
|
||
vscode: | ||
extensions: | ||
- [email protected]:y0vNEkuQw4SUFvPIFxLkEA== |
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.
Do you know what the ID after the colon is for?
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.
With gitpod one has to manually install extension by:
a) Manually download VSCode extension from https://marketplace.visualstudio.com/items?itemName=correctnessLab.dafny-vscode
b) Spin-up a gitpod instance
c) Manually install correctnessLab.dafny-vscode-0.17.1.vsix
in gitpod
d) .gitpod.yml is modified and lists new extension
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.
Fair enough, I read up on the docs and this looks standard, I was just curious.
One further thought: it might make sense to move the tutorial and samples to a separate repository, just as TLA+ has done. It may be somewhat confusing to assume that someone loading the Dafny repo itself in gitpod is intending to use the tutorial rather than develop Dafny itself. |
Please have a look at https://github.com/lemmy/dafny-sort/ |
For gitpod, it might make more sense to convert the markdown guide into a single or set of .dfy files => No need to copy snippets from markdown. |
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.
Shoot, just realized I never hit the submit button on this.
For gitpod, it might make more sense to convert the markdown guide into a single or set of .dfy files => No need to copy snippets from markdown.
I think these end up being different beasts, though - a markdown guide can narrate things selectively, out of order, etc. A source file with lots of comments can't do that.
@@ -0,0 +1,11 @@ | |||
image: lemmster/gitpod-dafny:latest |
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.
Cool - I'd be happy to consider maintaining such an image under the dafny-lang umbrella in the future. Are you comfortable with deferring that for now?
|
||
vscode: | ||
extensions: | ||
- [email protected]:y0vNEkuQw4SUFvPIFxLkEA== |
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.
Fair enough, I read up on the docs and this looks standard, I was just curious.
- command: gp open Docs/OnlineTutorial/guide.md | ||
- command: gp open Docs/OnlineTutorial/guide.dfy |
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.
That's too bad. I would suggest we add some instructions at the top of guide.dfy for opening the preview then.
Alternatively, we could render the content with a markdown engine that supports Dafny syntax (I'm about to add a KDE syntax definition which pandoc can use) and commit the result, just as we do for the Dafny reference.
@robin-aws May I assume that you are going to put on the finishing touches that you mention above? |
I'm not sure when we'll have the time to in the immediate future, to be honest, but I'm willing in theory. We're also still thinking about the best way to host the tutorial, so we may let this sit for a little while longer just to make sure the experience is optimal for new users/contributors to Dafny. |
This seems like a cool idea! I'd love to use something like this in my classes. FWIW, when I try running the GitPod (https://gitpod.io/#https://github.com/dafny-lang/dafny/), it looks like it's setup to work on the Dafny project, but when I open a Dafny file (e.g., |
The link only works with this PR merged (it is not). If you want to toy with Dafny on Gitpod, you can try https://gitpod.io/#https://github.com/lemmy/dafny-sort/ In the long run, Github codespaces are, perhaps, be the better infrastructure to build all of this on. |
Ah, okay, thanks that makes sense. I didn't look carefully enough at the URLs. |
Is there still interest in this PR? |
Hi lemmy! I agreed with your point about codespaces being potentially a better option, and I've been trying to find time to evaluate that before investing any more here. Since codespaces isn't generally available yet there's still a possibility this is the right call. Let's keep this open for a bit longer at least while I investigate. |
@lemmy: I followed your TLA link to look at how they hooked gitpod up, but I don't see any evidence of it there any more: https://github.com/tlaplus/Examples/blob/master/README.md Am I missing something or was the integration removed? |
I haven't gotten around to adding it for all examples. It's only on for one of them: https://gitpod.io/#https://github.com/lemmy/BlockingQueue/blob/master/BlockingQueue.tla The config is at https://github.com/lemmy/BlockingQueue/blob/master/.gitpod.yml |
👋 from Gitpod. I've added all of the folks in the |
In light of the comment above re: free Gitpod, and given that GitHub Codespaces have been out for a while now, should we try to pick one for hosting (a) A version of the interactive Dafny tutorial, and/or (b) a setup for people wanting to help develop Dafny? The old Rise4Fun was a useful resource to point newcomers at as a zero-effort way to trying out Dafny. |
That would be very nice. In the long run, though, I would like to do something a bit more ambitious for the Dafny tutorial (something like Alectryon or fslit). |
(I'm not sure whether it's a one-time thing or whether it's like that every time but I tried opening the GitPod link above and "pulling the container image" takes a very long time — compare with the experience of loading up F* + Z3 in https://people.csail.mit.edu/cpitcla/fstar.js/stlc.html, which is a few seconds at most) |
@cpitclaudel I assume startup takes longer with custom Docker containers. If you open, e.g., https://gitpod.io/#https://github.com/lemmy/z3_tutorial, the IDE appears within 10 seconds and is fully provisioned in under 30 seconds. |
@lemmy very nice, thanks! |
Not Gitpod, but still: Prebuild Github Codespaces (https://docs.github.com/en/codespaces/prebuilding-your-codespaces). |
Set up gitpod IDE - a browser-based/zero-install VSCode clone - for the Dafny online tutorial.
Try it out yourself at https://gitpod.io/#https://github.com/dafny-lang/dafny/
Screencast/demo at https://tla.msr-inria.inria.fr/kuppe/gitpod-dafny.mp4
rise4fun has reached its lifetime and capacity (TLA has started to use a similar setup for its examples: https://github.com/tlaplus/Examples/blob/master/README.md)