-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Diógenes Fernandes <[email protected]>
- Loading branch information
Showing
2 changed files
with
14 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,14 @@ | ||
# Search worker | ||
|
||
To setup your local environment for this project: | ||
|
||
1. Copy the `.example.dev.vars` to a new `.dev.vars` file in the same folder. | ||
2. Postgres Search data: | ||
|
||
- Go to `search/pg-indexer` folder and run `PG_CONNECTION_STRING=postgres://postgres:secret@localhost:5432/postgres?sslmode=disable go run . ` to populate the postgres search. | ||
|
||
3. R2 data from providers: | ||
The Search worker is used as the backend that route requests on our Cloudflare Worker. Static files are served from R2 directly and search goes to our serverless Neon Database. There's a cache in Cloudflare worker as well that is handled by this application. | ||
|
||
Go to the `backend` folder and run: | ||
## Installation | ||
|
||
``` | ||
go run ./cmd/generate/ --licenses-file ../licenses.json --tofu-binary-path=$(which tofu) --destination-dir /tmp/registry --namespace <namespace> | ||
``` | ||
|
||
to generate for a namespace and for a full load use: | ||
|
||
``` | ||
go run ./cmd/generate/ --licenses-file ../licenses.json --tofu-binary-path=$(which tofu)$ --destination-dir /tmp/registry | ||
``` | ||
To setup your local environment for this project: | ||
|
||
This will create a folder in /tmp/registry with all the registry data. | ||
1. Copy the `.example.dev.vars` to a new `.dev.vars` file in the same folder. | ||
2. When running docker-compose, the whole folder will be copied, so you can overwrite `.dev.vars` with your environment variables. | ||
|
||
To load these files into our R2 local bucket, use the script: | ||
## Feeding data | ||
|
||
``` | ||
cd search/worker && npm run feed-data | ||
``` | ||
There's a `Makefile` folder on the root with commands to setup the data in this application. |