From b701c95b97662ca474f75d587134a1285ff757d5 Mon Sep 17 00:00:00 2001 From: Josmar Regalado Date: Tue, 13 Dec 2022 07:45:13 +0000 Subject: [PATCH 01/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7aa4922..fad704a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,10 @@ stages: - deploy variables: + DOCKER_HOST: tcp://docker:2376 + DOCKER_TLS_CERTDIR: "/certs" + DOCKER_TLS_VERIFY: 1 + DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client" IMAGE_RELEASE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID IMAGE_TEST_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID-test CACHE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-cache @@ -32,7 +36,7 @@ workflow: ## Common CI/CD targets used with extends keyword .build_image_base: stage: build - image: docker:20.10.6 + image: docker:20.10.16 services: - docker:20.10.6-dind variables: @@ -44,7 +48,7 @@ workflow: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com script: # defaults: --build-arg REQUIREMENTS=requirements_prod.txt - - 'eval docker pull $CACHE_TAG || true' + #- 'eval docker pull $CACHE_TAG || true' - 'eval docker build --build-arg APP_IMG_VER=$APP_IMG_VER $BUILD_EXTRA_ARGS --cache-from $CACHE_TAG --tag $IMAGE_TAG --tag $CACHE_TAG .' - 'eval docker push $IMAGE_TAG' - 'eval docker push $CACHE_TAG' @@ -54,7 +58,7 @@ workflow: stage: test image: docker:20.10.6 services: - - docker:20.10.6-dind + - docker:20.10.16-dind before_script: - set -x - env From 390d2539de8bac025f5f369ac2a6d8c978f83565 Mon Sep 17 00:00:00 2001 From: Josmar Regalado Date: Tue, 13 Dec 2022 07:56:49 +0000 Subject: [PATCH 02/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fad704a..08b21b2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,7 +45,7 @@ workflow: before_script: - set -x - env - - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN mcr.gitlab.montel.fi script: # defaults: --build-arg REQUIREMENTS=requirements_prod.txt #- 'eval docker pull $CACHE_TAG || true' @@ -62,7 +62,7 @@ workflow: before_script: - set -x - env - - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN mcr.gitlab.montel.fi - apk add docker-compose script: - 'eval export TEST_IMG=$IMAGE_TEST_TAG' From 0d3327269c94838c2c2bff560e1a9ebe0f134089 Mon Sep 17 00:00:00 2001 From: Josmar Regalado Date: Tue, 13 Dec 2022 08:41:04 +0000 Subject: [PATCH 03/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 08b21b2..61a25f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,7 +49,7 @@ workflow: script: # defaults: --build-arg REQUIREMENTS=requirements_prod.txt #- 'eval docker pull $CACHE_TAG || true' - - 'eval docker build --build-arg APP_IMG_VER=$APP_IMG_VER $BUILD_EXTRA_ARGS --cache-from $CACHE_TAG --tag $IMAGE_TAG --tag $CACHE_TAG .' + - 'eval docker build --network host --build-arg APP_IMG_VER=$APP_IMG_VER $BUILD_EXTRA_ARGS --cache-from $CACHE_TAG --tag $IMAGE_TAG --tag $CACHE_TAG .' - 'eval docker push $IMAGE_TAG' - 'eval docker push $CACHE_TAG' From 1d9d566961454b406a9f3d5d9693dec4d87ecfb0 Mon Sep 17 00:00:00 2001 From: Josmar Regalado Date: Tue, 13 Dec 2022 14:45:20 +0000 Subject: [PATCH 04/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 61a25f4..8df35e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,7 +41,7 @@ workflow: - docker:20.10.6-dind variables: IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID - CACHE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-cache + CACHE_TAG: $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}-cache before_script: - set -x - env @@ -49,9 +49,15 @@ workflow: script: # defaults: --build-arg REQUIREMENTS=requirements_prod.txt #- 'eval docker pull $CACHE_TAG || true' - - 'eval docker build --network host --build-arg APP_IMG_VER=$APP_IMG_VER $BUILD_EXTRA_ARGS --cache-from $CACHE_TAG --tag $IMAGE_TAG --tag $CACHE_TAG .' - - 'eval docker push $IMAGE_TAG' - - 'eval docker push $CACHE_TAG' + - > + docker build + --network host + --build-arg APP_IMG_VER=$APP_IMG_VER $BUILD_EXTRA_ARGS + --cache-from $CACHE_TAG + --tag $IMAGE_TAG + --tag $CACHE_TAG . + - docker push $IMAGE_TAG + - docker push $CACHE_TAG .test_image_base: From 5b317133e581557fc9b97c11f9c29f2e4751ecff Mon Sep 17 00:00:00 2001 From: Josmar Regalado Date: Tue, 13 Dec 2022 14:51:42 +0000 Subject: [PATCH 05/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8df35e8..80cc41e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,7 @@ variables: IMAGE_RELEASE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID IMAGE_TEST_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID-test CACHE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-cache + #CACHE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG APP_IMG_VER: $CI_COMMIT_SHORT_SHA workflow: From 8d791007a025706e8d4a0f9be0765b92c3254d89 Mon Sep 17 00:00:00 2001 From: Pekka Lampila Date: Tue, 9 May 2023 12:42:18 +0300 Subject: [PATCH 06/10] Remove demo frontend from readme --- README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index d10ea57..e0c972f 100644 --- a/README.md +++ b/README.md @@ -112,12 +112,4 @@ commit. ## Running tests * Set the `DEBUG` environment variable to `1`. -* Run `pytest`. - -## Demo frontend -Navigate to frontend folder. - -To install `node_modules` run `yarn install`. -Create `.env` file, use `.env.example` as a base. - -After installation is completed run application with `yarn start`. Application is now running and can be found at `localhost:3000`. +* Run `pytest`. \ No newline at end of file From bc1f5cca9a6604c5aed7ec09eea42b132009c335 Mon Sep 17 00:00:00 2001 From: Pekka Lampila Date: Mon, 30 Oct 2023 16:11:03 +0200 Subject: [PATCH 07/10] Upgrade to Python 3.9 --- Dockerfile | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e4b5569..f9221ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # ============================== -FROM helsinkitest/python:3.8-slim as appbase +FROM helsinkitest/python:3.9-slim as appbase # ============================== RUN mkdir /entrypoint @@ -9,7 +9,7 @@ COPY --chown=appuser:appuser requirements-prod.txt /app/requirements-prod.txt RUN apt-install.sh \ build-essential \ libpq-dev \ - netcat \ + netcat-traditional \ gdal-bin \ python3-gdal \ && pip install -U pip \ diff --git a/README.md b/README.md index e0c972f..2f25151 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Prerequisites: Prerequisites: * PostgreSQL 11 -* Python 3.8 +* Python 3.9 ### Installing Python requirements From c4f8bf3fdd496b3b1b109d8b5a42a1fff566272f Mon Sep 17 00:00:00 2001 From: Pekka Lampila Date: Mon, 30 Oct 2023 18:10:50 +0200 Subject: [PATCH 08/10] Updated dependencies --- requirements-dev.txt | 160 ++++++++++++++++++++++-------------------- requirements-prod.txt | 6 +- requirements.in | 2 +- requirements.txt | 125 ++++++++++++++++++++------------- 4 files changed, 164 insertions(+), 129 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a9c27b4..784d57e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,166 +1,176 @@ # -# This file is autogenerated by pip-compile -# To update, run: +# This file is autogenerated by pip-compile with Python 3.9 +# by the following command: # # pip-compile requirements-dev.in # -appdirs==1.4.4 - # via black -asgiref==3.3.4 +asgiref==3.7.2 # via # -c requirements.txt # django -attrs==21.1.0 +asttokens==2.4.1 + # via stack-data +attrs==23.1.0 # via # -c requirements.txt # flake8-bugbear - # pytest -autoflake==1.4 +autoflake==2.2.1 # via -r requirements-dev.in -backcall==0.2.0 - # via ipython -black==21.5b0 +black==23.10.1 # via -r requirements-dev.in -certifi==2020.12.5 +certifi==2023.7.22 # via # -c requirements.txt # requests -chardet==4.0.0 +charset-normalizer==3.3.1 # via # -c requirements.txt # requests -click==7.1.2 +click==8.1.7 # via # -c requirements.txt # black -coverage==5.5 - # via pytest-cov -decorator==5.0.7 +coverage[toml]==7.3.2 + # via + # coverage + # pytest-cov +decorator==5.1.1 # via ipython -django==3.2.2 +django==3.2.22 # via # -c requirements.txt # model-bakery -fastdiff==0.2.0 +exceptiongroup==1.1.3 + # via + # ipython + # pytest +executing==2.0.1 + # via stack-data +fastdiff==0.3.0 # via snapshottest -flake8-bugbear==21.4.3 - # via -r requirements-dev.in -flake8-polyfill==1.0.2 - # via pep8-naming -flake8==3.9.1 +flake8==6.1.0 # via # -r requirements-dev.in # flake8-bugbear - # flake8-polyfill -freezegun==1.1.0 + # pep8-naming +flake8-bugbear==23.9.16 + # via -r requirements-dev.in +freezegun==1.2.2 # via -r requirements-dev.in -idna==2.10 +idna==3.4 # via # -c requirements.txt # requests -iniconfig==1.1.1 +iniconfig==2.0.0 # via pytest -ipython-genutils==0.2.0 - # via traitlets -ipython==7.23.1 +ipython==8.17.1 # via -r requirements-dev.in -isort==5.8.0 +isort==5.12.0 # via -r requirements-dev.in -jedi==0.18.0 +jedi==0.19.1 # via ipython -matplotlib-inline==0.1.2 +matplotlib-inline==0.1.6 # via ipython -mccabe==0.6.1 +mccabe==0.7.0 # via flake8 -model-bakery==1.3.1 +model-bakery==1.17.0 # via -r requirements-dev.in -mypy-extensions==0.4.3 +mypy-extensions==1.0.0 # via black -packaging==20.9 - # via pytest -parso==0.8.2 +packaging==23.2 + # via + # -c requirements.txt + # black + # pytest +parso==0.8.3 # via jedi -pathspec==0.8.1 +pathspec==0.11.2 # via black -pep8-naming==0.11.1 +pep8-naming==0.13.3 # via -r requirements-dev.in pexpect==4.8.0 # via ipython -pickleshare==0.7.5 - # via ipython -pluggy==0.13.1 +platformdirs==3.11.0 + # via black +pluggy==1.3.0 # via pytest -prompt-toolkit==3.0.18 +prompt-toolkit==3.0.39 # via ipython ptyprocess==0.7.0 # via pexpect -py==1.10.0 - # via pytest -pycodestyle==2.7.0 +pure-eval==0.2.2 + # via stack-data +pycodestyle==2.11.1 # via flake8 -pyflakes==2.3.1 +pyflakes==3.1.0 # via # autoflake # flake8 -pygments==2.9.0 +pygments==2.16.1 # via ipython -pyparsing==2.4.7 - # via packaging -pytest-cov==2.11.1 - # via -r requirements-dev.in -pytest-django==4.2.0 - # via -r requirements-dev.in -pytest==6.2.4 +pytest==7.4.3 # via # -r requirements-dev.in # pytest-cov # pytest-django -python-dateutil==2.8.1 +pytest-cov==4.1.0 + # via -r requirements-dev.in +pytest-django==4.6.0 + # via -r requirements-dev.in +python-dateutil==2.8.2 # via # -c requirements.txt # freezegun -pytz==2021.1 +pytz==2023.3.post1 # via # -c requirements.txt # django -regex==2021.4.4 - # via black -requests-mock==1.9.2 - # via -r requirements-dev.in -requests==2.25.1 +requests==2.31.0 # via # -c requirements.txt # requests-mock +requests-mock==1.11.0 + # via -r requirements-dev.in six==1.16.0 # via # -c requirements.txt + # asttokens # python-dateutil # requests-mock # snapshottest snapshottest==0.6.0 # via -r requirements-dev.in -sqlparse==0.4.1 +sqlparse==0.4.4 # via # -c requirements.txt # django -termcolor==1.1.0 +stack-data==0.6.3 + # via ipython +termcolor==2.3.0 # via snapshottest -toml==0.10.2 +tomli==2.0.1 # via + # autoflake # black + # coverage # pytest -traitlets==5.0.5 +traitlets==5.13.0 # via # ipython # matplotlib-inline -urllib3==1.26.4 +typing-extensions==4.8.0 + # via + # -c requirements.txt + # asgiref + # black + # ipython +urllib3==2.0.7 # via # -c requirements.txt # requests -wasmer==1.0.0 +wasmer==1.1.0 + # via fastdiff +wasmer-compiler-cranelift==1.1.0 # via fastdiff -wcwidth==0.2.5 +wcwidth==0.2.8 # via prompt-toolkit - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/requirements-prod.txt b/requirements-prod.txt index c66ad0d..2c64b70 100644 --- a/requirements-prod.txt +++ b/requirements-prod.txt @@ -1,8 +1,8 @@ # -# This file is autogenerated by pip-compile -# To update, run: +# This file is autogenerated by pip-compile with Python 3.9 +# by the following command: # # pip-compile requirements-prod.in # -uwsgi==2.0.19.1 +uwsgi==2.0.22 # via -r requirements-prod.in diff --git a/requirements.in b/requirements.in index 47e59a5..fde846a 100644 --- a/requirements.in +++ b/requirements.in @@ -1,4 +1,4 @@ -Django +Django~=3.2.22 django-environ psycopg2 sentry_sdk diff --git a/requirements.txt b/requirements.txt index da87ec1..7af2abc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,127 +1,152 @@ # -# This file is autogenerated by pip-compile -# To update, run: +# This file is autogenerated by pip-compile with Python 3.9 +# by the following command: # # pip-compile requirements.in # -asgiref==3.3.4 +asgiref==3.7.2 # via django -attrs==21.1.0 +attrs==23.1.0 # via # fiona # jsonschema -branca==0.4.2 + # referencing +branca==0.6.0 # via folium -certifi==2020.12.5 +certifi==2023.7.22 # via # fiona # pyproj # requests # sentry-sdk -chardet==4.0.0 +charset-normalizer==3.3.1 # via requests +click==8.1.7 + # via + # click-plugins + # cligj + # fiona click-plugins==1.1.1 # via fiona -click==7.1.2 - # via fiona -cligj==0.7.1 +cligj==0.7.2 # via fiona -django-cors-headers==3.7.0 - # via -r requirements.in -django-environ==0.4.5 - # via -r requirements.in -django-filter==2.4.0 - # via -r requirements.in -django-parler==2.2 - # via -r requirements.in -django==3.2.2 +django==3.2.22 # via # -r requirements.in # django-cors-headers # django-filter + # django-parler # djangorestframework # drf-spectacular -djangorestframework-gis==0.17 +django-cors-headers==4.3.0 + # via -r requirements.in +django-environ==0.11.2 + # via -r requirements.in +django-filter==23.3 # via -r requirements.in -djangorestframework==3.12.4 +django-parler==2.3 + # via -r requirements.in +djangorestframework==3.14.0 # via # -r requirements.in # djangorestframework-gis # drf-spectacular -drf-spectacular==0.16.0 +djangorestframework-gis==1.0 + # via -r requirements.in +drf-spectacular==0.26.5 # via -r requirements.in -fiona==1.8.19 +fiona==1.9.5 # via geopandas -folium==0.12.1 +folium==0.14.0 # via gtfs-kit -geopandas==0.9.0 +geopandas==0.14.0 # via gtfs-kit -gtfs-kit==5.1.1 +gtfs-kit==6.0.0 # via -r requirements.in -idna==2.10 +idna==3.4 # via requests +importlib-metadata==6.8.0 + # via fiona inflection==0.5.1 # via drf-spectacular -jinja2==2.11.3 +jinja2==3.1.2 # via # branca # folium json2html==1.3.0 # via gtfs-kit -jsonschema==3.2.0 +jsonschema==4.19.2 # via drf-spectacular -markupsafe==1.1.1 +jsonschema-specifications==2023.7.1 + # via jsonschema +markupsafe==2.1.3 # via jinja2 -munch==2.5.0 - # via fiona -numpy==1.20.2 +numpy==1.26.1 # via # folium # pandas -pandas==1.2.4 + # shapely +packaging==23.2 + # via geopandas +pandas==2.1.2 # via # geopandas # gtfs-kit -psycopg2==2.8.6 +psycopg2==2.9.9 # via -r requirements.in -pycountry==19.8.18 +pycountry==22.3.5 # via gtfs-kit -pyproj==3.0.1 +pyproj==3.6.1 # via geopandas -pyrsistent==0.17.3 - # via jsonschema -python-dateutil==2.8.1 +python-dateutil==2.8.2 # via pandas -pytz==2021.1 +pytz==2023.3.post1 # via # django + # djangorestframework # pandas -pyyaml==5.4.1 +pyyaml==6.0.1 # via drf-spectacular -requests==2.25.1 +referencing==0.30.2 + # via + # jsonschema + # jsonschema-specifications +requests==2.31.0 # via # folium # gtfs-kit -rtree==0.9.7 +rpds-py==0.10.6 + # via + # jsonschema + # referencing +rtree==1.1.0 # via gtfs-kit -sentry-sdk==1.0.0 +sentry-sdk==1.32.0 # via -r requirements.in -shapely==1.7.1 +shapely==2.0.2 # via # geopandas # gtfs-kit six==1.16.0 # via # fiona - # jsonschema # python-dateutil -sqlparse==0.4.1 +sqlparse==0.4.4 # via django -uritemplate==3.0.1 +typing-extensions==4.8.0 + # via asgiref +tzdata==2023.3 + # via pandas +uritemplate==4.1.1 # via drf-spectacular -urllib3==1.26.4 +urllib3==2.0.7 # via # requests # sentry-sdk utm==0.7.0 # via gtfs-kit +zipp==3.17.0 + # via importlib-metadata + +# The following packages are considered to be unsafe in a requirements file: +# setuptools From 8b8e69eedd0b8692cb413583001624c347c3cfab Mon Sep 17 00:00:00 2001 From: Pekka Lampila Date: Mon, 30 Oct 2023 21:06:26 +0200 Subject: [PATCH 09/10] Update Docker version --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 80cc41e..9e0e6f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,9 +37,9 @@ workflow: ## Common CI/CD targets used with extends keyword .build_image_base: stage: build - image: docker:20.10.16 + image: docker:20.10.21 services: - - docker:20.10.6-dind + - docker:20.10.21-dind variables: IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID CACHE_TAG: $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}-cache @@ -63,9 +63,9 @@ workflow: .test_image_base: stage: test - image: docker:20.10.6 + image: docker:20.10.21 services: - - docker:20.10.16-dind + - docker:20.10.21-dind before_script: - set -x - env From 1807400b275a67c8613ec3304c8ae883a47d543e Mon Sep 17 00:00:00 2001 From: Pekka Lampila Date: Mon, 30 Oct 2023 21:15:46 +0200 Subject: [PATCH 10/10] Fix docker version --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e0e6f6..d6bdee7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,9 +37,9 @@ workflow: ## Common CI/CD targets used with extends keyword .build_image_base: stage: build - image: docker:20.10.21 + image: docker:20.10.16 services: - - docker:20.10.21-dind + - docker:20.10.16-dind variables: IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID CACHE_TAG: $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}-cache @@ -63,9 +63,9 @@ workflow: .test_image_base: stage: test - image: docker:20.10.21 + image: docker:20.10.16 services: - - docker:20.10.21-dind + - docker:20.10.16-dind before_script: - set -x - env