duncdrum / glider

xqerl glider not to be confused with flying xqerl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not to be confused with the Flying Squirrel.

xQuery 3.1 is the query language for building data driven web applications.

Xqerl pronounced 'squirrel', is a xQuery 3.1 application server.

Xqerl is an erlang application that runs on top of the Erlang virtual machine BEAM Web applications that run on the BEAM have a reputation for being long running, fault tolerant and reliable. The xqerl docker image has the erlang OTP builtin, so although xqerl is a erlang application that runs on the BEAM, to use xqerl you do not need to locally install erlang or even know much about erlang.

The xqerl application has 2 aspects

  1. a xQuery 3.1 application engine:
  2. a database that stores XDM items

Aims

We will be setting up a local dockerized xQuery web application development environment.

Prerequisites

  • make, bash
  • to prettyfy cmd line output:
    • jq: pipe to format JSON output `jq '.'
    • xmlint: pipe to format XML output xmllint --format
    • w3m: to screen dump http requests w3m -dump http://localhost
  • podman getting-started

Podman is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System I am using the latest release v4

  • gh the GitHub CLI

Getting Started

# clone this repo
gh repo clone grantmacken/glider
cd glider
# enter super do
sudo -s 
# pull images
make-images
# bring container pod up
make-up
# see what is running in the pod
podman podman --pod
# exit super do
exit
# use w3m to make a request to 'http://localhost'
w3m -dump http://localhost

xqerl as a service

Now we have a running xqerl instance, we can set the pod to run on boot by using podman to generate systemd files. We make slight adjustment to the generated files as we want our proxy server container to boot after our xqerl container is running.

# enter super do
sudo -s 
make service
# reboot
reboot

After reboot we can now use systemctl to

  • check service status
  • stop the service
  • start the service
# enter super do
sudo -s
# check service status
make service-status
# check with podman
podman ps --pod -a
# stop the service
make service-stop
# 'xq' ond 'or' containers should now have exited
podman ps --pod --all
# restart the service
# 'xq' ond 'or' containers should now be up
podman ps --pod --all
# check the xqerl container log 'xq'
podman log xq
# use podman top
podman top xq
# exit super do
exit
# use firefox to make a request to 'http://localhost'
firefox http://localhost

About

xqerl glider not to be confused with flying xqerl

License:MIT License


Languages

Language:Makefile 98.9%Language:Shell 1.1%