You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development.md
+23-10Lines changed: 23 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ Follow the steps below to configure the necessary settings.
51
51
NMDC_SESSION_SECRET_KEY=changeme
52
52
NMDC_API_JWT_SECRET=changeme
53
53
```
54
-
54
+
55
55
### NERSC Credentials
56
56
57
57
To load production data or to run an ingest locally, you will need NERSC credentials.
@@ -196,7 +196,7 @@ Although the project is designed to be run in Docker, having the dependencies in
196
196
source .venv/bin/activate
197
197
pip install -e .
198
198
```
199
-
199
+
200
200
### Frontend dependencies
201
201
202
202
1. Install the frontend dependencies.
@@ -212,7 +212,7 @@ Run the full stack via Docker Compose:
212
212
<!-- TODO: Consider adding `--build` to this command so that Docker Compose builds
213
213
the containers, rather than pulling from from GHCR (unless you
214
214
want to use the versions that happen to currently be on GHCR).
215
-
This has to do with the fact that the `docker-compose.yml` file
215
+
This has to do with the fact that the `docker-compose.yml` file
216
216
contains service specs having both an `image` and `build` section. -->
217
217
218
218
```bash
@@ -250,16 +250,16 @@ yarn serve
250
250
<details>
251
251
<summary>Running yarn via npx?</summary>
252
252
253
-
When you run `$ npx yarn serve`while using a Node.js version newer than 17, the frontend development server may fail to start and may, instead, display the error code "`ERR_OSSL_EVP_UNSUPPORTED`".
253
+
When you run `$ npx yarn serve`while using a Node.js version newer than 17, the frontend development server may fail to start and may, instead, display the error code "`ERR_OSSL_EVP_UNSUPPORTED`".
254
254
255
-
You can work around that error by prefixing the command with "`NODE_OPTIONS=--openssl-legacy-provider`", as explained [here](https://stackoverflow.com/a/70582385) and shown below:
255
+
You can work around that error by prefixing the command with "`NODE_OPTIONS=--openssl-legacy-provider`", as explained [here](https://stackoverflow.com/a/70582385) and shown below:
View the main application at `http://127.0.0.1:8081/`. Changes to files in the `web` directory will automatically trigger a reload in your browser.
262
+
View the main application at `http://127.0.0.1:8081/`. Changes to files in the `web` directory will automatically trigger a reload in your browser.
263
263
264
264
>**Note**: An instance of the frontend application will continue to be served via Docker Compose on port `8080`, but that instance will not pick up changes to the `web` directory automatically. Be aware of which port you are accessing when doing frontend development.
265
265
@@ -271,7 +271,7 @@ It is recommended to use `127.0.0.1` instead of `localhost` for local developmen
271
271
272
272
>**Note**: This is not generally required unless you are specifically working on the ingest code. If you are working on the web application, simply [loading from a recent production backup](#load-production-data) is sufficient.
273
273
274
-
1. Ensure that you have completed the sections above about configuring your [NERSC credentials](#nersc-credentials) and [MongoDB credentials](#mongodb-credentials).
274
+
1. Ensure that you have completed the sections above about configuring your [NERSC credentials](#nersc-credentials) and [MongoDB credentials](#mongodb-credentials).
275
275
2. Obtain a new SSH key from NERSC if you haven't done so in the last 24 hours.
276
276
```bash
277
277
sshproxy.sh -u $NERSC_USER
@@ -288,8 +288,8 @@ It is recommended to use `127.0.0.1` instead of `localhost` for local developmen
288
288
-i ~/.ssh/nersc \
289
289
dtn01.nersc.gov
290
290
```
291
-
> That command will set up SSH port forwarding such that your computer can access the dev MongoDB server at `localhost:37018` and the prod MongoDB server at `localhost:37019`.
292
-
291
+
> That command will set up SSH port forwarding such that your computer can access the dev MongoDB server at `localhost:37018` and the prod MongoDB server at `localhost:37019`.
292
+
293
293
> From within a Docker container `host.docker.internal` can be used to access the `localhost` of your computer. When ingesting from the dev or prod MongoDB instances, be sure to set `NMDC_MONGO_HOST=host.docker.internal` in your `.env` file.
294
294
295
295
> See https://github.com/microbiomedata/infra-admin/blob/main/mongodb/connection-guide.md (internal) for more information on connecting to the MongoDB instances.
@@ -305,7 +305,7 @@ It is recommended to use `127.0.0.1` instead of `localhost` for local developmen
305
305
```bash
306
306
docker-compose run backend nmdc-server ingest -vv --function-limit 100
307
307
```
308
-
308
+
309
309
> **Note**: The `--function-limit` flag is optional. It is used to reduce the time that the ingest takes by limiting the number of certain types of objects loaded. This can be useful for testing purposes. For more information on options run `nmdc-server ingest --help`.
310
310
311
311
## Testing
@@ -314,6 +314,19 @@ It is recommended to use `127.0.0.1` instead of `localhost` for local developmen
314
314
tox
315
315
```
316
316
317
+
In order for the `py312` test suite to run properly, it needs to be able to communicate with a running `postgres` server and the fake GCS service. You can use the docker configuration to get these services up and running:
318
+
319
+
```bash
320
+
docker compose up db storage
321
+
```
322
+
323
+
You'll also need to set environment variables so the tests know where these resources can be found. If you're running the services via `docker compose`, then you can use the following values:
0 commit comments