Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

UNDER CONSTRUCTION

Welcome to the Getting Started

Tutorial
  • Install Saga, Saga Server Parser, and Saga UI.
  • Get an idea of how to start a Saga project using the Saga UI (no programming knowledge needed).

Prerequisites

  1. MongoDB 3.4+
  2. Node JS 6+
  3. Maven

Step 1: Download and Build the code

Saga is made up of several projects that can be used stand-alone or together. For this tutorial, we'll be using the following projects to set up an instance of Saga and be able to start a new project:

  1. https://source.digital.accenture.com/projects/ST/repos/saga-library/browse
  2. https://source.digital.accenture.com/projects/ST/repos/saga-elasticsearch-action/browse
  3. https://source.digital.accenture.com/projects/ST/repos/saga-mongodb-provider/browse
  4. https://source.digital.accenture.com/projects/ST/repos/saga-openexchange-action/browse
  5. https://source.digital.accenture.com/projects/ST/repos/saga-sentence-breaker-stage/browse
  6. https://source.digital.accenture.com/projects/ST/repos/saga-spelling-alternatives-stage/browse
  7. https://source.digital.accenture.com/projects/ST/repos/saga-spellchecking-indexer/browse
  8. https://source.digital.accenture.com/projects/ST/repos/saga-entity-trainer/browse
  9. https://source.digital.accenture.com/projects/ST/repos/saga-action-framework/browse
  10. https://source.digital.accenture.com/projects/ST/repos/saga-server-parser/browse
  11. https://source.digital.accenture.com/projects/ST/repos/saga-server-ui/browse

Start by cloning each repository and building the projects in the previous order. From 1 to 10, you can build each of them by using the following command in each project:

...> mvn clean install

The eleventh package can be built via Node:

.../saga-server-ui> npm install

Step 2: Load a Mongo database

If you have any database to use with saga, just run the following command in the database folder to import it to Mongo:

.../database/directory> mongostore --db databaseName --drop .

Make sure Mongo is up and running before running the previous command, otherwise you will get a message of running and unknown command.

Step 3: Configuring the environment

Saga Server Parser configuration files are specified in the Configure Pipelines & Resource Providers section. If you change any of those files in the saga-server-parser/src/main/resources folder, you need to rebuild the project or transfer the files to the directory specified in the saga-server-parser/startup.bat.

For the UI, you need to check the file in config/env/development.js. The display name, "Saga" in following snippet, is the name the UI will show for the project, but what it is important is the uri attribute from db, this is the database that Saga will be using. In the snippet, the database in use will be "SagaDB", change it according to your preference. If you loaded a Mongo database in step 2, you must change "SagaDB" to the name of the database you loaded. If you want to start a new database, just choose a proper name and the UI will create the database.

solutions: [

{

display: 'Saga',
db: {

uri: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/SagaDB',
options: {

keepAlive: 10000,
reconnectTries: 10

},

//Database info for patter matching server switch
host: process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost',
port: 27017,
name: 'SagaDB',

// Enable mongoose debug mode
debug: process.env.MONGODB_DEBUG || false

},

matcher: {

uri: 'http://localhost:8080/_saga'

}

}

]

Step 4: Starting Saga

Before starting Saga, make sure Mongo is up and running. Try to run:

...> mongo

If the command does not run, run the following command from the MongoDB/Server/3.6/bin:

.../MongoDB/Server/3.6/bin> mongod

Then, you will need to run the Saga Server Parser and the Saga Server UI. The first to be run is the Saga Server UI, since it will create the database if it doesn't exist. Go to the Saga Server UI directory and run the startup.bat from a console:

.../saga-server-ui> startup.bat

And then do the same for the Saga Server Parser:

.../saga-server-parser> startup.bat

If you didn't

guide, This is what you will achieve by following the next steps:

  • Getting Saga
  • Setting up the environment
  • Deploying Saga
  • Running Saga
  • Checking that it's working!

Prerequisites


  1. ElasticSearch 7+
  2. Java 11 or above

Step 1: Getting Saga


You'll be able to get it from here (Saga team in MS Teams).

In addition to Saga binaries you can also find:

  1. Saga introductory presentation
  2. Saga user manual
Note

Creators and users of Saga are subscribed to this Saga team, so you can always publish a message to get some help if you have questions or comments.


Step 2: Set 
up the environment


  1. Check that Java 11 is installed on your machine by running on terminal (or system console):

    $> java -version

  2. Unpackage Saga in your preferred location. 
    This is our recommended setup but you can pretty much handle the paths as you wish.
    This guide will refer to Saga's working directory as {SAGA_HOME}.
  3. Saga uses ElasticSearch (7+) and you can get it here.
    1. Deploy ElasticSearch (ES) 
    2. Run ES by executing the binary on {SAGA_HOME}/Elasticsearch-7.10.1/bin.



Tip

If Saga executes with an empty ElasticSearch, it will generate all the necessary indexes with the minimum default data (base pipeline, executors,...); although you need to add new tags and resources.


Step 3: Deploy Saga


Once you have Saga in {SAGA_HOME} validate the following:

There is a {SAGA_HOME}/lib folder containing the following JARs:

  1. saga-classification-trainer-stage-1.2.2
  2. saga-faq-stage-1.2.2.jar
  3. saga-lang-detector-stage-1.2.2.jar
  4. saga-name-trainer-stage-1.2.2.jar
  5. saga-parts-of-speech-stage-1.2.2.jar
  6. saga-sentence-breaker-stage-1.2.2.jar
  7. saga-spellchecking-stage-1.2.2.jar

Check the basic configuration on {SAGA_HOME}/config/config.json:

  1. "apiPort": 8080 → The port used by the server.
  2. "ipAddress": "0.0.0.0" → This IP/mask is used to restrict inbound connections, open to all connections by default.
  3. "security" → Security access to the Saga Server and Management UI (recommended only when ssl is also enabled)
    1. "enable": true → Indicates the use of security
    2. "encryptionKeyFile": → file containing the encryption key.  A file is provided by default but it is recommended to change it.
    3. "users.username" → Specify the username to use
    4. "users.password" → Specify the password for the username. Can be either plain or encrypted
  4. "ssl" → Enables SSL for the communication with the Saga Server
    1. enable": true → Indicates the use of ssl
    2. keyStore → Path to the keyStore
    3. keyStorePassword → Password of the keyStore. Can be either plain or encrypted
  5. "libraryJars": ["./lib"] → Folder where library jars are located
  6. If you are running elasticseach in localhost then you don't need to change anything. But if your elasticsearch runs somewhere else then you'll need to adjust the "hostnamesAndPorts" and "scheme" properties in both "elasticSearch" solution and "Elastic" provider. In case you have a cluster, you can specify them separated by comma, for example: "hostnamesAndPorts": ["elastic1:9200", "elastic2:9200", "elastic3:9200"],


If you have some valid "models" you'd like to include them on the server:

  1. Create a {SAGA-HOME}/nt-models folder for "name trainers" and copy the model there.
  2. Create a {SAGA-HOME}/ct-models folder for "classification trainers" and copy the model there.
  3. Create a {SAGA-HOME}/tf-models folder for "FAQ" (uses TensorFlow) and copy the model there.

To add datasets:

  1. Create a {SAGA-HOME}/datasets folder.
  2. Each dataset must be placed in its own folder. This folder name will be the one displayed for "test runs".
  3. Each data document in the dataset must be compliant with Saga's data file JSON format.
  4. Each folder must contain a ".metadata" file with information about the dataset and how to read it.
    You can check out the dataset format here.

Step 4: Run Saga


To run Saga:

Check that ElasticSearch is running.

Use the bundled startup script on {SAGA_HOME}/bin (either startup.bat for Windows or startup.sh for Linux).

If you didn't change the default port on the configuration, you should be able to access Saga UI

change the port, you should be able to access saga

.
If not, then check your configuration for the right port.


Step 5: Run Python Bridge Server


Saga has a python recognizer and python stage that can be used to process text using machine learning python models like Bert.

In case you need this, follow instruction on how to setup and run the python bridge here.



Panel

On this page:

Table of Contents

Related pages

Content by LabelshowLabelsfalsespacessaga12newshowSpacefalsesorttitletypepagecqllabel = "documentation-space-sample" and type = "page" and space = "saga12new"labelsdocumentation-space-sample