# Smartkit SmeUP Printing Service use

## How to download a OVA compatible with smartkit-printing-service

Download the last OVA from https://s3.eu-central-1.wasabisys.com/smeup-public-read/Smartkit/Webup/ISO/Virtualbox/smartkit-webup-vbox-1.0.0.ova and import it in your hypervisor (ex: Virtualbox)

## How to install or update smartkit-printing-service

You can install on the virtual machine the smarkit-commons project that helps managing smarkits.

Or you can download a smartkit-printing-service zipped version X.X.X from smeup repo, unzip inside /tmp dir and call installer.sh.

    cd /tmp
    wget https://repo.smeup.cloud/nexus/content/repositories/releases/com/smeup/smartkit/smartkit-printing-service/X.X.X/smartkit-printing-service-x.x.x-full.zip
    unzip smartkit-printing-service-x.x.x-full.zip
    smartkit-printing-service-x.x.x/installer.sh
    
smartkit-printing-service dir will be ~/smarkit/smartkit-printing-service.

## How to use smartkit-printing-service

Call: 

    ~/smarkit/smartkit-commons/scripts/smart.sh --help

## How to install a SmeUP Printing Service (sps)

The smartkit-printing-service doesn't contain any running SmeUP Printing Service at startup. You have to setup the software you want.

For example to create a new sps instance with id prod1 (you have to choose a string made of max 6 lower case chars or numbers) call:
	
	~/smarkit/smartkit-printing-service/smart.sh sps-create prod1

It will create one docker container with this name:
* sps-prod1

During installation you have to insert a free host tcp port (ex: 8080).

If you install more instances remberer to use differents tcp ports for each instance, (ex: 8080, 8081, etc...) 

## How to check a sps

* SmeUP Printing Service responds:

```sh
curl http://virtual-machine-ip:($port)/rdsv6/rest/rdsspool/v1/ping
```

## How to see logs

To see logs of a running docker container (ex: sps-prod1): 

```sh
docker logs sps-prod1
```

You can find specific log files of each application in its container var dir (ex: ~/smartkit/smartkit-printing-service/sps-prod1/container/var dir).

## How to update a sps

To update a sps with id prod1 call:

    ~/smarkit/smartkit-printing-service/smart.sh sps-update prod1 
    
It will backup old sps dir, it will destroy all containers and redo new containers.   

## System requirements

At least a CPU Dual core.

Suggested for each sps:
* 4GB RAM (-Xmx2048m)
* 10GB HDD
