Clinical-Genomics / loqusdbapi

A simple REST api for loqusdb
2 stars 0 forks source link

Fix mongo adapter timeout #21

Closed dnil closed 2 years ago

dnil commented 2 years ago

This PR adds | fixes:

How to prepare for test:

How to test:

Expected outcome:

Review:

This version is a:

dnil commented 2 years ago

Tested locally: (loqusdb) k1315C02VR0WRHTDH:loqusdbapi dannil$ docker-compose up Screenshot 2021-11-22 at 11 36 51

dnil commented 2 years ago
[hiseq.clinical@cg-vm1 ~]$ systemctl --user restart loqusdbapi-rd@latest.service
[hiseq.clinical@cg-vm1 ~]$ systemctl --user status loqusdbapi-rd@latest.service
● loqusdbapi-rd@latest.service - Loqusdbapi application
   Loaded: loaded (/home/hiseq.clinical/.config/systemd/user/loqusdbapi-rd@.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-11-22 15:03:44 CET; 9s ago
  Process: 3570182 ExecStop=/var/cg-data/podman-installations/recommended/bin/podman rm -f loqusdbapi-rd-latest (code=exited, status=0/SUCCESS)
  Process: 3570257 ExecStartPre=/var/cg-data/podman-installations/recommended/bin/podman pull ${CONTAINER_URL}:latest (code=exited, status=0/SUCCESS)
 Main PID: 3570357 (podman)
   CGroup: /user.slice/user-2191.slice/user@2191.service/loqusdbapi\x2drd.slice/loqusdbapi-rd@latest.service
           ├─3570357 /var/cg-data/podman-installations/recommended/bin/podman --runtime=/var/cg-data/podman-installations/recommended/bin/crun run --log-driver=journald --log-opt tag={{.ImageName}} --security-opt label=disable --env-file /var/cg-data/container-env//loqusdbapi-rd.env --volume /home/proj/:/home/proj:ro --replace>
           ├─3570369 /var/cg-data/podman-installations/recommended/bin/podman --runtime=/var/cg-data/podman-installations/recommended/bin/crun run --log-driver=journald --log-opt tag={{.ImageName}} --security-opt label=disable --env-file /var/cg-data/container-env//loqusdbapi-rd.env --volume /home/proj/:/home/proj:ro --replace>
           ├─3570385 /usr/bin/fuse-overlayfs -o ,lowerdir=/home/hiseq.clinical/.local/share/containers/storage/overlay/l/54JVNLOOMUQNHPDKOJQCWMQMXY:/home/hiseq.clinical/.local/share/containers/storage/overlay/l/KRCF6YICDUL532LKB2CKAB7UKE:/home/hiseq.clinical/.local/share/containers/storage/overlay/l/ZWVD2B7PKVXFNUO3KPNHEV5SBU:>
           ├─3570387 /usr/bin/slirp4netns --disable-host-loopback --mtu=65520 --enable-sandbox --enable-seccomp -c -e 3 -r 4 --netns-type=path /run/user/2191/netns/cni-a97dcdd2-330c-7d7a-d5c5-70c0e4c4743b tap0
           ├─3570389 containers-rootlessport
           ├─3570400 containers-rootlessport-child
           ├─3570413 /usr/bin/conmon --api-version 1 -c c947e30fa1ada26dcc1980ee47ce1663ab221f1afd5d1eff7acd7e646caa45ff -u c947e30fa1ada26dcc1980ee47ce1663ab221f1afd5d1eff7acd7e646caa45ff -r /var/cg-data/podman-installations/recommended/bin/crun -b /home/hiseq.clinical/.local/share/containers/storage/overlay-containers/c947e3>
           ├─3570416 /bin/sh -c gunicorn     --workers=$GUNICORN_WORKERS     --bind=$GUNICORN_BIND      --threads=$GUNICORN_THREADS     --timeout=$GUNICORN_TIMEOUT     --proxy-protocol     --forwarded-allow-ips="10.0.2.100,127.0.0.1"     --log-syslog     --access-logfile -     --error-logfile -     --log-level="debug"     --wo>
           ├─3570418 /usr/local/bin/python /usr/local/bin/gunicorn --workers=1 --bind=0.0.0.0:8000 --threads=1 --timeout=400 --proxy-protocol --forwarded-allow-ips=10.0.2.100,127.0.0.1 --log-syslog --access-logfile - --error-logfile - --log-level=debug --worker-class=uvicorn.workers.UvicornWorker loqusdbapi.main:app
           └─3570420 /usr/local/bin/python /usr/local/bin/gunicorn --workers=1 --bind=0.0.0.0:8000 --threads=1 --timeout=400 --proxy-protocol --forwarded-allow-ips=10.0.2.100,127.0.0.1 --log-syslog --access-logfile - --error-logfile - --log-level=debug --worker-class=uvicorn.workers.UvicornWorker loqusdbapi.main:app

Nov 22 15:03:45 cg-vm1.scilifelab.se conmon[3570413]: [2021-11-22 14:03:45 +0000] [2] [INFO] Using worker: uvicorn.workers.UvicornWorker
Nov 22 15:03:45 cg-vm1.scilifelab.se conmon[3570413]: [2021-11-22 14:03:45 +0000] [4] [INFO] Booting worker with pid: 4
Nov 22 15:03:45 cg-vm1.scilifelab.se conmon[3570413]: [2021-11-22 14:03:45 +0000] [2] [DEBUG] 1 workers
Nov 22 15:03:45 cg-vm1.scilifelab.se podman[3570357]: [2021-11-22 14:03:45 +0000] [2] [DEBUG] 1 workers
Nov 22 15:03:45 cg-vm1.scilifelab.se conmon[3570413]: [2021-11-22 14:03:45 +0000] [4] [INFO] Started server process [4]
Nov 22 15:03:45 cg-vm1.scilifelab.se podman[3570357]: [2021-11-22 14:03:45 +0000] [4] [INFO] Started server process [4]
Nov 22 15:03:45 cg-vm1.scilifelab.se podman[3570357]: [2021-11-22 14:03:45 +0000] [4] [INFO] Waiting for application startup.
Nov 22 15:03:45 cg-vm1.scilifelab.se podman[3570357]: [2021-11-22 14:03:45 +0000] [4] [INFO] Application startup complete.
Nov 22 15:03:45 cg-vm1.scilifelab.se conmon[3570413]: [2021-11-22 14:03:45 +0000] [4] [INFO] Waiting for application startup.
Nov 22 15:03:45 cg-vm1.scilifelab.se conmon[3570413]: [2021-11-22 14:03:45 +0000] [4] [INFO] Application startup complete.
[hiseq.clinical@cg-vm1 ~]$ curl -X GET "http://localhost:7079/svs/?chrom=17&end_chrom=17&pos=44287865&end=44287937&sv_type=INS" -H "accept: application/json"
{"chrom":"17","observations":2010,"families":["pumpeddeer","clearamoeba","mintserval","tightdoe","briefmantis","majormuskox","famoushyena","nicepig","keensalmon","divinecow","clearguppy","fleetbison","lightwren","primeasp","awakeyak","wholeseal","usableadder","provenmaggot","epichawk","majorraven","deepseal","restedcrab","hardygoblin","livingpup","stablecondor","topghost","lightoriole","tightcicada","caringhound","solidbadger","pickedjennet","frankghoul","funnyghost","neatkodiak","solidbeagle","goldenweevil","nextiguana","eagertetra","quickgopher","fluentsnake","pickedglider","acedragon","politecondor","guidedmako","mintlizard","smoothhawk","trueroughy","holyvervet","minthermit","cleancow"],"total":5328,"end_chrom":"17","end_left":44287937,"end_right":44287937,"sv_type":"INS","length":72,"pos_left":44287865,"pos_right":44287865}
dnil commented 2 years ago

Also works on scout-stage, when setting loqus to default for the case institute: Screenshot 2021-11-22 at 15 44 23