Skip to content

Commit

Permalink
Better clean, tests from source image, upgrade reqs, fix shared pg conn
Browse files Browse the repository at this point in the history
  • Loading branch information
pomo-mondreganto committed Nov 27, 2022
1 parent 44db01e commit 9bd5d23
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
3 changes: 2 additions & 1 deletion backend/lib/helpers/singleton.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import json
from abc import ABCMeta, abstractmethod
from typing import TypeVar, Generic, Dict, Any
Expand All @@ -12,7 +13,7 @@ class Singleton(Generic[T], metaclass=ABCMeta):
@classmethod
def __get_key(cls, data: Dict[str, Any]):
rep = json.dumps(data, sort_keys=True)
return f'{cls.__module__}.{cls.__name__}-{rep}'
return f'{os.getpid()}.{cls.__module__}.{cls.__name__}-{rep}'

@staticmethod
@abstractmethod
Expand Down
32 changes: 16 additions & 16 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ async-timeout==4.0.2
autopep8==1.6.0
bidict==0.21.2
billiard==3.6.4.0
celery==5.2.3
celery==5.2.7
certifi==2020.12.5
charset-normalizer==2.1.0
click==8.0.3
Expand All @@ -13,42 +13,42 @@ click-repl==0.2.0
Deprecated==1.2.13
dnspython==1.16.0
eventlet==0.30.2
Flask==2.1.3
Flask==2.2.2
Flask-Cors==3.0.10
Flask-SocketIO==5.2.0
flower==1.1.0
Flask-SocketIO==5.3.2
flower==1.2.0
greenlet==1.1.2
gunicorn==20.1.0
hiredis==2.0.0
humanize==3.12.0
idna==3.3
importlib-metadata==4.12.0
itsdangerous==2.0.1
Jinja2==3.0.3
Jinja2==3.1.2
kombu==5.2.3
MarkupSafe==2.0.1
MarkupSafe==2.1.1
packaging==21.3
prometheus-client==0.14.1
prometheus-flask-exporter==0.20.2
prometheus-client==0.15.0
prometheus-flask-exporter==0.21.0
prompt-toolkit==3.0.18
psycopg2==2.9.3
psycopg2==2.9.5
pycodestyle==2.8.0
pydantic==1.9.1
pydantic==1.10.2
pyparsing==3.0.6
python-dateutil==2.8.1
python-engineio==4.3.3
python-socketio==5.7.1
pytz==2021.3
PyYAML==5.4.1
redis==4.3.4
python-socketio==5.7.2
pytz==2022.6
PyYAML==6.0
redis==4.3.5
requests==2.28.1
six==1.16.0
toml==0.10.2
tornado==6.1
typing-extensions==3.10.0.0
typing_extensions==4.4.0
urllib3==1.26.10
vine==5.0.0
wcwidth==0.2.5
Werkzeug==2.0.2
Werkzeug==2.2.2
wrapt==1.13.3
zipp==3.8.1
2 changes: 2 additions & 0 deletions cli/kube/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ def clean():

terraform_cache_path = constants.TERRAFORM_DIR / '.terraform'
utils.remove_dir(terraform_cache_path)

utils.remove_dir(constants.DOCKER_VOLUMES_DIR)
6 changes: 3 additions & 3 deletions docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ version: '2.4'
x-celery-test: &celery-test
build:
context: .
dockerfile: ./docker_config/celery/Dockerfile.fast
dockerfile: ./docker_config/celery/Dockerfile
args:
version: ${FORCAD_VERSION:-latest}
restart: "no"

x-service-test: &service-test
build:
context: .
dockerfile: ./docker_config/services/Dockerfile.fast
dockerfile: ./docker_config/services/Dockerfile
args:
version: ${FORCAD_VERSION:-latest}
restart: "no"
Expand All @@ -26,7 +26,7 @@ services:
initializer:
build:
context: .
dockerfile: ./docker_config/initializer/Dockerfile.fast
dockerfile: ./docker_config/initializer/Dockerfile
args:
version: ${FORCAD_VERSION:-latest}
restart: "no"
Expand Down
4 changes: 2 additions & 2 deletions scripts/release_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pushd "${BASE_DIR}" >/dev/null

IMAGE="ghcr.io/pomo-mondreganto/forcad_base:${VERSION}"

echo "[*] Building ${IMAGE}"
docker buildx build --platform linux/amd64,linux/arm64 -t "${IMAGE}" -f docker_config/base_images/backend.Dockerfile "$*" "${BASE_DIR}"
echo "[*] Building ${IMAGE}, base dir ${BASE_DIR}"
docker buildx build --platform linux/amd64,linux/arm64 -t "${IMAGE}" -f docker_config/base_images/backend.Dockerfile "$@" "${BASE_DIR}"

popd >/dev/null

Expand Down

0 comments on commit 9bd5d23

Please sign in to comment.