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

feat: config migration and graph repo client #1889

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6035301
refactor(config)!: Refactor the config classes into a separate struct…
takb Nov 8, 2024
35d6067
feat(graph-repo-client): Download new routing graphs from a remote re…
jhaeu Nov 8, 2024
45750a3
test(integration-tests): Replace the old bash based integration tests…
MichaelsJP Nov 8, 2024
52e87ae
docs: Documentation for the config class migration and graph repo client
jhaeu Nov 8, 2024
9f4a76e
test: compare dates instead of date.toString()
jhaeu Nov 12, 2024
b9439d1
test: compare dates instead of date.toString() (#1896)
MichaelsJP Nov 12, 2024
63aee63
docs(graph-management): Overhaul config documentation
jhaeu Nov 14, 2024
a3c5951
test: Check high level content of the config_output functionality
MichaelsJP Nov 22, 2024
2c4a7bd
docs: complete config and grc docu (#1898)
MichaelsJP Nov 22, 2024
98c4230
feat(integration-tests): Isolate the integration tests
MichaelsJP Nov 21, 2024
c56e288
CI(integration-tests): Add the integration-tests.yml workflow
MichaelsJP Nov 21, 2024
095e20d
CI(integration-tests): Only run on main
MichaelsJP Nov 21, 2024
554c63b
docs(integration-tests): Introduce docs for integration tests
MichaelsJP Nov 21, 2024
82c8b7a
feat: Integration tests workflow (#1899)
MichaelsJP Nov 22, 2024
e5b79e3
CI(dependencies): Streamline the maven caches
MichaelsJP Nov 22, 2024
68cf069
ci: Streamline the maven caches (#1900)
MichaelsJP Nov 22, 2024
338fe1e
ci(dependencies): Streamline maven deps download process
MichaelsJP Nov 22, 2024
7dc549e
ci(dependencies): Streamline maven deps download process (#1901)
MichaelsJP Nov 22, 2024
88d4a1a
ci(integration-tests): Only run the tests when the PR is ready for re…
MichaelsJP Nov 22, 2024
4f291ba
chore(config): automatic conversion of application.yml to ors-config.…
MichaelsJP Nov 22, 2024
32cbbbb
ci: Execute maven tests on all PRs
MichaelsJP Nov 22, 2024
0f4433c
ci(integration-tests): Run integration tests only on ready pr (#1902)
MichaelsJP Nov 22, 2024
572b9b0
fix(integration-tests): Encapsulate the OneShotGraphBuilderTest
MichaelsJP Nov 22, 2024
7263869
fix: encapsulate integration tests graph builder (#1903)
MichaelsJP Nov 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
57 changes: 18 additions & 39 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,40 +1,19 @@
.metadata/
.git
.gitignore
**/*.pbf

.idea/
*.iml
.DS_Store
nohup.out
.python-version
.project

# Ignore all ors and app config files except for the sample ones
ors-api/src/main/resources/ors-config*
# Ignore all files
**
# Include the following files
!pom.xml
!ors-engine/pom.xml
!ors-engine/src/main
!ors-api/pom.xml
!ors-api/src/main/
!ors-report-aggregation/pom.xml
!ors-test-scenarios/pom.xml
# Special includes
!ors-config.env
!ors-config.yml
!docker-entrypoint.sh
!ors-test-scenarios/src/test/resources/maven-entrypoint.sh
!ors-api/src/test/files/heidelberg.test.pbf
!ors-api/src/test/files/elevation/srtm_38_03.gh
!ors-api/src/test/files/vrn_gtfs_cut.zip
!ors-api/src/main/resources/ors-config-sample.json

# no tests
ors-api/src/test
!ors-api/src/test/files/heidelberg.osm.gz
ors-engine/src/test

# folders generated by integration test runs
ors-api/graphs-apitests
ors-api/logs

ors-api/target/
ors-engine/target/
ors-docker/**

cgiar_provider/
cgiar_cache/
graphs/
build/
logs/
docker/
docs/
.github/
Dockerfile
envs/
.jqwik-database
62 changes: 28 additions & 34 deletions .github/utils/yml_config_to_ors_config_conversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,31 @@ fi
input_file=$1
output_file=$2

echo ""
echo "Copy $input_file to $output_file"
cp $input_file $output_file

###########################
### Replace parameters ####
###########################
echo ""
echo "Replace parameters:"

echo "- enable ors.engine.profiles.car"
yq -i '.ors.engine.profiles.car.enabled = true' "$output_file" || exit 1

echo "- set ors.engine.source_file to ors-api/src/test/files/heidelberg.osm.gz"
yq -i '.ors.engine.source_file = "ors-api/src/test/files/heidelberg.osm.gz"' "$output_file" || exit 1

###########################
### Convert input file ####
###########################
echo ""
echo "Converting input file:"
## Add # to the beginning of each line that is not empty or a comment
echo "- Comment everything"
sed -i '/^\s*[^#]/ s/^/#/' "$output_file" || exit 1

echo "- Uncomment ors, engine and source_file"
sed -i -e '/^#ors:/s/^#//' -e '/^#.*engine:/s/^#//' -e '/^#.*source_file:/s/^#//' "$output_file"

echo "- Uncomment subsequent lines for profiles.car.enabled in ors.engine"
sed -i -e '/^# profiles:/s/^#//' "$output_file"
sed -i -e '/^# car:.*/s/^#//' "$output_file"
sed -i -e '/^# enabled: true/s/^#//' "$output_file"

echo "Parsing complete. Result saved to $output_file"
echo "Generate minimal sample configuration..."

echo "\
################################################################################################
### Minimal configuration example file for openrouteservice. For a description please visit: ###
### https://giscience.github.io/openrouteservice/run-instance/configuration/ ###
################################################################################################" > ${output_file}

yq --null-input '
(.ors.engine.profile_default.build.source_file = "ors-api/src/test/files/heidelberg.test.pbf" )|
(.ors.engine.profiles.driving-car.enabled = true )
' >> ${output_file}


echo "Prepare all properties to be added as commented text..."
tmpYml=$(mktemp "prepare.XXXXXXXXX.yml")
cp ${input_file} ${tmpYml}
echo "Copied ${input_file} to ${tmpYml}"
echo "Remove config properties that should not be added.."
yq -i 'del(.ors.engine.graph_management)' ${tmpYml} || exit 1
yq -i 'del(.ors.engine.profile_default.repo)' ${tmpYml} || exit 1

echo "Append commented application.yml..."
echo "" >> ${output_file}
sed '/^\s*[^#]/ s/^/#/' ${tmpYml} >> ${output_file}

echo "Remove temporary file ${tmpYml}..."
rm ${tmpYml}
29 changes: 17 additions & 12 deletions .github/utils/yml_config_to_properties_conversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ cp $input_file $output_file
echo ""
echo "Replace parameters:"

echo "- enable ors.engine.profiles.car"
yq -i '.ors.engine.profiles.car.enabled = true' "$output_file" || exit 1
echo "- enable ors.engine.profiles.driving-car"
yq -i '.ors.engine.profiles.driving-car.enabled = true' "$output_file" || exit 1

echo "- set ors.engine.source_file to ors-api/src/test/files/heidelberg.osm.gz"
yq -i '.ors.engine.source_file = "ors-api/src/test/files/heidelberg.osm.gz"' "$output_file" || exit 1
echo "- set ors.engine.profile_default.build.source_file to ors-api/src/test/files/heidelberg.test.pbf"
yq -i '.ors.engine.profile_default.build.source_file = "ors-api/src/test/files/heidelberg.test.pbf"' "$output_file" || exit 1

echo "- remove .ors.engine.graph_management"
yq -i 'del(.ors.engine.graph_management)' "$output_file" || exit 1

echo "- remove .ors.engine.profile_default.repo"
yq -i 'del(.ors.engine.profile_default.repo)' "$output_file" || exit 1

###########################
### Convert input file ####
Expand All @@ -37,24 +42,24 @@ yq -i -o=props --unwrapScalar=false '.. | select(tag != "!!map" and tag != "!!s
echo "- Comment everything"
sed -i '/^\s*[^#]/ s/^/#/' "$output_file" || exit 1

echo "- Uncomment ors.engine.source_file and ors.engine.profiles.car.enabled"
sed -i -e '/^#ors.engine.source_file/s/^#//' -e '/^#ors.engine.profiles.car.enabled/s/^#//' "$output_file" || exit 1
echo "- Uncomment ors.engine.profile_default.build.source_file and ors.engine.profiles.driving-car.enabled"
sed -i -e '/^#ors.engine.profile_default.build.source_file/s/^#//' -e '/^#ors.engine.profiles.driving-car.enabled/s/^#//' "$output_file" || exit 1

############################
### Validate output file ###
############################
echo ""
echo "Validate output file:"
echo "- checking for ors.engine.source_file=ors-api/src/test/files/heidelberg.osm.gz"
return_value=$(sed -n '/^ors.engine.source_file=ors-api\/src\/test\/files\/heidelberg.osm.gz/p' $output_file)|| exit 1
echo "- checking for ors.engine.profile_default.source_file=ors-api/src/test/files/heidelberg.test.pbf"
return_value=$(sed -n '/^ors.engine.profile_default.build.source_file=ors-api\/src\/test\/files\/heidelberg.test.pbf/p' $output_file)|| exit 1
if [ -z "$return_value" ]; then
echo "ors.engine.source_file=ors-api/src/test/files/heidelberg.osm.gz not found"
echo "ors.engine.source_file=ors-api/src/test/files/heidelberg.test.pbf not found"
exit 1
fi
echo "- checking for ors.engine.profiles.car.enabled=true"
return_value=$(sed -n '/^ors.engine.profiles.car.enabled=true/p' $output_file) || exit 1
echo "- checking for ors.engine.profiles.driving-car.enabled=true"
return_value=$(sed -n '/^ors.engine.profiles.driving-car.enabled=true/p' $output_file) || exit 1
if [ -z "$return_value" ]; then
echo "ors.engine.profiles.car.enabled=true not found"
echo "ors.engine.profiles.driving-car.enabled=true not found"
exit 1
fi

Expand Down
7 changes: 2 additions & 5 deletions .github/utils/yml_config_validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ echo "Validate input file:"
echo "- checking if the input file is a valid yaml file"
yq 'true' $input_file /dev/null || exit 1
# Fail if ors.engine.profiles.car.enabled='false' can't be found access with schema .result | select(.property_history != null) | .property_history | map(select(.event_name == "Sold"))[0].date'
echo "- checking if ors.engine.source_file exists and has 'source_file' property"
yq --exit-status '.ors.engine | has("source_file")' $input_file > /dev/null || exit 1
# For profiles section for car with enabled using yq and contains
#echo "- checking if ors.engine.profiles.car exists and has 'enabled' property"
#yq --exit-status '.ors.engine.profiles.car | has("enabled")' $input_file > /dev/null || exit 1
echo "- checking if ors.engine.profile_default.build exists and has 'source_file' property"
yq --exit-status '.ors.engine.profile_default.build | has("source_file")' $input_file > /dev/null || exit 1
Loading
Loading