sdk: replace custom transport protocol by Capnproto

Initial patch by @talex5

Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
This commit is contained in:
Thomas Gazagnaire
2017-06-14 11:10:04 +01:00
parent a914c0cd2b
commit 03cd4d6fd3
13 changed files with 190 additions and 578 deletions

View File

@@ -1,39 +1,25 @@
BASE=ocaml/opam:alpine-3.5_ocaml-4.04.0
FILES=$(shell find . -name jbuild) \
$(shell find sdk/ -name '*.ml') \
$(shell find sdk/ -name '*.mli') \
dhcp-client/bpf/dhcp.c dhcp-client/main.ml \
dhcp-client-calf/unikernel.ml dhcp-client-calf/config.json
IMAGE=dhcp-client
.PHONY: tag push
default: push
@
.build: Dockerfile $(FILES)
docker build $(NO_CACHE) -t $(IMAGE) -f Dockerfile .
docker build $(NO_CACHE) -t $(IMAGE) -f Dockerfile -q . > .build || \
(rm -f $@ && exit 1)
ORG?=linuxkitprojects
IMAGE=dhcp-client
NOCACHE?=
hash: Makefile Dockerfile $(FILES) .build
{ cat $^; \
docker run --rm --entrypoint sh $(IMAGE) -c 'cat /lib/apk/db/installed'; \
docker run --rm --entrypoint sh $(IMAGE) -c 'opam list'; } \
| sha1sum | sed 's/ .*//' > $@
DEPS=Dockerfile \
$(shell find . -name jbuild) \
$(shell find . -name '*.ml') \
$(shell find . -name '*.mli') \
$(shell find . -name '*.c') \
$(shell find . -name '*.json')
tag: .build
docker tag $(IMAGE) linuxkitprojects/$(IMAGE):$(shell cat hash)
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
push: hash .build
docker pull $(BASE)
docker pull linuxkitprojects/$(IMAGE):$(shell cat hash) || \
(docker tag $(IMAGE) linuxkitprojects/$(IMAGE):$(shell cat hash) && \
docker push linuxkitprojects/$(IMAGE):$(shell cat hash))
tag: $(DEPS)
docker build --squash $(NOCACHE) -t $(ORG)/$(IMAGE):$(HASH) .
clean::
rm -rf hash .build
(docker rmi -f $(IMAGE) || echo ok)
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)
#### DEV
@@ -42,11 +28,9 @@ clean::
test:
jbuilder runtest --dev
dev-clean:
rm -rf _build
clean:
jbuilder clean
dev:
jbuilder build dhcp-client/main.exe --dev
jbuilder build dhcp-client-calf/unikernel.exe --dev
.DELETE_ON_ERROR: