Skip to content

Comments

Start Weaviate vector database as embedded#46

Open
shahariaazam wants to merge 5 commits intomainfrom
weaviate_vector_database_embedded
Open

Start Weaviate vector database as embedded#46
shahariaazam wants to merge 5 commits intomainfrom
weaviate_vector_database_embedded

Conversation

@shahariaazam
Copy link
Member

Embedded Weaviate is an experimental feature to run Weaviate as a embeddable vector database.

This is only supported with Python client. This PR follows the similar implementation like Python in Golang.

options := weaviate.Options{
		AdditionalEnvVars: map[string]string{
			"LOG_LEVEL": "debug",
		},
	}

logger := observability.NewDefaultLogger()

db, err := weaviate.AsEmbedded(options, logger)
if err != nil {
    logger.Fatalf("Failed to initialize embedded Weaviate: %v", err)
}

err = db.StartAndWatch()
if err != nil {
    logger.WithErr(err).Error("Shutdown completed with error")
} else {
    logger.Info("Shutdown completed successfully.")
}

The entire flow looks like:

2025/04/03 02:15:11 [DEBUG] Using default PersistenceDataPath
2025/04/03 02:15:11 [DEBUG] checking supported platform
2025/04/03 02:15:11 [DEBUG] ensuring necessary directories exist
2025/04/03 02:15:11 [DEBUG] determining download URL and version for Weaviate binary
2025/04/03 02:15:11 [version_tag=v1.26.6] [DEBUG] Using specific version
2025/04/03 02:15:11 [INFO] Constructed download URL: https://github.com/weaviate/weaviate/releases/download/v1.26.6/weaviate-v1.26.6-linux-amd64.tar.gz
2025/04/03 02:15:11 [binary_path=/home/shaharia/.cache/weaviate-embedded/weaviate-v1.26.6-020bb1d30e9d4ffa4fc06bdc284b08e6af9266fe3ed28086dbfa1cd605117848] [INFO] determined download URL and version for Weaviate binary
2025/04/03 02:15:11 [INFO] Starting embedded Weaviate and watching for signals...
2025/04/03 02:15:11 [grpc_port=50060 hostname=127.0.0.1 binary_path=/home/shaharia/.cache/weaviate-embedded/weaviate-v1.26.6-020bb1d30e9d4ffa4fc06bdc284b08e6af9266fe3ed28086dbfa1cd605117848 port=8079] [DEBUG] starting Weaviate process
2025/04/03 02:15:11 [DEBUG] ensuring binary exists
2025/04/03 02:15:11 [INFO] Weaviate binary already exists: /home/shaharia/.cache/weaviate-embedded/weaviate-v1.26.6-020bb1d30e9d4ffa4fc06bdc284b08e6af9266fe3ed28086dbfa1cd605117848
2025/04/03 02:15:11 [DEBUG] Starting Weaviate binary
2025/04/03 02:15:11 [INFO] Weaviate process started with PID 3517206
2025/04/03 02:15:11 [INFO] Waiting for Weaviate to be ready on http:8079 and grpc:50060...
2025/04/03 02:15:16 [DEBUG] Attempting to dial HTTP: 127.0.0.1:8079
2025/04/03 02:15:16 [DEBUG] Attempting to dial gRPC: [::1]:50060
2025/04/03 02:15:16 [INFO] Ports are now listening. HTTP: true, gRPC: true
2025/04/03 02:15:16 [INFO] Weaviate is ready!
2025/04/03 02:15:16 [INFO] Embedded Weaviate running. Press Ctrl+C to stop.
^C2025/04/03 02:15:19 [INFO] Received signal: interrupt. Shutting down Weaviate...
2025/04/03 02:15:19 [INFO] Attempting to stop Weaviate process with PID 3517206...
2025/04/03 02:15:20 [INFO] Process 3517206 terminated gracefully.
2025/04/03 02:15:20 [INFO] Weaviate stopped gracefully.
2025/04/03 02:15:20 [INFO] Shutdown completed successfully.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 3, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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

Successfully merging this pull request may close these issues.

1 participant