Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

Hutch/improve local setup (#1601)

Will Hutchinson74ac8bedad95
diff --git a/RUNNING_LOCALLY.md b/RUNNING_LOCALLY.md
index d39c97e416..ed13272a40 100644
--- a/RUNNING_LOCALLY.md
+++ b/RUNNING_LOCALLY.md
@@ -11,45 +11,19 @@
## Local Setup
-### Setup SOPS
Export the **SOPS_KMS_ARN** (you can skip if you use nix-shell)
```bash
export SOPS_KMS_ARN = "arn:aws:kms:us-east-1:569036502058:key/mrk-cab29bf948044eb79005a81f48d40e93,arn:aws:kms:us-west-1:569036502058:key/mrk-cab29bf948044eb79005a81f48d40e93"
```
-You can run `just get_environment` to convert the encrypted sops file into a
-.env file. **Importantly**, if you modify the .env file then rerun
-`just get_environment` it will **wipe** any changes you made to the file.
-
-You can also run `just get_environment dev` to get all environment variables
-needed to run locally against dev assets. You will need to fill in the AWS
-credentials.
-
-### Setup Localstack
-You need to initialize the localstack with all local AWS constructs.
-
-To do this run the following:
-
-```bash
-just setup_localstack
-```
-
-### Setup Local MacroDB
-To instantiate macrodb run `just setup_local_dbs`.
-
-### Setup FusionAuth
-To setup local FusionAuth run `just infra/stacks/fusionauth-instance/setup`.
-Make sure you have already generated your .env file as FusionAuth needs to
-append values to it.
-
-### Building the base docker image
-We have a single "root" docker image that is used as a base for all services.
-To build this you can run `just rust/cloud-storage/build_dev_service_images`
+Run `just setup` to initialize your entire environment.
## Running
-You can run the services via `just run_local` or `just build_run_local` if you wanted to rebuild the base docker image.
+### Backend
+
+You can run the services via `just run_local`.
If you've updated the docker image after making changes to a service you'll need
to provide the `--build` flag in `just run_local` to trigger docker-compose to
@@ -57,3 +31,8 @@ update the containers.
By default we don't run **convert_service** or **search_processing_service**
locally as they are not needed by the frontend when using dev assets.
+
+### Frontend
+
+You can run the following command to get the frontend running pointed to local
+services `cd js/app && bun i && just local`.
diff --git a/docker-compose.yml b/docker-compose.yml
index 8d5d1ef69f..3b398983fd 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -81,30 +81,6 @@ services:
retries: 3
start_period: 10s
- # ============================================================================
- # convert_service (Port 8084)
- # Document format conversion - requires LibreOffice
- # ============================================================================
- convert_service:
- profiles:
- - processors
- <<: *common-env
- build:
- context: ./rust/cloud-storage
- dockerfile: Dockerfile.convert_service.dev
- target: convert_service
- ports:
- - "8084:8080"
- networks:
- - databases
- - services
- healthcheck:
- test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
- interval: 30s
- timeout: 10s
- retries: 3
- start_period: 10s
-
# ============================================================================
# document_cognition_service (Port 8085)
# Document analysis and processing
diff --git a/infra/stacks/fusionauth-instance/justfile b/infra/stacks/fusionauth-instance/justfile
index 9a07c50f38..da16d2b4ee 100644
--- a/infra/stacks/fusionauth-instance/justfile
+++ b/infra/stacks/fusionauth-instance/justfile
@@ -54,6 +54,7 @@ healthcheck:
# Sets up the local FusionAuth stack.
setup:
+ cd ../../ && bun i && cd -
just get_fusionauth_env
just start -d --wait
just healthcheck
diff --git a/justfile b/justfile
index d2ab94c892..ff7443d3fe 100644
--- a/justfile
+++ b/justfile
@@ -35,12 +35,6 @@ run_local *ARGS:
just create_networks
just docker_up {{ ARGS }}
-# Builds the main docker images for the services and runs the docker-compose
-# after
-build_run_local *ARGS:
- just rust/cloud-storage/build_dev_service_images
- just run_local {{ ARGS }}
-
# Stop all local services
stop-local:
docker compose down
@@ -82,3 +76,16 @@ docker_cache_clear_targets:
# Show BuildKit cache disk usage
docker_cache_usage:
docker builder du --verbose
+
+setup:
+ just get_environment
+ just create_networks
+ just setup_localstack
+ just setup_local_dbs
+ just infra/stacks/fusionauth-instance/setup
+ just rust/cloud-storage/build_dev_service_images
+ @echo "Setup complete."
+
+destroy:
+ just infra/stacks/fusionauth-instance/destroy
+ docker compose down -v
diff --git a/local_stack.just b/local_stack.just
index 5deb58e237..728d99fbc9 100644
--- a/local_stack.just
+++ b/local_stack.just
@@ -3,11 +3,12 @@ export AWS_PAGER := ""
# Start LocalStack for local AWS emulation
start_localstack:
+ docker rm -f localstack 2>/dev/null || true
docker run -d --name localstack \
--network databases \
-p 4566:4566 \
-e SERVICES=sqs,dynamodb,s3 \
- localstack/localstack 2>/dev/null || true
+ localstack/localstack
@echo "LocalStack started"
# Create SQS queues in LocalStack
diff --git a/rust/cloud-storage/justfile b/rust/cloud-storage/justfile
index 24160127e1..f23294d459 100644
--- a/rust/cloud-storage/justfile
+++ b/rust/cloud-storage/justfile
@@ -27,7 +27,6 @@ build:
# Build all dev service Docker images (pre-warms cache for run_local_build)
build_dev_service_images:
docker build -f Dockerfile.dev --target builder -t local-services .
- docker build -f Dockerfile.convert_service.dev --target builder -t local-convert-service .
docker build -f Dockerfile.search_processing_service.dev --target builder -t local-search-processing-service .
# Build all lambda functions
diff --git a/rust/cloud-storage/seed_cli/justfile b/rust/cloud-storage/seed_cli/justfile
index 416b65d75f..e9d6ac20a1 100644
--- a/rust/cloud-storage/seed_cli/justfile
+++ b/rust/cloud-storage/seed_cli/justfile
@@ -6,6 +6,8 @@ get_environment:
just ../../../infra/stacks/fusionauth-instance/insert_local_fusionauth_variables
@echo "Copying env file"
cp ../../../.env ./
+ @echo "Overriding FUSIONAUTH_BASE_URL"
+ sed -i '' 's|^FUSIONAUTH_BASE_URL=.*|FUSIONAUTH_BASE_URL="http://localhost:9011"|' .env
@echo "Overriding LOCAL_AWS_URL"
sed -i '' 's|^LOCAL_AWS_URL=.*|LOCAL_AWS_URL="http://localhost:4566"|' .env