Skip to content

Commit

Permalink
Security update 12.2024 (#1405)
Browse files Browse the repository at this point in the history
* Security update 12.2024

* Fix AttributeError: 'super' object has no attribute '__sklearn_tags__'

* Trying to fix mypy complains

* Black reformating
  • Loading branch information
koropets authored Dec 12, 2024
1 parent 0601b1f commit 7d0c1ca
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 73 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*

# Fix CVE-2024-6345
RUN pip install setuptools==70.0.0
RUN pip install setuptools~=75.0

WORKDIR /code
RUN rm -rf /code/dist \
Expand All @@ -38,7 +38,7 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*

# Fix CVE-2024-6345
RUN pip install setuptools==70.0.0
RUN pip install setuptools~=75.0

# Install requirements separately for improved docker caching
COPY --from=builder /code/prereq.txt .
Expand Down Expand Up @@ -80,7 +80,7 @@ RUN cp ${HOME}/build.sh /usr/bin/build \
WORKDIR ${HOME}

#download & install argo
ENV ARGO_VERSIONS="[{\"number\":3,\"version\":\"3.5.11\"}]"
ENV ARGO_VERSIONS="[{\"number\":3,\"version\":\"3.6.2\"}]"
COPY scripts/download_argo.py ./download_argo.py
RUN python3 ./download_argo.py -o /usr/local/bin

Expand Down
14 changes: 10 additions & 4 deletions gordo/reporters/mlflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import logging
import os
import tempfile
from typing import Dict, List, Union, Tuple, Optional, Type, cast
from typing import Dict, List, Union, Tuple, Optional, Type, TypedDict, cast
from collections.abc import Sequence
from uuid import uuid4

from azureml.core import Workspace
Expand Down Expand Up @@ -34,6 +35,11 @@ class MlflowLoggingError(ReporterException):
pass


class LogBatchKwargs(TypedDict):
metrics: Sequence[Metric]
params: Sequence[Param]


def _validate_dict(d: dict, required_keys: List[str]):
"""
Validate the required keys are contained in provided dictionary
Expand Down Expand Up @@ -88,7 +94,7 @@ def get_mlflow_client(
"""
logger.info("Creating MLflow tracking client.")

tracking_uri = None
tracking_uri: str = ""

# Get AzureML tracking_uri if using Azure as backend
if workspace_kwargs:
Expand Down Expand Up @@ -278,7 +284,7 @@ def batch_log_items(
params: List[Param],
n_max_metrics: int = 200,
n_max_params: int = 100,
) -> List[Dict[str, Union[Metric, Param]]]:
) -> List[LogBatchKwargs]:
"""
Split metrics, params and tags to batches that satisfy limits imposed by MLFlow and AzureML
Expand Down Expand Up @@ -320,7 +326,7 @@ def _calc_n_batches(n: int, n_max: int):

i = 0
j = 0
log_batches = list()
log_batches: List[LogBatchKwargs] = list()
for _ in range(n_batches):
log_batches.append(
{
Expand Down
Loading

0 comments on commit 7d0c1ca

Please sign in to comment.