diff --git a/docs/dev_services.md b/docs/dev_services.md --- a/docs/dev_services.md +++ b/docs/dev_services.md @@ -82,7 +82,7 @@ ### Running services in the sandbox -First, you need to initialize the local cloud using the following command from the the `services` directory: +First, you need to initialize the local cloud using the following command from the `services` directory: ``` yarn init-local-cloud @@ -90,22 +90,22 @@ This will start the LocalStack Docker image and initialize required resources, including DynamoDB tables and S3 buckets, using the Terraform scripts located in `services/terraform`. -To start a certain service in the sandbox you can run the following command: +To start any service in the sandbox, except Identity, you can run the following command: ``` -yarn run-[service-name]-service-in-sandbox +cargo run ``` -For example, for Tunnelbroker the command will look like this: +To run the Identity service for the first time, you need to configure its keys first: ``` -yarn run-tunnelbroker-service-in-sandbox +cargo run keygen ``` -You can also run all services at once in the sandbox using the command below: +Then you can start the service: ``` -yarn run-all-services-in-sandbox +cargo run server ``` ### Rebuilding the base image diff --git a/docs/nix_services_setup.md b/docs/nix_services_setup.md --- a/docs/nix_services_setup.md +++ b/docs/nix_services_setup.md @@ -6,10 +6,10 @@ ## LocalStack -We use LocalStack to emulate AWS services, allowing us to develop and test our services locally. To start LocalStack, run: +We use LocalStack to emulate AWS services, allowing us to develop and test our services locally. To start LocalStack, run from the `services` directory: ``` -comm-dev services start +yarn init-local-cloud ``` Make sure your LocalStack resources are up to date: diff --git a/docs/nix_services_workflows.md b/docs/nix_services_workflows.md --- a/docs/nix_services_workflows.md +++ b/docs/nix_services_workflows.md @@ -38,3 +38,12 @@ Again, replace `your-table` with the name of the name of the table you would like to inspect. These commands will give you an overview of your table’s structure and contents in LocalStack DynamoDB. + +### DynamoDB web UI + +You can also use a web UI, for example `dynamodb-admin` to view and edit DynamoDB tables. + +``` +npm install -g dynamodb-admin +DYNAMO_ENDPOINT=http://localhost:4566 AWS_REGION=us-east-2 npx dynamodb-admin --open +``` diff --git a/scripts/bin/comm-dev b/scripts/bin/comm-dev deleted file mode 100755 --- a/scripts/bin/comm-dev +++ /dev/null @@ -1,7 +0,0 @@ -#! /usr/bin/env bash - -# This is a command entrypoint so that the majority of the bash -# code can be linted by shellcheck - -PRJ_ROOT=$(git rev-parse --show-toplevel) -"$PRJ_ROOT"/scripts/comm-dev.sh $@ diff --git a/scripts/comm-dev.sh b/scripts/comm-dev.sh deleted file mode 100755 --- a/scripts/comm-dev.sh +++ /dev/null @@ -1,105 +0,0 @@ -#! /usr/bin/env bash - -# This is an entry for common development workflows like starting and stopping -# expensive services - -set -euo pipefail - -COMM_ROOT="$(git rev-parse --show-toplevel)" - -log() { - echo "$@" >&2 -} - -usage() { - echo "Comm Development" - echo "" - echo "Commands:" - echo " services - start or stop development services" - echo " db - restart MariaDB server" - echo "" - - exit 1 -} - -services_usage() { - echo "Comm Development Services" - echo "" - echo "Commands:" - echo " clean - stop services and clean caches" - echo " restart - restart services" - echo " start - start localstack and rabbitmq" - echo " stop - stop localstack and rabbitmq" - echo "" - - exit 1 -} - -services_command() { - case "$1" in - clean) - "$0" services stop || true - log "Cleaning RabbitMQ cache" - [[ -n "${RABBITMQ_HOME}" ]] && \ - rm -r "${RABBITMQ_HOME}" - ;; - restart) - "$0" services stop || true - "$0" services start - ;; - start) - nix run "$COMM_ROOT"#localstack-up - nix run "$COMM_ROOT"#rabbitmq-up - ;; - stop) - log "Stopping services" - nix run "$COMM_ROOT"#localstack-down - pkill rabbitmq-server beam.smp - ;; - *) - log "$(basename "$0"): unknown services option '$1'" - services_usage - ;; - esac -} - -db_usage() { - echo "Comm MariaDB Server" - echo "" - echo "Commands:" - echo " restart - restart MariaDB server" - echo "" - - exit 1 -} - -db_command() { - case "$1" in - restart) - pkill mariadbd - nix run .#mariadb-up - ;; - *) - log "$(basename "$0"): unknown db option '$1'" - db_usage - ;; - esac -} - -case "$1" in - -h|--help) - usage - ;; - services) - shift - services_command "$@" - ;; - db) - shift - db_command "$@" - ;; - *) - log "$(basename "$0"): unknown option '$1'" - usage - ;; -esac