Yupiik Batch provides an UI which can be used to visualize a database populated using ExecutionTracer.

Dependency

The dependency to use is:

<dependency>
  <groupId>io.yupiik.batch</groupId>
  <artifactId>yupiik-batch-ui-backend</artifactId>
  <version>${yupiik-batch.version}</version>
</dependency>

You can add any JDBC driver you want too. Once you have it, you can create a Docker image using the main org.apache.openwebbeans.se.CDILauncher - just use the previous classpath.

TIP

using jib the docker image creation is very smooth.

Configuration

Name Env Variable Description

yupiik.batch.backend.database.jobTable

YUPIIK_BATCH_BACKEND_DATABASE_JOBTABLE

Job table to query.

yupiik.batch.backend.database.stepTable

YUPIIK_BATCH_BACKEND_DATABASE_STEPTABLE

Step table to query.

yupiik.batch.backend.datasource.driver *

YUPIIK_BATCH_BACKEND_DATASOURCE_DRIVER

Datasource driver.

yupiik.batch.backend.datasource.maxConnections

YUPIIK_BATCH_BACKEND_DATASOURCE_MAXCONNECTIONS

Max connections in the pool.

yupiik.batch.backend.datasource.minEvictableIdleTime

YUPIIK_BATCH_BACKEND_DATASOURCE_MINEVICTABLEIDLETIME

How long to await before a connection is considered idled and evictable.

yupiik.batch.backend.datasource.minIdle

YUPIIK_BATCH_BACKEND_DATASOURCE_MINIDLE

Min connections in the pool.

yupiik.batch.backend.datasource.password

YUPIIK_BATCH_BACKEND_DATASOURCE_PASSWORD

Datasource password.

yupiik.batch.backend.datasource.removeAbandoned

YUPIIK_BATCH_BACKEND_DATASOURCE_REMOVEABANDONED

Should connections be removed when abandoned (see related timeout).

yupiik.batch.backend.datasource.removeAbandonedTimeout

YUPIIK_BATCH_BACKEND_DATASOURCE_REMOVEABANDONEDTIMEOUT

The time in seconds before a connection can be considered abandoned.

yupiik.batch.backend.datasource.testOnBorrow

YUPIIK_BATCH_BACKEND_DATASOURCE_TESTONBORROW

Should connections be tested on borrow time.

yupiik.batch.backend.datasource.testOnReturn

YUPIIK_BATCH_BACKEND_DATASOURCE_TESTONRETURN

Should connections be tested on return to the pool time.

yupiik.batch.backend.datasource.testWhileIdle

YUPIIK_BATCH_BACKEND_DATASOURCE_TESTWHILEIDLE

Should connections be tested in background.

yupiik.batch.backend.datasource.timeBetweenEvictionRuns

YUPIIK_BATCH_BACKEND_DATASOURCE_TIMEBETWEENEVICTIONRUNS

Time between background evictions in ms.

yupiik.batch.backend.datasource.url *

YUPIIK_BATCH_BACKEND_DATASOURCE_URL

Datasource URL.

yupiik.batch.backend.datasource.username

YUPIIK_BATCH_BACKEND_DATASOURCE_USERNAME

Datasource username.

yupiik.batch.backend.datasource.validationQuery

YUPIIK_BATCH_BACKEND_DATASOURCE_VALIDATIONQUERY

Validation query to validate the connection when enabled.

yupiik.batch.backend.datasource.validationQueryTimeout

YUPIIK_BATCH_BACKEND_DATASOURCE_VALIDATIONQUERYTIMEOUT

How long to await for the validation query.

yupiik.batch.backend.queries.countAllJobs

YUPIIK_BATCH_BACKEND_QUERIES_COUNTALLJOBS

Count all jobs SQL query (for portability), `${table}` is replaced by the table name.

yupiik.batch.backend.queries.findAllJobs

YUPIIK_BATCH_BACKEND_QUERIES_FINDALLJOBS

Find all jobs with pagination SQL query (for portability), `${table}` is replaced by the table name. Parameters can be `${pageSize}`, `${firstIndex}` - inclusive, `${lastIndex}` - exclusive, or `${where}` which would be replaced by a name where clause (`WHERE name = ? `).

yupiik.batch.backend.queries.findJobById

YUPIIK_BATCH_BACKEND_QUERIES_FINDJOBBYID

Find a job by id SQL query (for portability), `${table}` is replaced by the table name.

yupiik.batch.backend.queries.findLastExecutions

YUPIIK_BATCH_BACKEND_QUERIES_FINDLASTEXECUTIONS

SQL query (for portability) to find last execution of each batch, `${table}` is replaced by the table name.

yupiik.batch.backend.queries.findStepsByJobId

YUPIIK_BATCH_BACKEND_QUERIES_FINDSTEPSBYJOBID

Find aall steps related to a job id SQL query (for portability), `${table}` is replaced by the step table name.

yupiik.batch.backend.tomcat.accessLogPattern

YUPIIK_BATCH_BACKEND_TOMCAT_ACCESSLOGPATTERN

Tomcat access log pattern.

yupiik.batch.backend.tomcat.port

YUPIIK_BATCH_BACKEND_TOMCAT_PORT

Tomcat port.

yupiik.batch.backend.tomcat.webUsers

YUPIIK_BATCH_BACKEND_TOMCAT_WEBUSERS

List of allowed users - by default all are. It uses a properties syntax: `user=password`. Security uses a web BASIC mecanism.

yupiik.batch.frontend.extensionsJs

YUPIIK_BATCH_FRONTEND_EXTENSIONSJS

Javascript path to a Yupiik Batch frontend extension. Script is injected just before yupiik-batch main one, i.e. after libraries ones but note they are minified wih webpack.

Extend the UI

The UI provides a few extension points to let you enrich it with other utilities.

First step is to create a javascript file which will register the extension then use the related configuration to let the server inject it into the index.html.

An extension often looks like:

window.yupiikBatchExtensions = (function () {
    return {
        routes: function (React, router, antd, antdIcons) { // custom additional routes
            var e = React.createElement;

            // foo extension (content + breadcrumb)
            function Foo() {
                return e(router.Link, { to: '/extensions/foo' }, ['Foo link']);
            }
            function FooBreadcrumb() {
                return e(antd.Breadcrumb, null, [
                    e(antd.Breadcrumb.Item, null, [
                        e(router.Link, { to: '/' }, [
                            e(antdIcons.HomeOutlined, null, null),
                        ]),
                    ]),
                    e(antd.Breadcrumb.Item, null, [
                        e('span', null, ['Files']),
                    ]),
                ]);
            }
            Foo.Breadcrumb = vBreadcrumb;

            // register extension routes
            return [
                {
                    path: '/extensions/foo',
                    component: Foo,
                    sider: {
                        selectedKey: 'foo',
                        menu: {
                            attributes: {
                                icon: e(antdIcons.FileOutlined, null, null),
                            },
                            content: e(router.Link, { to: '/extensions/foo' }, 'Foo'),
                        },
                    },
                },
            ];
        },

        // wrap comments - if you want to match a pattern to add links or components
        commentWrapper: function (comment, React, router, antd, antdIcons) {
            return `THIS IS A COMMENT: ${comment}`;
        },

        // enables to overwrite parts of the routes
        routeDecorator: function (route) { return route; },

        // enables to change the columns of the tables, method is the JSON-RPC methods called for the table
        tableColumnsWrapper: function ({ columns, method }) {
            return columns;
        },
        // enables to add headers into your fetchJsonRPC calls
        fetchJsonRpcHeaders: function() {
          return {
            'header1':'value',
            'header2':'value',
          }
        },
        // Enables to wrap the Yupiik Batch App in high order component, for logging or else
        // React and antd must be passed to the components  (library import will not work)
        bootstrap: function ({ ReactDOM, React , App, antd }) {
            ReactDOM.render(
                <React.StrictMode>
                    <ExampleWrapper app={App}  />
                </React.StrictMode>,
                document.getElementById('root')
            );
        },

    };
})();
TIP

React, react-router, useJsonRpc - a hook to call JSON-RPC server, andt - components, and antdIcons are injected in extension points to let you integrate with the application UI.