-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix stdout concurrency, add option
--num-threads
(#98)
* fix concurrency issue on output to stdout * add option --num-threads, set it to 1 in E2E tests to avoid concurrency issues with the std::stringstream buffer used to capture stdout and stderr * add separate actions for docker build with BZ2 compressed file output, uncompressed file output, and stdout output, e2e tests for uncompressed file out, and output to stdout (which is always uncompressed) * limit number of threads to 1 in remaining tests
- Loading branch information
Showing
18 changed files
with
376 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: End-to-end test, stdout output (docker build) | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
merge_group: | ||
|
||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: End-to-end test, stdout output (docker build) | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
dockerfile: [ Dockerfile] | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: Build the docker image | ||
run: | | ||
set -v | ||
docker build -f ${{matrix.dockerfile}} -t osm2rdf . | ||
docker run --rm osm2rdf --help | ||
- name: Build TTL for Malta and check its validity | ||
run: | | ||
set -v | ||
mkdir osm-malta && cd $_ | ||
curl -L -o osm-malta.pbf https://download.geofabrik.de/europe/malta-latest.osm.pbf | ||
ls -l osm-malta.pbf | ||
docker run --rm -v $(pwd):/data osm2rdf /data/osm-malta.pbf > osm-malta.ttl | ||
ls -l osm-malta.pbf osm-malta.ttl | ||
docker run --rm -v $(pwd):/data stain/jena riot --validate /data/osm-malta.ttl | ||
- name: Build QLever index and count the number of geometries | ||
run: | | ||
set -v | ||
cd osm-malta | ||
docker run -u $(id -u):$(id -g) -v $(pwd):/data -w /data --entrypoint bash adfreiburg/qlever -c "cat osm-malta.ttl | IndexBuilderMain -F ttl -f - -i osm-malta" | ||
docker run -d -p 7000:7000 -v $(pwd):/data -w /data --entrypoint bash --name qlever adfreiburg/qlever -c "ServerMain -i /data/osm-malta -p 7000" | ||
sleep 5 | ||
docker logs qlever | ||
RESULT_JSON=$(curl http://localhost:7000 --data-urlencode "query=PREFIX geo: <http://www.opengis.net/ont/geosparql#> SELECT (COUNT(?geometry) AS ?count) WHERE { ?osm_id geo:hasGeometry ?geometry }") | ||
echo "${RESULT_JSON}" | ||
NUM_GEOMS=$(echo "${RESULT_JSON}" | jq --exit-status --raw-output .results.bindings[0].count.value) | ||
echo ${NUM_GEOMS} | numfmt --grouping | ||
test ${NUM_GEOMS} -gt 100000 |
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,57 @@ | ||
name: End-to-end test, uncompressed output (docker build) | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
merge_group: | ||
|
||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: End-to-end test, uncompressed output (docker build) | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
dockerfile: [ Dockerfile] | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: Build the docker image | ||
run: | | ||
set -v | ||
docker build -f ${{matrix.dockerfile}} -t osm2rdf . | ||
docker run --rm osm2rdf --help | ||
- name: Build TTL for Malta and check its validity | ||
run: | | ||
set -v | ||
mkdir osm-malta && cd $_ | ||
curl -L -o osm-malta.pbf https://download.geofabrik.de/europe/malta-latest.osm.pbf | ||
ls -l osm-malta.pbf | ||
docker run --rm -v $(pwd):/data osm2rdf /data/osm-malta.pbf --output-no-compress -o /data/osm-malta.ttl | ||
ls -l osm-malta.pbf osm-malta.ttl | ||
docker run --rm -v $(pwd):/data stain/jena riot --validate /data/osm-malta.ttl | ||
- name: Build QLever index and count the number of geometries | ||
run: | | ||
set -v | ||
cd osm-malta | ||
docker run -u $(id -u):$(id -g) -v $(pwd):/data -w /data --entrypoint bash adfreiburg/qlever -c "cat osm-malta.ttl | IndexBuilderMain -F ttl -f - -i osm-malta" | ||
docker run -d -p 7000:7000 -v $(pwd):/data -w /data --entrypoint bash --name qlever adfreiburg/qlever -c "ServerMain -i /data/osm-malta -p 7000" | ||
sleep 5 | ||
docker logs qlever | ||
RESULT_JSON=$(curl http://localhost:7000 --data-urlencode "query=PREFIX geo: <http://www.opengis.net/ont/geosparql#> SELECT (COUNT(?geometry) AS ?count) WHERE { ?osm_id geo:hasGeometry ?geometry }") | ||
echo "${RESULT_JSON}" | ||
NUM_GEOMS=$(echo "${RESULT_JSON}" | jq --exit-status --raw-output .results.bindings[0].count.value) | ||
echo ${NUM_GEOMS} | numfmt --grouping | ||
test ${NUM_GEOMS} -gt 100000 |
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
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
Oops, something went wrong.