Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,20 @@ tf-deploy: ## Deploy the app locally via Terraform
mkdir -p build/lambda
cp -r app/lambda/* build/lambda/

# docker run -it --platform=linux/amd64 --rm --entrypoint= -v $(PWD)/build/lambda:/tmp/lambda public.ecr.aws/lambda/python:3.11 pip install --upgrade --target /tmp/lambda -r /tmp/lambda/requirements.txt
docker run -it --platform=linux/amd64 --rm --entrypoint= -v $(PWD)/build/lambda:/tmp/lambda public.ecr.aws/lambda/python:3.11 pip install --upgrade --target /tmp/lambda -r /tmp/lambda/requirements.txt

# NOTE: SOMETIMES THE ARM64 VERSION WORKS, SOMETIMES THE AMD64 VERSION WORKS?
##### NOTE: SOMETIMES THE ARM64 VERSION WORKS, SOMETIMES THE AMD64 VERSION WORKS? #####
#docker run -it --platform=linux/arm64/v8 --rm --entrypoint= -v $(PWD)/build/lambda:/tmp/lambda public.ecr.aws/lambda/python:3.11 pip install --upgrade --target /tmp/lambda -r /tmp/lambda/requirements.txt

$(VENV_RUN); tflocal init; tflocal apply -auto-approve

requests: ## Send a couple of test requests to create entries in the database
endpoint=http://users-api.execute-api.localhost.localstack.cloud:4566/test/users; \
curl -H 'content-type: application/json' -d '{"name":"Alice","age":42}' $$endpoint; \
curl -H 'content-type: application/json' -d '{"name":"Bob","age":31}' $$endpoint; \
curl $$endpoint
test-lambda: ## Run Lambda API tests
$(VENV_RUN); pytest tests/test_lambda.py -v -s

format: ## Run ruff to format the whole codebase
$(VENV_RUN); python -m ruff format .; python -m ruff check --output-format=full --fix .

test: ## Run integration tests (requires LocalStack running with the Extension installed)
$(VENV_RUN); pytest tests
$(VENV_RUN); pytest tests/test_extension.py -v -s

.PHONY: clean install usage venv format test
.PHONY: clean install usage venv format test requests test-lambda tf-deploy
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ $ localstack extensions install "git+https://github.com/whummer/localstack-utils
## Start localstack

```
$ localstack start
$ DOCKER_FLAGS='-e TYPEDB_FLAGS=--development-mode.enabled=true' localstack start
```

Note: mac users may need to also run
(Note: developers of this repo should set the development mode flag to true to disable TypeDB's analytics)

Mac users may need to also run
```
$ sudo /Applications/Docker.app/Contents/MacOS/install vmnetd
```
Expand Down
Loading