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 igwm-kube

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

minikube -p igwn-kube ssh docker login containers.ligo.org
minikube -p igwn-kube ssh docker pull containers.ligo.org/emfollow/mock-event-generator:latest
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 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 with the commands:

./utility/enter-pod.sh meg
meg ca-certificate /tmp/ca.crt
ligo-proxy-init albert.einstein
meg create --source production --target local --original-search S240428dr  
alternatevely,
meg create --source production --target https://<graceDB name server>/  --original-search S240428dr
where <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

Generate a certificate and copy on 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