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

Use Apache Jena Fuseki docker image #1477

Merged
merged 3 commits into from
Aug 24, 2023
Merged

Conversation

kinow
Copy link
Collaborator

@kinow kinow commented Jun 7, 2023

Reasons for creating this PR

To use the latest version of Jena Fuseki, and an updated base image.

Link to relevant issue(s), if any

Description of the changes in this PR

This PR uses Apache Jena's official Docker image in our Docker Compose. The Dockerfile is copied, and the commit reference in the README until we find a better way to sync our version used and their releases (e.g. work together to get the image uploaded to some public repository).

  • replace our image by Jena's
  • test that it works after we create a dataset and upload data with curl (no UI with this image)
  • update the documentation

Known problems or uncertainties in this PR

  • Docs
  • Feature-parity
  • Keeping versions synced after Jena releases

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.05% 🎉

Comparison is base (9817e23) 70.03% compared to head (eea1ee8) 70.08%.
Report is 6 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1477      +/-   ##
============================================
+ Coverage     70.03%   70.08%   +0.05%     
- Complexity     1656     1658       +2     
============================================
  Files            32       32              
  Lines          4268     4272       +4     
============================================
+ Hits           2989     2994       +5     
+ Misses         1279     1278       -1     

see 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kinow
Copy link
Collaborator Author

kinow commented Jun 8, 2023

Updated & tested the new docs for Skosmos with docker. Pending now the part with docker-compose.

dockerfiles/README.md Outdated Show resolved Hide resolved
@kinow kinow marked this pull request as ready for review June 8, 2023 22:26
@kinow
Copy link
Collaborator Author

kinow commented Jun 8, 2023

@osma, I updated the documentation during my tests, and managed to get Skosmos working with just docker, and then with docker-compose.

However, when doing a final test with docker-compose and loading the data, the UNESCO vocabulary was correctly displayed

image

image

but the STW only displayed the vocabulary general information and failed to show any terms. I re-downloaded my data, but couldn't find what is wrong. Do you know if there's any issue with the STW vocabulary and the latest version of Skosmos? If none, I will troubleshoot it later (by enabling exceptions in the browser console and inspecting the console logs).

image

Cheers
Bruno

@osma
Copy link
Member

osma commented Jun 9, 2023

Thanks a lot, this looks very promising.

I think we need to make it clearer in the documentation which files were copied from Jena and how to update them later.

I also have some concerns about requiring the use tdbloader, see my comment above.

I will test this locally and see how it works, including testing STW that you had some problems with.

@kinow
Copy link
Collaborator Author

kinow commented Jun 9, 2023

I think we need to make it clearer in the documentation which files were copied from Jena and how to update them later.

👍

I also have some concerns about requiring the use tdbloader, see my comment above.

Noted, will try curl.

I will test this locally and see how it works, including testing STW that you had some problems with.

If you'd like you can wait until I modify it to curl (up to you).

Thank you Osma!

@osma
Copy link
Member

osma commented Jun 9, 2023

If you'd like you can wait until I modify it to curl (up to you).

Sounds good, I will wait a bit!

@kinow
Copy link
Collaborator Author

kinow commented Jun 10, 2023

Hi @osma,

I forgot that the Apache Jena image starts a jena-fuseki-server server, which runs jena-fuseki-main.

The main server does not depend on any files on disk (other than for databases provided by the application), and does not provide the Fuseki UI or admins functions to create dataset via HTTP.

In the Docker startup command we define the name of the dataset to be used and location.

That's why Apache Jena documentation suggested to create a local dataset with mkdir followed by tdbloader2. Then the Fuseki Main instance starts and simply exposes that dataset as an HTTP service, but without the admin operations.

i.e. we cannot start the container and then curl or s-* to manage the datasets.

So I think it is by design, and this would be a bit hard to modify, since the Docker image runs a Maven package that does not include the admin functions. WDYT?

@kinow
Copy link
Collaborator Author

kinow commented Jun 12, 2023

I think one possibility would be to run another docker command to load the data. There might a docker image with tdbloader, so that users (that area already using docker) can use docker run --rm some-image tdbloader2 .... I'll search for a good image (maybe even stain's) in the meantime.

@osma
Copy link
Member

osma commented Jun 19, 2023

i.e. we cannot start the container and then curl or s-* to manage the datasets.

So I think it is by design, and this would be a bit hard to modify, since the Docker image runs a Maven package that does not include the admin functions. WDYT?

Hmm, that's a pity. But I understand that sometimes having a minimal Fuseki is desirable.

I don't quite understand why using tdbloader2 would be necessary. Normally Fuseki can start with an empty dataset (just the dataset config file) and it will create an empty TDB (and an empty jena-text index, if configured) when it starts up. For example we often wipe the Finto datasets from servers using this kind of procedure:

  1. Shut down Fuseki
  2. Delete the dataset directory (containing both TDB and jena-text)
  3. Start up Fuseki
  4. Wait a bit for Fuseki to start, it will recreate the dataset directory
  5. Load new data via s-put or other HTTP APIs

Could we do the same with the Docker container? Just give it a dataset config file, without actually loading any data. Then after it has started up (and Fuseki has created the dataset directory), we can load data with s-put or plain curl.

@kinow
Copy link
Collaborator Author

kinow commented Jun 19, 2023

Could we do the same with the Docker container? Just give it a dataset config file, without actually loading any data. Then after it has started up (and Fuseki has created the dataset directory), we can load data with s-put or plain curl.

Let me play a bit with Fuseki in the container. I only manage datasets with the UI or via the Jena tools, but if this works it might be actually useful for me to know for other projects, and would definitely simplify our Docker setup for Skosmos users.

@kinow
Copy link
Collaborator Author

kinow commented Jul 3, 2023

Modified the docker-compose command-line to pass the ttl for the Skosmos dataset/service, but for some reason FusekiMain fails to initialize, complaining that it finds two elements for the root dataset (I believe it's looking for any RDFDataSet and locating two, the text dataset, and the tdb2 dataset)

skosmos-web     | [Mon Jul 03 19:07:46.267430 2023] [core:notice] [pid 7] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'
skosmos-fuseki  | org.apache.jena.sparql.ARQException: Found two matches: var ?root -> http://base/#text_dataset, file:///fuseki/skosmos.ttl#tdb_dataset_readwrite
skosmos-fuseki  | 	at org.apache.jena.sparql.util.QueryExecUtils.getAtMostOne(QueryExecUtils.java:395)
skosmos-fuseki  | 	at org.apache.jena.sparql.util.graph.GraphUtils.findRootByType(GraphUtils.java:213)
skosmos-fuseki  | 	at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:138)
skosmos-fuseki  | 	at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:132)
skosmos-fuseki  | 	at arq.cmdline.ModAssembler.create(ModAssembler.java:68)
skosmos-fuseki  | 	at arq.cmdline.ModDatasetAssembler.createDataset(ModDatasetAssembler.java:41)
skosmos-fuseki  | 	at org.apache.jena.fuseki.main.cmds.FusekiMain.processModulesAndArgs(FusekiMain.java:370)
skosmos-fuseki  | 	at org.apache.jena.cmd.CmdArgModule.process(CmdArgModule.java:39)
skosmos-fuseki  | 	at org.apache.jena.cmd.CmdMain.mainMethod(CmdMain.java:86)
skosmos-fuseki  | 	at org.apache.jena.cmd.CmdMain.mainRun(CmdMain.java:56)
skosmos-fuseki  | 	at org.apache.jena.cmd.CmdMain.mainRun(CmdMain.java:43)
skosmos-fuseki  | 	at org.apache.jena.fuseki.main.cmds.FusekiMain.run(FusekiMain.java:134)
skosmos-fuseki  | 	at org.apache.jena.fuseki.main.cmds.FusekiMainCmd.main(FusekiMainCmd.java:47)
skosmos-fuseki exited with code 2

Trying a few different configurations before I resort to debugging it in Jena 🙂

EDIT: apache/jena#1950

@sonarcloud
Copy link

sonarcloud bot commented Jul 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.3% 1.3% Duplication

Copy link
Collaborator Author

@kinow kinow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready for review again @osma! Squashed the commits, and tested both Docker & Docker Compose.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff doesn't look too good on GitHub. Better open the file from this branch without the diff and compare with the Apache Jena docs https://jena.apache.org/documentation/query/text-query.html#text-dataset-assembler

I left the items as close as possible, without really modifying what we had before.

@kinow kinow requested a review from osma July 5, 2023 21:06
@kinow kinow mentioned this pull request Aug 1, 2023
4 tasks
@osma osma self-assigned this Aug 22, 2023
@osma osma added the maintenance Dependency changes, security updates, infrastructure tweaks & general mainenance label Aug 22, 2023
@osma
Copy link
Member

osma commented Aug 22, 2023

Hi @kinow , thanks a lot for this, I finally found time to test it (I was on vacation when you sent this & then had to work on non-Skosmos stuff).

I tested building the Docker image. But for some reason it fails to build with an error message mkdir: can't create directory '/fuseki/logs': Permission denied:

detailed log
$     docker build -t jena-fuseki:$JENA_4_VERSION \
        --build-arg JENA_VERSION=$JENA_4_VERSION \
        --no-cache dockerfiles/jena-fuseki2-docker
Sending build context to Docker daemon  14.34kB
Step 1/46 : ARG JAVA_VERSION=17
Step 2/46 : ARG ALPINE_VERSION=3.17.1
Step 3/46 : ARG JENA_VERSION=""
Step 4/46 : ARG FUSEKI_DIR=/fuseki
Step 5/46 : ARG FUSEKI_JAR=jena-fuseki-server-${JENA_VERSION}.jar
Step 6/46 : ARG JAVA_MINIMAL=/opt/java-minimal
Step 7/46 : FROM eclipse-temurin:${JAVA_VERSION}-alpine AS base
17-alpine: Pulling from library/eclipse-temurin
7264a8db6415: Pull complete 
994e83f716a0: Pull complete 
00dcebe8dfc8: Pull complete 
920d29c34aa3: Pull complete 
6024980cb8b4: Pull complete 
Digest: sha256:039f727ed86402f37524b5d01a129947e2f061d5856901d07d73a454e689bb13
Status: Downloaded newer image for eclipse-temurin:17-alpine
 ---> e1e1ae8cfac2
Step 8/46 : ARG JAVA_MINIMAL
 ---> Running in 0fcbfcfbc09b
Removing intermediate container 0fcbfcfbc09b
 ---> cd16996022a6
Step 9/46 : ARG JENA_VERSION
 ---> Running in f3c18d7e2f7f
Removing intermediate container f3c18d7e2f7f
 ---> b7bba15799bf
Step 10/46 : ARG FUSEKI_DIR
 ---> Running in 4983f43eb8dd
Removing intermediate container 4983f43eb8dd
 ---> cd129a5640ff
Step 11/46 : ARG FUSEKI_JAR
 ---> Running in 2dba661827b8
Removing intermediate container 2dba661827b8
 ---> c766f874444b
Step 12/46 : ARG REPO=https://repo1.maven.org/maven2
 ---> Running in ce1dedcc1a65
Removing intermediate container ce1dedcc1a65
 ---> ff4157878350
Step 13/46 : ARG JAR_URL=${REPO}/org/apache/jena/jena-fuseki-server/${JENA_VERSION}/${FUSEKI_JAR}
 ---> Running in e5cfaa3f2c9f
Removing intermediate container e5cfaa3f2c9f
 ---> c96c1863e5a3
Step 14/46 : RUN [ "${JENA_VERSION}" != "" ] || { echo -e '\n**** Set JENA_VERSION ****\n' ; exit 1 ; }
 ---> Running in 91f2676e7072
Removing intermediate container 91f2676e7072
 ---> ff36cd948457
Step 15/46 : RUN echo && echo "==== Docker build for Apache Jena Fuseki ${JENA_VERSION} ====" && echo
 ---> Running in 8ede2bb8fa45

==== Docker build for Apache Jena Fuseki 4.8.0 ====

Removing intermediate container 8ede2bb8fa45
 ---> fe9b9687981f
Step 16/46 : RUN apk add --no-cache curl binutils
 ---> Running in f71115288c71
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
(1/9) Installing libgcc (12.2.1_git20220924-r10)
(2/9) Installing libstdc++ (12.2.1_git20220924-r10)
(3/9) Installing zstd-libs (1.5.5-r4)
(4/9) Installing binutils (2.40-r7)
(5/9) Installing libunistring (1.1-r1)
(6/9) Installing libidn2 (2.3.4-r1)
(7/9) Installing nghttp2-libs (1.55.1-r0)
(8/9) Installing libcurl (8.2.1-r0)
(9/9) Installing curl (8.2.1-r0)
Executing busybox-1.36.1-r2.trigger
OK: 42 MiB in 49 packages
Removing intermediate container f71115288c71
 ---> 60232b020d1b
Step 17/46 : WORKDIR $FUSEKI_DIR
 ---> Running in 82b7768048a5
Removing intermediate container 82b7768048a5
 ---> 878f433a5337
Step 18/46 : COPY download.sh .
 ---> 1ed672b784d0
Step 19/46 : RUN chmod a+x download.sh
 ---> Running in 59d3a5d42423
Removing intermediate container 59d3a5d42423
 ---> 2fb3a8038cdb
Step 20/46 : RUN ./download.sh --chksum sha1 "$JAR_URL"
 ---> Running in 807129d3f736
Fetching https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-server/4.8.0/jena-fuseki-server-4.8.0.jar
Fetching https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-server/4.8.0/jena-fuseki-server-4.8.0.jar.sha1
Good download: jena-fuseki-server-4.8.0.jar
Removing intermediate container 807129d3f736
 ---> c9f25f0cb3ad
Step 21/46 : ARG JDEPS_EXTRA="jdk.crypto.cryptoki,jdk.crypto.ec"
 ---> Running in bf3e92ca33e6
Removing intermediate container bf3e92ca33e6
 ---> c93c5f5da818
Step 22/46 : RUN   JDEPS="$(jdeps --multi-release base --print-module-deps --ignore-missing-deps ${FUSEKI_JAR})"  &&   jlink         --compress 2 --strip-debug --no-header-files --no-man-pages         --output "${JAVA_MINIMAL}"         --add-modules "${JDEPS},${JDEPS_EXTRA}"
 ---> Running in 23df180dd161
Removing intermediate container 23df180dd161
 ---> 9616a231d347
Step 23/46 : ADD entrypoint.sh .
 ---> b5e64880512d
Step 24/46 : ADD log4j2.properties .
 ---> f4505af7bdb7
Step 25/46 : FROM alpine:${ALPINE_VERSION}
3.17.1: Pulling from library/alpine
8921db27df28: Pull complete 
Digest: sha256:f271e74b17ced29b915d351685fd4644785c6d1559dd1f2d4189a5e851ef753a
Status: Downloaded newer image for alpine:3.17.1
 ---> 042a816809aa
Step 26/46 : ARG JENA_VERSION
 ---> Running in c7877cfbae63
Removing intermediate container c7877cfbae63
 ---> 1ac2ce891ed8
Step 27/46 : ARG JAVA_MINIMAL
 ---> Running in 79edf2f58ff1
Removing intermediate container 79edf2f58ff1
 ---> c2e89c2863cd
Step 28/46 : ARG FUSEKI_DIR
 ---> Running in 39ce9929c3f4
Removing intermediate container 39ce9929c3f4
 ---> c9e6b2a10598
Step 29/46 : ARG FUSEKI_JAR
 ---> Running in c52de90045e0
Removing intermediate container c52de90045e0
 ---> e4c974c2e90c
Step 30/46 : COPY --from=base /opt/java-minimal /opt/java-minimal
 ---> 885061dd06b9
Step 31/46 : COPY --from=base /fuseki /fuseki
 ---> 8bee8d94bcdc
Step 32/46 : WORKDIR $FUSEKI_DIR
 ---> Running in c8f298873718
Removing intermediate container c8f298873718
 ---> 85566306eab5
Step 33/46 : ARG LOGS=${FUSEKI_DIR}/logs
 ---> Running in 92f6a8dfcca5
Removing intermediate container 92f6a8dfcca5
 ---> 2b80c8af8454
Step 34/46 : ARG DATA=${FUSEKI_DIR}/databases
 ---> Running in 5c8aa25ca076
Removing intermediate container 5c8aa25ca076
 ---> 414846ed6a28
Step 35/46 : ARG JENA_USER=fuseki
 ---> Running in ef2322610b4c
Removing intermediate container ef2322610b4c
 ---> 696fd6eb4d51
Step 36/46 : ARG JENA_GROUP=$JENA_USER
 ---> Running in b3784415c87f
Removing intermediate container b3784415c87f
 ---> 4b013e397dc1
Step 37/46 : ARG JENA_GID=1000
 ---> Running in 1ea29f0ef1fb
Removing intermediate container 1ea29f0ef1fb
 ---> 912160583e69
Step 38/46 : ARG JENA_UID=1000
 ---> Running in 874fd1e11a9a
Removing intermediate container 874fd1e11a9a
 ---> 528145993286
Step 39/46 : RUN addgroup -g "${JENA_GID}" "${JENA_GROUP}" &&     adduser "${JENA_USER}" -G "${JENA_GROUP}" -s /bin/ash -u "${JENA_UID}" -H -D
 ---> Running in f3de664e38d9
Removing intermediate container f3de664e38d9
 ---> 7eaf2dcfc222
Step 40/46 : RUN mkdir --parents "${FUSEKI_DIR}" &&     chown -R $JENA_USER ${FUSEKI_DIR}
 ---> Running in 01e6fadfd3ee
Removing intermediate container 01e6fadfd3ee
 ---> 06b97c469856
Step 41/46 : USER $JENA_USER
 ---> Running in 8cb859a7aeb8
Removing intermediate container 8cb859a7aeb8
 ---> 357ba258de22
Step 42/46 : RUN     mkdir -p $LOGS &&     mkdir -p $DATA &&     chmod a+x entrypoint.sh
 ---> Running in 305a2d46f8cd
mkdir: can't create directory '/fuseki/logs': Permission denied
The command '/bin/sh -c mkdir -p $LOGS &&     mkdir -p $DATA &&     chmod a+x entrypoint.sh' returned a non-zero code: 1

I did run export JENA_4_VERSION=4.8.0 just before this command. I noticed that the output still says Step 3/46 : ARG JENA_VERSION="" which doesn't seem right.

I also tried docker-compose up -d and got the same error.

(EDIT:) I'm running docker commands as non-root, but my user account is in the docker group.

I have Ubuntu 22.04 and installed docker.io and docker-compose using apt (not snap) from the Ubuntu repos. These are my versions:

ii  docker-compose 1.29.2-1                  all          define and run multi-container Docker applications with YAML
ii  docker.io      20.10.25-0ubuntu1~22.04.1 amd64        Linux container runtime

@@ -0,0 +1 @@
Commit: 26153afe9a229bb7a609d5406d899eb240ab385e
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more than a little bit cryptic. Maybe this README could explain that these files were copied from the Jena repo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1!

I thought I had written about it somewhere. I will have a look and add it to this README.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still needs to be done, right?

@kinow
Copy link
Collaborator Author

kinow commented Aug 22, 2023

Hi @osma! 👋

I just tried the following and it worked:

$ cd Skosmos
$ git reset --hard kinow/fuseki-docker
$ export JENA_4_VERSION=4.8.0
docker build -t jena-fuseki:$JENA_4_VERSION \
        --build-arg JENA_VERSION=$JENA_4_VERSION \
        --no-cache dockerfiles/jena-fuseki2-docker
[+] Building 76.9s (26/26) FINISHED                              docker:default
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 3.57kB                                     0.0s
 => [internal] load metadata for docker.io/library/alpine:3.17.1           2.2s
 => [internal] load metadata for docker.io/library/eclipse-temurin:17-alp  2.0s
 => [auth] library/eclipse-temurin:pull token for registry-1.docker.io     0.0s
 => [auth] library/alpine:pull token for registry-1.docker.io              0.0s
 => [base  1/11] FROM docker.io/library/eclipse-temurin:17-alpine@sha256  29.6s
 => => resolve docker.io/library/eclipse-temurin:17-alpine@sha256:039f727  0.0s
 => => sha256:7264a8db6415046d36d16ba98b79778e18accee6ffa 3.40MB / 3.40MB  2.9s
 => => sha256:994e83f716a0db024fb37caf707eae5af27172a0fff 9.28MB / 9.28MB  8.0s
 => => sha256:00dcebe8dfc82ba6d7ef1c3aba301f87bfcf69 144.11MB / 144.11MB  26.1s
 => => sha256:039f727ed86402f37524b5d01a129947e2f061d5856901d 320B / 320B  0.0s
 => => sha256:3f30352a87719a81c03c9fad62073e8ec8c44fc736d 1.37kB / 1.37kB  0.0s
 => => sha256:e1e1ae8cfac28d1b75eb2dfa65fdc27070c2e364ee0 4.63kB / 4.63kB  0.0s
 => => extracting sha256:7264a8db6415046d36d16ba98b79778e18accee6ffa71850  0.1s
 => => sha256:920d29c34aa30c6d8a6a682852c76d9ea24a83c8bab5c45 176B / 176B  3.2s
 => => sha256:6024980cb8b498b9a2ef4e378a9cfe55c4dbd7a0f6c623e 733B / 733B  3.5s
 => => extracting sha256:994e83f716a0db024fb37caf707eae5af27172a0fffb691c  0.5s
 => => extracting sha256:00dcebe8dfc82ba6d7ef1c3aba301f87bfcf69a05c6e9fcc  3.3s
 => => extracting sha256:920d29c34aa30c6d8a6a682852c76d9ea24a83c8bab5c459  0.0s
 => => extracting sha256:6024980cb8b498b9a2ef4e378a9cfe55c4dbd7a0f6c623e7  0.0s
 => [stage-1 1/7] FROM docker.io/library/alpine:3.17.1@sha256:f271e74b17c  5.6s
 => => resolve docker.io/library/alpine:3.17.1@sha256:f271e74b17ced29b915  0.0s
 => => sha256:f271e74b17ced29b915d351685fd4644785c6d1559d 1.64kB / 1.64kB  0.0s
 => => sha256:93d5a28ff72d288d69b5997b8ba47396d2cbb62a72b5d87 528B / 528B  0.0s
 => => sha256:042a816809aac8d0f7d7cacac7965782ee2ecac3f21 1.47kB / 1.47kB  0.0s
 => => sha256:8921db27df2831fa6eaa85321205a2470c669b855f3 3.37MB / 3.37MB  5.3s
 => => extracting sha256:8921db27df2831fa6eaa85321205a2470c669b855f3ec95d  0.1s
 => [internal] load build context                                          0.0s
 => => transferring context: 6.12kB                                        0.0s
 => [base  2/11] RUN [ "4.8.0" != "" ] || { echo -e '\n**** Set JENA_VERS  1.2s
 => [base  3/11] RUN echo && echo "==== Docker build for Apache Jena Fuse  0.5s
 => [base  4/11] RUN apk add --no-cache curl binutils                      1.9s
 => [base  5/11] WORKDIR /fuseki                                           0.1s
 => [base  6/11] COPY download.sh .                                        0.0s
 => [base  7/11] RUN chmod a+x download.sh                                 0.3s
 => [base  8/11] RUN ./download.sh --chksum sha1 "https://repo1.maven.or  12.1s
 => [base  9/11] RUN   JDEPS="$(jdeps --multi-release base --print-modul  26.3s
 => [base 10/11] ADD entrypoint.sh .                                       0.0s
 => [base 11/11] ADD log4j2.properties .                                   0.0s
 => [stage-1 2/7] COPY --from=base /opt/java-minimal /opt/java-minimal     0.3s
 => [stage-1 3/7] COPY --from=base /fuseki /fuseki                         0.2s
 => [stage-1 4/7] WORKDIR /fuseki                                          0.0s
 => [stage-1 5/7] RUN addgroup -g "1000" "fuseki" &&     adduser "fuseki"  0.3s
 => [stage-1 6/7] RUN mkdir --parents "/fuseki" &&     chown -R fuseki /f  0.5s
 => [stage-1 7/7] RUN     mkdir -p /fuseki/logs &&     mkdir -p /fuseki/d  0.3s
 => exporting to image                                                     0.6s
 => => exporting layers                                                    0.6s
 => => writing image sha256:9250a08d4769af1db7cdad8b34ab62516375dedf9309d  0.0s
 => => naming to docker.io/library/jena-fuseki:4.8.0 

(EDIT:) I'm running docker commands as non-root, but my user account is in the docker group.

I'm also running Ubuntu, but jammy, Ubuntu 22.04.3 LTS. And my user is also in the docker group.

It might be due to the version of Docker?

kinow@ranma:~/Development/php/workspace/Skosmos$ docker --version
Docker version 24.0.5, build ced0996
kinow@ranma:~/Development/php/workspace/Skosmos$ docker compose version
Docker Compose version v2.20.2

I had a similar issue at $work this week. In that case, there was a feature in Docker... Compose (I think?) that was only available in the newest version.

I am not sure if this is a hard requirement, so I can try to test it with your versions if you think it's better that we support older versions. WDYT?

@osma
Copy link
Member

osma commented Aug 23, 2023

Thanks @kinow !

First, I also have Ubuntu 22.04 (jammy), not 23.04, sorry for the typo. I edited the comment above to clarify.

I removed the old Docker installation that came from the Ubuntu repos and switched to the official docker repo instead. Now I have the exact same versions of docker and docker compose that you have. And I was able to build the image successfully, though I still had some mysterious errors when trying to start it. In any case docker compose is now working and starting up all three containers 🎉

I will give a few suggestions for the documentation in this PR, then let's try to get this merged soon-ish to the master branch and also to the skosmos-3 branch.

For the Skosmos 3 PHPUnit and Cypress tests I think we should use the Docker Compose setup for running Skosmos and Fusek, so this will require some changes to the current PHPUnit setup including init_fuseki.sh. I will open a separate issue about these ideas.

dockerfiles/README.md Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@kinow kinow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced docker-compose by docker compose and added a section for prerequisites. Let me know if this looks better, please, @osma . Thanks!

dockerfiles/README.md Show resolved Hide resolved
@osma
Copy link
Member

osma commented Aug 24, 2023

Thanks @kinow ! Regarding the documentation:

  1. The prerequisites section is good!
  2. Also the change to use docker compose looks good
  3. I think the jena-fuseki2-docker/README.md file still needs to be expanded, it just contains the commit id?
  4. There was a minor bug in the README instructions for running the container using docker run; the command didn't work when run from the root of the project, unlike the previous docker build command. I fixed this in a follow-up commit to your PR branch (thanks for allowing it!) by adding dockerfiles/ to the path. (Also fixed a minor grammar problem)

I tested the instructions once again, and everything seemed to work, so I would be ready to merge this as soon as the jena-fuseki2-docker/README.md file is ready. I will merge this first to the master branch (Skosmos 2.x) but soon after also to the skosmos-3 branch because we're going to need it e.g. for implementing #1488 .

Please don't rebase this PR branch anymore as I might be basing some of my work on this!

@kinow
Copy link
Collaborator Author

kinow commented Aug 24, 2023

Please don't rebase this PR branch anymore as I might be basing some of my work on this!

Noted!

There was a minor bug in the README instructions for running the container using docker run; the command didn't work when run from the root of the project, unlike the previous docker build command. I fixed this in a follow-up commit to your PR branch (thanks for allowing it!) by adding dockerfiles/ to the path. (Also fixed a minor grammar problem)

Thank you!

I think the jena-fuseki2-docker/README.md file still needs to be expanded, it just contains the commit id?

Ah, sorry, you mentioned that in a review and I forgot to update that. Will add some text in some hours. Thanks again @osma !

@sonarcloud
Copy link

sonarcloud bot commented Aug 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.3% 1.3% Duplication

@kinow
Copy link
Collaborator Author

kinow commented Aug 24, 2023

Done, @osma !

image

@osma
Copy link
Member

osma commented Aug 24, 2023

Excellent, thanks a lot @kinow !

@osma osma merged commit 99448fc into NatLibFi:master Aug 24, 2023
@osma osma added this to the 2.17 milestone Aug 24, 2023
@kinow kinow deleted the fuseki-docker branch August 24, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Dependency changes, security updates, infrastructure tweaks & general mainenance
Projects
Status: Done (verified in test.dev.finto.fi, set Milestone 3.0 for both issue & PR)
Development

Successfully merging this pull request may close these issues.

Update Fuseki Docker
2 participants