-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: IConfiguration definition is base
- Loading branch information
1 parent
a4a6357
commit d8cdd96
Showing
16 changed files
with
160 additions
and
127 deletions.
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
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
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
51 changes: 0 additions & 51 deletions
51
packages/cpp/ArmoniK.Api.Common/header/utils/RootConfiguration.h
This file was deleted.
Oops, something went wrong.
37 changes: 32 additions & 5 deletions
37
packages/cpp/ArmoniK.Api.Common/source/utils/IConfiguration.cpp
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 |
---|---|---|
@@ -1,22 +1,49 @@ | ||
#include "utils/IConfiguration.h" | ||
|
||
#include "options/ComputePlane.h" | ||
#include "utils/EnvConfiguration.h" | ||
#include "utils/JsonConfiguration.h" | ||
|
||
namespace armonik::api::common::utils { | ||
IConfiguration &IConfiguration::add_json_configuration(const std::string &file_path) { | ||
JsonConfiguration json_configuration(file_path); | ||
|
||
JsonConfiguration::fromPath(*this, file_path); | ||
return *this; | ||
} | ||
|
||
IConfiguration &IConfiguration::add_env_configuration() { | ||
EnvConfiguration env_config; | ||
use_environment_ = true; | ||
above_env_keys_.clear(); | ||
return *this; | ||
} | ||
|
||
options::ComputePlane IConfiguration::get_compute_plane() { | ||
return *this; | ||
} | ||
|
||
options::ComputePlane IConfiguration::get_compute_plane() { return *this; } | ||
void IConfiguration::set(const IConfiguration &other) { | ||
for(auto&& [key, value] : other.list()){ | ||
set(key, value); | ||
} | ||
} | ||
void IConfiguration::set(const std::string &key, const std::string &value) { | ||
if(use_environment_){ | ||
above_env_keys_.insert(key); | ||
} | ||
options_[key] = value; | ||
} | ||
|
||
std::string IConfiguration::get(const std::string &string) const { | ||
if(use_environment_ && above_env_keys_.find(string) == above_env_keys_.end()){ | ||
char* value = std::getenv(string.c_str()); | ||
if(value != nullptr){ | ||
return value; | ||
} | ||
} | ||
auto position = options_.find(string); | ||
return position == options_.end() ? "" : position->second; | ||
} | ||
|
||
const std::map<std::string, std::string> &IConfiguration::list() const { | ||
return options_; | ||
} | ||
|
||
} // namespace armonik::api::common::utils |
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
File renamed without changes.
File renamed without changes.
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,2 @@ | ||
This project uses simdjson (https://github.com/simdjson/simdjson) from The simdjson authors under Apache 2.0 license (https://www.apache.org/licenses/LICENSE-2.0) | ||
|
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,36 @@ | ||
FROM ubuntu:23.04 | ||
|
||
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" TZ="Europe/London" apt-get install -y \ | ||
ssh \ | ||
gcc \ | ||
g++ \ | ||
gdb \ | ||
clang \ | ||
make \ | ||
ninja-build \ | ||
cmake \ | ||
autoconf \ | ||
automake \ | ||
locales-all \ | ||
build-essential \ | ||
libc-ares-dev \ | ||
protobuf-compiler-grpc \ | ||
grpc-proto \ | ||
libgrpc-dev \ | ||
libgrpc++-dev \ | ||
libprotobuf-dev \ | ||
&& apt-get clean | ||
|
||
ENV protobuf_BUILD_TESTS=OFF | ||
|
||
RUN ( \ | ||
echo 'LogLevel DEBUG2'; \ | ||
echo 'PermitRootLogin yes'; \ | ||
echo 'PasswordAuthentication yes'; \ | ||
echo 'Subsystem sftp /usr/lib/openssh/sftp-server'; \ | ||
) > /etc/ssh/sshd_config_test_clion \ | ||
&& mkdir -p /run/sshd | ||
|
||
RUN yes password | passwd root | ||
|
||
CMD ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config_test_clion"] |
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
Oops, something went wrong.