Skip to content
Snippets Groups Projects
Commit 757189e8 authored by Rodrigo Goncalves's avatar Rodrigo Goncalves
Browse files

Container to configure cassandra

parent 911d3a7f
No related branches found
No related tags found
4 merge requests!25Resolve "CI/CD for SmartDataContext",!24Resolve "Fixes and optimizations for SmartDataContext",!23Resolve "SI Units for Ingress data from TikiWiki",!22Resolve "Unstructured SmartDataContext storage"
FROM debian:12.5-slim
RUN apt update -y
RUN apt install -y python3 python3-pip python3-venv
RUN mkdir /startup
CMD ["/scripts/startup.sh"]
\ No newline at end of file
CREATE TYPE smartdata_v1.v1_1_digital (
value blob,
error tinyint,
confidence tinyint,
gw bigint
);
CREATE TYPE smartdata_v1.v1_1_si (
value double,
error tinyint,
confidence tinyint,
gw bigint
);
CREATE TYPE smartdata_v1.v1_1_si_blob (
period int,
gateway bigint,
uncertainty int,
data blob
);
CREATE TYPE smartdata_v1.v1_2_digital (
value blob,
error tinyint,
confidence tinyint,
x int,
y int,
z int,
gw bigint
);
CREATE TYPE smartdata_v1.v1_2_si (
value double,
error tinyint,
confidence tinyint,
x int,
y int,
z int,
gw bigint
);
CREATE TYPE smartdata_v1.v1_2_si_blob (
x int,
y int,
z int,
period int,
gateway bigint,
uncertainty int,
data blob
);
\ No newline at end of file
DROP KEYSPACE IF EXISTS smartdata_v1;
CREATE KEYSPACE smartdata_v1 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;
USE smartdata_v1;
\ No newline at end of file
#!/bin/bash
cd /startup
python3 -m venv venv
source ./venv/bin/activate
pip3 install cqlsh
while ! cqlsh -e 'describe cluster' cassandra ; do
echo Waiting for cassandra to startup...
sleep 1
done
cqlsh -f /scripts/keyspace.sql cassandra
cqlsh -f /scripts/entry.sql cassandra
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment