-
Notifications
You must be signed in to change notification settings - Fork 38
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
Arm64 Support In Dockerfile #21
Conversation
Ping @psftw could you please share your thoughts on this. |
@psftw Kindly have a look on this PR |
Thanks for your work on this @odidev. Unfortunately right now I don't have the time to see this through, and merging/publishing prematurely would be a mistake. This PR only addresses 8.8, which in the past I had experimented with and ran in to usability problems (many of which may be resolved now). I'm not sure of the current 8.8/8.10 status for GHC (+ tooling/ecosystem) on ARM, but I'd like to do significant testing and research to make sure we are not releasing anything we shouldn't be. I'm pretty sure a number of caveats would need to be documented for users in any case. I'd also like to have a sustainable smoke-testing process that can integrate with (or replace) the existing github actions. It is possible to temporarily spin up an ARM server and use it as a github action runner, but this is not ideal. |
I think this needs doing for 8.10 too? |
8.8/buster/Dockerfile
Outdated
xz-utils \ | ||
zlib1g-dev && \ | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git wget \ |
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.
don't need wget
8.8/buster/Dockerfile
Outdated
g++ netbase xz-utils libnuma-dev make openssh-client && \ | ||
export GNUPGHOME="$(mktemp -d)" && \ | ||
if [ `uname -m` = "aarch64" ] ; then \ | ||
wget https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-aarch64-deb9-linux.tar.xz && \ |
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.
You need to verify the download just like for stack.
Hi, Added the support for arm64 in Dockerfile for 8.8 and 8.10 The stack consist of binary whereas binary of ghc is unavailable so i cannot verify the tar as these tar consists of the source for arm64. |
@GrahamCampbell |
I think the best approach now would be to only add ARM support for GHC 8.10.3, since there is official support now. There are a lot of issues with ARM on 8.8, even if it does "build". The 8.8 series should be left alone. |
As far as I'm aware, GHC 8.10.3 is the first version of GHC where ARM64 support could actually be described as "mostly working" on Linux: https://downloads.haskell.org/~ghc/8.10.3/ghc-8.10.3-aarch64-deb10-linux.tar.xz. |
8.10/buster/Dockerfile
Outdated
RUN arch=`uname -m` && \ | ||
export GNUPGHOME="$(mktemp -d)" && \ | ||
if [ $arch = "aarch64" ] ; then \ | ||
curl -fSL https://github.com/commercialhaskell/stack/releases/download/v2.1.3/stack-2.1.3-linux-$arch.tar.gz -o stack.tar.gz && \ |
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.
version should not be hard coded
Signed-off-by: odidev <[email protected]>
I have amended the changes as per the given suggestions. Now this PR only consists of the changes for 8.10 buster, here 8.10.3 ghc version is used for arm64 development and the latest version of stack available for arm64 is 2.1.3. So I have updated the stack version for arm64. Can you please review the latest commits and let me know if any further changes is required |
Not up to me at this point. Up to one of the maintainers with write permissions. |
Likely they will say wait till the debian builds are ready, then change the code back: #31 (comment). |
I saw there was a GHC 8.10.4 released yesterday, so I made a few tweaks to this PR and built it on an AWS Graviton system. While I was able to get it "working", there are still critical issues with releasing an aarch64 image. Without cabal-install (and ideally Stack as well) I don't think we should ship. I would rather the issues with packaging get resolved upstream instead of hacking something here. The line in your PR to install the cabal-install package brings in another set of packages including an older GHC from upstream Debian repositories which is not what we want. Similarly, including an old version of Stack because they no longer provide binaries for aarch64 is also not going to fly. |
ghcup supports arm now and I also have an unofficial stack binary: https://downloads.haskell.org/ghcup/unofficial-bindists/stack/2.7.3/stack-2.7.3-linux-armv7 (not distributed... these were built in an attempt to migrate stack CI to GHC gitlab, which has first-class support for ARM) See: |
@psftw any chance to move this forward? Arm docker images for GHC would be a great help for package maintainers. |
Thanks for the ping on this @Bodigrim . FYI @psftw has stepped down from maintaining this project after many years of service. I believe the major blockers at this point are:
I'll see if I can get something fully working in travis CI with stack 2.7.1 for now. If that works then perhaps we can bug the stack maintainers (or offer a hand) :) |
Hmm dang, seems that the haskell github org is out of travis ci credits. |
Yeah, Travis is no longer an option for OSS maintainers. I have successful experience with ARM machines provided by drone.io, see https://github.com/haskell/bytestring/blob/master/.drone.yml and https://github.com/haskell/text/blob/master/.drone.yml Even a |
Ah drone looks nice thanks I'll try that. Yeah, ideally we get stack too, but if it is not likely to be possible anytime soon I think it can be omitted (or just provide stack 2.7.1 for now). |
Although, I think someone who is a haskell org admin would need to follow https://docs.drone.io/server/provider/github/ or apply the setup bytestring has to docker-haskell? Do drone host all the 'server' and 'runner' agents for us? |
I've been working on ghcup docker images, which are more flexible and lightweight than At any rate, it's not hard to install ghcup in a stock arm64 image. |
@AlistairB I set up drone.io for @hasufell true, but installing everything from the scratch takes too long for a low-latency CI, which is my use case. |
@Bodigrim, @AlistairB already has admin access to this repo (docker-haskell). Did you mean another repo? |
Ah, good, then he should be able to set up drone.io for |
Ah hmm, ok let me have another go. The instructions seemed to suggest it needs to be done at an org level. |
So I've been playing with the emulated approach. The good news I think I have a good pattern now to make the Dockerfiles processor architecture agnostic in that PR. Unfortunately the emulated approach is not working as @Bodigrim Re drone, am I correct in thinking I would need to run 'servers' and/or 'runners' myself somewhere? The instructions ask me to set up a GitHub OAuth App. And I would need to host some I don't really want to host anything myself (if I am understanding this all correctly) and if I did I would probably set up a self hosted github CI agent. I think if there are no viable non-self hosted options, it is actually not the worst to just have no CI verifying ARM in this repo. As when new releases are PRed against https://github.com/docker-library/official-images as part of the release process their CI should check everything. |
@AlistairB Drone provides both servers and runners. I remember that GitHub integration was not documented well, but I managed to setup it for bytestring and text - just do not remember how :) Dunno, try adding .drone.yml to a fork first and see whether you can integrate it? |
Ok thanks that is good to know. I will figure this out! 😅 |
Just an update:
|
Going to close this PR and continue with the other one. Thanks @odidev this was useful to show how it is done! |
#1
Added the support for arm64 in Dockerfile.
As GHC official binaries are not yet released for arm64, I am building the GHC binaries from its source.