Skip to content

Commit

Permalink
Fix nightly builds (#1101)
Browse files Browse the repository at this point in the history
* Restore files used in nightly
* fix helm test to use renamed argo
* point test to correct python location
* use python 3.9 for :=
  • Loading branch information
LisannaAtGalois authored Mar 10, 2021
1 parent 9943b5c commit 8a0a009
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,20 @@ jobs:
- name: Build test-cryptol-remote-api
uses: docker/build-push-action@v1
with:
tags: test
repository: galoisinc/cryptol-remote-api
tags: latest
repository: galoisinc/test-cryptol-remote-api
push: false
dockerfile: cryptol-remote-api/test/Dockerfile
dockerfile: cryptol-remote-api/test.Dockerfile
- name: Test cryptol-remote-api helm chart
run: |
set -x
kind create cluster --wait 10m
kind load docker-image galoisinc/cryptol-remote-api:nightly
kind load docker-image galoisinc/cryptol-remote-api:test
kind load docker-image galoisinc/test-cryptol-remote-api:latest
helm install --wait cra-http ./helm/cryptol-remote-api --set server.connType=http --set image.tag=nightly
helm install --wait cra-socket ./helm/cryptol-remote-api --set server.connType=socket --set image.tag=nightly
kubectl run --rm --attach test-http --image=galoisinc/cryptol-remote-api:test --image-pull-policy=Never --restart=Never -- http cra-http-cryptol-remote-api 8080
kubectl run --rm --attach test-socket --image=galoisinc/cryptol-remote-api:test --image-pull-policy=Never --restart=Never -- socket cra-socket-cryptol-remote-api 8080
kubectl run --rm --attach test-http --image=galoisinc/test-cryptol-remote-api --image-pull-policy=Never --restart=Never -- http cra-http-cryptol-remote-api 8080
kubectl run --rm --attach test-socket --image=galoisinc/test-cryptol-remote-api --image-pull-policy=Never --restart=Never -- socket cra-socket-cryptol-remote-api 8080
docker-cryptol-remote-api-portable:
runs-on: ubuntu-latest
Expand Down
17 changes: 17 additions & 0 deletions cryptol-remote-api/test-cryptol-remote-api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import sys
import argo_client.connection as argo
import cryptol

connType = sys.argv[1]
host = sys.argv[2]
port = int(sys.argv[3])

if connType == 'socket':
c = cryptol.connect(argo.RemoteSocketProcess(host, port=port, ipv6=False))
elif connType == 'http':
c = cryptol.CryptolConnection(argo.ServerConnection(argo.HttpProcess(url="http://%s:%d/" % (host,port))))
else:
raise Exception('specify socket or http for connection type')

c.load_module('Cryptol')
assert c.evaluate_expression("1+1").result()['value'] == 2
8 changes: 8 additions & 0 deletions cryptol-remote-api/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.9
# Intended to be built from the root of the cryptol git repository

COPY cryptol-remote-api/python python
RUN pip3 install -r python/requirements.txt
RUN pip3 install -e python
COPY cryptol-remote-api/test-cryptol-remote-api.py /entrypoint.py
ENTRYPOINT ["python3", "/entrypoint.py"]

0 comments on commit 8a0a009

Please sign in to comment.