Public | Automated Build

Last pushed: 4 months ago
Short Description
Base image used to create Agave Java API images.
Full Description

Agave Java API Base Image

This is the base image used to create the Agave Java API Images. It has Tomcat 6 and Oracle JDK7 installed and configured with a JNDI connection to a MySQL or MariaDB container defined in the environment and/or linked at runtime. CORS support is implicit in this image, so all webapps extending it will have proper support out of the box.

What is the Agave Platform?

The Agave Platform (http://agaveapi.co) is an open source, science-as-a-service API platform for powering your digital lab. Agave allows you to bring together your public, private, and shared high performance computing (HPC), high throughput computing (HTC), Cloud, and Big Data resources under a single, web-friendly REST API.

  • Run scientific codes

    your own or community provided codes

  • ...on HPC, HTC, or cloud resources

    your own, shared, or commercial systems

  • ...and manage your data

    reliable, multi-protocol, async data movement

  • ...from the web

    webhooks, rest, json, cors, OAuth2

  • ...and remember how you did it

    deep provenance, history, and reproducibility built in

For more information, visit the Agave Developer’s Portal at http://agaveapi.co.

Using this image

This image can be used as a base image for all Java APIs. Simply create a Dockerfile that inherits this base image and add your war file to the Tomcat webapps folder /usr/local/tomcat/webapps.

Tomcat has a preconfigured JNDI connection with the following configuration:

<Resource name="jdbc/iplant_io"
        auth="Container"
        username="%MYSQL_USERNAME%"
        password="%MYSQL_PASSWORD%"
        driverClassName="com.mysql.jdbc.Driver"
        url="jdbc:mysql://%MYSQL_HOST%:%MYSQL_PORT%/%MYSQL_DATABASE%"
        connectionProperties="zeroDateTimeBehavior=convertToNull;sessionVariables=FOREIGN_KEY_CHECKS=0;autocommit=0"
        type="javax.sql.DataSource"
        factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"

        suspectTimeout="60"
        abandonWhenPercentageFull="50"
        logAbandonded="true"
        validationQuery="SELECT 1"
        validationInterval="30000"

        maxActive="50"
        minIdle="10"
        minEvictableIdleTimeMillis="30000"
        timeBetweenEvictionRunsMillis="30000"

        jmxEnabled="true"
        jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState(autocommit=false,defaultAutoCommit=false);
            org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer;
            org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer"

        useUnicode="true"
        characterEncoding="utf-8"
        characterSetResults="utf8"/>

The mysql and tomcat jdbc drivers are already present in the image. If not specified in the container environment, the tokens will be replaced with the values of a trusted MySQL or MariaDB container linked at runtime.

Running this image

When running in production, both the access and application logs will stream to standard out so they can be access via the Docker logs facility by default.

docker run -h docker.example.com
           -p 80:8080 \
           --name some-api \
           -e MYSQL_USERNAME=agaveuser \
           -e MYSQL_PASSWORD=password \
           -e MYSQL_HOST=mysql \
           -e MYSQL_PORT=3306 \
           agaveapi/java-api-base:latest
Docker Pull Command
Owner
agaveapi

Comments (0)