Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/2.2.2 #130

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if( UNIX AND NOT APPLE )
set( default__fpa_flag TRUE )
endif( UNIX AND NOT APPLE )

set( CMAKE_CXX_STANDARD 17 )
set_to_max( CMAKE_CXX_STANDARD 17 )

option( Psyllid_ENABLE_ITERATOR_TIMING "Flag to enable iterator time profiling" FALSE )
option( Psyllid_ENABLE_FPA "Flag to enable the fast-packet-acquisition interface (requires root)" ${default__fpa_flag} )
Expand Down
30 changes: 25 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ SHELL ["/bin/bash", "-c"]
ARG psyllid_tag=beta
ARG psyllid_subdir=psyllid
ARG build_type=Release
ARG narg=2


ENV P8_ROOT=/usr/local/p8
ENV PSYLLID_TAG=${psyllid_tag}
ENV PSYLLID_INSTALL_PREFIX=${P8_ROOT}/${psyllid_subdir}/${PSYLLID_TAG}
ENV NARG=${narg}

ENV PATH="${PATH}:${PSYLLID_INSTALL_PREFIX}"

# Build image with dev dependencies
FROM base AS build
FROM base AS deps

# use quill_checkout to specify a tag or branch name to checkout
ARG quill_checkout=v7.3.0
ENV QUILL_CHECKOUT=${quill_checkout}

RUN apt-get update &&\
DEBIAN_FRONTEND=noninteractive apt-get install -y \
Expand All @@ -37,26 +44,38 @@ RUN apt-get update &&\
&&\
apt-get clean &&\
rm -rf /var/lib/apt/lists/* &&\
cd /usr/local &&\
git clone https://github.com/odygrd/quill.git &&\
cd quill &&\
git checkout ${QUILL_CHECKOUT} &&\
mkdir build &&\
cd build &&\
cmake .. &&\
make -j${narg} install &&\
cd / &&\
rm -rf /usr/local/quill &&\
/bin/true

# Build psyllid in the deps image
FROM deps AS build

COPY . /tmp_source

## store cmake args because we'll need to run twice (known package_builder issue)
## use `extra_cmake_args` to add or replace options at build time; CMAKE_CONFIG_ARGS_LIST are defaults
ARG extra_cmake_args=""
ENV CMAKE_CONFIG_ARGS_LIST="\
-D CMAKE_BUILD_TYPE=$build_type \
-D CMAKE_INSTALL_PREFIX:PATH=$PSYLLID_BUILD_PREFIX \
-D CMAKE_INSTALL_PREFIX:PATH=$PSYLLID_INSTALL_PREFIX \
-D Psyllid_ENABLE_FPA=FALSE \
${extra_cmake_args} \
${OS_CMAKE_ARGS} \
"

RUN mkdir -p /tmp_source/build &&\
cd /tmp_source/build &&\
cmake ${CMAKE_CONFIG_ARGS_LIST} .. &&\
cmake ${CMAKE_CONFIG_ARGS_LIST} .. &&\
make install &&\
make -j${NARG} install &&\
/bin/true

# Final production image
Expand All @@ -80,4 +99,5 @@ RUN apt-get update &&\
/bin/true

# for now we must grab the extra dependency content as well as psyllid itself
COPY --from=build $PSYLLID_BUILD_PREFIX $PSYLLID_BUILD_PREFIX
COPY --from=build /usr/local/lib /usr/local/lib
COPY --from=build $PSYLLID_INSTALL_PREFIX $PSYLLID_INSTALL_PREFIX
2 changes: 1 addition & 1 deletion documentation/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,6 @@ All `command` requests are lockable.
Put in its deactivated state, in which it is not immediately ready to take data. Psyllid must be in its activated state before this call.

.. toggle-header::
:header: ``quit-psyllid``
:header: ``quit``

Instruct the Psyllid executable to exit.
2 changes: 1 addition & 1 deletion source/applications/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set( psyllid_exe_PROGRAMS )

# Non-psyllid executables
set( programs
grab_packet
grab_packet.cc
)

pbuilder_executables(
Expand Down
3 changes: 3 additions & 0 deletions source/applications/grab_packet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,15 @@ int main( int argc, char** argv )
// Parse CL options and run the application
CLI11_PARSE( the_main, argc, argv );

STOP_LOGGING;

return RETURN_SUCCESS;
}
catch( std::exception& e )
{
LERROR( plog, "Caught an exception: " << e.what() );
}
STOP_LOGGING;
return RETURN_ERROR;
}

Expand Down
19 changes: 11 additions & 8 deletions source/applications/psyllid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ int main( int argc, char** argv )
"\t\t _/ _/ \n" <<
"\t\t_/ _/_/ \n\n");

unsigned return_val;
try
{
// The application
Expand All @@ -51,7 +52,7 @@ int main( int argc, char** argv )
auto t_cwrap = scarab::wrap_cancelable( the_conductor );
t_sig_hand.add_cancelable( t_cwrap );

the_conductor.execute( the_main.primary_config() );
the_conductor.execute( the_main.primary_config(), the_main.auth() );
} );

// Command line options
Expand All @@ -63,34 +64,36 @@ int main( int argc, char** argv )
// Parse CL options and run the application
CLI11_PARSE( the_main, argc, argv );

return the_conductor.get_return();
return_val = the_conductor.get_return();

}
catch( scarab::error& e )
{
LERROR( plog, "configuration error: " << e.what() );
return RETURN_ERROR;
return_val = RETURN_ERROR;
}
catch( psyllid::error& e )
{
LERROR( plog, "psyllid error: " << e.what() );
return RETURN_ERROR;
return_val = RETURN_ERROR;
}
catch( sandfly::error& e )
{
LERROR( plog, "sandfly error: " << e.what() );
return RETURN_ERROR;
return_val = RETURN_ERROR;
}
catch( std::exception& e )
{
LERROR( plog, "std::exception caught: " << e.what() );
return RETURN_ERROR;
return_val = RETURN_ERROR;
}
catch( ... )
{
LERROR( plog, "unknown exception caught" );
return RETURN_ERROR;
return_val = RETURN_ERROR;
}

return RETURN_ERROR;
STOP_LOGGING;

return return_val;
}
4 changes: 2 additions & 2 deletions source/control/daq_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ namespace psyllid
{
LOGGER( plog, "daq_control" );

daq_control::daq_control( const param_node& a_primary_config, std::shared_ptr< sandfly::stream_manager > a_mgr ) :
sandfly::run_control( a_primary_config, a_mgr ),
daq_control::daq_control( const param_node& a_primary_config, std::shared_ptr< sandfly::stream_manager > a_mgr, std::shared_ptr< sandfly::message_relayer > a_relay ) :
sandfly::run_control( a_primary_config, a_mgr, a_relay ),
f_use_monarch( true )
{
set_use_monarch( f_daq_config.get_value( "use-monarch", get_use_monarch() ) );
Expand Down
2 changes: 1 addition & 1 deletion source/control/daq_control.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace psyllid
{

public:
daq_control( const scarab::param_node& a_primary_config, std::shared_ptr< sandfly::stream_manager > a_mgr );
daq_control( const scarab::param_node& a_primary_config, std::shared_ptr< sandfly::stream_manager > a_mgr, std::shared_ptr< sandfly::message_relayer > a_relay );
virtual ~daq_control();

protected:
Expand Down
4 changes: 2 additions & 2 deletions source/daq/egg3_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* Author: laroque
*/

// ordering note: this is before egg3_reader.hh so that the Monarch operator<<'s are defined before logger.hh is included
#include "M3Monarch.hh"

#include "egg3_reader.hh"

#include "psyllid_error.hh"
#include "time_data.hh"

#include "M3Monarch.hh"

#include "run_control.hh"

#include "logger.hh"
Expand Down
2 changes: 1 addition & 1 deletion source/daq/packet_receiver_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ namespace psyllid
}
else // t_size_received < 0 && f_last_errno != EWOULDBLOCK && f_last_errno != EAGAIN
{
LWARN( "Unable to receive; error message: " << strerror( f_last_errno ) );
LWARN( plog, "Unable to receive; error message: " << strerror( f_last_errno ) );
}
}
}
Expand Down
Loading