Skip to content

Simulates a "point of sale", sometimes called a "cash register"

License

Notifications You must be signed in to change notification settings

qiot-project/qiot-retail-edgepos

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qiot-retail-edgepos

This project uses Quarkus, the Supersonic Subatomic Java Framework.

If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ . The GUI embedded in this repo is coming from this sibling project: https://github.com/tarilabs/demo20220831-edgepos-ui

Notes

used https://code.quarkus.redhat.com/?g=org.drools.hackfest2022&a=demo20220831-edgepos&e=resteasy-jackson&e=smallrye-openapi&e=kubernetes&e=container-image-jib&e=org.kie.kogito%3Akogito-quarkus-rules&extension-search=origin:platform%20DRL

pushing to Quay.io with

mvn clean install install -Dquarkus.container-image.push=true

Quick start

Install podman and ensure date(time) is setup correctly:

Fedora:

typically Podman is already installed, in case:

sudo dnf install podman
date

Debian-based:

sudo apt-get install podman
date

Launch application:

Then, launch this Drools+Quarkus application from a container image from quay.io registry

podman pull quay.io/mmortari/demo20220831-edgepos:1.0.0-SNAPSHOT
podman run -i --rm -p 8080:8080 quay.io/mmortari/demo20220831-edgepos:1.0.0-SNAPSHOT

Configuring a Fedora box:

Configuring podman and systemd (manually)

sudo systemctl enable podman-auto-update.service

podman run --name app1 -d --label "io.containers.autoupdate=registry" --rm -p 8080:8080 quay.io/mmortari/demo20220831-edgepos:1.0.0-SNAPSHOT
podman generate systemd --new app1 -n > ~/.config/systemd/user/app1.service
systemctl --user daemon-reload
systemctl --user enable app1.service
systemctl --user start app1.service
systemctl --user status app1.service

Systemd files

# container-app1.service
# autogenerated by Podman 4.3.1
# Thu Feb  9 18:48:26 CET 2023

[Unit]
Description=Podman container-app1.service
Documentation=man:podman-generate-systemd(1)
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm \
	-f %t/%n.ctr-id
ExecStart=/usr/bin/podman run \
	--cidfile=%t/%n.ctr-id \
	--cgroups=no-conmon \
	--rm \
	--sdnotify=conmon \
	--replace \
	--name app1 \
	-d \
	--label io.containers.autoupdate=registry \
	-p 8080:8080 quay.io/mmortari/demo20220831-edgepos:1.0.0-SNAPSHOT
ExecStop=/usr/bin/podman stop \
	--ignore -t 10 \
	--cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm \
	-f \
	--ignore -t 10 \
	--cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all

[Install]
WantedBy=default.target

also:

[Unit]
Description=Service running firefox
After=network.target app1.service

[Service]
Type=simple
Environment="DISPLAY=:0"
ExecStart=/usr/bin/firefox --kiosk http://localhost:8080
Restart=on-failure
RestartSec=1
TimeoutSec=60
RuntimeMaxSec=infinity

[Install]
WantedBy=default.target

About

Simulates a "point of sale", sometimes called a "cash register"

Resources

License

Stars

Watchers

Forks

Languages

  • Java 94.4%
  • HTML 3.5%
  • CSS 2.1%