Prerequisites
- Elasticsearch 6.4.1 or above.ElasticSearch 7+
- Java 11 or above.
Step 1: Getting Saga
At the moment of writing, Saga version 1.0.0 has just been released. You can get it You'll be able to get it from here (Saga team in MS Teams).
It is a bundle containing:
Saga binariesInstance of Elasticsearch (with sample data for your convenience)In addition to Saga binaries you can also find:
- Saga introductory presentation
- Saga user manual
Note |
---|
Creators and users of Saga are subscribed to this Saga team, so in case you you can always publish a message to get some help if you have questions or comments. |
Step 2: Set up the environment
- Check that Java 11 is installed on your machine by running on terminal (or system console):
$> java -version
- 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}
. - Saga uses Elasticsearch (6.4.1 or aboveElasticSearch (7+) and you can get it here.
- Deploy Elasticsearch ElasticSearch (ES) under
{SAGA_HOME}
in something like {SAGA_HOME}/Elasticsearch-6.4.1
. - Run ES by executing the binary on
{SAGA_HOME}/Elasticsearch-
67.
410.1/bin
.Saga can run on an empty ES instance
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:
saga-classification-trainer-stage-1.2.2
saga-faq-stage-1.
0.02.2.jar
- -SNAPSHOT
saga-lang-detector-stage-1.2.2.jar
saga-name-trainer-stage-1.2.2.jar
saga-parts-of-speech-stage-1.2.2.jar
saga-sentence-breaker-stage-1.2.
0.0-SNAPSHOT2.jar
saga-spellchecking-stage-1.2.2.jar
Check the basic configuration on {SAGA_HOME}/config/config.json
:
- "airPortapiPort": 8080 → The port used by the server.
- "ipAdressipAddress": "0.0.0.0" → This IP/mask is used to restrict inbound connections, open to all connections by default.
- "logger" → Each logger level config per handler.security" → Security access to the Saga Server and Management UI (recommended only when ssl is also enabled)
- "enable": true → Indicates the use of security
- "encryptionKeyFile": → file containing the encryption key. A file is provided by default but it is recommended to change it.
- "users.username" → Specify the username to use
- "users.password" → Specify the password for the username. Can be either plain or encrypted
- "ssl" → Enables SSL for the communication with the Saga Server
- enable": true → Indicates the use of ssl
- keyStore → Path to the keyStore
- keyStorePassword → Password of the keyStore. Can be either plain or encrypted
- "libraryJars": ["./lib"] → Folder where library jars are located
- 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"],
- "provider" → Data Resources, mainly used to specify a location of resource files like dictionaries and ES configuration
- New filesystem providers can be added to group different resource files.
- ES configuration includes the "port" to connect to . The default is 9200; you may change it to fit your environment.
"solutions" → Bundle solution schema. Its values may change to have multiple servers with different "solutions" or to switch from one to another.A solution work as a domain. By default the "saga" solution creates ES indexes using the pattern "saga-<index>" and only loads indexes with the same pattern.
So you could have multiple solutions on a ES server.
To switch between solutions you'd need to shut down the server, change the "indexName" value and restart the server.
If you have some valid "models" you'd like to include them on the server:
- Create a
{SAGA-HOME}/nt-models
folder for "name trainers" and copy the model there. - Create a
{SAGA-HOME}/ct-models
folder for "classification trainers" and copy the model there. - Create a
{SAGA-HOME}/tf-models
folder for "FAQ" (uses TensorFlow) and copy the model there.
To add datasets:
- Create a
{SAGA-HOME}/datasets
folder. - Each dataset must be placed in its own folder. This folder name will be the one displayed for "test runs".
- Each data document in the dataset must be compliant with Saga's data file JSON format.
- 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 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 at http://localhost:8080/.
If not, then check your configuration for the right port.