Skip to content

Commit

Permalink
Release 5.12.4
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosbento committed Apr 24, 2024
2 parents 1cafe6c + 7e1cc73 commit 35f5ea5
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 26 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif()
find_package( ecbuild 3.4 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild ) # Before project()

# this will generate variables, see ACore/ecflow_version.h.in
project( ecflow LANGUAGES CXX VERSION 5.12.3 )
project( ecflow LANGUAGES CXX VERSION 5.12.4 )

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

Expand Down Expand Up @@ -58,7 +58,6 @@ option( ENABLE_UI_BACKTRACE "Print a UI debug backtrace" OFF )
option( ENABLE_UI_USAGE_LOG "Enable UI usage logging" OFF )
option( ENABLE_SSL "Enable SSL encrypted communication" ON )
option( ENABLE_PYTHON_PTR_REGISTER "Some compilers/boost versions do not register shared ptr automatically" OFF )
option( ENABLE_PYTHON_UNDEF_LOOKUP "Some boost/python versions are too closely linked" OFF )
option( ENABLE_HTTP "Enable HTTP server (experimental)" ON )
option( ENABLE_HTTP_COMPRESSION "Enable compression support by HTTP server" ON )
option( ENABLE_UDP "Enable UDP server (experimental)" ON )
Expand Down Expand Up @@ -192,7 +191,6 @@ endif()
ecbuild_info( "ENABLE_SERVER : ${ENABLE_SERVER}" )
ecbuild_info( "ENABLE_PYTHON : ${ENABLE_PYTHON}" )
ecbuild_info( "ENABLE_PYTHON_PTR_REGISTER : ${ENABLE_PYTHON_PTR_REGISTER}" )
ecbuild_info( "ENABLE_PYTHON_UNDEF_LOOKUP : ${ENABLE_PYTHON_UNDEF_LOOKUP}" )
ecbuild_info( "ENABLE_UI : ${ENABLE_UI}" )
ecbuild_info( "ENABLE_TESTS : ${ENABLE_TESTS} *if* disabled no need for boost test libs" )
ecbuild_info( "ENABLE_ALL_TESTS : ${ENABLE_ALL_TESTS}" )
Expand Down
8 changes: 7 additions & 1 deletion Http/src/ecflow/http/ApiV1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ static std::string get_tree_content_kind(const httplib::Request& request) {
return request.has_param(content) ? request.get_param_value(content) : "basic";
}

static bool get_tree_content_id_flag(const httplib::Request& request) {
constexpr const char* content = "with_id";
return request.has_param(content) ? (request.get_param_value(content) == "true" ? true : false) : false;
}

} // namespace

namespace v1 {
Expand Down Expand Up @@ -262,7 +267,8 @@ void node_tree_read(const httplib::Request& request, httplib::Response& response
num_cached_requests++;
const std::string path = request.matches[1];
std::string tree_kind = get_tree_content_kind(request);
ojson tree_content = (tree_kind == "full") ? get_full_node_tree(path) : get_basic_node_tree(path);
bool with_id = get_tree_content_id_flag(request);
ojson tree_content = (tree_kind == "full") ? get_full_node_tree(path, with_id) : get_basic_node_tree(path);
ojson j = filter_json(tree_content, request);
response.status = HttpStatusCode::success_ok;
response.set_content(j.dump(), "application/json");
Expand Down
4 changes: 2 additions & 2 deletions Http/src/ecflow/http/ApiV1Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ ojson get_basic_node_tree(const std::string& path) {
return tree.content();
}

ojson get_full_node_tree(const std::string& path) {
FullTree tree;
ojson get_full_node_tree(const std::string& path, bool with_id) {
FullTree tree{with_id};
DefsTreeVisitor(get_defs(), tree).visit_at(path);
return tree.content();
}
Expand Down
2 changes: 1 addition & 1 deletion Http/src/ecflow/http/ApiV1Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
namespace ecf::http {

ojson get_basic_node_tree(const std::string& path);
ojson get_full_node_tree(const std::string& path);
ojson get_full_node_tree(const std::string& path, bool with_id);
ojson get_sparser_node_tree(const std::string& path);

void add_suite(const httplib::Request& request, httplib::Response& response);
Expand Down
23 changes: 19 additions & 4 deletions Http/src/ecflow/http/TreeGeneration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,16 @@ struct BasicTree

struct FullTree
{
FullTree() : root_(ojson::object({})), stack_{&root_} {}
FullTree(bool with_id) : root_(ojson::object({})), stack_{&root_}, with_id_{with_id} {}

void begin_visit(const Suite& suite) {
ojson& parent_ = *stack_.back();
ojson& current = parent_[suite.name()] = ojson::object({});

current["type"] = "suite";
if (with_id_) {
current["id"] = suite.absNodePath();
}
publish_state(suite, current);
publish_attributes(suite, current);

Expand All @@ -84,6 +87,9 @@ struct FullTree
ojson& current = parent_[family.name()] = ojson::object({});

current["type"] = "family";
if (with_id_) {
current["id"] = family.absNodePath();
}
publish_state(family, current);
publish_attributes(family, current);

Expand All @@ -98,6 +104,9 @@ struct FullTree
ojson& current = parent_[task.name()] = ojson::object({});

current["type"] = "task";
if (with_id_) {
current["id"] = task.absNodePath();
}
publish_state(task, current);
publish_attributes(task, current);

Expand All @@ -113,13 +122,14 @@ struct FullTree
stack_.push_back(&current);

current["type"] = "alias";
if (with_id_) {
current["id"] = alias.absNodePath();
}
publish_state(alias, current);
publish_attributes(alias, current);
}

void end_visit(const Alias& alias [[maybe_unused]]) {
// Nothing to do...
}
void end_visit(const Alias& alias [[maybe_unused]]) { stack_.pop_back(); }

const ojson& content() const { return root_; }

Expand Down Expand Up @@ -225,11 +235,16 @@ struct FullTree
for (const auto& attr : node.generics()) {
array.emplace_back(publish_atribute(attr, "generic"));
}

if (auto flag = node.get_flag(); flag.flag()) {
array.emplace_back(publish_atribute(flag, "flag"));
}
}

private:
ojson root_;
std::vector<ojson*> stack_;
bool with_id_;
};

} // namespace ecf::http
Expand Down
2 changes: 1 addition & 1 deletion Pyext/ecflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
The ecFlow python module
"""

__version__ = '5.12.3'
__version__ = '5.12.4'

# http://stackoverflow.com/questions/13040646/how-do-i-create-documentation-with-pydoc
22 changes: 11 additions & 11 deletions Pyext/python3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
# nor does it submit to any jurisdiction.
#

# ENABLE_PYTHON_UNDEF_LOOKUP
# on some systems (e.g. conda on macOS) the boost Python libraries seem to be too
# closely linked with the exact version of the Python development libraries,
# meaning that we get segfaults when we try to run a Python example. By removing
# the Python libraries from the link line and adding -undefined dynamic_lookup
# we can make our ecflow shared library more movable bewteen systems

if (ENABLE_PYTHON_UNDEF_LOOKUP)
add_link_options(-undefined dynamic_lookup)
endif()
#
# Important!
#
# Notice that ecflow Python module is linked with `Python3::Module` CMake imported target,
# to enable a loose linkage with Python development libraries -- this is necessary in some
# platforms, such as conda-forge+macOS.
#
# In practice, this implies that `-undefined` and `-dynamic_lookup` linkage flags are used
# and the Python development libraries are not linked directly into the ecflow Python module.
#

ecbuild_add_library(
TARGET
Expand All @@ -35,7 +35,7 @@ ecbuild_add_library(
node
attributes
core
Python3::Python
Python3::Module
Boost::${ECFLOW_BOOST_PYTHON_COMPONENT}
$<$<BOOL:${OPENSSL_FOUND}>:OpenSSL::SSL>
CXXFLAGS
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@


def get_ecflow_version():
version = "5.12.3"
version = "5.12.4"
ecflow_version = version.split(".")
print("Extracted ecflow version '" + str(ecflow_version))
return ecflow_version
Expand Down
16 changes: 16 additions & 0 deletions docs/release_notes/version_5.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ Version 5.12 updates
.. role:: jiraissue
:class: hidden

Version 5.12.4
==============

* `Released <https://confluence.ecmwf.int/display/ECFLOW/Releases>`__\ on 2024-03-23

ecFlow Client
-------------

- **Bug** corrected ecFlow Python3 module linkage (specific for conda-forge) :jiraissue:`ECFLOW-1950`

ecFlow HTTP
-----------

- **Feature** added :code:`id` field to each Node in the :code:`/<path>/tree` endpoint response :jiraissue:`ECFLOW-1952`
- **Improvement** added *flag* attribute to Nodes in the :code:`/<path>/tree` endpoint response :jiraissue:`ECFLOW-1954`
- **Bug** corrected Alias node structure in the :code:`/<path>/tree` endpoint response :jiraissue:`ECFLOW-1953`

Version 5.12.3
==============
Expand Down
7 changes: 5 additions & 2 deletions docs/rest_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ Obtain the tree of all Suites
* - Description
- **Read** a tree with all suites
* - Parameters
- :code:`content`, (optional), possible values: :code:`basic`, :code:`full`
- :code:`content`, (optional), possible values: :code:`basic`, :code:`full`; :code:`with_id`, (optional), possible values: :code:`true`, :code:`false`
* - Payload
- *empty*
* - Response
Expand All @@ -513,13 +513,14 @@ When query parameter :code:`content` is not provided, or query parameter is :cod
}
}
When query parameter :code:`content=full`, the full Suite tree is provided:
When query parameters :code:`content=full&with_id=true`, the full Suite tree is provided:

.. code:: json
{
"some_suite": {
"type": "suite",
"id": "/some_suite",
"state": {
"node": "active",
"default": "complete"
Expand All @@ -535,6 +536,7 @@ When query parameter :code:`content=full`, the full Suite tree is provided:
"children": {
"some_family": {
"type": "family",
"id": "/some_suite/some_family",
"state": {
"node": "active",
"default": "unknown"
Expand All @@ -543,6 +545,7 @@ When query parameter :code:`content=full`, the full Suite tree is provided:
"children": {
"some_task": {
"type": "task",
"id": "/some_suite/some_family/some_task",
"state": {
"node": "active",
"default": "unknown"
Expand Down

0 comments on commit 35f5ea5

Please sign in to comment.