Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,3 @@
**/__archive__*
**/__pycache__*
/build

# ----------------------------------------------------------------
# FORCE RETAIN
# ----------------------------------------------------------------

!**/.gitkeep
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Example Rabbit MQ #

This repository provides an example implementation of a tool with a single feature `SEARCH-FILESYSTEM`,
This repository provides an example implementation of a tool with a single feature `SEARCH-FS`,
which upon performs the following:

- given a request payload;
Expand All @@ -29,6 +29,10 @@ which upon performs the following:

- [docker + CLI tools](https://docs.docker.com/engine/install)

- (optional) [Postman](https://www.postman.com).
Cf. the [wiki](https://github.com/raj-open/example-rabbit-mq/wiki/Postman-Setup)
for an prepared environment + collection.

NOTE: We primarily use Docker for local testing, in particular to spin up a Rabbit MQ server.

## Basic setup ##
Expand Down Expand Up @@ -192,6 +196,7 @@ Fill in `setup/requests.yaml` as follows:
label: 'Mock example'

options:
reset-queue: true # default is false - whether to clear (sub)queue for task at start of run
# skip-empty: true # false (default) => includes empty files; true => skips them
max-depth: 100 # limits depth of folder structure
max-items: 1_000_000 # limits number of items that can be logged
Expand Down
46 changes: 38 additions & 8 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,44 @@ For ease of use one can also run the demos as follows:

where `{name}` is the name of the subfolder, e.g. `"example-case-1"`.

> [!TIP]
> Call
>
> ```bash
> just demo "example-all"
> ```
>
> to run all the examples.
> [!TIP]
> Call one of
>
> ```bash
> just demo "example-all"
> just demos # equivalent command
> ```
>
> to run all the examples.

## Alternative via FastApi ##

In step 2 one can alternatively start the FastApi server
(via `just start-server` or `just docker-start-server`)
and send a POST-request to the endpoing `/feature/search-fs`
with JSON-body e.g.

```json
{
"ref": {
"location": "OS",
"path": "demo/example-case-1/requests.yaml"
}
}
```

to run `SEARCH-FS` against `example-case-1` or

```json
{
"ref": {
"location": "OS",
"path": "demo/example-all/requests.yaml"
}
}
```

to run `SEARCH-FS` against all cases.

## Results ##

Expand Down
1 change: 1 addition & 0 deletions demo/example-case-1/requests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
label: 'Demo Case 1'

options:
reset-queue: true
skip-empty: true
max-depth: 100
max-items: 10_000_000
Expand Down
1 change: 1 addition & 0 deletions demo/example-case-2/requests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
label: 'Demo Case 2'

options:
reset-queue: true
skip-empty: false
max-depth: 100
max-items: 10_000_000
Expand Down
1 change: 1 addition & 0 deletions demo/example-case-3/requests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
label: 'Demo Case 3'

options:
reset-queue: true
skip-empty: true
max-depth: 100
max-items: 10_000_000
Expand Down
1 change: 1 addition & 0 deletions demo/example-case-4/requests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
label: 'Demo Case 4'

options:
reset-queue: true
skip-empty: false
max-depth: 100
max-items: 10_000_000
Expand Down
1 change: 1 addition & 0 deletions demo/example-empty/requests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
label: 'Demo Empty'

options:
reset-queue: true
skip-empty: true
max-depth: 100
max-items: 10_000_000
Expand Down
1 change: 1 addition & 0 deletions demo/example-flat/requests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
label: 'Demo Flat'

options:
reset-queue: true
skip-empty: true
max-depth: 100
max-items: 10_000_000
Expand Down
20 changes: 7 additions & 13 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ secrets:

services:
# --------------------------------
# SERVICE: builds container
# SERVICES: main code base
# --------------------------------

base:
Expand All @@ -44,10 +44,6 @@ services:
stdin_open: true
user: root

# --------------------------------
# SERVICE: builds container
# --------------------------------

build:
image: local/examplerabbitmq:build

Expand All @@ -70,10 +66,6 @@ services:
echo "success"
'

# --------------------------------
# SERVICE: runs qa steps
# --------------------------------

qa:
image: local/examplerabbitmq:build # <- i.e. use this image
env_file:
Expand All @@ -93,7 +85,7 @@ services:
'

# --------------------------------
# SERVICE: starts server
# SERVICES: server
# --------------------------------

server:
Expand All @@ -111,16 +103,18 @@ services:
- type: bind
source: ${PATH_LOGS}
target: //home/basicuser/app/logs
- ./setup://home/basicuser/app/setup:ro
- ./demo://home/basicuser/app/demo:ro
- ./data://home/basicuser/app/data:rw
- ./setup://home/basicuser/app/setup:ro

# # for debugging
# volumes:
# - type: bind
# source: ${PATH_LOGS}
# target: //home/basicuser/app/logs
# - ./setup://home/basicuser/app/setup:ro
# - ./demo://home/basicuser/app/demo:ro
# - ./data://home/basicuser/app/data:rw
# - ./setup://home/basicuser/app/setup:ro
# - ./scripts://home/basicuser/app/scripts:ro
# - ./src://home/basicuser/app/src:ro
# - ./tests://home/basicuser/app/tests:ro
Expand Down Expand Up @@ -160,7 +154,7 @@ services:
'

# --------------------------------
# SERVICE: queue
# SERVICES: queue
# --------------------------------

queue-build:
Expand Down
1 change: 1 addition & 0 deletions docs/models/application/Models/RequestTaskOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **reset-queue** | **Boolean** | Whether to clear queue before execution | [optional] [default to false] |
| **skip-empty** | **Boolean** | Whether to only include non-empty files | [optional] [default to false] |
| **max-depth** | **Integer** | Limits the search depth | [optional] [default to 50] |
| **max-items** | **Integer** | Limits the amount of items that can be found | [optional] [default to 1000000] |
Expand Down
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ create-mocks *args:
demo name:
@just run SEARCH-FS --requests "demo/{{name}}/requests.yaml"

demos:
@just demo "example-all"

# --------------------------------
# TARGETS: terminate execution
# --------------------------------
Expand Down
5 changes: 5 additions & 0 deletions models/schema-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ components:
- max-duration
additionalProperties: true
properties:
reset-queue:
description: |-
Whether to clear queue before execution
type: boolean
default: false
skip-empty:
description: |-
Whether to only include non-empty files
Expand Down
Loading