diff --git a/Dockerfile b/Dockerfile index a1b7ec5..6aee64f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,8 @@ RUN ["pip3", "install", "pipenv"] ENV PIPENV_VENV_IN_PROJECT 1 WORKDIR /usr/src/app # copy only pipfiles to install dependencies -COPY ./adaptation_layer/Pipfile . -COPY ./adaptation_layer/Pipfile.lock . -RUN ["pipenv", "install"] +COPY ./adaptation_layer/Pipfile* ./ +RUN ["pipenv", "install", "--system", "--ignore-pipfile", "--deploy"] COPY ./adaptation_layer . # setup env variables to initialize database ARG DB_SEED_NFVO @@ -15,13 +14,13 @@ ENV DB_SEED_NFVO $DB_SEED_NFVO ARG DB_SEED_NFVO_CRED ENV DB_SEED_NFVO_CRED $DB_SEED_NFVO_CRED RUN ["rm", "-f", "data/mso-lo.db"] -RUN ["pipenv", "run", "flask", "db", "upgrade"] -RUN ["pipenv", "run", "python", "manage.py", "seed"] - -FROM base as test -COPY ./openapi ./openapi +RUN ["flask", "db", "upgrade"] +RUN ["python", "manage.py", "seed"] FROM base as prod COPY ./uWSGI/app.ini . -CMD ["pipenv", "run", "uwsgi", "--ini", "app.ini"] +CMD ["uwsgi", "--ini", "app.ini"] + +FROM base as test +COPY ./openapi ./openapi diff --git a/README.md b/README.md index 6f3e654..6600b6c 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ edit [docker-compose.yaml](docker-compose.yml) and change the environment variab ```yaml SITEINV: 'true' SITEINV_HOST: '192.168.17.20' -SITEINV_PORT: '8087' +SITEINV_PORT: '8087' SITEINV_INTERVAL: '300' ``` @@ -140,13 +140,16 @@ celery -A tasks worker -B --loglevel=info --- -Please, always use `pipenv` to add dependencies: +Please, always use `pipenv` to add/remove dependencies: ```shell script pipenv install + +pipenv uninstall ``` -After that, please commit `Pipfile` and `Pipfile.lock`. +If everything works with the new dependencies, run `pipenv lock` and commit +both `Pipfile` and `Pipfile.lock`. ### Add a new NFVO driver diff --git a/adaptation_layer/Pipfile.lock b/adaptation_layer/Pipfile.lock index 51f4b79..fce5003 100644 --- a/adaptation_layer/Pipfile.lock +++ b/adaptation_layer/Pipfile.lock @@ -149,10 +149,10 @@ }, "mako": { "hashes": [ - "sha256:3139c5d64aa5d175dbafb95027057128b5fbd05a40c53999f3905ceb53366d9d", - "sha256:8e8b53c71c7e59f3de716b6832c4e401d903af574f6962edbbbf6ecc2a5fe6c9" + "sha256:8195c8c1400ceb53496064314c6736719c6f25e7479cd24c77be3d9361cddc27", + "sha256:93729a258e4ff0747c876bd9e20df1b9758028946e976324ccd2d68245c7b6a9" ], - "version": "==1.1.2" + "version": "==1.1.3" }, "markupsafe": { "hashes": [ diff --git a/docker-compose.test-nfvo.yml b/docker-compose.test-nfvo.yml index ee50b17..42b256c 100644 --- a/docker-compose.test-nfvo.yml +++ b/docker-compose.test-nfvo.yml @@ -11,5 +11,5 @@ services: environment: TESTING: "True" OPENAPI_PATH: ./openapi/MSO-LO-swagger-resolved.yaml - command: ["pipenv", "run", "pytest", "-v", "tests/test_nfvo.py"] + command: ["pytest", "-v", "tests/test_nfvo.py"] diff --git a/docker-compose.test-onap.yml b/docker-compose.test-onap.yml index 90a9040..c8f097b 100644 --- a/docker-compose.test-onap.yml +++ b/docker-compose.test-onap.yml @@ -27,7 +27,7 @@ services: TESTING: "True" PRISM_ALIAS: prism-onap OPENAPI_PATH: ./openapi/MSO-LO-swagger-resolved.yaml - command: ["./tests/wait-for-it.sh", "prism-onap:9999", "--", "pipenv", "run", "pytest", "-v", "tests/test_onap.py"] + command: ["./tests/wait-for-it.sh", "prism-onap:9999", "--", "pytest", "-v", "tests/test_onap.py"] networks: mso-lo-net: aliases: diff --git a/docker-compose.test-osm.yml b/docker-compose.test-osm.yml index 5cd4d6c..e317409 100644 --- a/docker-compose.test-osm.yml +++ b/docker-compose.test-osm.yml @@ -27,7 +27,7 @@ services: TESTING: "True" PRISM_ALIAS: prism-osm OPENAPI_PATH: ./openapi/MSO-LO-swagger-resolved.yaml - command: ["./tests/wait-for-it.sh", "prism-osm:9999", "--", "pipenv", "run", "pytest", "-v", "tests/test_osm.py"] + command: ["./tests/wait-for-it.sh", "prism-osm:9999", "--", "pytest", "-v", "tests/test_osm.py"] networks: mso-lo-net: aliases: