Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker example: migration failed #3760

Open
KernelA opened this issue Apr 21, 2023 · 0 comments
Open

Docker example: migration failed #3760

KernelA opened this issue Apr 21, 2023 · 0 comments

Comments

@KernelA
Copy link

KernelA commented Apr 21, 2023

Cannot run an example in the docker because migration lead to error.

docker-compose.all.yaml

services:
    modeldb-backend:
        image: vertaaiofficial/modeldb-backend:2.0.8.1
        container_name: "modeldb-backend"
        expose:
            - "8085"
            - "8086"
        ports:
            - "8085:8085"
            - "8086:8086"
        networks:
            - modeldb_network
        environment:
            - VERTA_MODELDB_CONFIG:/config/config.yaml
            - LIQUIBASE_MIGRATION:true
        volumes:
            - ./backend/config:/config/
            - artifact-store:/artifact-store/

    modeldb-proxy:
        image: vertaaiofficial/modeldb-proxy:2.0.8.1
        container_name: "modeldb-proxy"
        environment:
            MDB_ADDRESS: "modeldb-backend:8085"
            SERVER_HTTP_PORT: "8080"
        expose:
            - "8080"
        ports:
            - "8080:8080"
        depends_on:
            - modeldb-backend
        networks:
            - modeldb_network

    modeldb-graphql:
        image: vertaaiofficial/modeldb-graphql:2.0.8.1
        container_name: "modeldb-graphql"
        environment:
            MDB_ADDRESS: "modeldb-backend:8085"
            SERVER_HTTP_PORT: "4000"
            QUERY_PATH: "/api/v1/graphql/query"
        expose:
            - "4000"
        ports:
            - "4000:4000"
        depends_on:
            - modeldb-backend
        networks:
            - modeldb_network

    modeldb-frontend:
        image: vertaaiofficial/modeldb-frontend:2.0.8.2
        container_name: "modeldb-frontend"
        expose:
            - "3000"
        ports:
            - "3000:3000"
        depends_on:
            - modeldb-proxy
            - modeldb-graphql
        environment:
            DEPLOYED: "yes"
            BACKEND_API_PROTOCOL: "http"
            BACKEND_API_DOMAIN: "modeldb-webapp:3000"
            MDB_ADDRESS: http://modeldb-proxy:8080
            ARTIFACTORY_ADDRESS: http://modeldb-backend:8086
            GQL_ADDRESS: http://modeldb-graphql:4000
        networks:
            - modeldb_network

    modeldb-database:
        image: mysql:5.7.42
        container_name: "modeldb-db"
        restart: always
        environment:
            MYSQL_ROOT_PASSWORD: root
            POSTGRES_USER: root
            MYSQL_DATABASE: modeldb
        networks:
            - modeldb_network
        volumes:
            - db-volume:/var/lib/mysql

networks:
    modeldb_network:


volumes:
    db-volume:
    artifact-store:

config.yaml

#This config is used by docker compose.
#ModelDB Properties
grpcServer:
  port: 8085

springServer:
  port: 8086
  shutdownTimeout: 30 #time in second

artifactStoreConfig:
  artifactStoreType: NFS #S3, GCP, NFS
  NFS:
    nfsUrlProtocol: http
    nfsRootPath: /artifact-store/
    artifactEndpoint:
      getArtifact: "api/v1/artifact/getArtifact"
      storeArtifact: "api/v1/artifact/storeArtifact"

# Database settings (type mongodb, couchbasedb, relational etc..)
database:
  DBType: relational
  timeout: 4
  liquibaseLockThreshold: 60 #time in second
  RdbConfiguration:
    RdbDatabaseName: modeldb
    RdbDriver: "com.mysql.cj.jdbc.Driver"
    RdbDialect: "org.hibernate.dialect.MySQL5Dialect"
    RdbUrl: "jdbc:mysql://modeldb-db:3306"
    RdbUsername: root
    RdbPassword: root # only for tests

# Test Database settings (type mongodb, couchbasedb etc..)
test:
  test-database:
    DBType: relational
    timeout: 4
    liquibaseLockThreshold: 60 #time in second
    RdbConfiguration:
      RdbDatabaseName: modeldb
      RdbDriver: "com.mysql.cj.jdbc.Driver"
      RdbDialect: "org.hibernate.dialect.MySQL5Dialect"
      RdbUrl: "jdbc:mysql://modeldb-db:3306"
      RdbUsername: root
      RdbPassword: root # only for tests

#ArtifactStore Properties
artifactStore_grpcServer:
  host: modeldb-backend
  port: 8086

cron_job:
  update_parent_timestamp:
    frequency: 10 #frequency to update parent timestamp in second, default 60
    record_update_limit: 100
  delete_entities:
    frequency: 60 #frequency to update parent timestamp in second, default 60
    record_update_limit: 100

telemetry:
  opt_in: true
  frequency: 1 #frequency to share data in hours, default 1
  consumer: https://app.verta.ai/api/v1/uac-proxy/telemetry/collectTelemetry
ai.verta.modeldb.ModelDBException: Migration failed for change set src/main/resources/liquibase/create-tables-changelog-1.0.xml::create-config_blob::raviS:
modeldb-backend   |      Reason: liquibase.exception.DatabaseException: Can't write; duplicate key in table 'config_blob' [Failed SQL: (1022) CREATE TABLE modeldb.config_blob (blob_hash VARCHAR(64) NOT NULL, config_seq_number INT NOT NULL, hyperparameter_type INT NULL, hyperparameter_set_config_blob_hash VARCHAR(64) NULL, hyperparameter_element_config_blob_hash VARCHAR(64) NULL, CONSTRAINT pk_config_blob PRIMARY KEY (blob_hash, config_seq_number), CONSTRAINT fk_hyperparameter_element_config_blob FOREIGN KEY (hyperparameter_element_config_blob_hash) REFERENCES modeldb.hyperparameter_element_config_blob(blob_hash), CONSTRAINT fk_hyperparameter_set_config_blob FOREIGN KEY (hyperparameter_set_config_blob_hash) REFERENCES modeldb.hyperparameter_set_config_blob(blob_hash))]
modeldb-backend   |     at ai.verta.modeldb.utils.ModelDBHibernateUtil.createOrGetSessionFactory(ModelDBHibernateUtil.java:268)
modeldb-backend   |     at ai.verta.modeldb.App.initializeServicesBaseOnDataBase(App.java:368)
modeldb-backend   |     at ai.verta.modeldb.App.main(App.java:263)
modeldb-backend   |     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
modeldb-backend   |     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
modeldb-backend   |     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
modeldb-backend   |     at java.base/java.lang.reflect.Method.invoke(Method.java:564)
modeldb-backend   |     at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
modeldb-backend   |     at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
modeldb-backend   |     at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
modeldb-backend   |     at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)
modeldb-backend   | Apr 21, 2023 10:00:07 AM org.apache.coyote.AbstractProtocol pause
modeldb-backend   | INFO: Pausing ProtocolHandler ["http-nio-8086"]
modeldb-backend   | *** NFS Server Shutdown ***
modeldb-backend   | {"thread":"main","level":"INFO","loggerName":"org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor","message":"Shutting down ExecutorService 'applicationTaskExecutor'","endOfBatch":false,"loggerFqcn":"org.apache.commons.logging.LogAdapter$Log4jLog","instant":{"epochSecond":1682071207,"nanoOfSecond":418000000},"threadId":1,"threadPriority":5,"hostName":"afb3470f725e","kubernetes.podIP":""}
modeldb-backend   | Apr 21, 2023 10:00:07 AM org.apache.coyote.AbstractProtocol pause
modeldb-backend   | INFO: Pausing ProtocolHandler ["http-nio-8086"]
modeldb-backend   | Apr 21, 2023 10:00:07 AM org.apache.catalina.core.StandardService stopInternal
modeldb-backend   | INFO: Stopping service [Tomcat]
modeldb-backend   | Apr 21, 2023 10:00:07 AM org.apache.coyote.AbstractProtocol stop
modeldb-backend   | INFO: Stopping ProtocolHandler ["http-nio-8086"]
modeldb-backend   | Apr 21, 2023 10:00:07 AM org.apache.coyote.AbstractProtocol destroy
modeldb-backend   | INFO: Destroying ProtocolHandler ["http-nio-8086"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant