From df9877a76ce131f9ed1cc1f187847bc5ef5cf814 Mon Sep 17 00:00:00 2001 From: Michal Jagiello Date: Fri, 17 Jul 2020 13:06:11 +0000 Subject: Run in Python 3.8 Use image recommended by SECCOM Issue-ID: DCAEGEN2-2292 Signed-off-by: Michal Jagiello Change-Id: I52a358f22c5f9c2e1cad4b574105c8bda10acf25 --- Changelog.md | 5 +++++ Dockerfile | 25 ++++++++++++++----------- pom.xml | 2 +- setup.py | 2 +- tox.ini | 4 ++-- version.properties | 2 +- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Changelog.md b/Changelog.md index 12c2a71..f42bbc6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.5.3] - 7/22/2020 +* Run in Python 3.8 +* Add py38 for unit testing +* Run as "onap" user + ## [2.5.2] - 8/16/2019 * Switch to py37 for unit testing and docker now that LF supports it under the python jjb diff --git a/Dockerfile b/Dockerfile index df26a59..db32b24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,23 @@ -FROM python:3.7-alpine +FROM python:3.8.2-alpine3.11 MAINTAINER tommy@research.att.com -COPY . /tmp -WORKDIR /tmp - EXPOSE 10000 # it is an ONAP requirement to make, and switch to, a non root user -ENV CBSUSER cbs -RUN addgroup -S $CBSUSER && adduser -S -G $CBSUSER $CBSUSER +ARG user=onap +ARG group=onap +RUN addgroup -S $group && adduser -S -D -h /home/$user $user $group && \ + chown -R $user:$group /home/$user && \ + mkdir /var/log/$user && \ + chown -R $user:$group /var/log/$user && \ + mkdir /app && \ + chown -R $user:$group /app +WORKDIR /app + +COPY . /app -# create logs dir and install # alpine does not come with GCC like the standard "python" docker base does, which the install needs, see https://wiki.alpinelinux.org/wiki/GCC -RUN apk add build-base && \ - mkdir -p /opt/logs/ && \ - chown $CBSUSER:$CBSUSER /opt/logs && \ +RUN apk add build-base libffi-dev && \ pip install --upgrade pip && \ pip install . @@ -22,5 +25,5 @@ RUN apk add build-base && \ ENV PROD_LOGGING 1 # Run the application -USER $CBSUSER +USER $user CMD run.py diff --git a/pom.xml b/pom.xml index bf516f5..10722c4 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. org.onap.dcaegen2.platform configbinding dcaegen2-platform-configbinding - 2.5.2-SNAPSHOT + 2.5.3-SNAPSHOT http://maven.apache.org UTF-8 diff --git a/setup.py b/setup.py index 8ee9816..191a14f 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ from setuptools import setup, find_packages setup( name="config_binding_service", - version="2.5.2", + version="2.5.3", packages=find_packages(exclude=["tests.*", "tests"]), author="Tommy Carpenter", author_email="tommy@research.att.com", diff --git a/tox.ini b/tox.ini index 614642b..6758393 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ # ECOMP is a trademark and service mark of AT&T Intellectual Property. [tox] -envlist = py37,flake8 +envlist = py37,py38 [testenv] deps= @@ -33,7 +33,7 @@ commands= coverage xml -i [testenv:flake8] -basepython = python3.7 +basepython = python3.8 skip_install = true deps = flake8 commands = flake8 setup.py config_binding_service tests diff --git a/version.properties b/version.properties index d193a56..f15ca21 100644 --- a/version.properties +++ b/version.properties @@ -1,6 +1,6 @@ major=2 minor=5 -patch=2 +patch=3 base_version=${major}.${minor}.${patch} release_version=${base_version} snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg