# Getting Started

# Retrieving a Distribution

A pre-built Rosetta distribution may be retrieved from our public Maven repository using the following steps.

  1. Install Maven (if you have not already).

  2. Add the following repository to your settings.xml:

    <repository>
       <id>k-int-public-repository</id>
       <name>Knowledge Integration Public Maven Repository</name>
       <url>https://maven.k-int.com/repository/public/</url>
       <releases>
          <enabled>true</enabled>
       </releases>
       <snapshots>
          <enabled>false</enabled>
       </snapshots>
    </repository>
  3. Run the following command:

    mvn dependency:copy -Dartifact=com.k-int.rosetta:rosetta-server:3.0.0:zip -DoutputDirectory=/output/directory/for/rosetta

    where you may replace /output/directory/for/rosetta with your output directory of choice, which is where the distribution will be downloaded.
    You may also specify tar instead of zip in the command above to download the distribution as a tar file, if preferred.

# Deploy

# Docker

  1. Create a directory with this file structure:

    • (root)/
      • config/
        • resources/
        • rosetta.yml
      • plugins/
      • docker-compose.yml
  2. In the docker-compose.yml file, write this:

    version: "3.8"
    
    services:
      rosetta:
        container_name: rosetta
        image: public.ecr.aws/v3w7q3a1/rosetta:3.0.0
        volumes:
          - ./config/rosetta.yml:/rosetta/config/application.yml
          - ./config/resources:/rosetta/config/resources # Use this for Proteus specs etc.
          - ./config/plugins:/rosetta/plugins-additional # Alternatively, map this to /rosetta/plugins to overwrite all plugins built into the image
        networks:
          - internal
        restart: always
        ports:
          - "4923:4923"
    
    networks:
      internal:
  3. Customize config (See example)

  4. cd to the (root) folder where your docker compose file was placed

  5. Run docker compose up -d

  6. Rosetta should now be running on port 4923!

# Standalone

  1. Obtain a distribution of Rosetta (see Retrieving a Distribution.
  2. Extract your distribution to a directory of your choice. The structure of its contents includes the following files/directories:
    • (root)/
      • bin/
        • rosetta
        • rosetta.bat
      • config/
        • application.yml
      • lib/
      • plugins/
  3. Customize config (See example)
  4. Run the binary from your (root) directory
      1. Run ./bin/rosetta if using Linux
      1. Run "./bin/rosetta.bat" if using Windows
  5. Rosetta should now be running on port 4923!

# Configure

# Typical search config

The following is typical config for a single search endpoint mapped to path /search backed by an Elasticsearch index called "my_index" running locally on port 9200.

  1. In application.yml for standalone or rosetta.yml for docker, write this:
    rosetta:
      view:
        views:
          - name: search
            paths:
              - /search
            profile: default
            transforms:
              request:
                policy: list
                names:
                  - to-generic-search
              response:
                policy: list
                names:
                  - to-simple-data-response
    
      profile:
        profiles:
          - name: default
            providers:
              policy: list
              names:
                - elasticsearch
            transforms:
              request:
                - glyphs:
                    policy: list
                    names:
                      - elastic-generic-search
    
      provider:
        providers:
          - name: elasticsearch
            type: elasticsearch
            properties:
              protocol: http
              host: localhost
              port: 9200
              index: my_index
    
      transform:
        glyphs:
          - name: to-generic-search
            type: to-generic-search
    
          - name: to-simple-data-response
            type: to-simple-data-response
    
          - name: elastic-generic-search
            type: elastic-generic-search
  2. Start/restart rosetta as necessary
  3. Test your deployment is working by executing a search request e.g. at http://localhost:4923/search