Building and deploying the Solution

Building the project

Maven repositories

  1. From the ActiveViam share page, download the maven repository for the version of Atoti Server the Solution is based on (will be specified in the Release notes of the Solution you are deploying). The zip file containing the maven repository will be called maven-repository-<version number>.zip.

  2. On the Solution Release notes page, follow the directions to the Distribution Files section and download the maven repository for the Solution (contains all dependencies required to build the Solution that aren’t included in the Atoti Server download). A zip file containing the maven repository will be called simm-accelerator-<version number>-maven-repository.zip.

    Add these repositories to your existing maven repository.

Set up Artifactory access

In addition to the repository zips, you can download all of the maven dependencies from artifactory by setting up your maven settings file like so:

<settings>
    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

            <repositories>
                <repository>
                    <id>ActiveViamInternalRepository</id>
                    <name>ActiveViam Internal Repository</name>
                    <url>https://activeviam.jfrog.io/activeviam/activeviam-mvn-accelerators/</url>
                </repository>
            </repositories>
        </profile>
    </profiles>

    <servers>
        <server>
            <id>ActiveViamInternalRepository</id>
            <username>username</username>
            <password>password</password>
        </server>
    </servers>
</settings>

In order to download the dependencies for the ui, it is required to set up access to artifactory via npm, like so:

npm login --scope @activeviam --registry https://activeviam.jfrog.io/artifactory/api/npm/activeviam-npm-accelerators/

The result should be the following message: Logged in as username to scope @activeviam on https://activeviam.jfrog.io/artifactory/api/npm/activeviam-npm-accelerators/.

If the scope isn’t mentioned in the message, they might have to change the command to: npm login --scope=@activeviam --registry=https://activeviam.jfrog.io/artifactory/api/npm/activeviam-npm-accelerators/

Source

Download and unzip the source zip from the Artifactory page.

Build

note

Java 17 support

The Solution can be run within a Java 17 JVM. Some functionality in the full application and in the regressions tests requires deep reflection access to Java packages. To enable access, please use the following JVM parameters, either through the command line or maven surefire/failsafe configuration.

--add-opens=java.base/java.util.concurrent=ALL-UNNAMED
--add-opens=java.base/java.nio=ALL-UNNAMED

Atoti ISDA-SIMM also works in a Java 11 JVM.

  1. Once you have added all the maven repositories and extracted the source code, run mvn install on the parent pom file to build the entire project.

    This will build the Atoti Server executable JAR file (simm-starter/target/simm-starter-exec.jar), ActiveMonitor executable JAR file (simm-activemonitor/target/simm-activemonitor-2.0.2-exec.jar) .

  2. When the build is complete, you must deploy it. See Deployment.

  3. Build the standalone UI application using npm or yarn.

  4. Deploy the UI application.

Configuration

The only configuration required to start is to edit simm-starter/src/main/resources/properties/simm.properties

Set input.data.root.dir.path to the directory you want to put your data.

For more details, see Project configuration.

Alternatives

  1. If you only want to use the sample data embedded in the project along with the Jetty server, then you don’t need to configure the data directory.
  2. You can copy the sample data (simm-starter/src/test/resources/data-samples/data/) into simm-starter/src/main/resources/ then the sample data will be included in the .jar file and you won’t need to set the data directory.

Deployment

Atoti Server and ActiveMonitor

simm-starter and simm-activemonitor are Spring Boot applications that build to an executable JAR. To deploy the executable JAR files, simply use the following commands:

java -jar simm-starter-exec.jar

and

java -jar simm-activemonitor-2.0.2-exec.jar

note

Each executable JAR will publish the application on a different port. The default port for simm-starter is 12000, and for simm-activemonitor is 12001.

Atoti Server will be available at: http://<your hostname>:12000/simm-starter/

ActiveMonitor will be available at: http://<your hostname>:12001/simm-activemonitor/

You can change the port by either of the following:

  • Use the argument server.port.

    For example:

    java --add-opens java.base/java.util.concurrent=ALL-UNNAMED -jar simm-starter-exec.jar --server.port=<port>
    
  • Externalize the properties files (see Externalizing Properties Files )

[Eclipse / IntelliJ]

  • Use maven to run an initial build of the Solution $ mvn clean install.
  • Start the server by running SimmWebApplication.java in simm-starter/src/java/com/activeviam/simm/starter.
  • The server will run at https://localhost:12000/simm-starter
  • You will need to compile and serve up the ui from the ui source code, as described in the Atoti UI section below.

Atoti UI

Atoti UI is a static website that can be deployed in any way you see fit. All the necessary files are to be found in the ./build folder of the standalone application after the project has been built.

As an example, the UI can be deployed on Tomcat using the following instructions:

  1. Build the standalone application:

    1. Set up artifactory access for node dependencies
    2. Download the ui source code from artifactory.
    3. Copy the lockfile for the build tool you use (i.e. package-lock.json for npm, yarn.lock for yarn) into the project’s main directory.
    4. Run npm ci if using npm, or yarn install --frozen-lockfile if using yarn.
    5. Run npm run build if using npm, or yarn build if using yarn.
  2. Place the deployment in the webapps folder of your Tomcat:

    1. Find where the webapps folder is for your Tomcat.
    2. Create a folder called simm-activeui in the Tomcat webapps folder.
    3. Copy the contents from the build folder into your new folder webapps/simm-activeui/.
  3. Start the Tomcat server. You can now access the UI on the address http://<your hostname>:<port>/simm-activeui/.

For details on how to configure the UI, see Configuring the UI.

How to run all tests

mvn clean install -P IT

Externalizing Properties Files

In the default implementation, all the necessary properties are within the project. A number of properties files have been externalized and can be overridden with an external file using JVM variables. You may wish to use this functionality if you are running the project in different environments. Below is a list of the files together with their respective variable names:

There are three options to override default properties:

  • OPTION 1: Command line arguments, e.g.<span class="measure"> --csvSource.dataset=/path/to/folder</span> .

note

We use “–” to set properties with Spring Boot.

  • OPTION 2: Create a properties file (e.g. <span class="measure">application.properties</span>) and add your property overrides. Then pass it to the main using the command line argument <span class="measure">--spring.config.additional-location=/&lt;path&gt; application.properties</span>

  • OPTION 3: Change the path to the default properties file using the appropriate variable specified below:

    File Variable Name
    simm.properties app.env.properties.file.path
    hibernate.properties hibernate.env.properties.file.path

    If any of the above variables are not set, the default properties files will be used.

    Example values for these properties files include:

    • classpath:<filename>

    • file:/home/etc/<filename>; - Unix Environment

    • file:///C:/Users/john/config/<filename> - Windows environment

tip

Options 1 and 2 are recommended because they only override the properties you specify and use the defaults for other ones. Additionally, they can be used to override any property.

Option 3 only works for specific properties files (i.e. the ones specified in the table above), and replaces the default file completely, meaning you need to make a copy of the default file and have all properties in your external custom file even if they have the same value as the default file.