Skip to content

Commit ddb5d3d

Browse files
whorkadoprdele
andauthored
feat: copy ondemand.d files on startup to configure OOD (#557)
* feat: copy ondemand.d files on startup to configure OOD * update docs with new `make dev_up` behavior * feat(ondemand): add loop configuration for file uploads --------- Co-authored-by: Evan Sarmiento <[email protected]>
1 parent 653f395 commit ddb5d3d

File tree

5 files changed

+24
-11
lines changed

5 files changed

+24
-11
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@ include tools/make/ood_versions.mk
77
COMPOSE_CMD = docker compose
88
WORKING_DIR := $(shell pwd)
99
DOC_BUILDER_IMAGE := python:3.11-slim
10+
WORKING_DIR := $(shell pwd)
11+
CONFIG_DIR := $(WORKING_DIR)/config
1012

1113
ENV := env OOD_IMAGE=$(OOD_IMAGE) OOD_UID=$(OOD_UID) OOD_GID=$(OOD_GID)
1214

1315
loop_up: loop_down
14-
$(ENV) $(COMPOSE_CMD) -p loop_passenger up --build || :
16+
$(ENV) $(COMPOSE_CMD) -p loop_passenger up --build -d || :
1517

1618
loop_down:
1719
$(ENV) $(COMPOSE_CMD) -p loop_passenger down -v || :
1820

1921
dev_up: dev_down
20-
$(ENV) $(COMPOSE_CMD) -f docker-compose.yml -f docker/docker-local-override.yaml -p loop_passenger up --build || :
22+
$(ENV) $(COMPOSE_CMD) -f docker-compose.yml -f docker/docker-local-override.yaml -p loop_passenger up --build -d
23+
# These must be copied not bind-mounted b/c docker will present bind-mounted files and being owned by the calling user but OOD requires that config files be owned by root when run in rails_env=production
24+
docker cp $(CONFIG_DIR)/ondemand.d passenger_loop_ood:/etc/ood/config
25+
docker exec -u 0 passenger_loop_ood chown -hR root:root /etc/ood/config/ondemand.d
2126

2227
dev_down:
2328
$(ENV) $(COMPOSE_CMD) -f docker-compose.yml -f docker/docker-local-override.yaml -p loop_passenger down -v || :

config/ondemand.d/.empty

Whitespace-only changes.

config/ondemand.d/loop.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
files_select_target:
2+
endpoint: /pun/sys/loop/connect
3+
label: "Send to Loop"
4+
title: "Send the selected files to the OnDemand Loop application for upload"
5+
icon: "fas://paper-plane"

docs/guide/content/development_guide/index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ make loop_build
1212
make dev_up
1313
```
1414
The `make dev_up` command starts the development environment using Docker Compose with local development configuration.
15-
It runs in the foreground, streaming logs from all containers to your terminal.
16-
The shell prompt will not return until you stop the environment manually.
15+
It runs in the background. The shell prompt will return immediately.
1716

18-
To stop the environment, press <kbd>Ctrl</kbd>+<kbd>C</kbd>. This will gracefully shut down all containers.
19-
Alternatively, in another terminal you can run: `make dev_down`
17+
To stop the environment, run:
2018

19+
```bash
20+
make dev_down
21+
```
2122
Once the containers are running visit [https://localhost:33000/pun/sys/loop](https://localhost:33000/pun/sys/loop) and log in with the test user `ood/ood`.
2223

2324
The documentation is organized by topic to help you find what you need quickly:

docs/guide/content/development_guide/local_environment.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,19 @@ make dev_up
5656
```
5757

5858
The `make dev_up` command starts the development environment using Docker Compose with local development configuration.
59-
It runs in the foreground, streaming logs from all containers to your terminal.
60-
The shell prompt will not return until you stop the environment manually.
59+
It runs in the background. The shell prompt will return immediately.
6160

62-
To stop the environment, press <kbd>Ctrl</kbd>+<kbd>C</kbd>. This will gracefully shut down all containers.
63-
Alternatively, in another terminal you can run: `make dev_down`
61+
To stop the environment, run:
62+
63+
```bash
64+
make dev_down
65+
```
6466

6567
#### Development vs Vanilla Environment
6668

6769
The project provides two different targets for running the application locally:
6870

69-
- **`make dev_up`** - **Recommended for development**. Uses additional volume mounts for local configuration and development files. This target loads both the main `docker-compose.yml` and the local override file `docker/docker-local-override.yaml`.
71+
- **`make dev_up`** - **Recommended for development**. Uses additional volume mounts and copies files for local configuration and development. This target loads both the main `docker-compose.yml` and the local override file `docker/docker-local-override.yaml`.
7072

7173
- **`make loop_up`** - **Vanilla installation**. Uses only the base Docker Compose configuration without local development overrides. Use this when you need to test the application in a configuration closer to production or for troubleshooting configuration issues.
7274

0 commit comments

Comments
 (0)