Skip to content

Commit

Permalink
Address character limits for README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hernandezc1 committed Apr 19, 2024
1 parent a970776 commit b240422
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
19 changes: 15 additions & 4 deletions broker/consumer/lvk/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
# Start the LIGO/Virgo/KAGRA (LVK) consumer VM

Check notice on line 1 in broker/consumer/lvk/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

broker/consumer/lvk/README.md#L1

First line in a file should be a top-level heading

See `broker/setup_broker/lvk/README.md` for setup instructions.


To start the `lvk-consumer` VM and begin ingesting a LVK topic:
To start the consumer VM:

```bash
survey="lvk"
testid="mytest"
instancename="${survey}-consumer-${testid}"
consumerVM="${survey}-consumer-${testid}"
zone="us-central1-a"

# Set the VM metadata
KAFKA_TOPIC="enter Kafka topic"
# must be within the last 7 days and contain at least 1 alert
PS_TOPIC="lvk-alerts-${testid}"
PS_TOPIC="${survey}-alerts-${testid}"
gcloud compute instances add-metadata ${consumerVM} --zone=${zone} \
--metadata KAFKA_TOPIC=${KAFKA_TOPIC},PS_TOPIC=${PS_TOPIC}

# Start the VM
gcloud compute instances start ${consumerVM} --zone ${zone}
# this launches the startup script which configures and starts the
# Kafka -> Pub/Sub connector
```

To stop stop the consumer VM:
```bash

Check notice on line 27 in broker/consumer/lvk/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

broker/consumer/lvk/README.md#L27

Fenced code blocks should be surrounded by blank lines
survey="lvk"
testid="mytest"
consumerVM="${survey}-consumer-${testid}"
zone="us-central1-a"

# Stop the VM
gcloud compute instances stop ${consumerVM} --zone ${zone}
```
20 changes: 9 additions & 11 deletions broker/setup_broker/lvk/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Connect Pitt-Google to the LIGO/Virgo/KAGRA (LVK) alert stream
# Connect Pitt-Google to the LIGO/Virgo/KAGRA (LVK) Gravitational Wave Alert Stream

April 2024 - Author: Christopher Hernandez

Expand All @@ -9,22 +9,20 @@ April 2024 - Author: Christopher Hernandez
- [Delete broker instance](#delete-broker-instance)

## Overview

Check notice on line 11 in broker/setup_broker/lvk/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

broker/setup_broker/lvk/README.md#L11

Expected: 120; Actual: 228
Gravitational-wave transients detected by the LIGO, Virgo, and KAGRA network are distributed publicly as
Gravitational-wave transients detected by the LIGO, Virgo, and KAGRA network are distributed publicly as
machine-readable alerts through
[General Coordinates Network (GCN) Notices](https://gcn.nasa.gov/docs/notices#gcn-notices).
Here are some links which were used as a reference to set this up:

- [Start streaming GCN Notices quick start quide](https://gcn.nasa.gov/quickstart)
- [Kafka Client Setup using Java](https://gcn.nasa.gov/docs/client#java)
- [Alert schemas](https://emfollow.docs.ligo.org/userguide/content.html#kafka-notice-gcn-scimma)

Below is the code I used to set up the necessary resources in GCP and ingest the LVK alert stream.
Below is the code I used to set up the necessary resources in GCP to ingest the LVK alert stream.

## Setup

The following assumes that you have:

Check notice on line 23 in broker/setup_broker/lvk/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

broker/setup_broker/lvk/README.md#L23

Expected: 120; Actual: 164
- Completed the [GCN Notices quick start guide](https://gcn.nasa.gov/quickstart) and identified your client credentials.
This includes a client ID and client secret
- Completed the [GCN Notices quick start guide](https://gcn.nasa.gov/quickstart) and identified your client

Check notice on line 24 in broker/setup_broker/lvk/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

broker/setup_broker/lvk/README.md#L24

Expected: 120; Actual: 166
credentials. This includes a client ID and client secret
- Set the environment variables `GOOGLE_CLOUD_PROJECT` and `GOOGLE_APPLICATION_CREDENTIALS` to appropriate values for

Check notice on line 26 in broker/setup_broker/lvk/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

broker/setup_broker/lvk/README.md#L26

Expected: 120; Actual: 147
your GCP project and service account credentials
- Authenticated the service account to make `gcloud` calls through the project
Expand Down Expand Up @@ -56,8 +54,8 @@ gcloud secrets create "${client_secret}" \
--replication-policy="automatic"
```

Select one of the following options to add a secret version. Adding a version directly on the command line is
discouraged, see
Select one of the following options to add a secret version. Note that adding a version directly on the command line is
discouraged by Google Cloud, see
[add a secret version documentation](https://cloud.google.com/secret-manager/docs/add-secret-version#add-secret-version)
for details.
```bash
Expand Down Expand Up @@ -89,10 +87,10 @@ region="us-central1"
./setup_broker.sh "${testid}" "${teardown}" "${survey}" "${region}"
```
This will create all of the necessary GCP resources. Allow the consumer VM to finish its installation process. Once
complete, the VM will shut down automatically. You can check the status of the VM in the
complete, the VM will shut down automatically. You can check the status of the VM in the
[Google Cloud Console](https://console.cloud.google.com/compute).

## Ingest the LVK alert stream
## Start the Consumer VM to ingest the LVK alert stream
```bash
zone="${region}-a"
consumerVM="${survey}-consumer-${testid}"
Expand Down

0 comments on commit b240422

Please sign in to comment.