From 3fa689fd163260e54346b2fedf162e577e61dbd5 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Fri, 26 Jul 2024 19:11:26 +0200 Subject: [PATCH] a few docker-related fixes --- .gitea/workflows/backend_build-image.yaml | 6 +-- .gitea/workflows/frontend_build-android.yaml | 2 +- .gitea/workflows/frontend_build-web.yaml | 52 ++++++++++---------- backend/Dockerfile | 2 +- backend/src/constants.py | 5 +- backend/{ => src}/log_config.yaml | 0 6 files changed, 34 insertions(+), 33 deletions(-) rename backend/{ => src}/log_config.yaml (100%) diff --git a/.gitea/workflows/backend_build-image.yaml b/.gitea/workflows/backend_build-image.yaml index 1552c03..0a40ccd 100644 --- a/.gitea/workflows/backend_build-image.yaml +++ b/.gitea/workflows/backend_build-image.yaml @@ -14,13 +14,13 @@ jobs: steps: - uses: https://gitea.com/actions/checkout@v4 - + - name: Login to Docker Registry uses: docker/login-action@v3 with: registry: git.kluster.moll.re username: ${{ gitea.repository_owner }} - password: ${{ secrets.DOCKER_PUSH_TOKEN }} + password: ${{ secrets.PACKAGE_REGISTRY_ACCESS }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -29,5 +29,5 @@ jobs: uses: docker/build-push-action@v5 with: context: backend - tags: git.kluster.moll.re/remoll/fast_network_navigation/backend:latest + tags: git.kluster.moll.re/anydev/anyway-backend:latest push: true diff --git a/.gitea/workflows/frontend_build-android.yaml b/.gitea/workflows/frontend_build-android.yaml index 5856576..2979c23 100644 --- a/.gitea/workflows/frontend_build-android.yaml +++ b/.gitea/workflows/frontend_build-android.yaml @@ -44,7 +44,7 @@ jobs: - name: Add required secrets run: | - echo ${{ secrets.ANDROID_SECRETS_BASE64 }} | base64 -d > ./android/secrets.properties + echo ${{ secrets.ANDROID_SECRETS_PROPERTIES }} > ./android/secrets.properties working-directory: ./frontend - name: Sanity check diff --git a/.gitea/workflows/frontend_build-web.yaml b/.gitea/workflows/frontend_build-web.yaml index f5980fe..05f28d4 100644 --- a/.gitea/workflows/frontend_build-web.yaml +++ b/.gitea/workflows/frontend_build-web.yaml @@ -1,34 +1,34 @@ -on: - pull_request: - branches: - - main - paths: - - frontend/** +# on: +# pull_request: +# branches: +# - main +# paths: +# - frontend/** -name: Build web +# name: Build web -jobs: - build: - name: Build Web - runs-on: ubuntu-latest - steps: +# jobs: +# build: +# name: Build Web +# runs-on: ubuntu-latest +# steps: - - name: Install prerequisites - run: | - sudo apt-get update - sudo apt-get install -y xz-utils +# - name: Install prerequisites +# run: | +# sudo apt-get update +# sudo apt-get install -y xz-utils - - uses: actions/checkout@v4 +# - uses: actions/checkout@v4 - - uses: https://github.com/subosito/flutter-action@v2 - with: - channel: stable - flutter-version: 3.19.6 - cache: true +# - uses: https://github.com/subosito/flutter-action@v2 +# with: +# channel: stable +# flutter-version: 3.19.6 +# cache: true - - run: flutter pub get - working-directory: ./frontend +# - run: flutter pub get +# working-directory: ./frontend - - run: flutter build web - working-directory: ./frontend +# - run: flutter build web +# working-directory: ./frontend diff --git a/backend/Dockerfile b/backend/Dockerfile index b21b3c3..e399a4f 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -14,4 +14,4 @@ EXPOSE 8000 ENV NUM_WORKERS=1 ENV OSM_CACHE_DIR=/cache -CMD ["fastapi", "run", "src/main.py", "--port 8000", "--workers $NUM_WORKERS"] +CMD fastapi run src/main.py --port 8000 --workers $NUM_WORKERS diff --git a/backend/src/constants.py b/backend/src/constants.py index 9bb628c..1b57a3a 100644 --- a/backend/src/constants.py +++ b/backend/src/constants.py @@ -2,7 +2,8 @@ import logging.config from pathlib import Path import os -PARAMETERS_DIR = Path('src/parameters') +LOCATION_PREFIX = Path('src') +PARAMETERS_DIR = LOCATION_PREFIX / 'parameters' AMENITY_SELECTORS_PATH = PARAMETERS_DIR / 'amenity_selectors.yaml' LANDMARK_PARAMETERS_PATH = PARAMETERS_DIR / 'landmark_parameters.yaml' OPTIMIZER_PARAMETERS_PATH = PARAMETERS_DIR / 'optimizer_parameters.yaml' @@ -16,7 +17,7 @@ OSM_CACHE_DIR = Path(cache_dir_string) import logging import yaml -LOGGING_CONFIG = Path('log_config.yaml') +LOGGING_CONFIG = LOCATION_PREFIX / 'log_config.yaml' config = yaml.safe_load(LOGGING_CONFIG.read_text()) logging.config.dictConfig(config) diff --git a/backend/log_config.yaml b/backend/src/log_config.yaml similarity index 100% rename from backend/log_config.yaml rename to backend/src/log_config.yaml