Building and deploying development images

Your local environment is ready for building and deploying Maximo® Manage into a Podman container after you complete pulling and tagging base images.

About this task

You can use a docker build file to build new development images.

The development flow and process can be described in the following way:
  1. Make changes and add customizations, and so on, to Java class files.
  2. Copy the class files by following the appropriate folder structure.
  3. Build the new WLP development image by using the Docker build file. Download the build file.
  4. Deploy the new development image into a new Podman container, which initiates the MXServer.
  5. Access the Manage application by using the browser.

Procedure

  1. Update the Docker build file that you downloaded.
    Edit the following environment variables to reflect your database details.
    ENV MXE_DB_URL='jdbc:db2://9.30.213.13:50000/bludb'
    ENV MXE_DB_SCHEMAOWNER=maximo
    ENV MXE_DB_DRIVER='com.ibm.db2.jcc.DB2Driver'
    ENV MXE_SECURITY_OLD_CRYPTO_KEY=SzUwFenwARerIQCMotXkisoU
    ENV MXE_SECURITY_CRYPTO_KEY=SzUwFenwARerIQCMotXkisoU
    ENV MXE_SECURITY_OLD_CRYPTOX_KEY=SzUwFenwARerIQCMotXkisoU
    ENV MXE_SECURITY_CRYPTOX_KEY=SzUwFenwARerIQCMotXkisoU
    ENV MXE_DB_USER=maximo
    ENV MXE_DB_PASSWORD=maximo
    
    To access the Maximo Manage local development environment outside the local host, add following commands before setting up environment variables in docker build file:
    WORKDIR /opt/ibm/wlp/usr/servers/defaultServer
    RUN mv server.xml server-BAK.xml
    RUN mv server-dev.xml server.xml
    WORKDIR /<maximo_home_dir>/deployment/was-liberty-default/config-deployment-descriptors/maximo-all/maximouiweb/webmodule/WEB-INF
    RUN mv web-dev.xml web.xml
  2. Execute the following command to run the docker file relative to the ./manage-developer/Dockerfile path.
    podman build --build-arg BUNDLE=all --tag managedev:latest -f ./manage-developer/Dockerfile
    Note: The server bundle type can be passed as a build arg. In this example, you are building the "all" wlp image. Depending on the bundle image type that was downloaded from the Red Hat® OpenShift® registry, the appropriate bundle image type arg must be passed. Valid bundle types are all, ui, cron, report and mea. Tag the new development image, for example, --tag managedev:latest.
  3. When the build is complete, use the following command to see all the images inside the local image registry.
    podman images
    You can see at least three images, manage-all-dev, manage-admin-dev, and managedev.
  4. After building the development image, deploy and run the image inside a Podman container. Run the following command to create a container and start a new process for the image.
    podman run -dt --name maximo_dev -p 9080:90/tcp localhost/managedev:latest
    The -p option publishes the host and container TCP ports. The URL for the Manage application, in this example is http://localhost:9080/maximo. The --name flag assigns a name for the container. If this flag is not set, an arbitrary name is assigned.
  5. To check if the maximo_dev process is running, run the following command.
    podman ps -a
    You can see a container process named maximo_dev listed for the managedev image.
  6. Start the maximo_dev container.

    The development image is a Websphere Liberty Profile (WLP) image and deploys the Manage application into Liberty and starts MXServer. The following command starts the container in an interactive mode by passing the -i option. It is necessary to run the container in interactive mode so that MXserver can be up and running until the user stops it.

    podman start -a -i maximo_dev
    At this point, you can see MXServer starting and all the services, like BulletinBoard, Workorder, Scheduler, and others. When the server is up, you are able to access Manage from the browser.
    Note: While testing, it was noticed that during server startup, sometimes the Podman container displays an out-of-memory exception. The reason for this is not yet known. However, recreating the machine typically resolves the issue. Also, adjusting the CPU and memory allocation during machine initialization might help in resolving the issue. The following commands are helpful:
    podman machine stop
    podman machine rm
    podman machine init --cpus 2 --memory 2048 --disk-size 20
    podman machine start
    You can refer to a discussion thread to resolve the out-of-memory issue. For more information, see How can I increase the number of CPUs?
    Tip: Useful Podman commands:
    podman machine start (or stop)
    podman machine ls (status)
    podman images
    podman machine rm (removes the VM. Will lose local registry and everything else)
    podman machine init (initializes and creates a new VM – start fresh)
    podman ps -a