WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

Configure

Pizza Model

In the pizza model, configuring is analogous to creating and freezing the pizza base.

This section outlines the tools that are provided for configuring NetKernel.

Instances

The core concept in this section is the idea of declaring one or many named instances of NetKernel. For each declared instance the NetKernel plugin will create an associated set of configuration tasks for that instance.

Here's how to declare an instance in the netkernel{ } configuration...

//...NK plugin boilerplate not shown for clarity...

netkernel {

    instances {
        TEST
        {
            edition = "EE"
            location = "/opt/netkernel/NKEE-5.2.1-test/"
        }
        STAGE
        {
            edition = "EE"
            location = "/opt/netkernel/NKEE-5.2.1-stage/"
        }
        PROD
        {
            edition = "EE"
            location = "/opt/netkernel/NKEE-5.2.1-prod/"
        }
    }

}

In this example we have 3 named instances TEST, STAGE and PROD. The name you may choose for an instance is arbitrary (the underlying data structure for instances is Gradle's NamedObjectCollection). Here we're using all caps since its useful to be able to clearly spot the named instance when looking at the available tasks (more below).

An instance must declare an edition property which must be either "SE" or "EE".

location

An instance should declare a location property which must be the directory for the NetKernel installation (note, here we mean the NK concept of an installation).

The location may point to an existing instance of NetKernel, but equally an instance may not yet exist and so declaring the location states where you would like to install an instance of NetKernel.

It can be useful in some circumstances to not declare the location, for example if you have an open source project that just wants to grab a copy of NetKernel to run on. In which case the location will default to:

~/.gradle/netkernel/instances/XXXXX/

The instance concept is best understood with reference to the available tasks.

=Other Instance Properties

The following optional properties may be set in an instance declaration, the defaults are shown below...

url = "http://localhost"
backendPort = 1060
frontendPort = 8080

Instance Tasks

When you have a declared an instance in your NetKernel configuration, you will have access to a new set of tasks. For example, looking at the TEST instance above, when we issue...

gradle tasks

In addition to the regular build tasks of Gradle, we see the following highlighted set of tasks..

NetKernel Instance (TEST) tasks
-------------------------------
appositeConfigureTEST - Configures NetKernel (TEST) with packages from Apposite repository
appositeIsUpdatedTEST - Verifies that (TEST) is up to date with latest changes from Apposite repository
appositeUpdateTEST - Updates NetKernel (TEST) from Apposite repository
cleanFreezeTEST - Cleans frozen instance
deployCollectionTEST - Deploy the collection of modules from Maven to NetKernel(TEST)
freezeTEST - Freezes the NetKernel instance (TEST)
installFreezeTEST - Installs frozen NetKernel TEST into maven repository
installTEST - Installs NetKernel instance (TEST)
startTEST - Starts NetKernel instance (TEST)
stopTEST - Stops NetKernel instance (TEST)
undeployCollectionTEST - Undeploy the collection of modules from NetKernel(TEST)
xunitTEST - Run XUnit tests on NetKernel instance TEST

Notice how the named instance is identifiable and the task is specific to that instance.

Some of the tasks are self-evident: startTEST, stopTEST and xunitTEST - do what you'd expect they start, stop and run the full set of Xunit tests on the named instance.

In the following documentation for instance specific tasks, XXXX means the name of the specific instance

installXXXX

installXXXX can be used to install a brand new installation of NetKernel to the location specified for the named instance.

This task depends on the download task which is not instance specific but which requires some configuration as follows...

netkernel {

    download {
        edition = "EE"  //or SE
        username = "foo"   //Optional - will be prompted at console if not set
        password = "baa"   //Optional - will be prompted at console if not set
    }

}

The download task fetches a fresh NetKernel installer jar from the 1060 Research servers.

download must specify an edition which must be one of EE or SE.

If specifying EE you must provide the username and password for you NetKernel account - if login details are not specified in the download task's configuration you will be prompted at the command line.

The downloaded EE instance will have a temporary license suitable for configuration tasks but not suitable for production.

In all cases the installation jar file will be downloaded to:

~/.gradle/netkernel/download/

When installXXXX is run, if a recent copy of the jar file is found, the download task will not need to run.

Once installed then the instance can be started with startXXXX and stopped with stopXXXX.

appositeUpdateXXXX

Enterprise Edition Only

appositeUpdateXXXX will automatically synchronize and apply all available Apposite updates to the instance.

It's useful to apply this task immediately after running installXXXX to ensure your base installation is full up to date.

This task requires that the instance is running and will fail with a warning if it is not running.

appositeIsUpdatedXXXX

Enterprise Edition Only

appositeIsUpdatedXXXX will verify that the set of installed Apposite packages are fully up to date.

If this instance's Apposite packages are not up to date, this task will report an error.

appositeConfigureXXXX

Enterprise Edition Only

appositeConfigureXXXX will configure the instance by installing a specified set of packages from Apposite.

This task requires that you declare in the netkernel{} configuration the apposite packageList to install. Here is an example...

netkernel {

    apposite {
        packageList = ["lang-trl", "html5-frameworks"]
    }

}

packageList is an array containing the names of the apposite packages that must be installed.