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
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
!/src
!/src/**/
!/src/**/*.py
# the app-config (used internally for code only)
!/src/setup/*.yaml

!/tests
!/tests/**/
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
!/src
!/src/**/
!/src/**/*.py
# the app-config (used internally for code only)
!/src/setup/*.yaml

!/tests
!/tests/**/
Expand Down
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Example Rabbit MQ #

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

- given a request payload;
Expand Down Expand Up @@ -61,8 +61,6 @@ The main code base can be run in three modes:
- via the API
- via the API within docker

The cli-usage is limited

### Docker-free usage ###

For all sakes and purposes, so that local docker-less execution is possible,
Expand All @@ -73,6 +71,21 @@ just build
```

which assumes that the .env file has been correctly set up.
One can then either call

```bash
just run-server
```

to start the server
(which can be interacted with via Postman and/or cURL commands)
or else use the CLI:

```bash
just run-cli --help # displays usage
just run-cli version # displays version
just run-cli SEARCH-FS # runs the main feature
```

### Usage with docker ###

Expand All @@ -84,7 +97,13 @@ just docker-build # builds the application
just docker-qa # performs qa on the docker image of the main code base
```

To start the ap
to build the application (once),
then use the following commands to start/stop the server within docker:

```bash
just docker-start-server
just docker-stop-server
```

## Usage of Rabbit Message Queue ##

Expand Down Expand Up @@ -140,5 +159,6 @@ Password: ${HTTP_GUEST_PASSWORD_RABBIT}

## Execution ##

Start the queue (see [above](#activationdeactivation-of-queue)).
Start the server
1. Start the queue (see [above](#activationdeactivation-of-queue)).

2. Use the CLI commands or the API with/without docker (see [above](#usage-of-main-application)).
15 changes: 11 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ services:
user: basicuser
command: |-
bash --login -c '
source /run/secrets/credentials
just prettify || exit 1
just tests-unit || exit 1
'
Expand Down Expand Up @@ -115,7 +116,9 @@ services:

# # for debugging
# volumes:
# - ${PATH_LOGS}://home/basicuser/app/logs:rw
# - type: bind
# source: ${PATH_LOGS}
# target: //home/basicuser/app/logs
# - ./setup://home/basicuser/app/setup:ro
# - ./data://home/basicuser/app/data:rw
# - ./scripts://home/basicuser/app/scripts:ro
Expand Down Expand Up @@ -143,14 +146,18 @@ services:
# the healthcheck
test: |-
bash --login -c '
curl -f "${HTTP_IP}:${HTTP_PORT}/api/ping" || exit 1
curl -f "${HTTP_IP}:${HTTP_PORT}/ping" || exit 1
'

user: root
user: basicuser
# restart: unless-stopped
restart: no
# entrypoint: "//home/basicuser/app/scripts/entrypoint.sh"
command: just serve-fastapi
command: |-
bash --login -c '
source /run/secrets/credentials
just run-server
'

# --------------------------------
# SERVICE: queue
Expand Down
8 changes: 8 additions & 0 deletions docs/models/application/Models/EnumDataFileFormat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# EnumDataFileFormat
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

8 changes: 8 additions & 0 deletions docs/models/application/Models/EnumFeatures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# EnumFeatures
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

11 changes: 11 additions & 0 deletions docs/models/application/Models/FileRef.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# FileRef
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **location** | [**EnumFilesSystem**](EnumFilesSystem.md) | | [optional] [default to null] |
| **path** | **String** | Absolute path to file. | [optional] [default to .] |
| **format** | [**EnumDataFileFormat**](EnumDataFileFormat.md) | | [optional] [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

9 changes: 9 additions & 0 deletions docs/models/application/Models/GeneralConfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# GeneralConfig
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **version** | **String** | User defined version. Bump this value with every change to the config. | [optional] [default to X.Y.Z] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

16 changes: 16 additions & 0 deletions docs/models/application/Models/MetaData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# MetaData
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **filename** | **String** | Filename (without path, but with extension) | [default to null] |
| **basename** | **String** | Filename without path and without extension | [default to null] |
| **ext** | **String** | Extension of file | [default to null] |
| **size** | **Integer** | Size of file in bytes | [default to null] |
| **author** | **String** | Author of file | [optional] [default to null] |
| **author\_id** | **String** | Id of author of file | [optional] [default to null] |
| **time-created** | [**datetime**](datetime.md) | | [optional] [default to null] |
| **time-updated** | [**datetime**](datetime.md) | | [optional] [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

9 changes: 9 additions & 0 deletions docs/models/application/Models/ProxyConfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ProxyConfig
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **ref** | [**FileRef**](FileRef.md) | | [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

11 changes: 11 additions & 0 deletions docs/models/application/Models/RequestTask.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# RequestTask
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **label** | **String** | Label of task | [default to null] |
| **options** | [**Map**](AnyType.md) | Structure of requests payload > options NOTE: not yet implemented | [default to null] |
| **data** | [**RequestTaskData**](RequestTaskData.md) | | [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

9 changes: 9 additions & 0 deletions docs/models/application/Models/RequestTaskData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# RequestTaskData
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **inputs** | [**FileRef**](FileRef.md) | | [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

11 changes: 11 additions & 0 deletions docs/models/application/Models/RequestsPayload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# RequestsPayload
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **label** | **String** | Label of task | [default to null] |
| **options** | [**Map**](AnyType.md) | Structure of requests payload > options NOTE: not yet implemented | [default to null] |
| **data** | [**RequestTaskData**](RequestTaskData.md) | | [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

9 changes: 9 additions & 0 deletions docs/models/application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@ All URIs are relative to *https://acme.org*
<a name="documentation-for-models"></a>
## Documentation for Models

- [EnumDataFileFormat](./Models/EnumDataFileFormat.md)
- [EnumFeatures](./Models/EnumFeatures.md)
- [EnumFilesSystem](./Models/EnumFilesSystem.md)
- [FileRef](./Models/FileRef.md)
- [GeneralConfig](./Models/GeneralConfig.md)
- [MetaData](./Models/MetaData.md)
- [ProxyConfig](./Models/ProxyConfig.md)
- [RepoInfo](./Models/RepoInfo.md)
- [RepoInfo_urls](./Models/RepoInfo_urls.md)
- [RequestTask](./Models/RequestTask.md)
- [RequestTaskData](./Models/RequestTaskData.md)
- [RequestsPayload](./Models/RequestsPayload.md)


<a name="documentation-for-authorization"></a>
Expand Down
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ clear-logs log_path="${PATH_LOGS}":
@rm -rf "{{log_path}}" 2> /dev/null

create-logs log_path="${PATH_LOGS}":
@just create-logs-part "debug" "{{log_path}}"
@just create-logs-part "out" "{{log_path}}"
@just create-logs-part "err" "{{log_path}}"
@just _create-logs-part "debug" "{{log_path}}"
@just _create-logs-part "out" "{{log_path}}"
@just _create-logs-part "err" "{{log_path}}"

_create-logs-part part log_path="${PATH_LOGS}":
@mkdir -p "{{log_path}}"
Expand Down
Loading