Skip to content
Snippets Groups Projects
Commit bec81fc1 authored by Jaroslav Brazda's avatar Jaroslav Brazda
Browse files

Update Docker Install Guide

parent 76245cd7
No related branches found
No related tags found
No related merge requests found
FROM ubuntu:16.04
# Read the README.md for more details on the image configuration
FROM ubuntu:18.04
# Read the README.md for more details on the image configuration.
# You can use different baseline image or linux distribution
# but you will likely need to change supporting tools installation and environment settings
MAINTAINER Jaroslav Brazda <jaroslav.brazda@gmail.com>
#you can override the target installation directory
ARG INSTALL_DIR=/informatica/agent
# Defines whre to download agent from (this might be different for your org)
ARG AGENT_URL=https://app2.informaticacloud.com/saas/download/linux64/installer/agent64_install.bin
# Defines where to download agent from (this might be different for your org)
# This URL will have following pattern for latest IICS Orgs
# ARG AGENT_URL=https://<pod>.<region>.informaticacloud.com/saas/download/linux64/installer/agent64_install_ng_ext.bin
# Default is location for na1.dm-us.informaticacloud.com/
ARG AGENT_URL=https://na1.dm-us.informaticacloud.com/saas/download/linux64/installer/agent64_install_ng_ext.bin
# install system tools
RUN apt-get update && \
apt-get -y install curl \
less \
locales \
locales-all \
sudo \
unzip
# Set the locale
RUN apt-get update && apt-get install -y \
curl \
less \
locales \
locales-all \
sudo \
unzip
# Set the locale, Locale defaults are necessary for agent to operate correctly
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# we need to run docker image under a different user than root because the Secure agent process engine can't be run under root account
# We need to run docker image under a different user than root
# Secure agent process engine can't be run under root account
RUN useradd --create-home -ms /bin/bash -U agent
USER agent
#download and prepare Installer
# 1. Download and prepare Installer
# 2. Set file permissions
# 3. Install using silent install and the default location
# 4. Cleanup
RUN curl -o /tmp/agent64_install.bin $AGENT_URL && \
chmod +x /tmp/agent64_install.bin
#install
RUN ( /tmp/agent64_install.bin -i silent || true )
#cleanup
RUN rm -rf /tmp/agent64_install.bin
chmod +x /tmp/agent64_install.bin && \
/tmp/agent64_install.bin -i silent && \
rm -rf /tmp/agent64_install.bin
WORKDIR /home/agent/infaagent/apps/agentcore
## Define Volumes for Shared Data Staging area
VOLUME [ "/data" ]
## Ports used by the agent that might be used for external Connections
# 7080 Process Engine Shutdown Port
# 7443 Process Engine https port
# 5432 Process Engine Postgres DB
EXPOSE 7080 7443 5432
COPY run_agent.sh .
CMD [ "./agent_start.sh" ]
\ No newline at end of file
CMD [ "./run_agent.sh" ]
\ No newline at end of file
# Run Informatica Agent in Docker Container
<!-- MarkdownTOC -->
- [Description](#description)
- [1. Prepare Org for Agent installation](#1-prepare-org-for-agent-installation)
- [1.1 Create User](#11-create-user)
- [2. Build a Docker Image](#2-build-a-docker-image)
- [3. Create and run a Container using your Docker Image](#3-create-and-run-a-container-using-your-docker-image)
- [. Connect and Initialize Agent](#-connect-and-initialize-agent)
<!-- /MarkdownTOC -->
## Description
This package contains example docker file and supporting scripts to run Informatica CLoud Secure Agent on a Docker Container
## Use
This package contains example docker file and supporting scripts to run Informatica CLoud Secure Agent on a Docker Container.
Note that this is not an official or supported method how to run Informatica Secure Agent. It is useful though to leearning how to setup secure agent, create agent clusters or test integrations
Full containerization of Secure agent is non trivial as it requires custom configuration of agent if deem to use this method as your runtime
## 1. Prepare Org for Agent installation
### 1.1 Create User
1. Create IICS Native user account which will be used to connect secure agent and assign user to Admin Group
Follow naming convention that includes company domain and environment such as `sa_login@acme.com.dev`
2. Login to informatica Cloud to activate the user and retrive the Secure Agent Token on the Administration/Runtime Environments page
![Secure Token](../images/IC_SA_Token.png)
## 2. Build a Docker Image
1. Make sure you have docker installed, go to (https://docs.docker.com/engine/installation/)
2. Clone this repository
2. Make sure you have a git client installed
3. Clone repository with contents of this project
```shell
git clone git@github.com:jbrazda/ic-sagent-docker.git
```
3. Update the `Dockerfile` if necessary (Location of the SA agent installer might be different for your Informatica CLoud org) You can override the default location by specifying `--build-arg <name>=<value>` in next step
4. Run
4. Update the [Dockerfile](Dockerfile) if necessary (Location of the SA agent installer might be different for your Informatica CLoud org) You can override the default location by specifying `--build-arg <name>=<value>` in next step
5. Run command to build a docker Image
```shell
docker build -t ic-secure-agent:1.0 .
```
To override the download file location use following
The Agent installation location will be dependend on specific Informatica Pod where your org is provisioned
To override the download file location use AGENT_URL argument. typical format for download url is
`https://<pod>.<region>.informaticacloud.com/saas/download/linux64/installer/agent64_install_ng_ext.bin`
```shell
docker build --build-arg AGENT_URL=https://app3.informaticacloud.com/saas/download/linux64/installer/agent64_install.bin -t ic-secure-agent:1.0 .
```
5. execute following command `run -d -h <hostname> --name <agent_name> <image_name:image_tag>`
```shell
docker run -d -h agent1 --name ic-agent1 ic-secure-agent:1.0
```
6. We need to configure the agent to connect it to your Informatica Cloud Org When you running agent for the first time, run following command in the host machine to connect to running agent
```shell
docker exec -it ic-agent1 bash
```
7. Then run following command to configure agent
```shell
./consoleAgentManager.sh configure '<username>' '<password>'
```
8. You can monitor agent running by calling
```shell
docker exec -it ic-agent1 less agentCore.log
docker build --build-arg AGENT_URL=https://na1.dm-us.informaticacloud.com/saas/download/linux64/installer/agent64_install_ng_ext.bin -t ic-secure-agent:1.0 .
```
## 3. Create and run a Container using your Docker Image
Execute following command `run -d -h <hostname> --name <agent_name> <image_name:image_tag>`
```shell
docker run -d -h agent1 --name ic-agent1 ic-secure-agent:1.0
```
If you want to make certain ports available on your host like ability to call Secure agent processes or access oProcess engine Database from your host machine map the available exposed ports using th -p option of the docker run command
Stop the container using a `docker stop <container_name` i.e. docker stop
### . Connect and Initialize Agent
We need to configure the agent to connect it to your Informatica Cloud Org When you running agent for the first time, run following command in the host machine to connect to running agent
```shell
docker exec -it ic-agent1 bash
```
Then run following command to configure agent Prefer using the new method of using username/token instead of password
Using Token
```shell
./consoleAgentManager.sh configureToken '<username>' '<token>'
```
Using Password
```shell
./consoleAgentManager.sh configure '<username>' '<password>'
```
You can monitor agent logs running by
```shell
docker exec -it ic-agent1 less agentCore.log
```
images/IC_SA_Token.png

76.1 KiB

#!/usr/bin/env bash
## this wrapper takes care of running the agent and shutdown gracefully Under Docker
#set -x
# colors
red='\e[0;31m'
green='\e[0;32m'
yellow='\e[0;33m'
reset='\e[0m'
WORK_DIR=.
PID_FILE=$WORK_DIR/infaagentprocessid
#Colorized echo
echoRed() { echo -e "${red}$1${reset}"; }
echoGreen() { echo -e "${green}$1${reset}"; }
echoYellow() { echo -e "${yellow}$1${reset}"; }
# SIGUSR1-handler
my_handler() {
echo "Stopped Wait Loop"
}
prep_term()
{
unset term_child_pid
trap 'handle_term' TERM INT
# kill the last background process, which is `tail -f /dev/null` and execute the specified handler
trap 'kill ${!}; my_handler' SIGUSR1
echo 'Termination Handler Ready'
}
handle_term() {
echo "TERM Signal Received. Shutting Down PID $term_child_pid..."
if [ -z "$(pgrep -F $PID_FILE)" ]; then
echoRed "Process $term_child_pid not running";
exit 143;
else
echoGreen "PID $term_child_pid found, shuting down..."
./infaagent shutdown
echo "Secure Agent Stopped"
exit 143; # 128 + 15 -- SIGTERM
fi
}
# set shutdown hooks
prep_term
# run application
./infaagent startup
# get agent process id
term_child_pid=$(cat $PID_FILE)
echoGreen "Secure Agent Starting pid:$term_child_pid"
# wait until terminated
while true
do
tail -f /dev/null & wait ${!}
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment