Commit 56071290 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'develop' of ssh://gifrerenom_labs.etsi.org/tfs/controller into...

Merge branch 'develop' of ssh://gifrerenom_labs.etsi.org/tfs/controller into feat/306-cttc-enhanced-restconf-based-openconfig-nbi-for-dscm-pluggables
parents 4f5ad661 0bab2254
Loading
Loading
Loading
Loading
+29 −5
Original line number Diff line number Diff line
@@ -16,9 +16,24 @@ FROM python:3.9-slim

# Install dependencies
RUN apt-get --yes --quiet --quiet update && \
    apt-get --yes --quiet --quiet install wget g++ git && \
    apt-get --yes --quiet --quiet install wget g++ git build-essential cmake libpcre2-dev python3-dev python3-cffi && \
    rm -rf /var/lib/apt/lists/*

# Download, build and install libyang. Note that APT package is outdated
# - Ref: https://github.com/CESNET/libyang
# - Ref: https://github.com/CESNET/libyang-python/
RUN mkdir -p /var/libyang
RUN git clone https://github.com/CESNET/libyang.git /var/libyang
WORKDIR /var/libyang
RUN git fetch
RUN git checkout v2.1.148
RUN mkdir -p /var/libyang/build
WORKDIR /var/libyang/build
RUN cmake -D CMAKE_BUILD_TYPE:String="Release" ..
RUN make
RUN make install
RUN ldconfig

# Set Python to show logs as they occur
ENV PYTHONUNBUFFERED=0

@@ -56,13 +71,22 @@ RUN find . -type f -exec sed -i -E 's/^(import\ .*)_pb2/from . \1_pb2/g' {} \;
# Create component sub-folders, get specific Python packages
RUN mkdir -p /var/teraflow/pluggables
WORKDIR /var/teraflow/pluggables
COPY src/pluggables/requirements.in requirements.in
RUN pip-compile --quiet --output-file=requirements.txt requirements.in
COPY src/device/requirements.in requirements_device.in
COPY src/pluggables/requirements.in requirements_pluggables.in
RUN pip-compile --quiet --output-file=requirements.txt requirements_device.in requirements_pluggables.in
RUN python3 -m pip install -r requirements.txt

# Add component files into working directory
WORKDIR /var/teraflow
COPY src/context/__init__.py context/__init__.py
COPY src/context/client/. context/client/
COPY src/device/__init__.py device/__init__.py
COPY src/device/Config.py device/Config.py
COPY src/device/client/. device/client/
COPY src/device/service/. device/service/
COPY src/monitoring/__init__.py monitoring/__init__.py
COPY src/monitoring/client/. monitoring/client/
COPY src/pluggables/. pluggables/

# # Start the service
# Start the service
ENTRYPOINT ["python", "-m", "pluggables.service"]