From c9d540e0d10f98f246861c062d0469544210adcc Mon Sep 17 00:00:00 2001 From: Keerthana-Bidarakoppa <61800669+Keerthana-Bidarakoppa@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:33:08 -0700 Subject: [PATCH] Bugfix/mendscan (#57) * Add and modify files * Changes to Dockerfile and requirements * Edit workflow file * Edit Dockerfile * Edit Docker --- .github/workflows/TCGstorageAPI-build.yml | 10 ++----- docker/UBUNTU/18.04/Dockerfile => Dockerfile | 28 +++++++++++++----- docker/CENTOS/7/Dockerfile | 31 -------------------- requirements.txt | 4 +-- setup.py | 2 +- 5 files changed, 26 insertions(+), 49 deletions(-) rename docker/UBUNTU/18.04/Dockerfile => Dockerfile (53%) delete mode 100644 docker/CENTOS/7/Dockerfile diff --git a/.github/workflows/TCGstorageAPI-build.yml b/.github/workflows/TCGstorageAPI-build.yml index b05d0af..1b8f545 100644 --- a/.github/workflows/TCGstorageAPI-build.yml +++ b/.github/workflows/TCGstorageAPI-build.yml @@ -2,8 +2,6 @@ name: TCGstorageAPI build on: push: - branches: - - master pull_request: branches: - master @@ -12,7 +10,7 @@ jobs: build: name: TCGstorageAPI_build # This job runs on Linux - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -30,14 +28,12 @@ jobs: run: | sudo apt-get install python3-setuptools pip3 install --no-cache-dir -r requirements.txt - - name: Link gmake to make - run: sudo ln -s /usr/bin/make /usr/bin/gmake - name: Build opensea run: python3 setup.py opensea - name: Build TCGstorageAPI package run: python3 setup.py build - name: Run unit tests run: | - sudo cp -R build/lib.linux-x86_64-3.6/TCGstorageAPI /home/runner/work/TCGstorageAPI/TCGstorageAPI - export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.6/site-packages/ + sudo cp -R build/lib.linux-x86_64-3.10/TCGstorageAPI /home/runner/work/TCGstorageAPI/TCGstorageAPI + export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.10/dist-packages/ python3 TCGstorageAPI/tcgapi_test.py diff --git a/docker/UBUNTU/18.04/Dockerfile b/Dockerfile similarity index 53% rename from docker/UBUNTU/18.04/Dockerfile rename to Dockerfile index b26d665..ce57f9e 100644 --- a/docker/UBUNTU/18.04/Dockerfile +++ b/Dockerfile @@ -16,15 +16,27 @@ # limitations under the License. # #**************************************************************************** -FROM python:3.6 -COPY requirements.txt ./ +FROM ubuntu:22.04 AS tcgstorageapi + +RUN apt-get update && apt-get install -y --reinstall ca-certificates + +RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata + +WORKDIR /tcgstorageapi + +COPY TCGstorageAPI /tcgstorageapi/TCGstorageAPI +COPY setup.py /tcgstorageapi/setup.py +COPY opensea-common /tcgstorageapi/opensea-common +COPY opensea-operations /tcgstorageapi/opensea-operations +COPY opensea-transport /tcgstorageapi/opensea-transport +COPY pysed /tcgstorageapi/pysed +COPY sed_cli /tcgstorageapi/sed_cli +COPY requirements.txt /tcgstorageapi/requirements.txt + +RUN apt update -y && apt-get install -y python3-pip RUN pip3 install --no-cache-dir -r requirements.txt -RUN apt-get update \ - && apt-get install -y --no-install-recommends python3-all python3-all-dev libgnutls28-dev libboost-all-dev \ +RUN apt-get install -y --no-install-recommends python3-all python3-all-dev libgnutls28-dev libboost-all-dev \ && rm -rf /var/lib/apt/lists/* -WORKDIR /usr/src/TCGStorageAPI -COPY . . -RUN ln -s /usr/bin/make /usr/bin/gmake RUN python3 setup.py opensea RUN python3 setup.py build -RUN cp -r build/lib.linux-x86_64-3.6/TCGstorageAPI /usr/local/lib/python3.6/site-packages/. +RUN cp -r build/lib.linux-x86_64-3.10/TCGstorageAPI /usr/local/lib/python3.10/dist-packages/. diff --git a/docker/CENTOS/7/Dockerfile b/docker/CENTOS/7/Dockerfile deleted file mode 100644 index 00d9ef2..0000000 --- a/docker/CENTOS/7/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -#---------------------------------------------------------------------------- -# Do NOT modify or remove this copyright -# -# Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -#**************************************************************************** -FROM centos:7 -USER root -COPY requirements.txt ./ -RUN yum -y update && \ -yum -y install epel-release && \ -yum -y install python3 boost-python36.x86_64 boost-python36-devel.x86_64 gcc gcc-c++ gnutls-devel rpm-build python3-devel && \ -yum clean all -RUN pip3 install --no-cache-dir -r requirements.txt -WORKDIR /usr/src/TCGStorageAPI -COPY . . -RUN python3 setup.py opensea -RUN python3 setup.py bdist_rpm -RUN yum install -y dist/TCGstorageAPI-*.x86_64.rpm diff --git a/requirements.txt b/requirements.txt index 1a59c94..3d87600 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ boost -cryptography==3.3.2 +cryptography==42.0.8 passlib==1.7.4 pycparser==2.20 -pyopenssl==20.0.1 \ No newline at end of file +pyopenssl==24.2.1 diff --git a/setup.py b/setup.py index f3725a7..b865214 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ def run(self): 'pysed/support.cpp', 'pysed/Tls.cpp', ], - libraries=['boost_python3', 'gnutls', 'gnutlsxx' ], + libraries=['boost_python310', 'gnutls', 'gnutlsxx' ], include_dirs = ['pysed','opensea-transport/include','opensea-common/include','opensea-operations/include','opensea-transport/include/vendor','/usr/local/include'], extra_objects=['opensea-transport/Make/gcc/lib/libopensea-transport.a','opensea-common/Make/gcc/lib/libopensea-common.a','opensea-operations/Make/gcc/lib/libopensea-operations.a'], extra_compile_args=['-O0','-g','-DDISABLE_NVME_PASSTHROUGH']