From 7ff54a1112b12f44dc3252ae68131bc771bb8406 Mon Sep 17 00:00:00 2001 From: Bruno Domingues Date: Fri, 7 Nov 2025 15:08:50 -0300 Subject: [PATCH] SIENTIAPDE-1309: Improve Dockerignore, Gitignore, Dockerfile, README, model repository, tests, todo list and values.yaml files. --- .dockerignore | 21 +++++++++++++++++++ .gitignore | 3 ++- Dockerfile | 2 +- README.md | 8 ++++++- .../utils/repository/model_repository.py | 2 +- .../utils/repository/test_model_repository.py | 2 +- todo-list.txt | 2 -- values.yaml | 19 +++++++---------- 8 files changed, 41 insertions(+), 18 deletions(-) diff --git a/.dockerignore b/.dockerignore index 430ab98..14aa459 100644 --- a/.dockerignore +++ b/.dockerignore @@ -202,3 +202,24 @@ bin/local/ # Cache directories .cache/ cache/ + +# Development and configuration files +.env.example +requirements-dev.txt +pyproject.toml +sonar-project.properties +todo-list.txt +validate.sh +run_local.sh +LICENSE + +# Helm charts (development only) +sientia-module/ +*.yaml + +# Local directories +data/ +logs/ +models/ +temp/ +scripts/ diff --git a/.gitignore b/.gitignore index 7ef5963..bf259df 100644 --- a/.gitignore +++ b/.gitignore @@ -236,9 +236,10 @@ scouter/pipelines/**/triggers.yaml *.swp # Ignore test run reports in model_manager/reports -model_manager/reports/test_run_*/ +model_manager/reports/temp/test_run_*/ # Miscellaneous git_key* git_log tmp/ +sientia-module/ diff --git a/Dockerfile b/Dockerfile index 725a605..641b3b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ ENV PATH="/opt/venv/bin:$PATH" RUN pip install --upgrade pip setuptools wheel # Copy requirements files for better Docker layer caching -COPY requirements.txt requirements-dev.txt ./ +COPY requirements.txt ./ # Install only production dependencies with no cache RUN --mount=type=ssh echo "=== Installing dependencies ===" && \ diff --git a/README.md b/README.md index 8289dc1..d78a3f2 100644 --- a/README.md +++ b/README.md @@ -1089,12 +1089,18 @@ $ helm search repo sientia # List chart details $ helm show all sientia/sientia-module + +# Download chart to current directory +$ helm pull sientia/sientia-module --version 0.6.0 --untar + +# Remove chart directory +$ rm -rf sientia-module ``` ### Helm Install ```shell -$ helm upgrade --install sientia-dataops-model-manager sientia/sientia-module -n sientia --create-namespace -f ./values.yaml --version 0.5.0 +$ helm upgrade --install sientia-dataops-model-manager sientia/sientia-module -n sientia --create-namespace -f ./values.yaml --version 0.6.0 ``` ### Uninstall Helm Chart diff --git a/model_manager/utils/repository/model_repository.py b/model_manager/utils/repository/model_repository.py index ab1b093..5154f84 100644 --- a/model_manager/utils/repository/model_repository.py +++ b/model_manager/utils/repository/model_repository.py @@ -306,7 +306,7 @@ class ModelRepository: """ # Use microsecond precision to reduce collision probability timestamp = datetime.now().strftime('%Y%m%d_%H%M%S_%f') - run_dir = path.join(base_path, f'{run_name}_{timestamp}') + run_dir = path.join(base_path, 'temp', f'{run_name}_{timestamp}') try: makedirs(run_dir, exist_ok=True) diff --git a/tests/utils/repository/test_model_repository.py b/tests/utils/repository/test_model_repository.py index cbc25bc..a31cb42 100644 --- a/tests/utils/repository/test_model_repository.py +++ b/tests/utils/repository/test_model_repository.py @@ -289,7 +289,7 @@ def test_create_run_directory_success( result = repo._create_run_directory('/tmp/reports', 'test_run') # noqa: S108 - expected_path = os.path.join('/tmp/reports', 'test_run_20240101_120000_123456') # noqa: S108 + expected_path = os.path.join('/tmp/reports/temp', 'test_run_20240101_120000_123456') # noqa: S108 assert result == expected_path mock_makedirs.assert_called_once_with(expected_path, exist_ok=True) diff --git a/todo-list.txt b/todo-list.txt index 7e5e956..f9fee32 100644 --- a/todo-list.txt +++ b/todo-list.txt @@ -1,5 +1,3 @@ -- adiconar volume mounts por causa dos reports. - - Criar o dashboard do grafana. - Atualizar o .github/workflows/quality-gate.yml para usar os pipelines genéricos do github; diff --git a/values.yaml b/values.yaml index 2e55112..8ba2c9e 100644 --- a/values.yaml +++ b/values.yaml @@ -52,7 +52,6 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 1000 - resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little @@ -93,17 +92,15 @@ autoscaling: # targetMemoryUtilizationPercentage: 80 # Additional volumes on the output Deployment definition. -volumes: [] -# - name: foo -# secret: -# secretName: mysecret -# optional: false +volumes: + - name: reports-volume + emptyDir: + sizeLimit: 1Gi # Additional volumeMounts on the output Deployment definition. -volumeMounts: [] -# - name: foo -# mountPath: "/etc/foo" -# readOnly: true +volumeMounts: + - name: reports-volume + mountPath: "/app/model_manager/reports/temp" # Deployment strategy configuration # More information: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy @@ -246,7 +243,7 @@ ssh: # kubectl create secret docker-registry docker-hub-secret --namespace sientia --docker-server=http://aignosi.azurecr.io --docker-username=aignosi --docker-password=5I5zpQ6sRaHqX1hD3dr+2mo647yO3FRc359/wu6gsP+ACRDRz5mp -# helm upgrade --install sientia-dataops-model-manager sientia/sientia-module -n sientia --create-namespace -f ./values.yaml --version 0.5.0 +# helm upgrade --install sientia-dataops-model-manager sientia/sientia-module -n sientia --create-namespace -f ./values.yaml --version 0.6.0 # kubectl create secret generic git-ssh-key-sientia-model-manager-worker \ # --namespace sientia \