Skip to content

Commit cf30702

Browse files
committed
CI: Use Ubuntu 22.04, drop 18.04
GitHub Actions has deprecated its Ubuntu 18.04 runners, and they will be removed by December 1, 2022. Moreover, GitHub Actions now offers Ubuntu 22.04 runners. It seems like a good time to upgrade our CI accordingly. Somewhat annoyingly, the `haskell` Docker images that we use in our Dockerfiles use such an old version of Debian that their version of `glibc` is incompatible with any of the `what4-solvers` built for Ubuntu 20.04 or 22.04. As a result, I switched them from the `haskell` Docker image to the `ubuntu` one. This required some minor tweaks to how dependencies are installed, but nothing too serious. Fixes #1741. By upgrading the version of the solvers being used, this also fixes #1744.
1 parent 1ea10d0 commit cf30702

File tree

6 files changed

+73
-31
lines changed

6 files changed

+73
-31
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.DS_Store
44
.cabal-sandbox
55
cabal.sandbox.config
6+
cabal.project.local
67
.ghc.environment.x86_64-darwin-*
78
s2nTests
89

.github/workflows/ci.yml

+26-17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Overall configuration notes:
22
# - Artifact uploads for binaries are from GHC 8.10.7
3-
# - Builds for Ubuntu happen on 18.04 (would like to include 20.04, in addition)
3+
# - Builds for Ubuntu happen on 22.04. We also include a single configuration
4+
# for 20.04 to increase our Linux coverage.
45
# - Docker builds happen nightly, on manual invocation, and on release branch commits
56
# Please update this comment as those details change.
67

@@ -23,13 +24,13 @@ env:
2324
# ./saw-remote-api/Dockerfile
2425
# ./s2nTests/scripts/blst-entrypoint.sh
2526
# ./s2nTests/docker/saw.dockerfile
26-
SOLVER_PKG_VERSION: "snapshot-20220721"
27+
SOLVER_PKG_VERSION: "snapshot-20220902"
2728

2829
OCAML_VERSION: 4.09.x
2930

3031
jobs:
3132
config:
32-
runs-on: ubuntu-latest
33+
runs-on: ubuntu-22.04
3334
outputs:
3435
name: ${{ steps.config.outputs.name }}
3536
version: ${{ steps.config.outputs.version }}
@@ -66,20 +67,28 @@ jobs:
6667
strategy:
6768
fail-fast: false
6869
matrix:
69-
os: [ubuntu-18.04, macos-12, windows-latest]
70+
os: [ubuntu-22.04, macos-12, windows-latest]
7071
ghc: ["8.8.4", "8.10.7", "9.0.2"]
72+
run-tests: [true]
73+
include:
74+
- os: ubuntu-20.04
75+
ghc: "8.10.7"
76+
run-tests: false
7177
exclude:
7278
# Exclude 8.8 on macOS 12 due to
7379
# https://gitlab.haskell.org/ghc/ghc/-/issues/18446
7480
- os: macos-12
7581
ghc: "8.8.4"
82+
run-tests: true
7683
- os: windows-latest
7784
ghc: "8.8.4"
85+
run-tests: true
7886
# Exclude 9.0 on Windows for now until
7987
# https://github.com/commercialhaskell/stackage/issues/6400
8088
# is resolved
8189
- os: windows-latest
8290
ghc: "9.0.2"
91+
run-tests: false
8392
outputs:
8493
cabal-test-suites-json: ${{ steps.cabal-test-suites.outputs.targets-json }}
8594
steps:
@@ -91,9 +100,9 @@ jobs:
91100
- id: config
92101
shell: bash
93102
run: |
94-
NAME="${{ needs.config.outputs.name }}-${{ runner.os }}-x86_64"
103+
NAME="${{ needs.config.outputs.name }}-${{ matrix.os }}-x86_64"
95104
.github/ci.sh output name $NAME
96-
echo "NAME=${{ needs.config.outputs.name }}-${{ runner.os }}-x86_64" >> $GITHUB_ENV
105+
echo "NAME=${{ needs.config.outputs.name }}-${{ matrix.os }}-x86_64" >> $GITHUB_ENV
97106
98107
- uses: haskell/actions/setup@v1
99108
id: setup-haskell
@@ -119,9 +128,9 @@ jobs:
119128
path: |
120129
${{ steps.setup-haskell.outputs.cabal-store }}
121130
dist-newstyle
122-
key: ${{ env.CACHE_VERSION }}-cabal-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles(format('cabal.GHC-{0}.config', matrix.ghc)) }}-${{ github.sha }}
131+
key: ${{ env.CACHE_VERSION }}-cabal-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles(format('cabal.GHC-{0}.config', matrix.ghc)) }}-${{ github.sha }}
123132
restore-keys: |
124-
${{ env.CACHE_VERSION }}-cabal-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles(format('cabal.GHC-{0}.config', matrix.ghc)) }}-
133+
${{ env.CACHE_VERSION }}-cabal-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles(format('cabal.GHC-{0}.config', matrix.ghc)) }}-
125134
126135
- if: needs.config.outputs.release == 'true'
127136
shell: bash
@@ -198,7 +207,7 @@ jobs:
198207
if-no-files-found: error
199208
retention-days: ${{ needs.config.outputs.retention-days }}
200209

201-
- if: "matrix.ghc == '8.10.7'"
210+
- if: matrix.ghc == '8.10.7' && matrix.run-tests
202211
uses: actions/upload-artifact@v2
203212
with:
204213
path: dist/bin
@@ -209,7 +218,7 @@ jobs:
209218
strategy:
210219
fail-fast: false
211220
matrix:
212-
os: [ubuntu-latest, macos-12]
221+
os: [ubuntu-22.04, macos-12]
213222
runs-on: ${{ matrix.os }}
214223
steps:
215224
- uses: actions/checkout@v2
@@ -243,7 +252,7 @@ jobs:
243252
strategy:
244253
fail-fast: false
245254
matrix:
246-
os: [ubuntu-latest, macos-12]
255+
os: [ubuntu-22.04, macos-12]
247256
runs-on: ${{ matrix.os }}
248257
steps:
249258
- uses: actions/checkout@v2
@@ -295,7 +304,7 @@ jobs:
295304
include:
296305
- name: Install and test
297306
test: saw-remote-api/scripts/run_rpc_tests.sh
298-
os: ubuntu-18.04
307+
os: ubuntu-22.04
299308
# TODO: saw-remote-api unit tests are disabled pending a fix for #1699
300309
- name: Install on MacOS
301310
test: |
@@ -306,7 +315,7 @@ jobs:
306315
os: macos-12
307316
- name: Check docs
308317
test: saw-remote-api/scripts/check_docs.sh
309-
os: ubuntu-18.04
318+
os: ubuntu-22.04
310319
steps:
311320
- uses: actions/checkout@v2
312321
with:
@@ -350,7 +359,7 @@ jobs:
350359
fail-fast: false
351360
matrix:
352361
suite: ${{ fromJson(needs.build.outputs.cabal-test-suites-json) }}
353-
os: [ubuntu-18.04]
362+
os: [ubuntu-22.04]
354363
continue-on-error: [false]
355364
include:
356365
- suite: integration_tests
@@ -414,7 +423,7 @@ jobs:
414423
dist-tests/${{ matrix.suite }}
415424
416425
build-push-image:
417-
runs-on: ubuntu-latest
426+
runs-on: ubuntu-22.04
418427
needs: [config]
419428
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || needs.config.outputs.release == 'true'
420429
strategy:
@@ -516,7 +525,7 @@ jobs:
516525
name: "Test s2n proofs"
517526
timeout-minutes: 120
518527
needs: build
519-
runs-on: ubuntu-18.04
528+
runs-on: ubuntu-22.04
520529
strategy:
521530
fail-fast: false
522531
matrix:
@@ -569,7 +578,7 @@ jobs:
569578
# - changes to jobs or job instances don't require a mergify config update
570579
# - dependencies through `needs:` are validated, CI will fail if it's invalid
571580
mergify:
572-
runs-on: ubuntu-latest
581+
runs-on: ubuntu-22.04
573582
needs:
574583
- build
575584
- heapster-tests

s2nTests/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ This directory contains Docker configurations for running some more complex cryp
33
(These are the same configurations used in our GitHub Actions CI.)
44

55
## Building SAWScript
6-
Running `make saw-script` will build SAWScript from the current working tree and place the resulting `saw` binary in `bin/`. This is useful if you develop on a system that isn't binary-compatible with Ubuntu 18.04 (e.g. macOS or NixOS).
6+
Running `make saw-script` will build SAWScript from the current working tree and place the resulting `saw` binary in `bin/`. This is useful if you develop on a system that isn't binary-compatible with Ubuntu 22.04 (e.g. macOS or NixOS).
77

88
## Running tests
99
Running `make <target>` on one of the following targets will use the `saw` binary in `bin/` to run the respective proof:

s2nTests/scripts/blst-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cd /workdir
55
./scripts/install.sh
66
cp /saw-bin/saw bin/saw
77

8-
wget --quiet -O solvers.zip "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20210917/ubuntu-20.04-bin.zip"
8+
wget --quiet -O solvers.zip "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20220902/ubuntu-20.04-bin.zip"
99
(cd bin && unzip -o ../solvers.zip)
1010
chmod +x bin/*
1111

saw-remote-api/Dockerfile

+22-6
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,41 @@
1-
FROM haskell:8.8.4 AS build
1+
FROM ubuntu:22.04 AS build
22
USER root
3-
RUN apt-get update && apt-get install -y wget libncurses-dev unzip
3+
RUN apt-get update && \
4+
apt-get install -y \
5+
# ghcup requirements
6+
build-essential curl libffi-dev libffi8 libgmp-dev libgmp10 libncurses-dev libncurses6 libtinfo6 \
7+
# SAW dependencies
8+
zlib1g-dev \
9+
# Miscellaneous
10+
git wget unzip
411
RUN useradd -m saw
512
COPY --chown=saw:saw . /home/saw
613
USER saw
714
WORKDIR /home/saw
815
ENV LANG=C.UTF-8 \
916
LC_ALL=C.UTF-8
1017
COPY cabal.GHC-8.8.4.config cabal.project.freeze
18+
ENV PATH=/home/saw/ghcup-download/bin:/home/saw/.ghcup/bin:$PATH
19+
RUN mkdir -p /home/saw/ghcup-download/bin && \
20+
curl -L https://downloads.haskell.org/~ghcup/0.1.17.7/x86_64-linux-ghcup-0.1.17.7 -o /home/saw/ghcup-download/bin/ghcup && \
21+
chmod +x /home/saw/ghcup-download/bin/ghcup
22+
RUN mkdir -p /home/saw/.ghcup && \
23+
ghcup --version && \
24+
ghcup install cabal 3.6.2.0 && \
25+
ghcup install ghc 8.8.4 && \
26+
ghcup set ghc 8.8.4
1127
RUN cabal v2-update && cabal v2-build -j exe:saw-remote-api
1228
RUN mkdir -p /home/saw/rootfs/usr/local/bin
1329
RUN cp $(cabal v2-exec which saw-remote-api) /home/saw/rootfs/usr/local/bin/saw-remote-api
1430
WORKDIR /home/saw//rootfs/usr/local/bin
15-
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20210917/ubuntu-18.04-bin.zip"
31+
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20220902/ubuntu-22.04-bin.zip"
1632
RUN unzip solvers.zip && rm solvers.zip && chmod +x *
1733
USER root
1834
RUN chown -R root:root /home/saw/rootfs
1935

20-
FROM debian:buster-slim
21-
RUN apt-get update \
22-
&& apt-get install -y libgmp10 libgomp1 libffi6 wget libncurses5 unzip libreadline-dev openjdk-11-jdk-headless
36+
FROM ubuntu:22.04
37+
RUN apt-get update && \
38+
apt-get install -y libgmp10 libgomp1 libffi8 wget libncurses6 unzip libreadline-dev openjdk-11-jdk-headless
2339
COPY --from=build /home/saw/rootfs /
2440
RUN useradd -m saw && chown -R saw:saw /home/saw
2541
USER saw

saw/Dockerfile

+22-6
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,42 @@
1-
FROM haskell:8.8.4 AS build
1+
FROM ubuntu:22.04 AS build
22
USER root
3-
RUN apt-get update && apt-get install -y wget libncurses-dev unzip
3+
RUN apt-get update && \
4+
apt-get install -y \
5+
# ghcup requirements
6+
build-essential curl libffi-dev libffi8 libgmp-dev libgmp10 libncurses-dev libncurses6 libtinfo6 \
7+
# SAW dependencies
8+
zlib1g-dev \
9+
# Miscellaneous
10+
git wget unzip
411
RUN useradd -m saw
512
COPY --chown=saw:saw . /home/saw
613
USER saw
714
WORKDIR /home/saw
815
ENV LANG=C.UTF-8 \
916
LC_ALL=C.UTF-8
1017
COPY cabal.GHC-8.8.4.config cabal.project.freeze
18+
ENV PATH=/home/saw/ghcup-download/bin:/home/saw/.ghcup/bin:$PATH
19+
RUN mkdir -p /home/saw/ghcup-download/bin && \
20+
curl -L https://downloads.haskell.org/~ghcup/0.1.17.7/x86_64-linux-ghcup-0.1.17.7 -o /home/saw/ghcup-download/bin/ghcup && \
21+
chmod +x /home/saw/ghcup-download/bin/ghcup
22+
RUN mkdir -p /home/saw/.ghcup && \
23+
ghcup --version && \
24+
ghcup install cabal 3.6.2.0 && \
25+
ghcup install ghc 8.8.4 && \
26+
ghcup set ghc 8.8.4
1127
RUN cabal v2-update
1228
RUN cabal v2-build
1329
RUN mkdir -p /home/saw/rootfs/usr/local/bin
1430
RUN cp $(cabal v2-exec which saw) /home/saw/rootfs/usr/local/bin/saw
1531
WORKDIR /home/saw//rootfs/usr/local/bin
16-
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20210917/ubuntu-18.04-bin.zip"
32+
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20220902/ubuntu-22.04-bin.zip"
1733
RUN unzip solvers.zip && rm solvers.zip && chmod +x *
1834
USER root
1935
RUN chown -R root:root /home/saw/rootfs
2036

21-
FROM debian:buster-slim
22-
RUN apt-get update \
23-
&& apt-get install -y libgmp10 libgomp1 libffi6 wget libncurses5 libreadline-dev unzip
37+
FROM ubuntu:22.04
38+
RUN apt-get update && \
39+
apt-get install -y libgmp10 libgomp1 libffi8 wget libncurses6 libreadline-dev unzip
2440
COPY --from=build /home/saw/rootfs /
2541
RUN useradd -m saw && chown -R saw:saw /home/saw
2642
USER saw

0 commit comments

Comments
 (0)