PSEC - Powershell Enhanced Capability
Version 1.2.1

Lib Task Recycle Server

Purpose

This Controller Page can be used to restart a local GAEL server

Description

When the task is run a signal to shutdown the server is transmitted. The server shuts down.

The powershell script file (start-gael-server.ps1) looks for flags that may have been set that adjusts what the script should do. If no flags are present the server is just restarted after rebuilding the application jar file (the most common reason for restarting a server).

Options

These options adjust the restart sequence executed.

  • save - After the server stops a backup copy of the local_db.bin will be made. Occasionally the local_db.bin gets corrupted (I have not found the pattern as to why). Having a recent backup is usually enough in a development environment to prevent disaster.

  • stop - The server will not be restarted.

  • cold - a new deployment id will be created which will cause the server to do a cold start and rebuild internal server files such as the GDT.

  • prod - The server will be restarting in a production environment (including running a ./prodify script). This mode is useful to debug the ocassional bug that may only exist in a production environment.

Source of Truth

As of EC1B03 the script file that starts the server is also used in other places. Namely:

  1. Start the server
  2. Restart server in PSEC recycle-server-v3 lib task
  3. Start locate datastore in PSEC run-datastore-v3 lib task
  4. The Svelte build functions
  5. The run-gael choose-server task

See citv3.ps1 or chsol.ps1 as samples of these scripts.

Setup

A separate powershell task must be started using the following steps. By convention the workflow containing the recycle-server step is called run-xxxx.

  1. Start a PSEC-V4 powershell window.
  2. cd to h:/v3/gael-core/ps
  3. issue ./citv3.ps1 or whatever

This will start the server which can now be managed by this Task

Priming the Server

The following commands are useful. Assume the server is at localhost:8711

  1. http://localhost:8711/res/htm/gael-status.htm will enable the status of the server to be displayed.

  2. When the server is in virgin state the command http://localhost:8711/res/htm/gael-prime-server.htm will allow the server to be primed.

  3. Once primed from the previous step the url http://localhost:8711/sve/htm/gael-logon.htm will allow you to log in. Choosing View Datastore will allow you to view the contents.

  4. For the moment the transition is not automatic. The http://localhost:8711/sve/htm/gael-view-datastore.htm URL will dig out the token created by step 3 and start the datastore viewer.

Orphan Servers

It is possible by improperly closing PSEC task running server to create an orphan server. This, for example, is done by closing the server PowerShell window directly. The specially provided url http://localhost:PPPP/res/kill-server.htm may be used to terminate such an orphan server. The value PPPP is the port number used for the application. A button KILL Server will be presented which if pressed will issue the internal _ah development console command which will terminate the server.

Notes

  • The --jvm_flag=-Dappengine.allowRemoteShutdown=true must be enabled. This is set by default in the standard startup script start-gael-server.ps1

SVELTE Support

It is necessary to create a token in the localhi=ost:5000

  1. start a psec, cd to svelte project directory, npm run dev
  2. run ./logon which will start the logon process on the hotloader window
  3. logon to the desired application. You will see a blue message indicating the token has been setup
  4. kill the ./logon task and start the application you just logged onto.

Notes

  1. The gael server s/b configured to alloc CORS form the local host. TODO - remove this automatically in production.

  2. The port address and server address are presently hardwired to relay the gael requests to the server. The are obtained from the gael-server-port.js file which is created when the local server starts and used during the build process.

PSEC - Powershell Enhanced Capability
1.2.1

Copyright © 2018-2021, 2022, Rexcel System Inc.

 

 

 

 

 

X