Skip to content

Commit 3eef499

Browse files
Merge branch 'main' into wdqs-separate-concept-uri
2 parents 3516fcb + 3dd4b6f commit 3eef499

File tree

6 files changed

+133
-31
lines changed

6 files changed

+133
-31
lines changed

build/wdqs-frontend/README.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
Frontend for the [Wikidata Query Service (WDQS)](https://www.mediawiki.org/wiki/Wikidata_Query_Service).
44

5+
To interact with the WDQS frontend, navigate to the URL corresponding to the port allocated for it. In the example below, the WDQS frontend is available at `http://localhost:8834`.
6+
7+
When writing queries using the frontend interface, click "Code" to view the corresponding URL.
8+
9+
For general instructions on using WDQS, building SPARQL queries, and additional resources, see:
10+
- [Wikidata Query Service User Manual](https://www.mediawiki.org/wiki/Wikidata_Query_Service/User_Manual)
11+
- [What is SPARQL](https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service)
12+
513
> 💡 This image is part of Wikibase Suite (WBS). [WBS Deploy](https://github.com/wmde/wikibase-release-pipeline/deploy/README.md) provides everything you need to self-host a Wikibase instance out of the box.
614
715
## Requirements
@@ -21,11 +29,11 @@ We suggest using the [WBS Wikibase image](https://hub.docker.com/r/wikibase/wiki
2129

2230
### WDQS as server
2331

24-
We suggest using the [WBS Wikibase image](https://hub.docker.com/r/wikibase/wdqs).
32+
We suggest using the [WBS WDQS image](https://hub.docker.com/r/wikibase/wdqs).
2533

2634
### WDQS as updater
2735

28-
We suggest using the [WBS Wikibase image](https://hub.docker.com/r/wikibase/wdqs), the same as used for WDQS server. Check out the [documentation](https://wikitech.wikimedia.org/wiki/Wikidata_Query_Service) to learn how to run it in updater mode.
36+
We suggest using the [WBS WDQS image](https://hub.docker.com/r/wikibase/wdqs), the same as used for WDQS server. Check out the [documentation](https://wikitech.wikimedia.org/wiki/Wikidata_Query_Service) to learn how to run it in updater mode.
2937

3038
### Reverse proxy
3139

@@ -185,7 +193,7 @@ volumes:
185193
186194
Official releases of this image can be found on [Docker Hub wikibase/wdqs-frontend](https://hub.docker.com/r/wikibase/wdqs-frontend).
187195
188-
## Tags and Versioning
196+
## Tags and versioning
189197
190198
This WDQS Frontend image is using [semantic versioning](https://semver.org/spec/v2.0.0.html).
191199
@@ -206,4 +214,4 @@ This image is built from this [Dockerfile](https://github.com/wmde/wikibase-rele
206214
207215
This image is maintained by the Wikibase Suite Team at [Wikimedia Germany (WMDE)](https://wikimedia.de).
208216
209-
If you have questions not listed above or need help, use this [bug report form](https://phabricator.wikimedia.org/maniphest/task/edit/form/129/) to start a conversation with the engineering team.
217+
If you have questions not covered above or need further help, use this [bug report form](https://phabricator.wikimedia.org/maniphest/task/edit/form/129/) to start a conversation with the engineering team.

build/wdqs/Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ RUN apt-get update && \
5454
COPY --from=fetcher --chown=blazegraph:blazegraph /tmp/wdqs-service /wdqs
5555

5656
RUN mkdir /var/log/wdqs && chown blazegraph /var/log/wdqs
57+
RUN mkdir /wdqs/data && chown blazegraph /wdqs/data
5758

5859
# Don't set a memory limit otherwise bad things happen (OOMs)
5960
ENV MEMORY=""\
@@ -77,4 +78,6 @@ COPY --chown=blazegraph:blazegraph RWStore.properties allowlist.txt logback.xml
7778
# TODO this shouldn't be needed, but CI currently doesnt check for the +x bit, which is why this line is here
7879
RUN chmod +x /wdqs/runUpdate.sh
7980

81+
USER blazegraph
82+
8083
ENTRYPOINT ["/entrypoint.sh"]

build/wdqs/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ We suggest using the [WBS Wikibase image](https://hub.docker.com/r/wikibase/wiki
2323

2424
You'll need one instance of the image to execute the actual WDQS daemon started using `/runBlazegraph.sh`.
2525

26+
You can send `GET` requests with your SPARQL query to the WDQS endpoint (following the example below):
27+
`http://wdqs:9999/bigdata/namespace/wdq/sparql?query={SPARQL}`
28+
2629
### WDQS as updater
2730

2831
You'll need one instance of the image to execute the updater started using `/runUpdate.sh`. This polls changes from Wikibase.
@@ -213,7 +216,7 @@ In the Docker Compose example provided above, you might use the commands and ins
213216
docker compose stop wdqs-updater
214217
215218
# Start an updater with force sync settings
216-
docker compose run --rm wdqs-updater bash '/wdqs/runUpdate.sh -h http://"$WDQS_HOST":"$WDQS_PORT" -- --wikibaseUrl "$WIKIBASE_SCHEME"://"$WIKIBASE_HOST" --conceptUri "$WIKIBASE_CONCEPT_URI" --entityNamespaces "$WDQS_ENTITY_NAMESPACES" --init --start $(date +%Y%m%d000000)'
219+
docker compose run --rm wdqs-updater /wdqs/runUpdate.sh -h http://\$WDQS_HOST:\$WDQS_PORT -- --wikibaseUrl \$WIKIBASE_SCHEME://\$WIKIBASE_HOST --conceptUri \$WIKIBASE_CONCEPT_URI --entityNamespaces \$WDQS_ENTITY_NAMESPACES --init --start $(date +%Y%m%d000000)
217220
218221
# As soon as you see "Sleeping for 10 secs" in the logs, press CTRL-C to stop it again
219222

build/wdqs/entrypoint.sh

+4-14
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
# Test if required environment variables have been set
55
REQUIRED_VARIABLES=(WIKIBASE_HOST WDQS_HOST WDQS_PORT)
66
for i in "${REQUIRED_VARIABLES[@]}"; do
7-
eval THISSHOULDBESET=\$"$i"
8-
if [ -z "$THISSHOULDBESET" ]; then
7+
eval THISSHOULDBESET=\$"$i"
8+
if [ -z "$THISSHOULDBESET" ]; then
99
echo "$i is required but isn't set. You should pass it to docker. See: https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file";
1010
exit 1;
11-
fi
11+
fi
1212
done
1313

1414
set -eu
@@ -17,15 +17,5 @@ export BLAZEGRAPH_OPTS="${BLAZEGRAPH_EXTRA_OPTS} -DwikibaseHost=${WIKIBASE_HOST}
1717
export UPDATER_OPTS="-DwikibaseHost=${WIKIBASE_HOST} -DwikibaseMaxDaysBack=${WIKIBASE_MAX_DAYS_BACK}"
1818

1919
envsubst < /templates/mwservices.json > /wdqs/mwservices.json
20-
chown blazegraph:blazegraph /wdqs/mwservices.json
2120

22-
# The data directory should always be owned by the blazegraph user
23-
# This used to be owned by root (https://phabricator.wikimedia.org/T237248)
24-
if [ -d /wdqs/data/ ]; then
25-
chown blazegraph:blazegraph -R /wdqs/data/
26-
fi
27-
28-
# Start as the blazegraph user.
29-
# --preserve-environment does not preserve PATH, so we manually
30-
# set the PATH again. Java cannot be found otherwise.
31-
su --preserve-environment --command "export PATH=$PATH; $*" blazegraph
21+
exec $(echo "$@"| envsubst)

deploy/README.md

+23-12
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,13 @@ To back up your data, shut down the instance and dump the contents of all Docker
146146
docker compose down
147147

148148
for v in \
149-
wikibase-suite-wikibase_image-data \
150-
wikibase-suite_mysql-data \
151-
wikibase-suite_wdqs-data \
152-
wikibase-suite_elasticsearch-data \
153-
wikibase-suite_quickstatements-data \
154-
wikibase-suite_traefik-letsencrypt-data; do
149+
wbs-deploy_elasticsearch-data \
150+
wbs-deploy_mysql-data \
151+
wbs-deploy_quickstatements-data \
152+
wbs-deploy_traefik-letsencrypt-data \
153+
wbs-deploy_wdqs-data \
154+
wbs-deploy_wikibase-image-data \
155+
; do
155156
docker run --rm --volume $v:/backup debian:12-slim tar cz backup > $v.tar.gz
156157
done
157158
```
@@ -164,12 +165,13 @@ To restore the volume backups, ensure your instance has been shut down by runnin
164165
docker compose down
165166

166167
for v in \
167-
wikibase-suite-wikibase_image-data \
168-
wikibase-suite_mysql-data \
169-
wikibase-suite_wdqs-data \
170-
wikibase-suite_elasticsearch-data \
171-
wikibase-suite_quickstatements-data \
172-
wikibase-suite_traefik-letsencrypt-data; do
168+
wbs-deploy_elasticsearch-data \
169+
wbs-deploy_mysql-data \
170+
wbs-deploy_quickstatements-data \
171+
wbs-deploy_traefik-letsencrypt-data \
172+
wbs-deploy_wdqs-data \
173+
wbs-deploy_wikibase-image-data \
174+
; do
173175
docker volume rm $v 2> /dev/null
174176
docker volume create $v
175177
docker run -i --rm --volume $v:/backup debian:12-slim tar xz < $v.tar.gz
@@ -303,6 +305,15 @@ Removing the `traefik-letsencrypt-data` volume will request a new certificate fr
303305
```yml
304306
--certificatesresolvers.letsencrypt.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
305307
```
308+
309+
## WDQS Frontend
310+
311+
To interact with the WDQS frontend, navigate to the URL defined as `WDQS_FRONTEND_PUBLIC_HOST` in the `.env` file. By default, this is set to `wdqs-frontend.example`.
312+
313+
Alternatively, send `GET` requests with your SPARQL query to the WDQS frontend endpoint:
314+
`https://wdqs-frontend.example.com/proxy/wdqs/bigdata/namespace/wdq/sparql?query={SPARQL}`
315+
316+
306317
## FAQ
307318

308319
### Can I host WBS Deploy locally?

docs/conventional-commits.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Conventional commits
2+
3+
[Conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) are human and machine readable commit messages. We use them to automatically generate changelog items and [semantic version (SemVer)](https://semver.org/) bumps on release using [NX](https://nx.dev). Here is an example of a commit message describing a bug fix in a backup script. Releasing this change would bump the project's patch version number:
4+
5+
```
6+
fix(backup-script): report error if no space left on device
7+
```
8+
9+
On release of a project, NX collects all commit messages from git for the project's directory (e.g. `build/wdqs`) since last release (e.g. `[email protected]`). For this to work well we need to follow a certain procedure in our Pull requests:
10+
11+
- Use conventional commit syntax for the PR title, then squash merge the PR, so that the squashed commit will contain the conventional commit message from the PR title on the target branch. The PR body will become the commit message body.
12+
- Or: Merge with merge commit so that all commits from the PR are retained on the target branch. All commits in the PR should follow conventional commit syntax then.
13+
14+
## Supported types
15+
16+
NX supports [a number of](https://github.com/nrwl/nx/blob/db10812da789cd48d3a722628a00feda9d0e3810/packages/nx/src/command-line/release/config/conventional-commits.ts) conventional commit types. We use the following for changelog generation as configured in our [nx.json](https://github.com/wmde/wikibase-release-pipeline/blob/main/nx.json):
17+
18+
| Type | SemVer Bump | Changelog Title |
19+
| -------- | ----------- | ---------------- |
20+
| build | patch | 📦 Build |
21+
| chore | patch | 🏡 Chore |
22+
| ci | patch | 🤖 CI |
23+
| docs | patch | 📖 Documentation |
24+
| feat | minor | 🚀 Features |
25+
| fix | patch | 🩹 Fixes |
26+
| perf | patch | 🔥 Performance |
27+
| refactor | patch | 💅 Refactors |
28+
| style | patch | 🎨 Styles |
29+
| test | patch | ✅ Tests |
30+
31+
## Examples
32+
33+
### Feature
34+
35+
A new feature implementation bumping the minor version:
36+
37+
```
38+
feat: added support for cats
39+
```
40+
41+
Will generate the following changelog entry:
42+
43+
#### 🚀 Features
44+
45+
- added support for cats
46+
47+
### Documentation update
48+
49+
Some update to the docs bumping a minor version:
50+
51+
```
52+
docs: describe how to work around sleeping cats
53+
```
54+
55+
Will generate the following changelog entry:
56+
57+
#### 📖 Documentation
58+
59+
- describe how to work around sleeping cats
60+
61+
### Breaking change
62+
63+
All types can be breaking changes. Here is an example for a breaking refactor, bumping a major version.
64+
65+
```
66+
refactor!: remove support for sabre-toothed tiger
67+
```
68+
69+
Will generate the following changelog entry:
70+
71+
#### 💅 Refactors
72+
73+
- remove support for sabre-toothed tiger
74+
75+
### Performance change for a certain component
76+
77+
Noting that a change is specific to a component or subsystem in a project.
78+
79+
```
80+
pref(food-dispenser): improved speed
81+
```
82+
83+
Will generate the following changelog entry:
84+
85+
#### 🔥 Performance
86+
87+
- food-dispenser: improved speed

0 commit comments

Comments
 (0)