How to deploy weaviate with django BE on internet - trying Railway

Description

Hi, looking for any way how to deploy weaviate with django BE on internet. So far trying Railway service (https://railway.app/), but at this moment without much success.
All the things, django BE + Weaviate, works good on my local machine.
At the end I do not care that much about exact service provider, just looking for any functional and potencially easy to expand solution. BE can be on Railway and Weaviate on some other platform or any other combination or usage of diferent platform for deployment

Todos:
A) connect img2vec to weaviate
B) connect weaviate to django BE

A) connect img2vec to weaviate
with help chatGPT I create small github repo, to be albe deploy img2vec on Railway. It has basicly two files:

Dockerfile
FROM cr.weaviate.io/semitechnologies/img2vec-pytorch:resnet50

railway.toml

[build]
builder = "DOCKERFILE"
dockerfilePath = "Dockerfile"

[deploy]
startCommand = "python -m http.server 8080"

I was trying to setup public domain, because the internal does not work
https://art-db-img2vec-production.up.railway.app/
Port 8080

But the Railway service for Weaviate have in logs
img2vec-neural inference service not ready
the env variable in Weaviate service for IMAGE_INFERENCE_API is art-db-img2vec-production.up.railway.app:8080

B) connect weaviate to django BE
idealy keep the current v4 client, could be done with this, so far I did not make functional. First may need to resolve point A

client = weaviate.connect_to_custom(
    http_host=os.getenv("WEAVIATE_URL"),  # URL only, no http prefix
    http_port=443,
    http_secure=True,   # Set to True if https
    grpc_host=os.getenv("WEAVIATE_GPC_URL"),
    grpc_port=443,      # Default is 50051, WCD uses 443
    grpc_secure=True,   # Edit as needed
    auth_credentials=AuthApiKey(os.getenv("WEAVIATE_API_KEY")),
)

is this value mandatory?
one of the env varaibles in weaviate is
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'

what comes to my mind:

  1. rent some server and run all there (just do not have much experience with this)
  2. use the Railway template and figure out how to connect all the services together. This may need create service for img2vec and connect to Weavieate service. Plus connect Weavite to djange BE
    related posts:
  1. connect all these things in some other way, based on chatgpt or Claude instruction for example
  2. try to setup whole BE in one Railway service

Server Setup Information

  • Weaviate Server Version: http://cr.weaviate.io/semitechnologies/weaviate:1.24.7
  • Deployment Method: railway template and docker for img2vec
  • Multi Node? Number of Running Nodes: one node for Weaviate and one for img2vec-neural
  • Client Language and Version: python, v4
  • Multitenancy?: not sure, probably no?

Any additional Information

I am acctually not sure where to ask for help, it could be more related to Railway. I will keep trying to find solution on my own

Hi there!

I am a Django enthusiast my self :slight_smile: I was even thinking on an App that would help syncing a Django model to Weaviate, thru signals :thinking:

But I have seen some database level integrations and not sure it would be the best approach :grimacing:

Anyway, sorry my ignorance, but what is Django BE?

IMHO, the best and safest, considering you will be deploying Weaviate yourself, is to run everything on the same network and only expose what is necessary (I believe Django, on this case).

I am not familiar with railway :frowning:

From Weaviate side, you need to correctly expose both http and grpc endpoints and configure the client accordingly.

If you are using our hosted offerings, for example, we expose both http and grpc on the same port (443), but on different domains.

so whenever you call connect_to_weaviate_cloud (or deprecated connect_to_wcs), the client will basically produce a connect_to_custom considering those values.

the same goes to connect_to_local, that will use the values you can find in our docker compose.

From my experiences, those deployment automation tools are awesome, but will need some tweaking to get it all running.

So first I would make sure to make it work on a VPS, and from there, trying to replicate that deployment on, for example, Railway.

Let me know if this helps!!

Thanks

Thanks for response
Django BE - shortcut for Django backend. I got it from the group where I work, so maybe more local dialect
In the end, I running the weaviate task locally and populating the postgres db with the data that weaviate would otherwise return. I’ll probably come back to this later for things where it will need to be more live

1 Like

Oh, great!

I thought it was some app for Django :slight_smile:

Let me know if you need any help.

Thanks!

1 Like