From fc1968714a9ea4b2947dfeb7d6cadce073a3dce6 Mon Sep 17 00:00:00 2001 From: Surbhi Kanthed Date: Fri, 21 Jun 2024 13:23:54 -0400 Subject: [PATCH] Ensured all necessary dependencies, including mysql-connector and pymysql, are listed in requirements.txt. --- Containerfile | 21 +++++++++++++-------- requirements.txt | 2 ++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Containerfile b/Containerfile index 66e83c72..3b902bae 100644 --- a/Containerfile +++ b/Containerfile @@ -1,24 +1,29 @@ # This file contains the configuration for containerized esi-leap # Use python as the parent image for esi-leap -FROM python:3.11 +FROM docker.io/python:3.11 LABEL description="ESI-LEAP -- ESI lease policy manager" +# Indicate that service listens on this port +EXPOSE 7777 + # The working directory for esi-leap inside the container WORKDIR /esi-leap -# Copy the files of esi leap inside the container -COPY run_services.sh run_services.sh +# Copy the requirements file and install dependencies +COPY requirements.txt requirements.txt +RUN pip install -r requirements.txt +# Create necessary directories and files RUN mkdir -p /var/log/esi-leap RUN touch /var/log/esi-leap/esi-leap-dbsync.log -# Run command to install dependencies for esi-leap -RUN apt update -y && apt install -y python3-pymysql -RUN pip3 install esi-leap mysql-connector pymysql +# Copy the remaining files of esi leap inside the container +COPY run_services.sh run_services.sh + +# Command to run the services +CMD ["bash", "./run_services.sh"] -# Indicate that service listens on this port -EXPOSE 7777 CMD ["bash", "./run_services.sh"] diff --git a/requirements.txt b/requirements.txt index 5fc1bb64..638d962f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,6 +11,7 @@ iso8601>=0.1.11 # MIT keystoneauth1>=3.4.0 # Apache-2.0 keystonemiddleware>=4.17.0 # Apache-2.0 kombu!=4.0.2,>=4.0.0 # BSD +mysql-connector-python>=8.0.0 # GPL-2.0 openstacksdk<1.3.0 oslo.concurrency>=3.26.0 # Apache-2.0 oslo.config>=5.2.0 # Apache-2.0 @@ -30,6 +31,7 @@ netaddr>=0.7.18 # BSD python-ironicclient>=2.3.0 # Apache-2.0 python-keystoneclient>=3.8.0 # Apache-2.0 pecan!=1.0.2,!=1.0.3,!=1.0.4,!=1.2,>=1.0.0 # BSD +PyMySQL>=0.7.6 # MIT License sqlalchemy-migrate>=0.11.0 # Apache-2.0 requests>=2.18.4 # Apache-2.0 Routes>=2.3.1 # MIT