diff --git a/cabal.project b/cabal.project index 0db54b93..211a2e09 100644 --- a/cabal.project +++ b/cabal.project @@ -2,4 +2,4 @@ packages: . package grapesy tests: True - flags: +build-demo +build-stress-test + flags: +build-demo +build-stress-test +build-interop diff --git a/cabal.project.ci b/cabal.project.ci index e62380d6..45ccb981 100644 --- a/cabal.project.ci +++ b/cabal.project.ci @@ -2,5 +2,5 @@ packages: . package grapesy tests: True - flags: +build-demo +build-stress-test + flags: +build-demo +build-stress-test +build-interop ghc-options: -Werror diff --git a/dev/disable-ipv6.sh b/dev/disable-ipv6.sh new file mode 100755 index 00000000..6efcc72a --- /dev/null +++ b/dev/disable-ipv6.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +## +## Disable IPv6 for Docker +## +## The gRPC interop tests get confused if IPv6 is enabled: they only expect an +## IPv4 port to be listed by `docker port`, and throw a parse error when there +## is also an IPv6 port. Disabling IPv6 in `/etc/docker/daemon.json` instead +## would be cleaner but does not seem to have the desired effect. +## + +# Disable IPv6 on the host +sysctl -w net.ipv6.conf.all.disable_ipv6=1 +sysctl -w net.ipv6.conf.default.disable_ipv6=1 + +# Restart docker +systemctl restart docker + + diff --git a/dev/grapesy-deps-docker/Dockerfile b/dev/grapesy-deps-docker/Dockerfile new file mode 100644 index 00000000..a1977182 --- /dev/null +++ b/dev/grapesy-deps-docker/Dockerfile @@ -0,0 +1,8 @@ +FROM haskell:9.2.8 +RUN mkdir /var/local/git +RUN git clone https://github.com/well-typed/grapesy.git /var/local/git/grapesy +WORKDIR /var/local/git/grapesy +RUN cabal update -w /opt/ghc/9.2.8/bin/ghc +RUN cabal build -w /opt/ghc/9.2.8/bin/ghc all --only-dependencies +WORKDIR / +RUN rm -rf /var/local/git/grapesy diff --git a/dev/reset-docker.sh b/dev/reset-docker.sh new file mode 100755 index 00000000..5303b5da --- /dev/null +++ b/dev/reset-docker.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +## +## Reset the entire Docker state +## +## Don't use this is you are not sure if you might still need any docker +## images, containers, volumes or networks! +## + +if [ "$(docker ps -q)" ] +then + docker kill $(docker ps -q) +fi + +docker system prune -f --volumes diff --git a/grapesy.cabal b/grapesy.cabal index 6bd0a392..73e3ed92 100644 --- a/grapesy.cabal +++ b/grapesy.cabal @@ -386,6 +386,22 @@ executable test-stress buildable: False +executable grapesy-interop + import: + lang + hs-source-dirs: + interop + main-is: + Main.hs + build-depends: + , grapesy + build-depends: + , base + + if !flag(build-interop) + buildable: + False + Flag build-demo description: Build the demo default: False @@ -396,7 +412,13 @@ Flag build-stress-test default: False manual: True +Flag build-interop + description: Build the gRPC interop test executable + default: False + manual: True + Flag crypton description: Use the crypton-x509-* package family instead of x509-* default: True manual: False + diff --git a/interop/Main.hs b/interop/Main.hs new file mode 100644 index 00000000..df655f01 --- /dev/null +++ b/interop/Main.hs @@ -0,0 +1,8 @@ +module Main where + +import System.Environment + +main :: IO () +main = do + args <- getArgs + putStrLn $ "grapesy interop " ++ show args \ No newline at end of file