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

Updated solvers #1744

Closed
weaversa opened this issue Sep 30, 2022 · 4 comments · Fixed by #1746
Closed

Updated solvers #1744

weaversa opened this issue Sep 30, 2022 · 4 comments · Fixed by #1746
Labels
tooling: CI Issues involving CI/CD scripts or processes

Comments

@weaversa
Copy link
Contributor

The cryptol-remote-api container pulls in the latest August release of the solvers -- https://github.com/GaloisInc/cryptol/blob/master/cryptol-remote-api/Dockerfile

where as saw-remote-api is using the year old release of solvers -- https://github.com/GaloisInc/saw-script/blob/master/saw-remote-api/Dockerfile

Will you consider updating the saw-remote-api's solvers to the latest?

@weaversa
Copy link
Contributor Author

@RyanGlScott
Copy link
Contributor

Sure, we could update them. One minor complication is that we can't jump straight to the latest what4-solvers snapshot, as the SAW Docker images use Ubuntu 18.04, but what4-solvers' latest snapshot supports Ubuntu 20.04 as the minimum. We could still update it to snapshot-20220721, however, and that is relatively up to date.

Alternatively, we could wait until we fix #1741, as we will have to update the what4-solvers snapshot to the latest one in order to fix that issue.

@RyanGlScott RyanGlScott added the tooling: CI Issues involving CI/CD scripts or processes label Sep 30, 2022
@weaversa
Copy link
Contributor Author

I'm cheating a bit here by relying on you to build the tools...but it all seems to work on 22.04.

FROM public.ecr.aws/lts/ubuntu:22.04_stable

USER root

RUN ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && echo $CONTAINER_TIMEZONE > /etc/timezone

RUN apt-get update \
    && apt-get install -y libgmp10 libgomp1 libffi8 libncurses6 libtinfo6 libreadline8 libnuma-dev openssl openjdk-11-jdk-headless \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

COPY --from=ghcr.io/galoisinc/saw-remote-api:nightly /usr/local/bin /usr/local/bin

# Grab updated solvers from cryptol-remote-api container
COPY --from=ghcr.io/galoisinc/cryptol-remote-api:nightly /usr/local/bin /usr/local/bin

RUN useradd -m saw && chown -R saw:saw /home/saw
USER saw

ENV LANG=C.UTF-8 \
    LC_ALL=C.UTF-8

ENTRYPOINT ["/usr/local/bin/saw-remote-api"]

WORKDIR /home/saw
# Create self-signed certificates for HTTPS testing purposes - N.B.,
# clients must opt in to accepting these by passing `verify=False` to
# the `cryptol.connect` method (otherwise a security error is raised).
RUN openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr \
      -subj "/C=GB/ST=London/L=London/O=Acme Widgets/OU=IT Department/CN=localhost"
RUN openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

CMD ["http", "--host", "0.0.0.0", "--port", "8080", "/"]

EXPOSE 8080

@RyanGlScott
Copy link
Contributor

It's possible that it could work by accident, but I worry about there being incompatibilities between shared libraries used on Ubuntu 18.04 and 22.04. In practice, I've definitely encountered scenarios where solvers built for one version don't work on another due to glibc version differences.

RyanGlScott added a commit that referenced this issue Oct 3, 2022
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.
RyanGlScott added a commit that referenced this issue Oct 10, 2022
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.
@mergify mergify bot closed this as completed in #1746 Nov 22, 2022
@mergify mergify bot closed this as completed in cf30702 Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling: CI Issues involving CI/CD scripts or processes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants