Skip to content

Commit 4a1c6ed

Browse files
committed
includes updates related to schema version and config parameters
1 parent fc7e6f8 commit 4a1c6ed

File tree

6 files changed

+28
-6
lines changed

6 files changed

+28
-6
lines changed

broker/cloud_functions/lvk/store_BigQuery/deploy.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ testid="${1:-test}"
99
teardown="${2:-False}"
1010
# name of the survey this broker instance will ingest
1111
survey="${3:-lvk}"
12+
# schema version
13+
versiontag="${4:-v1_0}"
1214

1315
#--- GCP resources used in this script
1416
store_bq_trigger_topic="${survey}-alerts"
@@ -37,5 +39,5 @@ else # Deploy the Cloud Functions
3739
--runtime python312 \
3840
--memory "${memory}" \
3941
--trigger-topic "${store_bq_trigger_topic}" \
40-
--set-env-vars TESTID="${testid}",SURVEY="${survey}",GCP_PROJECT="${GOOGLE_CLOUD_PROJECT}"
42+
--set-env-vars TESTID="${testid}",SURVEY="${survey}",GCP_PROJECT="${GOOGLE_CLOUD_PROJECT}",VERSIONTAG="${versiontag}"
4143
fi

broker/consumer/lvk/ps-connector.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ name=CPSSinkConnector
2020
# Tha Java class for the Pub/Sub sink connector.
2121
connector.class=com.google.pubsub.kafka.sink.CloudPubSubSinkConnector
2222
# The maximum number of tasks that should be created for this connector.
23-
tasks.max=10
23+
tasks.max=1
2424
# Set the key converter for the Pub/Sub sink connector.
2525
key.converter=org.apache.kafka.connect.converters.ByteArrayConverter
2626
# Set the value converter for the Pub/Sub sink connector.

broker/consumer/lvk/psconnect-worker-authenticated.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
bootstrap.servers=kafka.gcn.nasa.gov:9092
55
plugin.path=/usr/local/share/kafka/plugins
66
offset.storage.file.filename=/tmp/connect.offsets
7+
session.timeout.ms=30000
8+
request.timeout.ms=30000
9+
max.poll.interval.ms=300000
10+
heartbeat.interval.ms=3000
11+
retry.backoff.ms=1000
12+
reconnect.backoff.max.ms=10000
13+
fetch.max.wait.ms=1000
14+
connections.max.idle.ms=5400000
715

816
# ByteArrayConverter provides a “pass-through” option that does no conversion.
917
key.converter=org.apache.kafka.connect.converters.ByteArrayConverter

broker/setup_broker/lvk/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,10 @@ Initialize parameters and call the deployment script:
9999
testid="mytest"
100100
teardown="False"
101101
survey="lvk"
102+
schema_version="1.0"
102103
region="us-central1"
103104

104-
./setup_broker.sh "${testid}" "${teardown}" "${survey}" "${region}"
105+
./setup_broker.sh "${testid}" "${teardown}" "${survey}" "${schema_version}" "${region}"
105106
```
106107

107108
This will create all of the necessary GCP resources. Allow the consumer VM to finish its installation process. Once
@@ -141,7 +142,8 @@ Similar to [deploy broker instance](#deploy-broker-instance). Initialize paramet
141142
testid="mytest"
142143
teardown="True"
143144
survey="lvk"
145+
schema_version="1.0"
144146
region="us-central1"
145147

146-
./setup_broker.sh "${testid}" "${teardown}" "${survey}" "${region}"
148+
./setup_broker.sh "${testid}" "${teardown}" "${survey}" "${schema_version}" "${region}"
147149
```

broker/setup_broker/lvk/setup_broker.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ echo
2222
echo "GOOGLE_CLOUD_PROJECT = ${PROJECT_ID}"
2323
echo "survey = ${survey}"
2424
echo "testid = ${testid}"
25+
echo "schema_version = ${schema_version}"
2526
echo "teardown = ${teardown}"
2627
echo
2728
echo "Continue? [y/(n)]: "
@@ -98,7 +99,7 @@ echo "Configuring Cloud Functions..."
9899
cd .. && cd .. && cd cloud_functions && cd lvk || exit 5
99100

100101
#--- BigQuery storage cloud function
101-
cd store_BigQuery && ./deploy.sh "$testid" "$teardown" "$survey" || exit 5
102+
cd store_BigQuery && ./deploy.sh "$testid" "$teardown" "$survey" "$versiontag"|| exit 5
102103

103104
#--- return to setup_broker/lvk directory
104105
cd .. && cd .. && cd .. && cd setup_broker && cd lvk || exit 5

broker/setup_broker/lvk/templates/bq_lvk_alerts_v1_0_schema.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,18 @@
1919
},
2020
{
2121
"description": "URLs relevant to the event, if any.",
22+
"fields": [
23+
{
24+
"description": "",
25+
"mode": "REQUIRED",
26+
"name": "gracedb",
27+
"type": "STRING"
28+
}
29+
],
2230
"mode": "REQUIRED",
2331
"name": "urls",
24-
"type": "STRING"
32+
"type": "RECORD"
33+
2534
},
2635
{
2736
"description": "Event information",

0 commit comments

Comments
 (0)