Skip to content

Commit

Permalink
Merge pull request #4 from ayushishu/main
Browse files Browse the repository at this point in the history
Enhance Documentation with README.md for Builder and Robot Docker Images
  • Loading branch information
askb committed Sep 6, 2023
2 parents 686209b + 2de6dd5 commit 5d42f13
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 2 deletions.
42 changes: 42 additions & 0 deletions Builder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# OpenDaylight Builder Docker Image

The provided Dockerfile is intended for building OpenDaylight projects. It sets up an environment with the necessary dependencies, including Java and Maven, to build OpenDaylight projects from source code. You can use this Docker image to build the OpenDaylight projects

## Building the Docker Image

You can build the Docker image for the desired base system (Ubuntu or CentOS) using the following commands:

### Ubuntu Base Builder Image

```
$ docker build -t builder_image_name ./Ubuntu/
```
### CentOS Base Builder Image
```
$ docker build -t builder_image_name .\Centos\
```
Replace Builder_Image_Name with your preferred image name.

### Using the Builder Image for MVN Builds
Once you've built the Builder image, follow these steps to perform MVN builds within a Docker container:

1) Launch a Docker container:
```
$ docker run --name my-builder-container builder_image_name bash -c "tail -f /dev/null"
```
2) Access the Docker container:
```
$ docker exec -it my-builder-container bash
```
3) Inside the Docker container, clone the OpenDaylight repository you want to build:
```
$ git clone https://git.opendaylight.org/gerrit/integration/distribution
$ cd distribution
```
4) Run the Maven (MVN) build:
```
mvn clean install
```
This will initiate the build process for the OpenDaylight project. Make sure you replace the example Git URL (https://git.opendaylight.org/gerrit/integration/distribution) with the URL of the specific OpenDaylight repository you intend to build.
By following these steps, you can use the provided Docker image to build OpenDaylight projects with a consistent development environment.
65 changes: 65 additions & 0 deletions Robot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Robot Framework Docker Container

This Dockerfile facilitates the creation of a Docker image that comprises a comprehensive Robot Framework environment built on CentOS 8. The image is equipped with Python 3.10.2, Java 17, and all the necessary dependencies essential for executing Robot Framework tests efficiently.

## Prerequisites

Before you proceed with building and running this Docker image, ensure that you have Docker properly installed on your system.

## How to Use

To seamlessly build the Docker image and execute Robot Framework tests within a container, adhere to the following steps:

Step 1: Clone the Repository

Begin by cloning this repository to your local machine:

```
git clone https://github.com/askb/releng-docker
cd robot-framework-docker
```
Step 2: Build the Docker Image
Execute the following command to build the Docker image:

```
docker build -t robot-framework:latest .
```

Step 3: Run a Docker Container
Once the image has been successfully constructed, launch a Docker container from it. You have the flexibility to replace 'my-robot-container' with a name of your choice:
```
docker run -it --network=host --name my-robot-container robot-framework:latest bash -c "tail -f /dev/null"
```
Ensure that opendaylight and Robot containers are on the same Docker network.

You can now access the container using
`$ docker exec -it my-robot-container bash `

Step 4: Run the OpenDaylight container on the same network.
```
docker run -d --name opendaylight --network=host opendaylight-image --env FEATURES=odl-restconf,odl-netconf-topology
```
Step 5: Clone the integration-test repository
```
docker exec robot-container bash -c 'git clone https://github.com/opendaylight/integration-test.git"
```
Step 6: Run single integration test
```
docker exec robot-container bash -c '
robot -L debug --variable KARAF_HOME:/home/user/workspace/netconf/karaf/target/assembly/bin --variable USER_HOME:/home/jenkins --variable DEFAULT_LINUX_PROMPT:\$ --variable ODL_SYSTEM_IP:127.0.0.1 --variable ODL_SYSTEM_1_IP:127.0.0.1 --variable RESTCONFPORT:8181 --variable IS_KARAF_APPL:True ./test.robot'
```
For Example
```
docker exec robot bash -c 'git clone https://github.com/opendaylight/integration-test.git &&
cd integration-test/csit/suites/daexim &&
robot -L debug --variable USER_HOME:/root \
--variable WORKSPACE:/home/youruser \
-v BUNDLEFOLDER:karaf-0.18.1 \
-v ODL_STREAM:argon \
--variable DEFAULT_LINUX_PROMPT:\$ \
--variable ODL_SYSTEM_USER:youruser \
--variable ODL_SYSTEM_IP:localhost \
--variable ODL_SYSTEM_1_IP:localhost \
-v IS_KARAF_APPL:True \
./010-special-export.robot 020-import-basic.robot 030-export-basic.robot 040-export-inclusions.robot '
```
12 changes: 10 additions & 2 deletions Robot/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ RUN cd /etc/yum.repos.d/ \
&& sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

# Install OpenSSH
RUN yum install -y openssh

# Generate SSH key pair
RUN ssh-keygen -t rsa -b 4096 -N '' -f /root/.ssh/id_rsa

# Update the system and install essential dependencies
RUN yum update -y \
&& yum install -y epel-release \
Expand Down Expand Up @@ -36,8 +42,10 @@ RUN pip install \
robotframework-extendedrequestslibrary==0.5.5 \
robotframework-httplibrary==0.4.2 \
robotframework-requests==0.9.3 \
robotframework-sshlibrary==3.8.0
robotframework-sshlibrary==3.8.0 \
robotframework-sshlibrary


# Install Java 17
RUN yum install -y java-17-openjdk java-17-openjdk-devel
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk

0 comments on commit 5d42f13

Please sign in to comment.