Skip to content

Instantly share code, notes, and snippets.

@solatis
Created May 22, 2019 07:37
Show Gist options
  • Save solatis/e5ceb111333d0c30191d86b9268ebbfa to your computer and use it in GitHub Desktop.
Save solatis/e5ceb111333d0c30191d86b9268ebbfa to your computer and use it in GitHub Desktop.
FROM ubuntu:latest
RUN apt-get update -y && apt-get install python-pip cmake wget -y
RUN mkdir qdb-api && cd qdb-api && wget https://s3-eu-west-1.amazonaws.com/download.quasardb.net/quasardb/3.3/3.3.0/api/c/qdb-api_3.3.0-1.deb && dpkg -i qdb-api_3.3.0-1.deb && apt install -y -f
RUN pip install quasardb && pip install psutil
FROM ubuntu:latest
RUN apt-get update -y && apt-get install wget -y
RUN wget https://s3-eu-west-1.amazonaws.com/download.quasardb.net/quasardb/3.3/3.3.0/server/qdb-server_3.3.0-1.deb && dpkg -i qdb-server_3.3.0-1.deb && apt install -f -y
RUN wget https://s3-eu-west-1.amazonaws.com/download.quasardb.net/quasardb/3.3/3.3.0/api/c/qdb-api_3.3.0-1.deb && dpkg -i qdb-api_3.3.0-1.deb && apt install -f -y
RUN wget https://s3-eu-west-1.amazonaws.com/download.quasardb.net/quasardb/3.3/3.3.0/rest/qdb-rest_3.3.0-1.deb && dpkg -i qdb-rest_3.3.0-1.deb && apt install -f -y
RUN wget https://s3-eu-west-1.amazonaws.com/download.quasardb.net/quasardb/3.3/3.3.0/utils/qdb-utils_3.3.0-1.deb && dpkg -i qdb-utils_3.3.0-1.deb && apt install -f -y
ENTRYPOINT /usr/bin/qdbd -a eth0:2836
docker build -t server -f Dockerfile.server .
docker build -t client -f Dockerfile.client .
docker run -d -ti --name server server
docker run -ti --name server server
docker run -ti --name client --link server:server client
root@c32f4121491e:/# python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import quasardb
>>> print(quasardb.version())
3.3.0
>>> c = quasardb.Cluster(uri="qdb://server:2836")
>>> ts = c.ts("test")
>>> ts.create([quasardb.ColumnInfo(quasardb.ColumnType.Double, "close"), quasardb.ColumnInfo(quasardb.ColumnType.Int64, "volume"), quasardb.ColumnInfo(quasardb.ColumnType.Timestamp, "value_date")])
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment