-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add Docker image and continuous deployment for it #219
Conversation
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 looks great to me! I've added a couple of minor comments to this review. I'll do some more testing and sync up with @emina to generate the tokens. Will we be able to test the GitHub Action Docker build/push workflow in response to this PR before merging it in to master
?
It seems that the personal access token |
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.
Thanks for doing this, it's super awesome and automates a task I've done by hand many times before :-)
A lot of great comments. Let me integrate all of this! |
Following @lukenels's suggestion, the entry point is now
However, as of now, the REPL starts with:
before working fine (but without readline). I tried fixing it quickly with |
I haven't been successful fixing this readline issue within Alpine because |
Alright, I fixed the REPL. Somehow, there was a big inconsistency problem between
(Later, of course, this will be possible with simply Should I propose a modification of the README to mention the Docker image or are we happy with keeping it a little bit more discrete? (It will still show up on the left panel in the |
I don't think the Let's hold off on README changes for now so we can do some end-to-end tests once this commit has landed and caused the image to be pushed to GitHub. |
Alright. I just removed my last commit, then. It is still available on my fork in branch |
Racket 8.4 switches to use Chez Scheme's expeditor instead of libedit / readline. My very wild guess is that it couldn't find the necessary library for building expeditor (ncurses in particular), so it falls back to readline / libedit, but since Racket no longer uses readline by default, something's gone wrong. |
Do you think we should fix the image by installing the appropriate dependencies (eg. |
My tests seem to suggest that you were very right @sorawee: the problem can be fixed by installing the |
Ah, nice! I think this is better, especially if it only incurs not too much space, so this is better, I believe. |
This is awesome:
@lukenels is the expert here so I'll let him comment before merging, but this looks good to me! |
This looks great to me! The checks just finished running on the latest commit, so I'll go ahead and merge it now. If everything goes well it should publish the image to ghcr shortly 😄 |
closes #217
This PR defines a Docker image with just enough to run Rosette with Z3. It also adds a GitHub workflow to automatically build the Docker image on pushes to
main
and pull requests and to automatically publish the Docker image to GitHub Packages.In general, I believe the Docker image is quite well documented. A lot of things have also been discussed in #217. For the base image, the choice was to work from scratch, building on top of Alpine and installing Racket by hand. It should be fairly easy to update the Dockerfile for another version of Racket.
The Docker image has a bit of a complicated structure:
info.rkt
files and uses them to install all of Rosette's dependencies. (The trick that I use for that seems fairly complicated: if you have a better solution, I'd love to hear it!)The reason for this structure is to make the best use of Docker's cache: as long as
info.rkt
do not change, rebuilding the Docker image is only a matter of rebuilding Rosette. (On my laptop, around 45 seconds.) This can be practical when developing locally with Rosette. It also speeds up the continuous deployment when there has been a build less than seven (ten?) days before.The Docker image presents a user
rosette
in grouprosette
, working in/rosette
by default. It is fairly easy to make Rosette work on external files by use of mounting, eg. with:while having an appropriate
test.rkt
file in the current directory. You may actually try the above command withghcr.io/niols/rosette:docker-demo
which I published for demonstration purposes and will remove after this PR is done. This will require you to login to GHCR as shown here, you might want a PAT with no specific rights for that.The Docker image does not contain documentation of Rosette or its dependencies, so as to reduce its size. If you knew how I could also remove build dependencies, that would be great. The Docker image is also built on top of Racket minimal and does not include what is necessary to run DrRacket. I didn't think it was the goal but if I am mistaken please let me know and I will fix it.
I took the liberty to add a configuration for Dependabot, that creates pull requests whenever GitHub Action dependencies can be updated (eg.
action/checkout
).In order to work properly, the GitHub Action workflow needs to be able to push to GitHub Packages. This can be done in the global Settings > Developer Settings > Personal access tokens, by creating a new token that has thewrite:packages
rights (which will imply therepo
rights). This token then has to be provided as a secret in the repository's Settings > Secrets > Actions under the nameBOT_PAT
. I can rename this in something else if you think that is more appropriate, eg.GHCR_PAT
?We could easily adapt this PR to publish to Docker Hub instead, which would avoid requiring people to login to GitHub Packages and have the image be named
emina/rosette
instead ofghcr.io/emina/rosette
.I probably forgot a lot of things, so don't hesitate to shoot if you have questions!