about summary refs log tree commit diff

GN4 Guile Webservice

This directory provides a Guile web service incl. the new REST API. It is used in conjunction with the Python web services and (very much) WIP.

Run

  1. Navigate to the Web Directory and Start the Server

Running the web server is documented in guix script.

curl http://127.0.0.1:8091/version
"4.0.0"

Documentation

Start with this file and then the documentation in doc.

Development

The current repository lives at

git clone tux02.genenetwork.org:/home/git/public/gn-guile

or

git remote add gn git.genenetwork.org:/home/git/public/gn-guile

GNU Guile allows you to develop against a live running web server using emacs-geiser on port 1970. To try this fire up the web server from the web directory as

guix shell -L ~/guix-bioinformatics -m manifest.scm --container --network --file=guix.scm -- guile -L . --fresh-auto-compile --listen=1970 -e main web/webserver.scm 8091

By default the root points to the API:

curl http://127.0.0.1:8091

We also have some services

curl http://127.0.0.1:8091/home/msk curl http://127.0.0.1:8091/home/aging

The --container option runs the code in an isolated container, and the --network option connects that container's networking to the host to allow you to access the running service.

If you get an error no code for module (gn packages guile) add the appropriate guix-bioinformatics repo to the load path (-L switch). Note that, instead of hard-wiring guix-bioinformatics, the recommended way is to use a guix channel as defined in guix-channel.

We recommend checking the Guix documentation for manifests, channels and guix.scm definitions.

To run a standalone server you should run without the listener on port 1970:

guix shell -L ~/guix-bioinformatics -m manifest.scm --container --network --file=guix.scm -- guile -L . --fresh-auto-compile -e main web/webserver.scm 8091

Welcome to the world of interactive Lisp programming

Next fire up emacs with emacs-geiser-guile and connect to the running web server with M-x geiser-connect and the port 1970. Now you can not only inspect procedures, but also update any prodedure on the live server using C-M-x on code, call and get updated output from the webserver! No need to save/reload files and all that.

Note that you may have to try different versions of guile+emacs to succeed.

Also these days it may be a better bet to use Andrew Tropin's alternatives ares and arei that are very powerful alternatives to geiser (with a more common lisp type interactive experience):

=> https://git.sr.ht/~abcdw/guile-ares-rs => https://git.sr.ht/~abcdw/emacs-arei

Tools

Some tooling and scripts that run independently are stored in ./scripts.

Forwarding a MySQL port

You may want to forward a mysql port if there is no DB locally you can do something like:

ssh -L 3306:127.0.0.1:3306 -f -N tux02.genenetwork.org

Topics

LICENSE

This software is published by the GeneNetwork team under the AGPL3. See LICENSE.