Skip to content

Commit

Permalink
Merge pull request #51 from pkoutoupis/feature/rapiddiskd_api_daemon
Browse files Browse the repository at this point in the history
Feature/rapiddiskd api daemon
  • Loading branch information
pkoutoupis authored Oct 17, 2020
2 parents 59271bc + c4b0339 commit 21022b7
Show file tree
Hide file tree
Showing 37 changed files with 2,044 additions and 529 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*.order
*.swp
src/rapiddisk
src/rapiddiskd
test/rxflush
test/rxio
test/rxioctl
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
### Release 7.0.0 ###

- module: Updated for 5.8 kernels and later
- module: fixed cache status format typo
- daemon: Implement http-driven API to monitor/manage rapiddisk/cache functions
- utility: Removing support for RHEL / CentOS 6.x
- utility: Restructured userspace CLI
- test: Restructured and improved test framework
- misc: Code / documentation cleanup

### Release 6.1 ###

- kernel: added support for 5.7 kernel
Expand Down
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Building and Installing the rapiddisk kernel modules and utilities
Change into the project's parent directory path.

> To build the rapiddisk management utility, you will need to have the
> `libjansson` development library files installed on your host system.
> `libjansson` and `libmicrohttpd` development library files installed
> on your host system.
>
> You are required to having either the full kernel source or the kernel
> headers installed for your current kernel revision.
Expand Down Expand Up @@ -95,3 +96,31 @@ Uninstalling modules for DKMS support
```console
# make dkms-uninstall
```

Managing the RapidDisk daemon service
--------------------------------------------------------

After installation, to start the service via systemd:

```console
# systemctl start rapiddiskd.service
```

To check the status of the service via systemd:

```console
# systemctl status rapiddiskd.service
```

To stop the service via systemd:

```console
# systemctl stop rapiddiskd.service
```

To start the service at boot via systemd:

```console
# systemctl enable rapiddiskd.service
```

22 changes: 14 additions & 8 deletions conf/Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
CP := cp
RM := rm -rf
MKDIR := mkdir -pv
MKDIR := mkdir -pv -m 755
SERVICE = rapiddisk
CFG_DIR := /etc/$(SERVICE)/
SYSD_DIR := /etc/systemd/system
CHMOD := chmod
DIR := /etc/rapiddisk/

.PHONY: all
all:
@echo Nothing to do.

.PHONY: install
install: all
@echo Installing rapiddisk cluster files.
$(MKDIR) $(DESTDIR)$(DIR)
$(CP) rapiddisk.* $(DESTDIR)$(DIR)
$(CHMOD) -R 755 $(DESTDIR)$(DIR)
@echo Installing rapiddisk cluster and rapiddiskd daemon files.
$(MKDIR) $(DESTDIR)$(CFG_DIR)
$(CP) $(SERVICE).* $(DESTDIR)$(CFG_DIR)
$(CHMOD) -R 755 $(DESTDIR)$(CFG_DIR)
$(MKDIR) $(DESTDIR)$(SYSD_DIR)
$(CP) $(SERVICE)d.* $(DESTDIR)$(SYSD_DIR)
$(CHMOD) -R 755 $(DESTDIR)$(SYSD_DIR)

.PHONY: uninstall
uninstall:
@echo Uninstalling rapiddisk cluster files.
$(RM) $(DESTDIR)$(DIR)
@echo Uninstalling rapiddisk cluster and rapiddiskd daemon files.
$(RM) $(DESTDIR)$(CFG_DIR)
$(RM) $(DESTDIR)$(SYSD_DIR)/$(SERVICE)d.*

.PHONY: clean
clean:
Expand Down
11 changes: 11 additions & 0 deletions conf/rapiddiskd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=an enclosure monitoring daemon
After=network.target

[Service]
ExecStart=/sbin/rapiddiskd
Type=forking
Restart=always

[Install]
WantedBy=default.target
9 changes: 9 additions & 0 deletions pkg-mgmt/debian/changelog → debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
rapiddisk (7.0.0-1) released; urgency=medium
* module: Updated for 5.8 kernels and later
* module: fixed cache status format typo
* daemon: Implement http-driven API to monitor/manage rapiddisk/cache functions
* utility: Removing support for RHEL / CentOS 6.x
* utility: Restructured userspace CLI
* test: Restructured and improved test framework
* misc: Code / documentation cleanup

rapiddisk (6.1-1) released; urgency=medium
* kernel: added support for 5.7 kernel
* utility: fixed GCC compilation warnings
Expand Down
2 changes: 1 addition & 1 deletion pkg-mgmt/debian/control → debian/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: rapiddisk
Version: 6.1-1
Version: 7.0.0-1
Section: base
Priority: optional
Architecture: amd64
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions pkg-mgmt/debian/postinst → debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ fi
case "$1" in

configure)
dkms add -m rapiddisk -v 6.1
dkms build -m rapiddisk -v 6.1
dkms install -m rapiddisk -v 6.1
dkms add -m rapiddisk -v 7.0.0
dkms build -m rapiddisk -v 7.0.0
dkms install -m rapiddisk -v 7.0.0
echo "rapiddisk max_sectors=2048 nr_requests=1024" >> /etc/modules
echo "rapiddisk-cache" >> /etc/modules
echo "dm_mod" >> /etc/modules
Expand Down
File renamed without changes.
File renamed without changes.
199 changes: 199 additions & 0 deletions doc/API.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
Web server API revision 1

-------------------------
GET /v1/checkServiceStatus

ex) curl -s --output - 127.0.0.1:9118/v1/checkServiceStatus|jq .

status code: 200 (on success)

Check the status of the daemon. Example output:

{
"status": "OK",
"version": "7.0.0"
}

-------------------------
GET /v1/listAllResources

ex) curl -s --output - 127.0.0.1:9118/v1/listAllResources|jq .

status code: 200 (on success)

Retrieve system resource information. Example output:

{
"resources": [
{
"memory": [
{
"mem_total": 2084130816,
"mem_free": 229003264
}
]
},
{
"volumes": [
{
"device": "sda",
"size": 26843545600,
"vendor": "ATA",
"model": "VBOX"
}
]
}
]
}

-------------------------
GET /v1/listRapidDiskVolumes

ex) curl -s --output - 127.0.0.1:9118/v1/listRapidDiskVolumes|jq .

status code: 200 (on success)

Retrieve rapiddisk/cache information. Example output:

{
"volumes": [
{
"rapiddisk": [
{
"device": "rd1",
"size": 67108864
},
{
"device": "rd0",
"size": 67108864
}
]
},
{
"rapiddisk_cache": [
{
"device": "rc-wa_loop7",
"cache": "rd0",
"source": "loop7",
"mode": "write-around"
}
]
}
]
}

-------------------------
POST /v1/createRapidDisk/@size

ex) curl -X POST -s 127.0.0.1:9118/v1/createRapidDisk/128|jq .

status code: 200 (on success)

Create a rapiddisk volume. Example output:

{
"status": "Success"
}

-------------------------
POST /v1/resizeRapidDisk/@volume/@size

ex) curl -X POST -s 127.0.0.1:9118/v1/resizeRapidDisk/rd0/128|jq .

status code: 200 (on success)

Resize an existing rapiddisk volume. Example output:

{
"status": "Success"
}

-------------------------
POST /v1/flushRapidDisk/@volume

ex) curl -X POST -s 127.0.0.1:9118/v1/flushRapidDisk/rd0|jq .

status code: 200 (on success)

Flush the memory of an existing rapiddisk volume. Example output:

{
"status": "Success"
}

-------------------------
POST /v1/removeRapidDisk/@volume

ex) curl -X POST -s 127.0.0.1:9118/v1/removeRapidDisk/rd0|jq .

status code: 200 (on success)

Remove an existing rapiddisk volume. Example output:

{
"status": "Success"
}

-------------------------
POST /v1/createRapidDiskCache/@volume/@source/@policy

ex) curl -X POST -s 127.0.0.1:9118/v1/createRapidDiskCache/rd0/sdb/write-through|jq .

Supported caching policies:
* write-through
* write-around

status code: 200 (on success)

Create a rapiddisk-cache volume. Example output:

{
"status": "Success"
}

-------------------------
POST /v1/removeRapidDiskCache/@volume

ex) curl -X POST -s 127.0.0.1:9118/v1/removeRapidDiskCache/rc-wt_sdb|jq .

status code: 200 (on success)

Remove an existing rapiddisk-cache volume. Example output:

{
"status": "Success"
}

-------------------------
GET /v1/showRapidDiskCacheStats/@volume

ex) curl -s --output - 127.0.0.1:9118/v1/showRapidDiskCacheStats/rc-wt_sdb|tail -n1|jq .

status code: 200 (on success)

Retrieve cache statistics from an existing rapiddisk-cache volume. Example output:

{
"statistics": [
{
"cache_stats": [
{
"device": "rc-wt_loop7",
"reads": 527,
"writes": 1,
"cache_hits": 264,
"replacement": 0,
"write_replacement": 0,
"read_invalidates": 1,
"write_invalidates": 1,
"uncached_reads": 1,
"uncached_writes": 0,
"disk_reads": 263,
"disk_writes": 1,
"cache_reads": 264,
"cache_writes": 263
}
]
}
]
}
Loading

0 comments on commit 21022b7

Please sign in to comment.