Skip to content

MEG: Mock Event Generator

MEG is a tool used to insert mock events inside graceDB.

Deployment of the mock-event-generator

Deploy in igwn-kube

To have a local k8s deployment of the mock-event-generator using the locally provided Helm chart:

helm install meg meg
The first command will prompt you your ligo credential that are needed to establish a ssh connection between the container and the repository containers.ligo.org.

Deploy in igwm-k3s

on a local k3s deployment:

helm  --kubeconfig /etc/rancher/k3s/k3s.yaml upgrade --install -n default \
      --set storageClassName=local-path \
      meg meg
while on CIT (fluxuser2.ldas.cit) virtual machine
helm upgrade --install -n default \
     --set storageClassName=local-path \
     --set gracedb.hostAlias.hostname="gracedb-dev.ldas.cit" \
     --set gracedb.hostAlias.ip="10.14.150.23" \
     meg meg
make sure that meg contaner is running before to proceed
kubectl get pods meg-0

MEG usage examples

Create a mock events

Once installed, you may access the mock-event-generatiom entering the meg-0 pod with the command

kubectl exec -it meg-0 -- bash
Once you are inside the following commands will generate MOCK G-events in the local instance gracedb instance gracedb.default.svc.cluster.local
meg ca-certificate /tmp/ca.crt
ligo-proxy-init albert.einstein
meg create --source production --target local --original-search S240428dr  
alternatevely, the target instance may be specified using the command
meg create --source production --target https://<graceDB name server>/  --original-search S240428dr
where
is the name of the server hosting graceDB, for a local deployment it isgracedb.default.svc.cluster.localwhile on CIT server it isgracedb-dev.ldas.cit`

Generate a ca-certificate bundle (including the certiufication for teh local instance) and copy to the

local directory

kubectl exec -it meg-0 -- bash
meg ca-certificate /tmp/ca.crt 
cat $(python -m requests.certs) /tmp/ca.crt > cacerts.pem
REQUESTS_CA_BUNDLE=cacerts.pem gracedb -s https://<graceDB name server>/api credentials server
ligo-proxy-init albert.einstein
exit
# outside MEG copy the server certificate on the local directory
kubectl cp default/meg-0:cacerts.pem cacerts.pem
where albert.einstein is your albert.einstein LIGO username and <graceDB name server> is the name of the server hosting graceDB, for a local deployment it is gracedb.default.svc.cluster.local while on CIT server it is gracedb-dev.ldas.cit

See accessible topics on kafka listeners

Inside the meg-0 container (that may be started with the command),

kubectl exec -it meg-0 -- bash
The basic fuctionality may be tested giving the commands:
pip install hop-client igwn-alert

.local/bin/hop list-topics  --no-auth   kafka://hopskotch:9092
.local/bin/hop list-topics  --no-auth   kafka://<graceDB name server>:9092
.local/bin/igwn-alert  --no-auth  -g default -s   kafka://<graceDB name server>:9092 topics
<graceDB name server> is the name of the server hosting graceDB, for a local deployment it is gracedb.default.svc.cluster.local while on CIT server it is gracedb-dev.ldas.cit