Skip to content

Commit b29cd8d

Browse files
committed
Merge branch 'ais'
2 parents 1e75637 + 5f49145 commit b29cd8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4515
-0
lines changed

maritime-ais/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.env
2+
cloud_ingest.sh
3+
notes.adoc
4+
cloud.adoc

maritime-ais/README.adoc

Lines changed: 1098 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/env bash
2+
3+
echo "
4+
Make sure you that create the target topic first
5+
6+
-------
7+
ccloud login --save
8+
ccloud kafka cluster list
9+
ccloud kafka cluster use <your cluster>
10+
ccloud kafka topic create ais
11+
-------
12+
"
13+
14+
echo -e "\n\t-> Press any key to confirm that you've created the topic"
15+
while [ true ] ; do
16+
read -t 3 -n 1
17+
if [ $? = 0 ] ; then
18+
break;
19+
else
20+
echo -e "\t\t…waiting for the keypress"
21+
fi
22+
done
23+
24+
echo -e "\n\n-------\nSpinning up VM & Container in gcloud. Standby…\n"
25+
26+
gcloud compute instances create-with-container rmoff-ais-ingest-v05 \
27+
--zone=us-east1-b \
28+
--metadata=google-logging-enabled=true \
29+
--container-image edenhill/kafkacat:1.7.0-PRE1 \
30+
--container-restart-policy=never \
31+
--container-tty \
32+
--container-command=/bin/sh \
33+
--container-arg=-c \
34+
--container-arg='set -x
35+
# Install stuff
36+
apk add gpsd gpsd-clients
37+
38+
while [ 1 -eq 1 ];
39+
do
40+
nc 153.44.253.27 5631 | \
41+
gpsdecode | \
42+
kafkacat \
43+
-X security.protocol=SASL_SSL -X sasl.mechanisms=PLAIN \
44+
-X ssl.ca.location=./etc/ssl/cert.pem -X api.version.request=true \
45+
-b BROKER.gcp.confluent.cloud:9092 \
46+
-X sasl.username="CCLOUD_API_USER" \
47+
-X sasl.password="CCLOUD_API_PASSWORD" \
48+
-t ais -P
49+
50+
sleep 180
51+
done
52+
'
53+
54+
echo -e '
55+
To access the VM:
56+
57+
gcloud compute ssh --zone "us-east1-b" "rmoff-ais-ingest-v05"
58+
59+
Once connected to the VM you can list the containers:
60+
61+
docker ps -a
62+
63+
From there, you can view the container logs with
64+
65+
docker logs -f <container_name>
66+
67+
68+
---
69+
To remove the VM:
70+
71+
gcloud compute instances delete --zone "us-east1-b" "rmoff-ais-ingest-v05" '

0 commit comments

Comments
 (0)