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

Ekw/sre 996/release ghc alpine #4

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cf9e109
Add workflow to build ghc-alpine
EmilKWarmdahl Nov 5, 2024
45ab009
update version
EmilKWarmdahl Nov 5, 2024
c06565b
Add environment
EmilKWarmdahl Nov 5, 2024
58d184c
Change output folder in docker image
EmilKWarmdahl Nov 5, 2024
33dc56f
Use run instead of entryopint
EmilKWarmdahl Nov 5, 2024
4b2ebee
run script from different folder
EmilKWarmdahl Nov 5, 2024
9fc4f25
run script from different folder
EmilKWarmdahl Nov 5, 2024
e7720d9
run script from different folder
EmilKWarmdahl Nov 5, 2024
412b298
Add constraints to cabal install
EmilKWarmdahl Nov 5, 2024
b60ba86
Add constraints to cabal install
EmilKWarmdahl Nov 5, 2024
6892721
Add constraints to cabal install
EmilKWarmdahl Nov 5, 2024
272eb15
Add constraints to cabal install
EmilKWarmdahl Nov 5, 2024
bc72bb6
install happy 1.20
EmilKWarmdahl Nov 5, 2024
4590006
use happy 1.20.1.1
EmilKWarmdahl Nov 5, 2024
5d82575
Install more dependencies
EmilKWarmdahl Nov 6, 2024
23d97b9
Revert to look like jenkins pipeline
EmilKWarmdahl Nov 22, 2024
8416c61
Test without push
EmilKWarmdahl Dec 4, 2024
b6b69db
Use correct build script
EmilKWarmdahl Dec 4, 2024
43b8567
Don't run on branch push
EmilKWarmdahl Dec 4, 2024
f1241cb
Add ghc build script
EmilKWarmdahl Dec 17, 2024
28ac0ed
Fix typo
EmilKWarmdahl Dec 17, 2024
d6d1ad9
Fix typo
EmilKWarmdahl Dec 17, 2024
b73be14
Use branch for testing
EmilKWarmdahl Dec 17, 2024
633e50e
Checkout repository
EmilKWarmdahl Dec 19, 2024
846e63c
Do not run on branch push
EmilKWarmdahl Dec 19, 2024
7f8ea58
Test from branch
EmilKWarmdahl Dec 19, 2024
a12c638
Test push
EmilKWarmdahl Dec 19, 2024
04eb9c8
Use original name for artifact
EmilKWarmdahl Dec 19, 2024
8b50dc3
Don't push to branch
EmilKWarmdahl Dec 19, 2024
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
41 changes: 41 additions & 0 deletions .github/workflows/release-ghc-alpine.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
push:
tags:
- alpine-ghc/*

env:
AWS_ROLE_TO_ASSUME: "arn:aws:iam::192549843005:role/github_concordium-ghc"
GHC_VERSION: "9.6.6"
BOOTSTRAP_GHC_VERSION: "9.6.4"

permissions:
id-token: write
contents: read

jobs:
release-fpic:
runs-on: ubuntu-latest
environment: release
steps:

- name: Assume role
uses: aws-actions/configure-aws-credentials@v4
id: creds
with:
aws-region: "eu-west-1"
role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
role-session-name: ReleaseAlpineGhcSession

- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.ref_name }}

- name: Build and push
run: |
# GHC_VERSION corresponds to the version of GHC that we are building.
# BOOTSTRAP_GHC_VERSION corresponds to the version of GHC that we are using to build GHC_VERSION.
GHC_VERSION="${{ env.GHC_VERSION }}" \
BOOTSTRAP_GHC_VERSION="${{ env.BOOTSTRAP_GHC_VERSION }}" \
./scripts/ghc-alpine-build.sh
18 changes: 18 additions & 0 deletions docker/ghc-alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM alpine:latest
ARG GHC_VERSION
ARG BOOTSTRAP_HASKELL_GHC_VERSION

WORKDIR /

# Install system ghc and dependencies
RUN apk add musl-dev python3 autoconf automake ncurses-dev make file g++ xz git bash wget gmp-dev gmp libffi libffi-dev curl
ENV BOOTSTRAP_HASKELL_NONINTERACTIVE=1
ENV BOOTSTRAP_HASKELL_NO_UPGRADE=1
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

# Get GHC source
RUN git clone -b ghc-"$GHC_VERSION"-release https://gitlab.haskell.org/ghc/ghc.git/ --recurse-submodules

COPY scripts/alpine-integer-gmp-ghc.sh /alpine-integer-gmp-ghc.sh
RUN chmod +x /alpine-integer-gmp-ghc.sh
ENTRYPOINT ["./alpine-integer-gmp-ghc.sh"]
21 changes: 21 additions & 0 deletions scripts/alpine-integer-gmp-ghc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -ex

. "$HOME/.ghcup/env"

cd ghc/
cabal install happy alex --install-method=copy
cp ~/.cabal/bin/* /usr/bin

# Build GHC
./boot
./configure --disable-numa
./hadrian/build -j17 --docs=none
mkdir _build/docs
./hadrian/build binary-dist --docs=none

# Copy ghc to out
ls _build
ls _build/bindist
cp _build/bindist/ghc-"$GHC_VERSION"-x86_64-unknown-linux.tar.xz /out/ghc-"$GHC_VERSION"-x86_64-unknown-linux-integer-gmp.tar.xz
8 changes: 8 additions & 0 deletions scripts/ghc-alpine-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -ex

docker build -t concordium/alpine-ghc -f docker/ghc-alpine.Dockerfile --build-arg BOOTSTRAP_HASKELL_GHC_VERSION="$BOOTSTRAP_HASKELL_GHC_VERSION" --build-arg GHC_VERSION="$GHC_VERSION" .
mkdir out
docker run --name alpine-ghc -e GHC_VERSION -v "$(pwd)"/out:/out concordium/alpine-ghc
aws s3 cp out/ghc-"$GHC_VERSION"-x86_64-unknown-linux-integer-gmp.tar.xz s3://static-libraries.concordium.com/ --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers