Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/master-develop-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.9' ]
python-version: [ '3.10' ]

env:
POSTGRES_DB: mlflow
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.9' ]
python-version: [ '3.10' ]

env:
POSTGRES_DB: mlflow
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov .
pip install flake8 pytest pytest-cov torch .
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: start MLOps server
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.9' ]
python-version: [ '3.10' ]

env:
POSTGRES_DB: mlflow
Expand Down
2 changes: 1 addition & 1 deletion mlflow_server/mlflow/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.10-slim

ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
Expand Down
4 changes: 2 additions & 2 deletions mlflow_server/mlflow/requirements_mlflow.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mlflow==2.10.0
mlflow==3.11.1
psycopg2
psycopg2-binary
sqlalchemy
pymysql
boto3
requests==2.31.0
requests==2.33.0
16 changes: 11 additions & 5 deletions mlops/Experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@
import boto3
import docker
import mlflow
import torch.cuda
from git import Repo
from minio import Minio

from torch.cuda import is_available
from mlops import LOG_FILE
from mlops.ProjectFile import ProjectFile

logger = logging.getLogger(__name__)


def _cuda_available():
try:
subprocess.run(['nvidia-smi'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True)
return True
except (subprocess.CalledProcessError, FileNotFoundError):
return False


class Experiment:

def __init__(self, script, config_path, project_path: str = '.',
Expand Down Expand Up @@ -70,7 +76,7 @@ def check_gpu(self):
logger.debug(f'GPU resource not explicitly requested {e} defaulting to True')
request_gpu = True

logger.info(f'GPU requested: {request_gpu}, cuda_available {torch.cuda.is_available()}')
logger.info(f'GPU requested: {request_gpu}, cuda_available {_cuda_available()}')
if request_gpu:
return True
else:
Expand Down Expand Up @@ -285,9 +291,9 @@ def run(self, **kwargs):
logger.debug(f'Mounting shared env file for minio authentication to /root/.aws')
docker_args_default['v'] = '~/.aws/credentials:/root/.aws/credentials:ro'

if self.use_gpu and not is_available():
if self.use_gpu and not _cuda_available():
logger.warn('requested GPU resource but none available - using CPU')
elif self.use_gpu and is_available():
elif self.use_gpu and _cuda_available():
gpu_params = {'gpus': 'all',
'runtime': 'nvidia'}
logger.info('Adding docker args: {0}'.format(gpu_params))
Expand Down
2 changes: 1 addition & 1 deletion mlops/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__='0.10.0'
__version__='0.10.1'
10 changes: 2 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
mlflow==2.10.0
mlflow==3.11.1
boto3
docker
minio
pytest
colorlog
xnat
monai
itk
fsspec
tqdm
pandas
matplotlib
GitPython
PyYAML
requests==2.31.0
requests==2.33.0
click
setuptools
12 changes: 3 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,17 @@ long_description_content_type = text/markdown

[options]
packages = find:
python_requires = <3.12
python_requires = >=3.10
install_requires =
mlflow==2.10.0
mlflow>=3.11.1,<4.0.0
boto3
docker
minio
colorlog
monai
itk
pandas
matplotlib
xnat
GitPython
PyYAML
click
tqdm
requests==2.31.0
requests>=2.33.0

[options.entry_points]
console_scripts =
Expand Down
2 changes: 1 addition & 1 deletion tests/data/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.10-slim
RUN apt-get update && apt-get install -y git

# Configure application
Expand Down
6 changes: 3 additions & 3 deletions tests/data/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
numpy
-f https://download.pytorch.org/whl/torch_stable.html
torch==2.0.1+cpu
mlflow==2.10.0
torch==2.8.0
mlflow==3.11.1
boto3
requests==2.31.0
requests==2.33.0
Loading