From baecc65caafedb3bb54f190c3a7f9a63431155c2 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Wed, 20 Nov 2024 10:43:07 +0000 Subject: [PATCH 1/9] Bump backend python version --- containers/backend/Dockerfile | 2 +- containers/backend/pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/containers/backend/Dockerfile b/containers/backend/Dockerfile index 6e9e9ce7..4435af91 100644 --- a/containers/backend/Dockerfile +++ b/containers/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10 +FROM python:3.12 LABEL maintainer="frederick.thomas@ouce.ox.ac.uk" WORKDIR /code diff --git a/containers/backend/pyproject.toml b/containers/backend/pyproject.toml index 22304dde..7db15828 100644 --- a/containers/backend/pyproject.toml +++ b/containers/backend/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "gri-backend" -version = "0.3.0" +version = "0.4.0" description = "GRI API Backend" readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.12" license = { text = "MIT" } classifiers = ["Framework :: FastAPI", "Programming Language :: Python :: 3"] dependencies = [ From 7aa2e5e8d7e8ba506b997909f07cf51c20b3233a Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Wed, 20 Nov 2024 10:49:43 +0000 Subject: [PATCH 2/9] Fix some typing lints --- .../backend/app/internal/attribute_access.py | 4 ++-- containers/backend/backend/app/routers/colormap.py | 13 +++++++++---- containers/backend/backend/app/routers/features.py | 7 ++++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/containers/backend/backend/app/internal/attribute_access.py b/containers/backend/backend/app/internal/attribute_access.py index f8e347ac..140dad5d 100644 --- a/containers/backend/backend/app/internal/attribute_access.py +++ b/containers/backend/backend/app/internal/attribute_access.py @@ -55,7 +55,7 @@ def add_adaptation_value_query( adaptation_protection_level=dimensions.adaptation_protection_level, ) - value: Column | ColumnOperators = None + value: Column | ColumnOperators | None = None if field == "cost_benefit_ratio": cost_benefit_params: schemas.AdaptationCostBenefitRatioParameters = field_params @@ -78,7 +78,7 @@ class DataGroupConfig: add_value_query: Callable[ [Query, schemas.DataDimensions, str, schemas.DataParameters | None], Query ] - field_parameters_schemas: Optional[dict[str, schemas.DataParameters]] = None + field_parameters_schemas: Optional[dict[str, schemas.DataParameters]] | None = None DATA_GROUP_CONFIGS: dict[str, DataGroupConfig] = { diff --git a/containers/backend/backend/app/routers/colormap.py b/containers/backend/backend/app/routers/colormap.py index dff2dac7..b8d194e3 100644 --- a/containers/backend/backend/app/routers/colormap.py +++ b/containers/backend/backend/app/routers/colormap.py @@ -4,7 +4,7 @@ import inspect import json -from typing import Union +from typing import Optional from fastapi import APIRouter, HTTPException from fastapi.logger import logger @@ -29,7 +29,7 @@ def _get_colormap(options: schemas.ColorMapOptions) -> schemas.ColorMap: @router.get("", response_model=schemas.ColorMap) async def get_colormap( colormap: str, - stretch_range: Union[str, None], + stretch_range: Optional[str], num_values: int = 255, ) -> schemas.ColorMap: """ @@ -43,18 +43,23 @@ async def get_colormap( ::kwarg num_values int Number of values to generate in the colormap """ + if stretch_range is None: + stretch_range_arg: list[int] = [0, 10] + else: + stretch_range_arg = json.loads(stretch_range) + logger.debug( "performing %s, using %s, %s, %s", inspect.stack()[0][3], colormap, - json.loads(stretch_range), + stretch_range_arg, num_values, ) try: options = schemas.ColorMapOptions( colormap=colormap, - stretch_range=json.loads(stretch_range), + stretch_range=stretch_range_arg, num_values=num_values, ) diff --git a/containers/backend/backend/app/routers/features.py b/containers/backend/backend/app/routers/features.py index c3a5b1d4..6cfd8984 100644 --- a/containers/backend/backend/app/routers/features.py +++ b/containers/backend/backend/app/routers/features.py @@ -1,3 +1,5 @@ +from typing import Optional + from fastapi import APIRouter, Depends, HTTPException from fastapi_pagination import Page, Params from fastapi_pagination.ext.sqlalchemy import paginate @@ -32,7 +34,10 @@ def read_feature(feature_id: int, db: Session = Depends(get_db)): def get_layer_spec( - layer: str = None, sector: str = None, subsector: str = None, asset_type: str = None + layer: Optional[str] = None, + sector: Optional[str] = None, + subsector: Optional[str] = None, + asset_type: Optional[str] = None, ): return schemas.LayerSpec( layer_name=layer, From c7e010aeddef5a9ec3e68e269105b1e13e748c1f Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Wed, 20 Nov 2024 10:51:44 +0000 Subject: [PATCH 3/9] Replace conint with Annotated type, validator with field_validator https://docs.pydantic.dev/latest/api/types/#pydantic.types.conint--__tabbed_1_2 https://docs.pydantic.dev/latest/migration/#validator-and-root_validator-are-deprecated --- containers/backend/backend/app/schemas.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/containers/backend/backend/app/schemas.py b/containers/backend/backend/app/schemas.py index cb1bbf25..e499bf87 100644 --- a/containers/backend/backend/app/schemas.py +++ b/containers/backend/backend/app/schemas.py @@ -1,6 +1,7 @@ from enum import Enum -from typing import Generic, List, Optional, TypeVar, Union -from pydantic import BaseModel, ConfigDict, conint, validator +from typing import Generic, Optional, TypeVar, Union +from typing_extensions import Annotated +from pydantic import BaseModel, ConfigDict, Field, field_validator class FeatureBase(BaseModel): @@ -113,9 +114,9 @@ class AdaptationVariables(DataVariables): class AdaptationCostBenefitRatioParameters(DataParameters): - eael_days: conint(ge=1, le=30) + eael_days: Annotated[int, Field(ge=1, le=30)] - @validator("eael_days") + @field_validator("eael_days") def fix_eael_days(cls, eael_days: int) -> float: """ The data for `AdaptationCostBenefit.avoided_eael_mean` is erroneous and @@ -187,19 +188,19 @@ class TileSourceMeta(BaseModel): class TileSourceDomains(BaseModel): - domains: List[dict[str, str]] + domains: list[dict[str, str]] class ColorMapOptions(BaseModel): - stretch_range: List[int] + stretch_range: list[int] colormap: str num_values: Optional[int] = 255 class ColorMapEntry(BaseModel): value: float - rgba: List[int] + rgba: list[int] class ColorMap(BaseModel): - colormap: List[ColorMapEntry] + colormap: list[ColorMapEntry] From 95cb045f647db3e0c7743196cbadd25c33e80ffb Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Wed, 20 Nov 2024 10:56:01 +0000 Subject: [PATCH 4/9] Bump pinned dependencies --- containers/backend/pyproject.toml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/containers/backend/pyproject.toml b/containers/backend/pyproject.toml index 7db15828..da91e43e 100644 --- a/containers/backend/pyproject.toml +++ b/containers/backend/pyproject.toml @@ -11,13 +11,14 @@ requires-python = ">=3.12" license = { text = "MIT" } classifiers = ["Framework :: FastAPI", "Programming Language :: Python :: 3"] dependencies = [ - "fastapi==0.109.1", - "geoalchemy2==0.12.5", - "uvicorn==0.18.3", + "fastapi==0.115.5", + "fastapi-pagination==0.12.32", + "geoalchemy2==0.16.0", "psycopg2-binary==2.9.10", - "fastapi-pagination==0.10.0", + "pydantic==2.9.2", + "sqlalchemy==2.0.36", "terracotta==0.8.3", - "sqlalchemy==1.4.41", + "uvicorn==0.32.0", ] [project.optional-dependencies] From 55cd25a8db70fd2aa66ee04f40de4459ae441764 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Wed, 20 Nov 2024 10:58:01 +0000 Subject: [PATCH 5/9] Bump gri-backend to 1.6.0 --- README.md | 8 ++++---- docker-compose-dev.yaml | 4 ++-- docker-compose-prod-build.yaml | 2 +- docker-compose-prod-deploy.yaml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2ecfe5f5..c9ff32cc 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ As an example, below we update the backend on a development machine: ```bash # Edit docker-compose-prod-build.yaml image version: -# image: ghcr.io/nismod/gri-backend:1.5.0 +# image: ghcr.io/nismod/gri-backend:1.6.0 # Build docker compose -f docker-compose-prod-build.yaml build backend @@ -173,17 +173,17 @@ docker compose -f docker-compose-prod-build.yaml build backend # see: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry # Push -docker push ghcr.io/nismod/gri-backend:1.5.0 +docker push ghcr.io/nismod/gri-backend:1.6.0 ``` On the production remote, pull the image and restart the service: ```bash # Pull image -docker pull ghcr.io/nismod/gri-backend:1.5.0 +docker pull ghcr.io/nismod/gri-backend:1.6.0 # Edit docker-compose-prod-deploy.yaml image version (or sync up): -# image: ghcr.io/nismod/gri-backend:1.5.0 +# image: ghcr.io/nismod/gri-backend:1.6.0 # Restart service docker compose up -d backend diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml index 14277a29..ff9c7a00 100644 --- a/docker-compose-dev.yaml +++ b/docker-compose-dev.yaml @@ -45,7 +45,7 @@ services: backend: build: ./containers/backend - image: ghcr.io/nismod/gri-backend:1.5.0 + image: ghcr.io/nismod/gri-backend:1.6.0 volumes: - ./etl/raster/cog/:/data/ - ./containers/backend/backend/:/code/backend/ @@ -118,7 +118,7 @@ services: ## WARNING - this will wipe the existing tables. TODO: Alembic recreate-metadata-schema: build: ./containers/backend - image: ghcr.io/nismod/gri-backend:1.5.0 + image: ghcr.io/nismod/gri-backend:1.6.0 profiles: ["recreate-metadata-schema"] volumes: - ./containers/backend/backend/db/models.py:/code/backend/db/models.py diff --git a/docker-compose-prod-build.yaml b/docker-compose-prod-build.yaml index d8fc4432..ad71dea8 100644 --- a/docker-compose-prod-build.yaml +++ b/docker-compose-prod-build.yaml @@ -1,6 +1,6 @@ services: backend: - image: ghcr.io/nismod/gri-backend:1.5.0 + image: ghcr.io/nismod/gri-backend:1.6.0 build: ./containers/backend vector-tileserver: diff --git a/docker-compose-prod-deploy.yaml b/docker-compose-prod-deploy.yaml index c377e7ed..5555fea1 100644 --- a/docker-compose-prod-deploy.yaml +++ b/docker-compose-prod-deploy.yaml @@ -45,7 +45,7 @@ services: mem_limit: "250M" backend: - image: ghcr.io/nismod/gri-backend:1.5.0 + image: ghcr.io/nismod/gri-backend:1.6.0 restart: always volumes: - ./tileserver/raster/data:/data From 4aec772a183c64d46e44ed3de7ee2b4ba1f09dc3 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Wed, 20 Nov 2024 11:34:22 +0000 Subject: [PATCH 6/9] Include setuptools explicitly in backend dependencies, bump to 1.6.1 --- README.md | 8 ++++---- containers/backend/pyproject.toml | 3 ++- docker-compose-dev.yaml | 4 ++-- docker-compose-prod-build.yaml | 2 +- docker-compose-prod-deploy.yaml | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c9ff32cc..3164fab1 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ As an example, below we update the backend on a development machine: ```bash # Edit docker-compose-prod-build.yaml image version: -# image: ghcr.io/nismod/gri-backend:1.6.0 +# image: ghcr.io/nismod/gri-backend:1.6.1 # Build docker compose -f docker-compose-prod-build.yaml build backend @@ -173,17 +173,17 @@ docker compose -f docker-compose-prod-build.yaml build backend # see: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry # Push -docker push ghcr.io/nismod/gri-backend:1.6.0 +docker push ghcr.io/nismod/gri-backend:1.6.1 ``` On the production remote, pull the image and restart the service: ```bash # Pull image -docker pull ghcr.io/nismod/gri-backend:1.6.0 +docker pull ghcr.io/nismod/gri-backend:1.6.1 # Edit docker-compose-prod-deploy.yaml image version (or sync up): -# image: ghcr.io/nismod/gri-backend:1.6.0 +# image: ghcr.io/nismod/gri-backend:1.6.1 # Restart service docker compose up -d backend diff --git a/containers/backend/pyproject.toml b/containers/backend/pyproject.toml index da91e43e..0b5c14a0 100644 --- a/containers/backend/pyproject.toml +++ b/containers/backend/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "gri-backend" -version = "0.4.0" +version = "0.4.1" description = "GRI API Backend" readme = "README.md" requires-python = ">=3.12" @@ -17,6 +17,7 @@ dependencies = [ "psycopg2-binary==2.9.10", "pydantic==2.9.2", "sqlalchemy==2.0.36", + "setuptools==75.5.0", "terracotta==0.8.3", "uvicorn==0.32.0", ] diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml index ff9c7a00..05abbc76 100644 --- a/docker-compose-dev.yaml +++ b/docker-compose-dev.yaml @@ -45,7 +45,7 @@ services: backend: build: ./containers/backend - image: ghcr.io/nismod/gri-backend:1.6.0 + image: ghcr.io/nismod/gri-backend:1.6.1 volumes: - ./etl/raster/cog/:/data/ - ./containers/backend/backend/:/code/backend/ @@ -118,7 +118,7 @@ services: ## WARNING - this will wipe the existing tables. TODO: Alembic recreate-metadata-schema: build: ./containers/backend - image: ghcr.io/nismod/gri-backend:1.6.0 + image: ghcr.io/nismod/gri-backend:1.6.1 profiles: ["recreate-metadata-schema"] volumes: - ./containers/backend/backend/db/models.py:/code/backend/db/models.py diff --git a/docker-compose-prod-build.yaml b/docker-compose-prod-build.yaml index ad71dea8..c387aed0 100644 --- a/docker-compose-prod-build.yaml +++ b/docker-compose-prod-build.yaml @@ -1,6 +1,6 @@ services: backend: - image: ghcr.io/nismod/gri-backend:1.6.0 + image: ghcr.io/nismod/gri-backend:1.6.1 build: ./containers/backend vector-tileserver: diff --git a/docker-compose-prod-deploy.yaml b/docker-compose-prod-deploy.yaml index 5555fea1..4e982ad4 100644 --- a/docker-compose-prod-deploy.yaml +++ b/docker-compose-prod-deploy.yaml @@ -45,7 +45,7 @@ services: mem_limit: "250M" backend: - image: ghcr.io/nismod/gri-backend:1.6.0 + image: ghcr.io/nismod/gri-backend:1.6.1 restart: always volumes: - ./tileserver/raster/data:/data From f2c649f16d6d694d63f087275ebd7e324134a934 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Mon, 2 Dec 2024 11:39:57 +0000 Subject: [PATCH 7/9] Absolute imports for backend --- containers/backend/README.md | 2 +- containers/backend/backend/app/dependencies.py | 2 +- .../backend/backend/app/internal/attribute_access.py | 4 ++-- containers/backend/backend/app/internal/helpers.py | 2 +- containers/backend/backend/app/main.py | 7 +++++-- containers/backend/backend/app/routers/attributes.py | 8 ++++---- containers/backend/backend/app/routers/colormap.py | 4 ++-- containers/backend/backend/app/routers/features.py | 8 ++++---- containers/backend/backend/app/routers/tiles.py | 12 ++++++------ containers/backend/backend/create_schema.py | 4 ++-- 10 files changed, 28 insertions(+), 25 deletions(-) diff --git a/containers/backend/README.md b/containers/backend/README.md index 7e7e7e1a..d16b17f8 100644 --- a/containers/backend/README.md +++ b/containers/backend/README.md @@ -30,7 +30,7 @@ source venv/bin/activate pip install -e .[dev] # run the application -uvicorn app.main:app --port 8888 --reload +uvicorn backend.app.main:app --port 8888 --reload ``` ## Configuration diff --git a/containers/backend/backend/app/dependencies.py b/containers/backend/backend/app/dependencies.py index cc030b8f..10057c8c 100644 --- a/containers/backend/backend/app/dependencies.py +++ b/containers/backend/backend/app/dependencies.py @@ -1,4 +1,4 @@ -from db.database import SessionLocal +from backend.db.database import SessionLocal def get_db(): diff --git a/containers/backend/backend/app/internal/attribute_access.py b/containers/backend/backend/app/internal/attribute_access.py index 140dad5d..b337ba5b 100644 --- a/containers/backend/backend/app/internal/attribute_access.py +++ b/containers/backend/backend/app/internal/attribute_access.py @@ -7,8 +7,8 @@ from pydantic import Json, ValidationError -from app import schemas -from db import models +from backend.app import schemas +from backend.db import models def add_damages_expected_value_query( diff --git a/containers/backend/backend/app/internal/helpers.py b/containers/backend/backend/app/internal/helpers.py index 74be3741..fc675396 100644 --- a/containers/backend/backend/app/internal/helpers.py +++ b/containers/backend/backend/app/internal/helpers.py @@ -5,7 +5,7 @@ import logging import traceback -from config import TILEDB_URI +from backend.config import TILEDB_URI def build_driver_path(database: str, tiledb_uri: str = TILEDB_URI) -> str: diff --git a/containers/backend/backend/app/main.py b/containers/backend/backend/app/main.py index 87d53cd0..e1d7c292 100644 --- a/containers/backend/backend/app/main.py +++ b/containers/backend/backend/app/main.py @@ -4,8 +4,11 @@ from fastapi.routing import APIRoute from fastapi.logger import logger -from .routers import attributes, features, tiles, colormap -from config import LOG_LEVEL +import backend.app.routers.attributes as attributes +import backend.app.routers.features as features +import backend.app.routers.tiles as tiles +import backend.app.routers.colormap as colormap +from backend.config import LOG_LEVEL formatter = logging.Formatter( "[%(asctime)s.%(msecs)03d] %(levelname)s %(filename)s - %(funcName)s - %(message)s", diff --git a/containers/backend/backend/app/routers/attributes.py b/containers/backend/backend/app/routers/attributes.py index 4fe1a81d..031ae10e 100644 --- a/containers/backend/backend/app/routers/attributes.py +++ b/containers/backend/backend/app/routers/attributes.py @@ -2,16 +2,16 @@ from fastapi import APIRouter, Body, Depends from sqlalchemy.orm import Session -from app.dependencies import get_db -from app.internal.attribute_access import ( +from backend.app.dependencies import get_db +from backend.app.internal.attribute_access import ( add_value_query, parse_dimensions, parse_parameters, ) -from db import models +from backend.db import models -from .. import schemas +from backend.app import schemas router = APIRouter(tags=["attributes"]) diff --git a/containers/backend/backend/app/routers/colormap.py b/containers/backend/backend/app/routers/colormap.py index b8d194e3..44131cfe 100644 --- a/containers/backend/backend/app/routers/colormap.py +++ b/containers/backend/backend/app/routers/colormap.py @@ -9,8 +9,8 @@ from fastapi import APIRouter, HTTPException from fastapi.logger import logger -from app import schemas -from app.internal.helpers import handle_exception +from backend.app import schemas +from backend.app.internal.helpers import handle_exception router = APIRouter(tags=["colormap"]) diff --git a/containers/backend/backend/app/routers/features.py b/containers/backend/backend/app/routers/features.py index 6cfd8984..95f7befa 100644 --- a/containers/backend/backend/app/routers/features.py +++ b/containers/backend/backend/app/routers/features.py @@ -8,14 +8,14 @@ from sqlalchemy.orm import Session from geoalchemy2 import functions -from app import schemas -from app.dependencies import get_db -from app.internal.attribute_access import ( +from backend.app import schemas +from backend.app.dependencies import get_db +from backend.app.internal.attribute_access import ( add_value_query, parse_dimensions, parse_parameters, ) -from db import models +from backend.db import models router = APIRouter(tags=["features"]) diff --git a/containers/backend/backend/app/routers/tiles.py b/containers/backend/backend/app/routers/tiles.py index 73e41e6f..dc4fa227 100644 --- a/containers/backend/backend/app/routers/tiles.py +++ b/containers/backend/backend/app/routers/tiles.py @@ -17,15 +17,15 @@ from terracotta import get_driver -from app import schemas -from app.dependencies import get_db -from db import models -from app.internal.helpers import build_driver_path, handle_exception -from app.exceptions import ( +from backend.app import schemas +from backend.app.dependencies import get_db +from backend.db import models +from backend.app.internal.helpers import build_driver_path, handle_exception +from backend.app.exceptions import ( SourceDBDoesNotExistException, MissingExplicitColourMapException, ) -from config import CATEGORICAL_COLOR_MAPS +from backend.config import CATEGORICAL_COLOR_MAPS router = APIRouter(tags=["tiles"]) diff --git a/containers/backend/backend/create_schema.py b/containers/backend/backend/create_schema.py index 7deb83f2..f679e53e 100644 --- a/containers/backend/backend/create_schema.py +++ b/containers/backend/backend/create_schema.py @@ -2,8 +2,8 @@ SQLAlchemy Schema Setup Main """ -from db import models -from db.database import engine +from backend.db import models +from backend.db.database import engine if __name__ == "__main__": models.Base.metadata.drop_all(bind=engine) From 46efb9f3e4595332bfb7cb7d8c313b9b687dc25a Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Mon, 2 Dec 2024 11:43:35 +0000 Subject: [PATCH 8/9] Require stretch_range argument for colormap --- .../backend/backend/app/routers/colormap.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/containers/backend/backend/app/routers/colormap.py b/containers/backend/backend/app/routers/colormap.py index 44131cfe..35bd971b 100644 --- a/containers/backend/backend/app/routers/colormap.py +++ b/containers/backend/backend/app/routers/colormap.py @@ -4,7 +4,6 @@ import inspect import json -from typing import Optional from fastapi import APIRouter, HTTPException from fastapi.logger import logger @@ -29,7 +28,7 @@ def _get_colormap(options: schemas.ColorMapOptions) -> schemas.ColorMap: @router.get("", response_model=schemas.ColorMap) async def get_colormap( colormap: str, - stretch_range: Optional[str], + stretch_range: str, num_values: int = 255, ) -> schemas.ColorMap: """ @@ -43,10 +42,15 @@ async def get_colormap( ::kwarg num_values int Number of values to generate in the colormap """ - if stretch_range is None: - stretch_range_arg: list[int] = [0, 10] - else: - stretch_range_arg = json.loads(stretch_range) + try: + stretch_range_arg: list[int] = json.loads(stretch_range) + if len(stretch_range_arg) != 2: + raise ValueError + except ValueError: + raise HTTPException( + status_code=400, + detail="stretch_range should be a list of two values (min and max), like `stretch_range=[0,1]`", + ) logger.debug( "performing %s, using %s, %s, %s", From 6c87e2925c15a1441500df204317ab2bfb1470d7 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Mon, 2 Dec 2024 11:50:35 +0000 Subject: [PATCH 9/9] Bump irv-backend to 1.6.2 --- README.md | 8 ++++---- docker-compose-dev.yaml | 4 ++-- docker-compose-prod-build.yaml | 2 +- docker-compose-prod-deploy.yaml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3164fab1..06cc38f5 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ As an example, below we update the backend on a development machine: ```bash # Edit docker-compose-prod-build.yaml image version: -# image: ghcr.io/nismod/gri-backend:1.6.1 +# image: ghcr.io/nismod/gri-backend:1.6.2 # Build docker compose -f docker-compose-prod-build.yaml build backend @@ -173,17 +173,17 @@ docker compose -f docker-compose-prod-build.yaml build backend # see: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry # Push -docker push ghcr.io/nismod/gri-backend:1.6.1 +docker push ghcr.io/nismod/gri-backend:1.6.2 ``` On the production remote, pull the image and restart the service: ```bash # Pull image -docker pull ghcr.io/nismod/gri-backend:1.6.1 +docker pull ghcr.io/nismod/gri-backend:1.6.2 # Edit docker-compose-prod-deploy.yaml image version (or sync up): -# image: ghcr.io/nismod/gri-backend:1.6.1 +# image: ghcr.io/nismod/gri-backend:1.6.2 # Restart service docker compose up -d backend diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml index 05abbc76..a6ac6db1 100644 --- a/docker-compose-dev.yaml +++ b/docker-compose-dev.yaml @@ -45,7 +45,7 @@ services: backend: build: ./containers/backend - image: ghcr.io/nismod/gri-backend:1.6.1 + image: ghcr.io/nismod/gri-backend:1.6.2 volumes: - ./etl/raster/cog/:/data/ - ./containers/backend/backend/:/code/backend/ @@ -118,7 +118,7 @@ services: ## WARNING - this will wipe the existing tables. TODO: Alembic recreate-metadata-schema: build: ./containers/backend - image: ghcr.io/nismod/gri-backend:1.6.1 + image: ghcr.io/nismod/gri-backend:1.6.2 profiles: ["recreate-metadata-schema"] volumes: - ./containers/backend/backend/db/models.py:/code/backend/db/models.py diff --git a/docker-compose-prod-build.yaml b/docker-compose-prod-build.yaml index c387aed0..262369ea 100644 --- a/docker-compose-prod-build.yaml +++ b/docker-compose-prod-build.yaml @@ -1,6 +1,6 @@ services: backend: - image: ghcr.io/nismod/gri-backend:1.6.1 + image: ghcr.io/nismod/gri-backend:1.6.2 build: ./containers/backend vector-tileserver: diff --git a/docker-compose-prod-deploy.yaml b/docker-compose-prod-deploy.yaml index 4e982ad4..df5f767f 100644 --- a/docker-compose-prod-deploy.yaml +++ b/docker-compose-prod-deploy.yaml @@ -45,7 +45,7 @@ services: mem_limit: "250M" backend: - image: ghcr.io/nismod/gri-backend:1.6.1 + image: ghcr.io/nismod/gri-backend:1.6.2 restart: always volumes: - ./tileserver/raster/data:/data