Skip to content

Commit

Permalink
Enable basic auth test again
Browse files Browse the repository at this point in the history
  • Loading branch information
burakince committed Dec 15, 2024
1 parent 4fd8ae6 commit 74237fd
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 27 deletions.
4 changes: 2 additions & 2 deletions docker-compose.aws-mysql-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
start_period: 5s
networks:
- aws_mysql_test_nw

Expand All @@ -36,7 +36,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
start_period: 5s
networks:
- aws_mysql_test_nw

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.aws-postgres-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
start_period: 5s
networks:
- aws_pg_test_nw

Expand All @@ -33,7 +33,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
restart: always
start_period: 5s
networks:
- aws_pg_test_nw

Expand Down
6 changes: 3 additions & 3 deletions docker-compose.azure-mysql-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ services:
test: ["CMD-SHELL", "nc -z localhost 10000 || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
retries: 5
start_period: 5s
volumes:
- ./test-containers/azurite/create-container.js:/create-container.js
- ./test-containers/azurite/run.sh:/run.sh
Expand All @@ -44,7 +44,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
start_period: 5s
networks:
- azure_mysql_test_nw

Expand Down
6 changes: 3 additions & 3 deletions docker-compose.azure-postgres-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ services:
test: ["CMD-SHELL", "nc -z localhost 10000 || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
retries: 5
start_period: 5s
volumes:
- ./test-containers/azurite/create-container.js:/create-container.js
- ./test-containers/azurite/run.sh:/run.sh
Expand All @@ -41,7 +41,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
restart: always
start_period: 5s
networks:
- azure_pg_test_nw

Expand Down
30 changes: 26 additions & 4 deletions docker-compose.basic-auth-mysql-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,52 @@ services:
ports:
- "9000:9000"
- "9001:9001"
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:9000/minio/health/live || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
networks:
- basic_auth_mysql_test_nw

mysql:
image: "mysql:${MYSQL_VERSION}"
container_name: mlflow-basic-auth-mysql-db
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: mlflow
MYSQL_USER: mlflow
MYSQL_PASSWORD: password
MYSQL_TCP_PORT: 3306
ports:
- "3306:3306"
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -prootpassword || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
networks:
- basic_auth_mysql_test_nw

usersdb:
image: "mysql:${MYSQL_VERSION}"
container_name: mlflow-basic-auth-users-mysql-db
environment:
MYSQL_ROOT_PASSWORD: userspassword
MYSQL_ROOT_PASSWORD: rootuserpassword
MYSQL_DATABASE: users
MYSQL_USER: users
MYSQL_PASSWORD: userspassword
MYSQL_TCP_PORT: 3306
ports:
- "3307:3306"
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -prootuserpassword || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
networks:
- basic_auth_mysql_test_nw

Expand All @@ -63,8 +81,12 @@ services:
volumes:
- ./test-containers/basic-auth/mysql/basic_auth.ini:/mlflow/basic_auth.ini
depends_on:
- minio
- mysql
minio:
condition: service_healthy
mysql:
condition: service_healthy
usersdb:
condition: service_healthy

networks:
basic_auth_mysql_test_nw:
Expand Down
7 changes: 4 additions & 3 deletions docker-compose.basic-auth-postgres-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
start_period: 5s
networks:
- basic_auth_pg_test_nw

Expand All @@ -34,7 +34,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
restart: always
start_period: 5s
networks:
- basic_auth_pg_test_nw

Expand All @@ -52,7 +52,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
restart: always
start_period: 5s
networks:
- basic_auth_pg_test_nw

Expand All @@ -76,6 +76,7 @@ services:
FLASK_ENV: development
DEBUG: True
GUNICORN_CMD_ARGS: --log-level debug
restart: always
ports:
- "8080:8080"
networks:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.gcp-mysql-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
start_period: 5s
networks:
- gcp_mysql_test_nw

Expand All @@ -31,7 +31,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
start_period: 5s
networks:
- gcp_mysql_test_nw

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.gcp-postgres-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
start_period: 5s
networks:
- gcp_pg_test_nw

Expand Down
2 changes: 2 additions & 0 deletions tests/test_basic_auth_mysql_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ def test_mysql_backended_model_upload_and_access_with_basic_auth(

assert "1" == r.json()["model_version"]["version"]
assert "READY" == r.json()["model_version"]["status"]

compose.stop()
16 changes: 9 additions & 7 deletions tests/test_basic_auth_postgres_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import re
import time

import pytest
# import pytest
import requests

import mlflow
Expand All @@ -12,12 +12,12 @@
from .extended_docker_compose import ExtendedDockerCompose


@pytest.mark.skip(
reason="""
auth alembic migrations getting duplicate key value violates unique constraint
`pg_type_typname_nsp_index` error and craches the gunicorn server
"""
)
# @pytest.mark.skip(
# reason="""
# auth alembic migrations getting duplicate key value violates unique constraint
# `pg_type_typname_nsp_index` error and craches the gunicorn server
# """
# )
def test_postgres_backended_model_upload_and_access_with_basic_auth(
test_model, training_params, conda_env
):
Expand Down Expand Up @@ -89,3 +89,5 @@ def test_postgres_backended_model_upload_and_access_with_basic_auth(

assert "1" == r.json()["model_version"]["version"]
assert "READY" == r.json()["model_version"]["status"]

compose.stop()

0 comments on commit 74237fd

Please sign in to comment.