Lambda server setup

I’m testing the lambda functionality and for that I need the lambda server. I have a docker-compose file that setups alpha, zero and lambda containers.

Here is the docer-compose:

version: "3.8"
services:
  zero1:
    image: dgraph/dgraph:latest
    working_dir: /data/zero1
    ports:
      - 5080:5080
      - 6080:6080
    labels:
      cluster: test
      service: zero1
    volumes:
      - data-volume:/dgraph
    command: dgraph zero --my=zero:5080 --replicas 3

  alpha1:
    image: dgraph/dgraph:latest
    working_dir: /data/alpha1
    volumes:
      - data-volume:/dgraph
    ports:
      - 8080:8080
      - 9080:9080
    labels:
      cluster: test
      service: alpha1
    command: dgraph alpha --my=alpha1:8080 --zero=zero:5080
  lambda:
    image: dgraph/dgraph-lambda:latest
    labels:
      cluster: test
    ports:
      - 8686:8686
    depends_on:
      - alpha1
    environment:
      DGRAPH_URL: http://localhost:8080
    volumes:
      - type: bind
        source: ./dgraphLambdaScripts.js
        target: /app/script/script.js
        read_only: true
volumes:
  data-volume:

Containers setup correctly but in alpha container i get thease kind of logs:

E0228 10:06:49.042653 19 groups.go:1148] Error during SubscribeForUpdates for prefix "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15dgraph.graphql.schema\x00": Unable to find any servers for group: 1. closer err: <nil>

I had similar error messages (prefixes with \x00 s prepended) when using different versions of alpha and ratel docker images. Each time I restarted the stack there were more \x00 prepended.
I have fixed the issue by making sure the versions matched, and removing the volume.

I think it would be useful if alpha/zero/ratel nodes exchanged info about their versions, and refused to start if their versions differ (unless overriden with --force-version-mismatch)

Yup this was the problem. There is no dgraph:latest container. Changed it to graph:master. and it started working. But then when i tried to upload schema it returned this message

resolving updateGQLSchema failed because unauthorized ip address: 172.18.0.1

Then I added this part to alpha command

--security "whitelist=172.18.0.1"

and afer that it started giving me the same errors as before.

E0301 12:30:10.913978 19 groups.go:1148] Error during SubscribeForUpdates for prefix "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15dgraph.graphql.schema\x00": error from client.subscribe: rpc error: code = Unavailable desc = connection closed. closer err: <nil>

Ok so i managed to find a docer-compose file from dgraphs github. There they used thease following command lines to start zero and alpha.
Zero:

dgraph zero --logtostderr -v=2 --bindall --expose_trace --profile_mode block --block_rate 10 --my=zero1:5080

Alpha:

dgraph alpha  --zero=zero1:5080 --expose_trace
--profile_mode block --block_rate 10 --logtostderr -v=2 --my=alpha1:7080
--security "whitelist=0.0.0.0/0"
--graphql "lambda-url=http://lambda:8686/graphql-worker;"
--trace "ratio=1.0;"

Whith tease lines i got it to work. If someone could please tell me what thease lines do and how to use them i would be super grateful!