Getting Started with Genero Container Images

Welcome to your guide to deploying Genero Applications using Genero Containers.

Genero Container Images are created to optimize the deployment and runtime of your Genero application in any Docker environment. With Genero Containers, your team gets simplified app deployment and rollback procedures, continuous integration and deployment (CI/CD), automated testing and infrastructure-as-code(IaC) approaches. Our images are built to run your app directly on Docker or on an advanced Kubernetes environment making your app highly available, scalable, resilient and secure.

This guide will help you get a jump start on creating a Genero Runtime container, containerizing your own Genero application, and adding custom configurations to your container instances on Docker.

Genero Container Images

These Docker images contain a Genero Application Server (GAS) and Genero Report Writer (GRE) runtime and database clients. They are tuned and integrated with AWS EKS scaling, monitoring, logging, and alerting.

We are currently supporting several types of GCIs that can mainly be split into 2 categories:

  • The runtime images - The base GAS image and GAS image with db client support.
  • The development image - GST-srv
Here’s the list of the latest Genero Container Images (GCI) we provide:
Image Short Name Description ECR Name
genero/enterprise/runtime

This image lets you deploy a container running a Genero Application Server (GAS).

OS/Arch: Linux® Rocky 9, x86-64

Note that these images provide GAS and FGL and DO NOT include GRE.

567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime:rl9-gas5.00.02-fgl5.00.03
genero/enterprise/runtime-gre

This image lets you deploy a container running a Genero Application Server (GAS).

OS/Arch: Linux Rocky 9, x86-64

567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime-gre:rl9-gas5.00.02-fgl5.00.03
genero/enterprise/runtime-mysql

Run a Genero Application Server (GAS) that supports connection to a MySQL database.

OS/Arch: Linux Rocky 9, x86-64

Note that these images provide GAS and FGL and DO NOT include GRE.

567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime-mysql:rl9-gas5.00.02-fgl5.00.03-mysql8.0.39
genero/enterprise/runtime-gre-mysql Run a Genero Application Server (GAS) that supports connection to a MySQL database.

OS/Arch: Linux Rocky 9, x86-64

567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime-gre-mysql:rl9-gas5.00.02-fgl5.00.03-mysql8.0.39
genero/enterprise/runtime-psql

Run a Genero Application Server (GAS) that supports connection to a Postgresql Database.

OS/Arch: Linux Rocky 9, x86-64

Note that these images provide GAS and FGL and DO NOT include GRE.

567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime-psql:rl9-gas5.00.02-fgl5.00.03-psql16
genero/enterprise/runtime-gre-psql

Run a Genero Application Server (GAS) that supports connection to a Postgresql Database.

OS/Arch: Linux Rocky 9, x86-64

567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime-gre-psql:rl9-gas5.00.02-fgl5.00.03-psql16
genero/enterprise/runtime-ifx

Run a Genero Application Server (GAS) that supports connection to an Informix® Database.

Note that these images provide GAS and FGL and DO NOT include GRE.

OS/Arch: Linux Rocky 9, x86-644

567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime-ifx:rl9-gas5.00.02-fgl5.00.03-ifx4.50.FC1
genero/enterprise/runtime-gre-ifx

Run a Genero Application Server (GAS) that supports connection to an Informix Database.

OS/Arch: Linux Rocky 9, x86-64

567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime-gre-ifx:rl9-gas5.00.02-fgl5.00.03-ifx4.50.FC1
genero/enterprise/development-build-gar

This image lets you build a Genero Application into a GAR file. It comes with a Genero Studio (GST) Server installed which enables it to build Genero projects.

OS/Arch: Linux Rocky 9, x86-64

567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/development-build-gar:5.00
Note:

Ask your support team for more versions of the GCI (4.01 and 3.20 are available).

Starting a Genero Runtime Container

Before you begin

Before starting, there is a set of tools and configurations that are required for this guide:
  • Install Docker Desktop (or any other Docker Daemon)
  • AWS tools. aws cli or the AWS Command Line Interface (CLI) is used for IAM user authentication. For more information, go to Install or update to the latest version of t he AWS CLI - AWS Command Line Interface.
  • AWS keys. Request access keys from your support team. You should get a set of 2 keys: Access and Secret key. Then run aws configure and set the user's access keys and region;
     aws configure
     AWS Access Key ID: XXXXXXXXXXXXXXXXXXXXX
     AWS Secret Access Key: XXXXXXXXXXXXXXXXXXXXX
     Default region name [eu-west-2]: eu-west-2
    
    To test your keys, run the following command:
    aws ecr get-login-password --region eu-west-2 | docker login --username AWS --password-stdin
    567640560273.dkr.ecr.eu-west-2.amazonaws.com
    
  • Request a Genero Containers standalone license from your support team. .

Start a Genero Runtime Container

When you pull an image from the private ECR, ensure that your AWS access keys are configured and that you are logged into the repo.

To log in, run the following command:

aws ecr get-login-password --region eu-west-2 | docker login --username AWS --password-stdin 567640560273.dkr.ecr.eu-west-2.amazonaws.com
  1. Run the following command to pull the image:
    docker pull 567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime
  2. Run the following command to start one GAS Container via Docker:
    docker run -it --privileged --rm --name gas -p 8080:80 -e FGL_LICENSE_NUMBER=<FGL LICENSE> -e FGL_LICENSE_KEY=
    <FGL_KEY> <Image Name>:latest
    
  3. (Optional) To set your license, set the following environment variables for your container:
    • FGL_LICENSE_NUMBER - License number for the GAS
    • FGL_LICENSE_KEY - License key for the GAS
    You can also set the following environment variables for your container via docker-compose.

    Here's an example of a docker-compose manifest that you can use to start one Genero Container;

    services:
     gas:
     ports:
     - '8080:80'
     image: "567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime:5.00"
     restart: always
     environment:
     # FGL License
     - FGL_LICENSE_NUMBER=<FGL License Number>
     - FGL_LICENSE_KEY=<FGL License Key>
    
    Save the file, then run the following command to deploy your container:
    docker compose -f <file name> up
  4. Test the Application Server with http://localhost:8080/gas/demos.html.
  5. Run a health check with http://localhost:8080/gas/ws/r/heartbeat/HeartBeat/status.
  6. Use the docker exec command to run commands inside a Docker container. The following command line gives you a bash shell inside your GAS container:
    docker exec -it gas_container_name bash
    The log is available through Docker's container log:
    docker logs gas_container_name
    

Persist Data From Your Genero Container

The Persisting container data webpage states "When a container starts, it uses the files and configuration provided by the image. Each container is able to create, modify, and delete files and does so without affecting any other containers. When the container is deleted, these file changes are also deleted.”

While this ephemeral nature of containers is great, it poses a challenge when you want to persist the data. For example, you might want to save certain configurations or any files on your Genero Container, so that when a container restarts the configurations are not lost, or even further you might want to start another container with the same configurations. So how can you persist these files?

The simple solution is to create Container Volumes. Let’s say you want to add/update configurations in the /usr/custom directory of your container, you will need to create a volume, we’ll call it custom-vol, and map the volume to the directory you want to persist, in this case /usr/custom. Here’s the example of the same .yaml file used in the previous example with the volume definition.
services:
gas:
    ports:
    - '8080:80'
    image: "567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime:5.00"
    restart: always
    environment:
    # FGL License
    - FGL_LICENSE_NUMBER=<FGL License Number>
    - FGL_LICENSE_KEY=<FGL License Key>
    volumes:
      - custom-vol:/usr/custom
volumes:
  custom-vol:
Note:

custom-vol: is supposed to be added this way.

When starting a container with the following command, the volume will be mounted or attached into the container at /usr/custom. If the volume custom-vol doesn't exist, Docker will automatically create it for you. When the container runs, all files it writes into the /usr/custom folder will be saved in this volume, outside of the container. If you delete the container and start a new container using the same volume, the files will still be there. For more information, go to the Persisting container data page.

Deploy your Application to a Genero Container

Manual Deployment During Runtime

When you want to run your application on a running Genero GAS container and the application has no dependencies or specific libraries, you can easily build a gar, upload it to the container and connect to your app.
Note:

You can ask your support team to give you a gar with a sample application for you to test.

With the .gar, copy the name of your container by running docker ps and the local path to your .gar, then run:
docker cp archive_name container_id:/archive_name.gar
Get shell access to your container (follow the instructions in the Container shell access and viewing GAS logs step) and enable your gar:
export GASADMIN="/opt/fourjs/gas/bin/gasadmin gar -E res.appdata.path=/opt/fourjs/gas/appdata"
su - genero -c "$GASADMIN --deploy-archive /archive_name.gar"
su - genero -c "$GASADMIN --enable-archive archive_name"
Connect to your application from the browser. For example: http://localhost:8080/gas/ua/r/app_name, where app_name is one of the apps listed in the output of the --enable-archive command without the XCF extension. Taking the previous example, the output would be: Install application app_name.xcf into /opt/fourjs/gas/appdata/app

Automate Process

Instead of going through the copy/paste and deploy/enable steps manually, whenever you have a new version of your application, there are various ways to automate the process.

Ask your professional services team to get more information on this topic.

Connect to a Database Server from Your Genero Runtime Container

Your application might require a connection to a specific database server to start, log users in, retrieve data, and more. This process is simplified with the provided lineage of Genero Runtime images with db-clients installed. All you have to do is check whether your required database type is listed in the table of the image provided, copy the ECR Name to the image, and use that to start your container(s).

For example, you can use the following image to connect to a psql server from your Genero container
567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime-psql
All you have to do is:
  • Pull the image -
    docker pull 567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime-psql 
  • Start the container -
    docker run -it --privileged --rm --name gas -p 8080:80 -e FGL_LICENSE_NUMBER=<FGL LICENSE> -e FGL_LICENSE_KEY=<FGL_KEY> 567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime-psql:latest
  • Now you can get shell access to your container and try connecting to a psql server:
    services:
      postgres:
        image: postgres:14-alpine
        ports:
          - 5432:5432
        environment:
          - POSTGRES_PASSWORD=S3cret
          - POSTGRES_USER=genero_user
          - POSTGRES_DB=genero_db
        hostname: psql-db
      gas:
        ports:
        - '8080:80'
        image: "567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime-psql"
          # You can specify any version of the provided gas image tags
        restart: always
        environment:
        # FGL License
        - FGL_LICENSE_NUMBER=<FGL License Number>
        - FGL_LICENSE_KEY=<FGL License Key>
    Note:

    To test this case, you can deploy a postgresql container and connect to it

Once you get shell access to your gas container, you can connect to the psql container by running:
psql -h psql-db -d genero_db -u genero_user -W
Then enter the password.

Create your own Genero Container Image

Manually

There are various ways to create a Genero Container Image with an app installed on it. For example, after copying and pasting you gar file, deploying and enabling it on the container and testing that you get a connection, you can save the container’s state into a new image. This is similar to the VM snapshots.

For more information, go to docker image save. After creating the image, you can start your new containers using the image, and your application will run on it. You can also add libraries and files, install any other dependencies, or add configurations.

From DockerFile

You can create a new Docker Container image based on our Genero Container Image but with additions that your application requires by creating a new Docker file and adding all the requirements there. For example;

 FROM <our image> 
# Your features
COPY path/to/my_feature_script /path/to/target/location/my_feature_script 
...

Automatically via CI/CD

An alternate way of creating a custom image with your app already built-in it is to compile it and install it in the same build process. We provide an image with GST Server installed on it. The GST Server image lets you compile your Genero project. The resulting files can then be transferred to a GAS image in order to deploy your app.

We recommend using a gar file as the target, but you can compile your app using any mechanism you deicde, in which case you’ll need to install what you need on the GST image. This can be done during the build phase.

Here is an example of usage of the GST image to build your custom GAS image:

#*****************************************************************************#
## Intermediate build stage
FROM 567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/development-build-gar AS builder
ARG FGL_LICENSE_NUMBER
ARG FGL_LICENSE_KEY
  # You'll need to define FGL_LICENSE_NUMBER and FGL_LICENSE_KEY as environment variables in your repo
  # and pass them as build arguments.
ENV FGL_LICENSE_NUMBER=${FGL_LICENSE_NUMBER}
ENV FGL_LICENSE_KEY=${FGL_LICENSE_KEY}
ENV BUILD_CMD=gsmake
ENV SOURCE_4PW_FILE=/opt/genero/<your genero project folder>/<your app name>.4pw
  # Define the location of your 4pw file.
COPY ./<your genero project folder> /opt/genero/<your genero project folder>
  # Copy project folder to the builder container
RUN /entrypoint.sh
  # Build the project
  # /!\ Note that you can replace the call to '/entrypoint.sh' or 'gsmake' with the
  #     call to your preferred build command, you’ll also need to call /generate-fgllicense.sh
  #     beforehand in order to setup the Genero License, otherwise you won’t be able to compile
  #     your Genero Project.
#*****************************************************************************#
## Base Install Image
FROM 567640560273.dkr.ecr.eu-west-2.amazonaws.com/genero/enterprise/runtime
COPY --from=builder /opt/genero/<your genero project folder>/distbin/<your app name>.gar /<your app name>.gar
RUN su - genero -c "/opt/fourjs/gas/bin/gasadmin gar -E res.appdata.path=/opt/fourjs/gas/appdata --deploy-archive /<your app name>.gar" \
  && su - genero -c "/opt/fourjs/gas/bin/gasadmin gar -E res.appdata.path=/opt/fourjs/gas/appdata --enable-archive <your app name>"
  # NOTE: If you package your app in a different way, you'll have to install the binaries of your app accordingly.
#*****************************************************************************#
This dockerfile can then be used to build your image via a CI/CD pipeline. Here is a diagram that summarizes the build process in the case of Bitbucket’s Pipelines with ECR:

In order to properly manage your Genero app and your image, we recommend using two separate repositories: one for your Genero app code and one for your custom image build files. You can then declare the the Genero code repo as a sub module of the image repo. By doing that, you keep both projects (the image and the genero app) separate but the image repo has access to the genero code, which means you can build the app while building your image. A benefit of using sub-modules is that you can add as many genero apps as you need. For more details about sub-modules, go to 7.11 Git Tools - Submodules.

Here are the steps to follow in order to setup your image’s repo:

  1. Add your Genero code’s git repo as a submodule of your image’s repo:
     git submodule add <Your git link>
    Note:

    If you are using the pipelines build, your pipelines will need to be able to pull the Genero code’s git repo. To create a key for the pipelines, go to your image’s repository settings → under Pipelines, SSH Keys → Generate a key and configure your app’s repo to allow pulls using that generated key. If your Genero code’s repo is under Bitbucket, Repository Settings > Under Security > Access keys > Add key > Paste the public key you generated.

  2. Edit the Dockerfile to compile your app in a first stage and then build the final image with your app in the final stage. Example here: Bitbucket .
  3. Repeat for each app you want to add to your custom image.

Summary

Thank you for following this guide to help you get ahead in deploying your Genero application on Docker containers. Now that you know the basics, continue with our team of experts to deploy your Genero application in an advanced environment with various additions that improve your application lifecycle and user experience.

Advanced topics include:
  • Deploying your container(s) on Kubernetes

  • Adding automated scaling

  • Adding efficient load-balancing techniques and replication across different data centers across the world

  • Enabling smart logging, monitoring, and alerting mechanisms

  • and more.

We are waiting to hear from you!