-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: nopayloadclient service #1428
Open
wdconinc
wants to merge
10
commits into
main
Choose a base branch
from
nopayloadclient
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c98ef05
feat: nopayloadclient service
wdconinc 75431a5
fix: payload WITH_SHARED_LIBRARY
wdconinc 5c21c4d
fix: FindCURL exposes CURL::libcurl
wdconinc 418b92a
fix: CURL::libcurl in lib only
wdconinc fd6ecf1
feat(ci): setup postgres and nopayloaddb as services in CI
wdconinc 479e5d7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a1e9570
fix: include full path to Log_service.h
wdconinc 8496447
fix(ci): jobs: build: strategy: fail-fast: false
wdconinc 29d994c
fix(ci): avoid fast-fail: false, but use 24.05.0 as 'old' env
wdconinc 0cec950
fix(ci): cli_npc checkConnection with default.json
wdconinc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ jobs: | |
release: nightly | ||
- CC: clang | ||
CMAKE_BUILD_TYPE: Release | ||
release: 24.04.0-stable | ||
release: 24.05.0-stable | ||
steps: | ||
- name: mmap rnd_bits workaround | ||
# https://github.com/actions/runner/issues/3207#issuecomment-2000066889 | ||
|
@@ -647,6 +647,86 @@ jobs: | |
path: rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}_${{ matrix.benchmark_plugins }}.hists.root | ||
if-no-files-found: error | ||
|
||
eicrecon-nopayloadclient: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
- npsim-gun | ||
strategy: | ||
matrix: | ||
CC: [clang] | ||
particle: [e] | ||
detector_config: [craterlake] | ||
services: | ||
db: | ||
image: postgres | ||
env: | ||
POSTGRES_DB: dbname | ||
POSTGRES_USER: login | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_HOST: localhost | ||
POSTGRES_PORT: 5432 | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
nopayloaddb-webapp: | ||
image: ghcr.io/eic/nopayloaddb-webapp:latest | ||
env: | ||
POSTGRES_DB: dbname | ||
POSTGRES_USER: login | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_HOST: localhost | ||
POSTGRES_PORT: 5432 | ||
ports: | ||
- 8000:8000 | ||
steps: | ||
- name: Checkout .github | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: .github | ||
- name: Download install directory | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: install-${{ matrix.CC }}-eic-shell-Release-${{ env.platform }}-${{ env.release }} | ||
- name: Uncompress install directory | ||
run: tar -xaf install.tar.zst | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root | ||
- uses: cvmfs-contrib/github-action-cvmfs@v4 | ||
- name: Run EICrecon | ||
uses: eic/run-cvmfs-osg-eic-shell@main | ||
with: | ||
platform-release: "${{ env.platform }}:${{ env.release }}" | ||
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | ||
run: | | ||
export NOPAYLOADCLIENT_CONF=$PWD/default.json | ||
cat <<- EOF > $NOPAYLOADCLIENT_CONF | ||
{ | ||
"base_url": "localhost:8000", | ||
"api_res": "/api/cdb_rest/", | ||
"write_dir": "/tmp/remote_pl_store/", | ||
"read_dir_list": ["/tmp/remote_pl_store/", "/cvmfs/place/holder/"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove place holder. |
||
"n_retries": 5, | ||
"retry_sleep_mean": 30, | ||
"cache_life_time": 10, | ||
"cache_max_mb": 1, | ||
"print_time_stamps": false, | ||
"use_fake_backend": false, | ||
"logger": "terminal", | ||
"log_level": "INFO" | ||
} | ||
EOF | ||
cli_npc checkConnection | ||
export DETECTOR_CONFIG=${DETECTOR}_${{ matrix.detector_config }} | ||
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH | ||
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins:/usr/local/plugins | ||
$PWD/install/bin/eicrecon -Ppodio:output_file=rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -Pplugins=dump_flags,janadot,janatop -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json -Pjana:warmup_timeout=0 -Pjana:timeout=0 | ||
|
||
eicrecon-gun: | ||
runs-on: ubuntu-latest | ||
needs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
# Automatically set plugin name the same as the directory name Don't forget | ||
# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in | ||
# its name | ||
get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) | ||
|
||
# Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets | ||
# Setting default includes, libraries and installation paths | ||
plugin_add(${PLUGIN_NAME} WITH_SHARED_LIBRARY) | ||
|
||
# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then | ||
# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds | ||
# headers to the correct installation directory | ||
plugin_glob_all(${PLUGIN_NAME}) | ||
|
||
# Find dependencies | ||
plugin_add_nopayloadclient(${PLUGIN_NAME}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
// Copyright (C) 2024 Wouter Deconinck | ||
|
||
#include "Payload_service.h" | ||
|
||
#include <JANA/JException.h> | ||
#include <nlohmann/json.hpp> | ||
#include <nopayloadclient/nopayloadclient.hpp> | ||
|
||
Payload_service::Payload_service(JApplication *app) | ||
: m_client("EICrecon") { | ||
m_application = app; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
// Copyright (C) 2024 Wouter Deconinck | ||
|
||
#pragma once | ||
|
||
#include <JANA/JApplication.h> | ||
#include <JANA/Services/JServiceLocator.h> | ||
#include <nlohmann/json.hpp> | ||
#include <nopayloadclient/nopayloadclient.hpp> | ||
#include <string> | ||
|
||
class Payload_service : public JService | ||
{ | ||
public: | ||
explicit Payload_service(JApplication *app); | ||
~Payload_service() { }; | ||
|
||
private: | ||
|
||
Payload_service() = default; | ||
|
||
nopayloadclient::NoPayloadClient m_client; | ||
|
||
JApplication* m_application; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2022, David Lawrence | ||
// Subject to the terms in the LICENSE file found in the top-level directory. | ||
// | ||
// | ||
|
||
#include <JANA/JApplication.h> | ||
#include <memory> | ||
|
||
#include "services/log/Log_service.h" | ||
|
||
extern "C" { | ||
void InitPlugin(JApplication* app) { | ||
InitJANAPlugin(app); | ||
app->ProvideService(std::make_shared<Log_service>(app)); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can move
env
up to job scope.