git clone [email protected]:basho-labs/marqs-ingest.git
-
Use python script to query Marathon and set env vars (or maybe do it instead in each step so they're not dependent on this step?)
- KAFKA_BROKERS
- KAFKA_TOPIC
- MESOS_MASTER
- RIAK_DIRECTOR_HOST
- RIAK_HTTP_PORT
- RIAK_PB_PORT
- RIAK_TABLE
- ZOOKEEPER
docker run -it -rm basho/dcos
dcos kafka topic add...
docker run *some-dockerhub-image*/kafka
(or maybe we make our own kafka docker image?
- command line producer write contents of data-file-from-repo:
/opt/kafka_2.10-0.8.2.2/bin/kafka-console-producer.sh --broker-list $KAFKA_BROKERS --topic $KAFKA_TOPIC < /data-file-from-repo.json
docker run -it basho/riak-python
import riak
marathonAPI = 'http://marathon.mesos:8080'
url = '%s/v2/apps/riak-director/tasks' % marathonAPI
j = json.load(urllib2.urlopen(url))
host = j['tasks'][0]['host']
# the protobuf port is the second item in the list of ports
pb_port = j['tasks'][0]['ports'][1]
hostAndPort = ':'.join([host, str(pb_port)])
client = riak.RiakClient(host=host, pb_port=pb_port)
tableName = 'ingest9999'
table = client.table(tableName)
create_sql = '''CREATE TABLE %(tableName)s (
site varchar not null,
species varchar not null,
measurementDate timestamp not null,
value double,
PRIMARY KEY ((site, species, quantum(measurementDate, 24, h)),
site, species, measurementDate))
''' % ({'tableName': tableName})
result = table.query(create_sql)
docker run spark/dcos-spark
dcos marathon app add marathon.json
sleep 180
- check all test data has been written to riak
- compare to data file from github
docker run -it basho/riak-python
curl -v -XDELETE http://leader.mesos:8080/v2/apps/marqs-ingest