Skip to content

Commit

Permalink
[REF] Consolidate deployment recipes and refactor template.env (#46)
Browse files Browse the repository at this point in the history
* reorganize template.env

* remove deprecated deployment-specific recipes

* lift files + configs for full-stack recipe to root

* move setup.sh into scripts/

* make script executable

* update mount paths
- switch to relative paths to avoid creating duplicate directories

* update paths in scripts and create logs/ dir

* update README

* update compatibility tests

* More context in template.env and README

Co-authored-by: Sebastian Urchs <surchs@users.noreply.github.com>

* update environment variable table
- added new variables:
  - NB_GRAPH_ADMIN_PASSWORD
  - LOCAL_GRAPH_DATA
- split NB_API_PORT, NB_API_PORT_HOST, and NB_API_TAG into f-API and n-API

---------

Co-authored-by: Sebastian Urchs <surchs@users.noreply.github.com>
  • Loading branch information
alyssadai and surchs authored Apr 22, 2024
1 parent 6f89a2c commit 7bc5311
Show file tree
Hide file tree
Showing 22 changed files with 146 additions and 818 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/compatibility-test copy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
uses: actions/checkout@v4

- name: Rename files
working-directory: ./dev
working-directory: .
run: |
cp template.env .env
cp local_nb_nodes.template.json local_nb_nodes.json
- name: Run docker compose
working-directory: ./dev
working-directory: .
run: |
docker compose --profile full_stack up -d
Expand All @@ -34,9 +34,9 @@ jobs:
run: npm install

- name: wait for graph set up
working-directory: ./dev
working-directory: ./scripts
run: |
while ! tail -n 0 -f ./DEPLOY.log | grep -q "Finished setting up the Neurobagel graph backend."; do
while ! tail -n 0 -f ./logs/DEPLOY.log | grep -q "Finished setting up the Neurobagel graph backend."; do
:
done
echo "Finished setting up the Neurobagel graph backend."
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/compatibility-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
uses: actions/checkout@v4

- name: Rename files
working-directory: ./dev
working-directory: .
run: |
cp template.env .env
cp local_nb_nodes.template.json local_nb_nodes.json
sed -i 's/latest/nightly/g' .env
- name: Run docker compose
working-directory: ./dev
working-directory: .
run: |
docker compose --profile full_stack up -d
Expand All @@ -32,9 +32,9 @@ jobs:
run: npm install

- name: wait for graph set up
working-directory: ./dev
working-directory: ./scripts
run: |
while ! tail -n 0 -f ./DEPLOY.log | grep -q "Finished setting up the Neurobagel graph backend."; do
while ! tail -n 0 -f ./logs/DEPLOY.log | grep -q "Finished setting up the Neurobagel graph backend."; do
:
done
echo "Finished setting up the Neurobagel graph backend."
Expand Down
60 changes: 15 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,24 @@ For detailed instructions on the deployment options for Neurobagel, see the offi
### Using the full-stack Docker Compose file

1. Clone the repository
```bash
git clone https://github.com/neurobagel/recipes.git
```
```bash
git clone https://github.com/neurobagel/recipes.git
```

2. Copy and rename the required template configuration files
```bash
cp template.env .env
2. `cd` into the directory containing the Neurobagel deployment recipe
<!---
TODO: Change once we rename this directory for production!
-->
```bash
cd recipes/dev
```
# if also setting up local federation
cp local_nb_nodes.template.json local_nb_nodes.json
```

3. Copy and rename template files in the directory
```bash
cp template.env .env
Ensure to edit the configuration file(s) according to your deployment.

# if also setting up local federation
cp local_nb_nodes.template.json local_nb_nodes.json
```
Ensure to edit the file(s) according to your deployment.
:warning: **Note**: You **must** change the value of the `NB_API_QUERY_URL` variable in the `.env` file before you can launch any service stack that includes a query tool (i.e., `local_node_query`, `full_stack`).
See comments in the `.env` file for more information.

4. Start the Docker Compose stack and specify your desired deployment profile
3. In the repository root, start the Docker Compose stack and specify your desired deployment profile

**To set up only a local node:**
```bash
Expand All @@ -48,30 +44,4 @@ Ensure to edit the file(s) according to your deployment.
```bash
docker compose --profile full_stack up -d
```
A log file `DEPLOY.log` will be automatically created in the current directory with a copy of the STDOUT from the automatic deployment process.

### Using deployment type-specific Docker Compose files

**Note: These instructions will soon be superceded by the full-stack Docker Compose file instructions.**

1. Clone the repository
```bash
git clone https://github.com/neurobagel/recipes.git
```

2. `cd` into the directory containing the appropriate configuration files
for your deployment scenario.

3. Depending on your deployment scenario,
copy and/or rename the template files in the directory
and edit them accordingly:

`local_federation/`
- `local_nb_nodes.json`
- `.env`

`local_node/`
- `.env`

`local_node_with_query_tool/`
- `.env`
A log file `DEPLOY.log` will be automatically created under `scripts/logs/` with a copy of the STDOUT from the automatic deployment process.
File renamed without changes.
244 changes: 0 additions & 244 deletions dev/add_data_to_graph.sh

This file was deleted.

Loading

0 comments on commit 7bc5311

Please sign in to comment.