# HG changeset patch # User drewp@bigasterisk.com # Date 1555828231 25200 # Node ID 4c68b604c7ec989d620011b63dd765540715b6df # Parent d96621e2fc0867943e458abc83c045bf89aa596f change port, put to /values, build updates Ignore-this: 8ebe7c9293d7ae47f6de73677053cafb diff -r d96621e2fc08 -r 4c68b604c7ec service/store/Dockerfile --- a/service/store/Dockerfile Sat Apr 20 23:29:44 2019 -0700 +++ b/service/store/Dockerfile Sat Apr 20 23:30:31 2019 -0700 @@ -7,6 +7,6 @@ COPY *.py *.html ./ -EXPOSE 11014 +EXPOSE 10015 CMD [ "python", "./store.py" ] diff -r d96621e2fc08 -r 4c68b604c7ec service/store/index.html --- a/service/store/index.html Sat Apr 20 23:29:44 2019 -0700 +++ b/service/store/index.html Sat Apr 20 23:30:31 2019 -0700 @@ -3,10 +3,41 @@ store + + + + + + + + + + + + +
+ /stats/ + /graph + /graph/events + /values (put) +
+ diff -r d96621e2fc08 -r 4c68b604c7ec service/store/makefile --- a/service/store/makefile Sat Apr 20 23:29:44 2019 -0700 +++ b/service/store/makefile Sat Apr 20 23:30:31 2019 -0700 @@ -1,5 +1,5 @@ JOB=store -PORT=10014 +PORT=10015 TAG=bang6:5000/${JOB}_x86:latest @@ -19,4 +19,7 @@ docker run --rm -it --cap-add SYS_PTRACE --net=host $(TAG) /bin/sh local_run: build_x86 - docker run --rm -it --net=host -v `pwd`/index.html:/opt/index.html -v `pwd`:/opt/homeauto_store bang6:5000/store_x86:latest python ./store.py -v + docker run --rm -it -v `pwd`/index.html:/opt/index.html -v `pwd`:/opt/homeauto_store bang6:5000/store_x86:latest python ./store.py -v + +redeploy: build_image + supervisorctl restart $(JOB)_$(PORT) diff -r d96621e2fc08 -r 4c68b604c7ec service/store/requirements.txt --- a/service/store/requirements.txt Sat Apr 20 23:29:44 2019 -0700 +++ b/service/store/requirements.txt Sat Apr 20 23:30:31 2019 -0700 @@ -1,4 +1,5 @@ rdflib==4.2.2 cyclone -https://projects.bigasterisk.com/rdfdb/rdfdb-0.6.0.tar.gz +https://projects.bigasterisk.com/rdfdb/rdfdb-0.8.0.tar.gz rdflib-jsonld==0.3 +git+http://github.com/drewp/scales.git@448d59fb491b7631877528e7695a93553bfaaa93#egg=scales diff -r d96621e2fc08 -r 4c68b604c7ec service/store/store.py --- a/service/store/store.py Sat Apr 20 23:29:44 2019 -0700 +++ b/service/store/store.py Sat Apr 20 23:30:31 2019 -0700 @@ -23,17 +23,17 @@ CTX = ROOM['stored'] -class OutputPage(cyclone.web.RequestHandler): +class ValuesResource(cyclone.web.RequestHandler): def put(self): arg = self.request.arguments if arg.get('s') and arg.get('p'): self._onQueryStringStatement(arg['s'][-1], arg['p'][-1], self.request.body) else: self._onGraphBodyStatements(self.request.body, self.request.headers) - + post = put def _onQueryStringStatement(self, s, p, body): - subj = URIRef(arg['s'][-1]) - pred = URIRef(arg['p'][-1]) + subj = URIRef(s) + pred = URIRef(p) turtleLiteral = self.request.body try: obj = Literal(float(turtleLiteral)) @@ -77,14 +77,14 @@ if dbFile.exists(): masterGraph._graph.parse(dbFile.open(), format='nquads') - port = 10014 + port = 10015 reactor.listenTCP(port, cyclone.web.Application([ (r"/()", cyclone.web.StaticFileHandler, {"path": ".", "default_filename": "index.html"}), (r"/graph", CycloneGraphHandler, {'masterGraph': masterGraph}), (r"/graph/events", CycloneGraphEventsHandler, {'masterGraph': masterGraph}), - (r'/output', OutputPage), + (r'/values', ValuesResource), ], masterGraph=masterGraph, dbFile=dbFile, debug=arg['-v']), interface='::') log.warn('serving on %s', port)