This article provides insight into constructing the ACCELQ Docker image inclusive of all essential jar dependencies.
The setup process involves generating all the essential dependencies on the local machine (host machine) and subsequently transferring these cached dependencies to the Docker container. This approach significantly cuts down the startup duration of the agent when employing the "docker run" command, an aspect comprehensively discussed in the linked article below:
Read more about Using Dockerized Agents for ACCELQ Test Execution
Benefits of the Setup
- Pre-packaged Dependencies: Bundling all required dependencies in the Docker image ensures the agent is ready to start instantly.
- Customizable Configuration: Providing the flexibility to copy specific files or libraries from the host machine into the image, minimizing setup and configuration time.
Steps to Build and Run the Dockerized Agent
-
Install the local agent
Install a local agent on the host machine by following the below article:
Installing Local Agent (using Install wizard)
Note:
- Take note of the agent installation folder as it will be required in subsequent steps.
- Ensure the agent starts successfully. Once the agent is fully started, stop the agent and Wait for 30-60 seconds to allow the agent to deregister completely before proceeding.
-
Pull the ACCELQ agent docker Image
docker pull accelq/accelq-acc-agent
-
Create a Dockerfile
Create a Dockerfile to customize the base image by adding the required dependencies and files to the below agent location:
~/ACCELQAgent/AgentInstances/agent/dockerfile
Below is an example:
File: dockerfile# Use the ACCELQ base image
FROM accelq/accelq-acc-agent
# Copy libraries into the container
COPY ./libs /Agent/ACCELQAgent/AgentInstances/agent/libs
# Copy test data to the user_data folder in the image
COPY ./user_data /Agent/ACCELQAgent/AgentInstances/agent/user_data
# Add additional lines if required to copy other necessary files -
Build the Docker Image
Use the following command to build the Docker image with your desired custom name. For example, you can name the image
accelq/accelq-acc-agent-custom
:docker build -t accelq/accelq-acc-agent-custom .
This command:- Builds the Docker image using the
Dockerfile
in the current directory. - Tags the image with the name
accelq/accelq-acc-agent-custom
.
- Builds the Docker image using the
-
Run the Docker Container
Once the image is built, you can start a container using your custom image.
Follow the instructions from the below article about generating the docker run command:
Using Dockerized Agents for ACCELQ Test Execution
For Example: Start Agent from the custom docker image [For a Dedicated User]docker run -d -e agent_name=<agent_name> -e num_concurrent_jobs=1 -e num_parallel_tc_per_job=3 -e accelq_server_url=<url> -e user_id=<user_Id> -e api_key=<apikey> -e project_code=<projcode> -e tenant_code=<tenant_code> -e sharing_type=0 -e agent_type=user accelq/accelq-acc-agent-custom
To enable access to the agent dashboard UI from your host machine’s browser, include the-p 47047:47047
argument in thedocker run
command. This maps the container's port47047
to the host's port47047
. Once the container is running, you can access the agent dashboard UI viahttp://localhost:47047
.
Important: Replace the image name in thedocker run
command from the article with your custom image name (accelq/accelq-acc-agent-custom
).
Comments
0 comments
Please sign in to leave a comment.