hello, for a dynamodb deployment do you need to sp...
# help
u
hello, for a dynamodb deployment do you need to specify a specific hash key? I do not see anything regarding that in the documentation
u
Hi Dylan, Welcome to the lake! I'm not sure I fully understand your question. Do you mean for the key schema your table will use? And do you mean to ask if you need to specify it in lakeFS configuration or in your DynamoDB table configuration when you create it?
u
thanks for replying, and yes when building a dynamodb to use for lakeFS here:https://docs.lakefs.io/deploy/aws.html the hash or partition key is a required attribute
u
Hi Dylen, I'm not sure I understand where do you see any of those keys. Maybe you mean to the encryption key? It's needed for the auth (you can see it's under the auth section) For the DynamoDB you only need to mention the table name and region
u
Please let me know if it was helpful or you still missing something!
u
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_table required_arguments: hash_key, Attribute to use as the hash (partition) key. Must also be defined as an
attribute
. See below. but im wondering if you can just use anything there
u
Ho, I see the confusion here. You don't have to create a table for lakeFS, It's already created as part of the lakeFS setup. Maybe we can make sure this point is clearer on our docs.
u
Thank you for clearing my confusion, so if I want to run this on ecs, I would run the treeverse/lakefs:latest imagine and that builds the dynamodb table?
u
Yep 🙂
u
I appreciate your help! I will go through and try that out
u
Sure thing, feel free to reach out
u
What's the error message you get?
u
lakefs | time="2022-10-29T024428Z" level=fatal msg="Failed to open KV store" func=cmd/lakefs/cmd.glob..func6 file="cmd/run.go:117" error="missing dynamodb settings: driver configuration" lakefs exited with code 1
u
I'm not sure you need the dynamodb section in your compose file. Can you try to remove it and see if it helps?
u
sure
u
I think you should also remove it from the entrypoint params
u
I removed just the "dynamodb:8000", and it says lakefs | Error: you need to provide a host and port to test. lakefs | Usage: lakefs | host:port [-t timeout] [-- command args] lakefs | -q | --quiet Do not output any status messages lakefs | -t TIMEOUT | --timeout=timeout Timeout in seconds, zero for no timeout lakefs | -- COMMAND ARGS Execute command with args after the test finishes lakefs exited with code 2
u
I'll try to look more into this, but I believe something like this should do the job:
Copy code
version: '3'
services:
  lakefs:
    image: "${REPO:-treeverse}/lakefs:${TAG:-latest}"
    command: "${COMMAND:-run}"
    ports:
      - "8000:8000"
    depends_on:
      - "dynamodb"
    environment:
      - LAKEFS_AUTH_ENCRYPT_SECRET_KEY=some random secret string
      - LAKEFS_BLOCKSTORE_TYPE=${LAKEFS_BLOCKSTORE_TYPE:-local}
      - LAKEFS_BLOCKSTORE_LOCAL_PATH=/home/lakefs
      - LAKEFS_LOGGING_LEVEL=DEBUG
      - LAKEFS_DATABASE_DYNAMODB_ENDPOINT=<http://dynamodb:8000>
      - LAKEFS_DATABASE_TYPE=dynamodb
      - LAKEFS_DATABASE_KV_ENABLED=true
      - LAKEFS_DATABASE_DYNAMODB_AWS_REGION=us-east-1
      - LAKEFS_DATABASE_DYNAMODB_AWS_ACCESS_KEY_ID=AKIAIO5FODNN7EXAMPLE
      - LAKEFS_DATABASE_DYNAMODB_AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K3MDENG/bPxRfiCYEXAMPLEKEY
    entrypoint:
      [
        "/app/wait-for",
        "dynamodb:8000",
        "--",
        "/app/lakefs",
        "run"
      ]
  dynamodb:
    image: amazon/dynamodb-local
    container_name: my-dynamodb
    hostname: dynamodb
    restart: always
    volumes:
      - ./my-dynamodb-data:/home/dynamodblocal/data
    ports:
      - 6432:8000
    command: "-jar DynamoDBLocal.jar -sharedDb -dbPath /home/dynamodblocal/data/"
u
that worked, you're so helpful thank you so much. I will look through this to figure out what I need to do
u
Sure 🙂