OpenSTEF / openstef-reference

Deploy the entire OpenSTEF stack on your machine. Provides a reference implementation of the OpenSTEF stack including datamodels, databases and UI
Mozilla Public License 2.0
20 stars 7 forks source link

Can't run demo #32

Closed gecube closed 2 months ago

gecube commented 2 months ago

Good day!

If I am trying to run the proposed reference docker-compose, I see that not all services are running. Like migrations for mysql

pymysql.err.OperationalError: (3780, "Referencing column 'name' and referenced column 'name' in foreign key constraint 'registered_model_alias_name_fkey' are incompatible.")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/mlflow/cli.py", line 425, in server
    initialize_backend_stores(backend_store_uri, registry_store_uri, default_artifact_root)
  File "/usr/local/lib/python3.10/site-packages/mlflow/server/handlers.py", line 355, in initialize_backend_stores
    _get_tracking_store(backend_store_uri, default_artifact_root)
  File "/usr/local/lib/python3.10/site-packages/mlflow/server/handlers.py", line 332, in _get_tracking_store
    _tracking_store = _tracking_store_registry.get_store(store_uri, artifact_root)
  File "/usr/local/lib/python3.10/site-packages/mlflow/tracking/_tracking_service/registry.py", line 42, in get_store
    return self._get_store_with_resolved_uri(resolved_store_uri, artifact_uri)
  File "/usr/local/lib/python3.10/site-packages/mlflow/tracking/_tracking_service/registry.py", line 52, in _get_store_with_resolved_uri
    return builder(store_uri=resolved_store_uri, artifact_uri=artifact_uri)
  File "/usr/local/lib/python3.10/site-packages/mlflow/server/handlers.py", line 153, in _get_sqlalchemy_store
    return SqlAlchemyStore(store_uri, artifact_uri)
  File "/usr/local/lib/python3.10/site-packages/mlflow/store/tracking/sqlalchemy_store.py", line 170, in init
    mlflow.store.db.utils._initialize_tables(self.engine)
  File "/usr/local/lib/python3.10/site-packages/mlflow/store/db/utils.py", line 98, in _initialize_tables
    _upgrade_db(engine)
  File "/usr/local/lib/python3.10/site-packages/mlflow/store/db/utils.py", line 223, in _upgrade_db
    command.upgrade(config, "heads")
  File "/usr/local/lib/python3.10/site-packages/alembic/command.py", line 406, in upgrade
    script.run_env()
  File "/usr/local/lib/python3.10/site-packages/alembic/script/base.py", line 582, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/usr/local/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/local/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/lib/python3.10/site-packages/mlflow/store/db_migrations/env.py", line 86, in <module>
    run_migrations_online()
  File "/usr/local/lib/python3.10/site-packages/mlflow/store/db_migrations/env.py", line 80, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/usr/local/lib/python3.10/site-packages/alembic/runtime/environment.py", line 946, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/local/lib/python3.10/site-packages/alembic/runtime/migration.py", line 628, in run_migrations
    step.migration_fn(**kw)
  File "/usr/local/lib/python3.10/site-packages/mlflow/store/db_migrations/versions/3500859a5d39_add_model_aliases_table.py", line 27, in upgrade
    op.create_table(
  File "<string>", line 8, in create_table
  File "<string>", line 3, in create_table
  File "/usr/local/lib/python3.10/site-packages/alembic/operations/ops.py", line 1311, in create_table
    return operations.invoke(op)
  File "/usr/local/lib/python3.10/site-packages/alembic/operations/base.py", line 442, in invoke
    return fn(self, operation)
  File "/usr/local/lib/python3.10/site-packages/alembic/operations/toimpl.py", line 131, in create_table
    operations.impl.create_table(table)
  File "/usr/local/lib/python3.10/site-packages/alembic/ddl/impl.py", line 369, in create_table
    self._exec(schema.CreateTable(table))
  File "/usr/local/lib/python3.10/site-packages/alembic/ddl/impl.py", line 210, in _exec
    return conn.execute(construct, params)
  File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1418, in execute
    return meth(
  File "/usr/local/lib/python3.10/site-packages/sqlalchemy/sql/ddl.py", line 180, in _execute_on_connection

and mlflow.

Looking for some assistance.

P.S. I am trying to run the d-c on Mac Intel x64.

gecube commented 2 months ago

mlflow issue related to mysql defaults:

mysql> SHOW FULL COLUMNS FROM model_version_tags;
+---------+---------------+-------------------+------+-----+---------+-------+---------------------------------+---------+
| Field   | Type          | Collation         | Null | Key | Default | Extra | Privileges                      | Comment |
+---------+---------------+-------------------+------+-----+---------+-------+---------------------------------+---------+
| key     | varchar(250)  | latin1_swedish_ci | NO   | PRI | NULL    |       | select,insert,update,references |         |
| value   | varchar(5000) | latin1_swedish_ci | YES  |     | NULL    |       | select,insert,update,references |         |
| name    | varchar(256)  | latin1_swedish_ci | NO   | PRI | NULL    |       | select,insert,update,references |         |
| version | int           | NULL              | NO   | PRI | NULL    |       | select,insert,update,references |         |
+---------+---------------+-------------------+------+-----+---------+-------+---------------------------------+---------+
4 rows in set (0.01 sec)

and https://github.com/mlflow/mlflow/issues/9484