Commit eb025076 authored by Aaron Dees's avatar Aaron Dees
Browse files

Merge branch 'general_improvements' into 'devel'

General improvements

See merge request oilgas/ltfs/fiphoboserver!26
parents 57797cf6 018c0f78
Pipeline #1263 passed with stages
in 5 minutes and 45 seconds
# FIPhoboServer
## Dependencies Installation Instructions
FIPhoboServer has many dependencies that require much patience to build. It may be simpler to invoke a prebuilt Docker image using a Dockerfile such as;
FROM ciaranorourke/fiphoboserver:debian
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y install \
[personal installation preferences]
CMD /home/superfiphoboserver/tools/ -r && [favourite shell]
Alternatively, see [SuperFIPhoboServer](oilgas/ltfs/superfiphoboserver) for instructions on how to create your own build environment.
It is recommended to run this Docker image by mounting your local branch of the FIPhoboServer project with `docker run -it -v /path/to/fiphoboserver:/destination [name]:[tag]`
To use the Phobos raid1 layout which is compatible with FIFOs, the following environment variables must be set;
......@@ -7,16 +24,45 @@ export PHOBOS_STORE_layout=raid1
export PHOBOS_LAYOUT_RAID1_repl_count={1,2,3,...}
Build with
## Build Instructions
To configure and build FIPhoboServer, a C++14 compatible compiler is required, and CMake >= 3.0.
cmake -DCMAKE_PREFIX_PATH=/path/to/proxygen /path/to/CMakeLists/file/
# Make a directory to hold the temporary build files
mkdir -p build
# Change directory to the build directory
cd build
# Configure the FIPhoboServer build using CMake
cmake \
-DCMAKE_PREFIX_PATH=/path/to/proxygen \
[more options below] \
# Build the FIPhoboServer project
from any directory you want and hope for the best! ;)
### Useful Options
#### Setting Compile/Link Flags
Option | Effect
------ | ------
`-DCMAKE_CXX_COMPILER=...` | Set the C++ compiler.
`-DCMAKE_CXX_FLAGS=...` | Set the flags to pass to the C++ compiler. Overrides the default flags.
#### Enabling / Disabling Sections of FIPhoboServer
Option | Effect
------ | ------
`-DFIPHOBOSERVER_BUILD_TESTS=...` | Set to `ON` to build FIPhoboServer tests and enable the `make test` target, or `OFF` to skip (Default `OFF`).
`-DCUSTOM_DOCU_PATH=...` | Set to `doc/` to build FIPhoboServer documentation or don't set to skip (Default `not set`).
## Testing
Oh, make sure Phobos include directories are under `../phobos/src/include` from the main `CMakeLists.txt`, or change that path in there
Units test can be run with `make -C build tests`, given `FIPHOBOSERVER_BUILD_TESTS` was set to `ON` during the build process.
Integration tests can be run from the `test/integration_tests/` directory with `python -m unittest client`.
The Doxygen documentation can be found [here](doc/Markdown/fiphoboserver)
## Documentation
The Doxygen documentation can be found [here](doc/Markdown/fiphoboserver).
......@@ -45,7 +45,7 @@ void GetRequestHandler::onRequest(
m_file_closed = false; // TODO: Better way of communicating this
m_stream_completed = false; // TODO: Better way of communicating this
catch (const std::system_error& ex) {
......@@ -81,7 +81,7 @@ void GetRequestHandler::onRequest(
void GetRequestHandler::read_file(folly::EventBase* evb)
folly::IOBufQueue buf;
while (!m_file_closed && !m_paused) {
while (!m_stream_completed && !m_paused) {
/* read 4k-ish chunks and foward each one to the client */
auto data = buf.preallocate(4000, 4000);
......@@ -100,7 +100,7 @@ void GetRequestHandler::read_file(folly::EventBase* evb)
else if (rc == 0) {
// done
m_file_closed = true;
m_stream_completed = true;
VLOG(4) << "Read EOF";
evb->runInEventBaseThread([this] {
......@@ -103,7 +103,7 @@ class GetRequestHandler : public proxygen::RequestHandler {
bool m_read_file_scheduled{false};
std::atomic<bool> m_paused{false};
bool m_finished{false};
bool m_file_closed{false};
bool m_stream_completed{false};
} // namespace fiphoboserver
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment