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

Upgrade base image #666

Open
wants to merge 4 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 Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN \
&& cp build/Release/silo .


FROM ubuntu:22.04 AS server
FROM ubuntu:24.04 AS server

WORKDIR /app
COPY docker_default_preprocessing_config.yaml ./default_preprocessing_config.yaml
Expand Down
17 changes: 11 additions & 6 deletions Dockerfile_dependencies
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

ARG TARGETPLATFORM

RUN apt update && apt dist-upgrade -y \
&& apt install -y \
cmake python3-pip

RUN pip install conan==2.8.1

RUN apt install -y software-properties-common wget gnupg lsb-release wget jq curl \
build-essential cmake python3 pipx software-properties-common wget gnupg lsb-release jq curl \
&& wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc \
&& add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main' \
&& apt install -y clang-tidy-15

# ensurepath adds a line to .profile
# which puts the pipx install directory ~/.local/bin into the PATH variable
RUN python3 -m pipx ensurepath
# .profile is only sourced on relogin. Dockerfile shells do not login by default.
# This line tells it to execute all subsequent commands with a prior login
SHELL ["/bin/bash", "-login", "-c"]

RUN python3 -m pipx install conan==2.8.1

WORKDIR /src
COPY conanfile.py conanprofile.docker conanprofile.docker_arm ./
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
Expand Down
1 change: 1 addition & 0 deletions conanprofile.docker_arm
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ arch=armv8
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=13.2
compiler.cppstd=20
build_type=Release
[options]
3 changes: 2 additions & 1 deletion include/silo/common/cons_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//! (no reference counting). This is meant to be used with recursive
//! algorithms to maintain a path back up.

#include <algorithm>
#include <functional>
#include <memory>
#include <optional>
Expand Down Expand Up @@ -62,7 +63,7 @@ class ConsList {
// then set Vec slots via index, but that needs Default and
// writes to memory twice, too), right?
std::vector<T> values = toVec();
std::reverse(values.begin(), values.end());
std::ranges::reverse(values);
return values;
}
};
20 changes: 7 additions & 13 deletions src/config/config_specification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@ namespace silo::config {

std::optional<ConfigAttributeSpecification> ConfigSpecification::
getAttributeSpecificationFromAmbiguousKey(const AmbiguousConfigKeyPath& key) const {
// TODO(#663)
auto maybe_result = std::find_if(
attribute_specifications.begin(),
attribute_specifications.end(),
[&](const auto& attribute_spec) {
auto maybe_result =
std::ranges::find_if(attribute_specifications, [&](const auto& attribute_spec) {
return AmbiguousConfigKeyPath::from(attribute_spec.key) == key;
}
);
});
if (maybe_result == attribute_specifications.end()) {
return std::nullopt;
}
Expand All @@ -51,12 +47,10 @@ std::optional<ConfigAttributeSpecification> ConfigSpecification::
std::optional<ConfigAttributeSpecification> ConfigSpecification::getAttributeSpecification(
const ConfigKeyPath& key
) const {
// TODO(#663)
auto maybe_result = std::find_if(
attribute_specifications.begin(),
attribute_specifications.end(),
[&](const auto& attribute_spec) { return attribute_spec.key == key; }
);
auto maybe_result =
std::ranges::find_if(attribute_specifications, [&](const auto& attribute_spec) {
return attribute_spec.key == key;
});
if (maybe_result == attribute_specifications.end()) {
return std::nullopt;
}
Expand Down
2 changes: 1 addition & 1 deletion src/config/source/environment_variables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ AmbiguousConfigKeyPath EnvironmentVariables::stringToConfigKeyPath(
const ConfigValue value = attribute_spec.parseValueFromString(value_string);
config_values.emplace(attribute_spec.key, value);
} else {
if (std::find(allow_list.begin(), allow_list.end(), key_string) != allow_list.end()) {
if (std::ranges::find(allow_list, key_string) != allow_list.end()) {
SPDLOG_INFO(
"Given env variable '{}' is not a valid key for '{}' but in allow_list.",
key_string,
Expand Down
3 changes: 1 addition & 2 deletions src/silo/common/lineage_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ std::optional<std::vector<Idx>> Graph::getCycle() const {
// We need to remove leading vertices up until the cycle
SILO_ASSERT_GE(witness_lasso.value().size(), 2UL);
const Idx cycle_node = witness_lasso.value().back();
auto cycle_node_first_occurrence =
std::find(witness_lasso.value().begin(), witness_lasso.value().end(), cycle_node);
auto cycle_node_first_occurrence = std::ranges::find(witness_lasso.value(), cycle_node);
SILO_ASSERT(cycle_node_first_occurrence < witness_lasso.value().end());
witness_lasso.value().erase(witness_lasso.value().begin(), cycle_node_first_occurrence);
return witness_lasso;
Expand Down
10 changes: 4 additions & 6 deletions src/silo/config/config_repository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ void validatePartitionBy(const DatabaseConfig& config) {

const std::string partition_by = config.schema.partition_by.value();

// TODO(#663)
const auto& partition_by_metadata = std::find_if(
config.schema.metadata.begin(),
config.schema.metadata.end(),
[&](const DatabaseMetadata& metadata) { return metadata.name == partition_by; }
);
const auto& partition_by_metadata =
std::ranges::find_if(config.schema.metadata, [&](const DatabaseMetadata& metadata) {
return metadata.name == partition_by;
});
if (partition_by_metadata == config.schema.metadata.end()) {
throw ConfigException("partitionBy '" + partition_by + "' is not in metadata");
}
Expand Down
8 changes: 3 additions & 5 deletions src/silo/config/database_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,9 @@ ColumnType DatabaseMetadata::getColumnType() const {
}

std::optional<DatabaseMetadata> DatabaseConfig::getMetadata(const std::string& name) const {
// TODO(#663)
auto element =
std::find_if(schema.metadata.begin(), schema.metadata.end(), [&name](const auto& metadata) {
return metadata.name == name;
});
auto element = std::ranges::find_if(schema.metadata, [&name](const auto& metadata) {
return metadata.name == name;
});
if (element == std::end(schema.metadata)) {
return std::nullopt;
}
Expand Down
6 changes: 2 additions & 4 deletions src/silo/preprocessing/metadata_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ void MetadataInfo::validateMetadataFile(
std::set<std::string> actual_fields;
for (size_t idx = 0; idx < result->ColumnCount(); idx++) {
actual_fields.emplace(result->ColumnName(idx));
// TODO(#663)
if (std::find_if(database_config.schema.metadata.begin(), database_config.schema.metadata.end(), [&](const auto& metadata) {
if (std::ranges::find_if(database_config.schema.metadata, [&](const auto& metadata) {
return metadata.name == result->ColumnName(idx);
}) == database_config.schema.metadata.end()) {
SPDLOG_WARN(
Expand Down Expand Up @@ -131,8 +130,7 @@ void MetadataInfo::validateNdjsonFile(
std::set<std::string> actual_fields;
for (size_t idx = 0; idx < result->ColumnCount(); idx++) {
actual_fields.emplace(result->ColumnName(idx));
// TODO(#663)
if (std::find_if(database_config.schema.metadata.begin(), database_config.schema.metadata.end(), [&](const auto& metadata) {
if (std::ranges::find_if(database_config.schema.metadata, [&](const auto& metadata) {
return metadata.name == result->ColumnName(idx);
}) == database_config.schema.metadata.end()) {
SPDLOG_WARN(
Expand Down
9 changes: 3 additions & 6 deletions src/silo/query_engine/actions/tuple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,9 @@ std::vector<Tuple::ComparatorField> Tuple::getCompareFields(
tuple_field_comparators.resize(order_by_fields.size());
size_t offset = 0;
for (const auto& metadata : columns_metadata) {
// TODO(#663)
auto element = std::find_if(
order_by_fields.begin(),
order_by_fields.end(),
[&](const auto& order_by_field) { return metadata.name == order_by_field.name; }
);
auto element = std::ranges::find_if(order_by_fields, [&](const auto& order_by_field) {
return metadata.name == order_by_field.name;
});
if (element != order_by_fields.end()) {
const size_t index = std::distance(order_by_fields.begin(), element);
tuple_field_comparators[index] =
Expand Down
Loading