Hello,
I try to use a custom .stxxl with my docker installation but I can't get it working.
The container is launch with this command:
/usr/bin/docker run \
--volume=/srv/osrm/data:/srv/osrm/data \
--volume=/srv/osrm/profiles:/srv/osrm/profiles \
--rm=true \
osrm/osrm-backend:v5.7.4 osrm-extract \
-p /srv/osrm/profiles/profile-car.lua /srv/osrm/data/car-20170614.osm.pbf
You can see that I have put a .stxxl in /srv/osrm/data:
root@OSRM-Prep:~/tom# l -lha /srv/osrm/data/
total 16K
drwxr-xr-x 3 root root 4,0K juin 14 18:00 .
drwxr-xr-x 5 root root 4,0K avril 13 11:12 ..
-rwxr-xr-x 1 root root 101 juin 14 17:54 .stxxl
drwxr-xr-x 2 root root 4,0K juin 14 18:00 car
lrwxrwxrwx 1 root root 30 juin 14 18:00 car-20170614.osm.pbf -> /20170614.osm.pbf
-rw-r--r-- 1 root root 0 juin 14 18:00 car-20170614.osrm.timestamp
root@OSRM-Prep:~/tom# cat /srv/osrm/data/.stxxl
# Doit se trouver dans /srv/osrm/data/
disk=/srv/osrm/data/stxxl,75G,syscall autogrow direct unlink
However, I have an error message:
Digest: sha256:01f7415e014851afc0135c1bb29525988bed15ee028b740a17f8544933b2abe3
Status: Downloaded newer image for osrm/osrm-backend:v5.7.4
[info] Using script /srv/osrm/profiles/profile-car.lua
[info] Input file: car-20170614.osm.pbf
[info] Profile: profile-car.lua
[info] Threads: 8
[info] Parsing in progress..
[STXXL-MSG] STXXL v1.4.1 (prerelease/Release) (git e7d36edd8152c73b115bd36cbcf566626d995434)
[STXXL-ERRMSG] Warning: no config file found.
[STXXL-ERRMSG] Using default disk configuration.
[STXXL-MSG] Disk '/var/tmp/stxxl' is allocated, space: 1000 MiB, I/O implementation: syscall autogrow delete_on_exit queue=0 devid=0
[info] input file generated by osmium/1.5.1
[info] timestamp: n/a
[info] Found 3 turn restriction tags:
[info] motorcar
[info] motor_vehicle
[info] vehicle
How can I use my custom file please ?
Regards.
STXXL looks for the .stxxl
file in the $(pwd)
in the container, not in /srv/osrm/data
.
The WORKDIR
in the Dockerfile is set to /opt
.
You can override this by adding -w=/srv/osrm/data
to your docker run
invocation and it should fix the problem.
Oh so that just something like that.
However, when I insert your code I get another error:
[info] Using script /srv/osrm/profiles/profile-car.lua
[info] Input file: car-20170615.osm.pbf
[info] Profile: profile-car.lua
[info] Threads: 8
[info] Parsing in progress..
[STXXL-MSG] STXXL v1.4.1 (prerelease/Release) (git e7d36edd8152c73b115bd36cbcf566626d995434)
[STXXL-MSG] Disk '/srv/osrm/data/stxxl' is allocated, space: 71525 MiB, I/O implementation: syscall autogrow direct=on queue=0 devid=0 unlink_on_open
terminate called after throwing an instance of 'sol::error'
what(): lua: error: /srv/osrm/profiles/profile-car.lua:5: module 'lib/access' not found:
no field package.preload['lib/access']
no file '/srv/osrm/profiles/lib/access.lua'
no file './lib/access.lua'
no file '/usr/local/share/lua/5.1/lib/access.lua'
no file '/usr/local/share/lua/5.1/lib/access/init.lua'
no file '/usr/local/lib/lua/5.1/lib/access.lua'
no file '/usr/local/lib/lua/5.1/lib/access/init.lua'
no file '/usr/share/lua/5.1/lib/access.lua'
no file '/usr/share/lua/5.1/lib/access/init.lua'
no file './lib/access.so'
no file '/usr/local/lib/lua/5.1/lib/access.so'
no file '/usr/lib/lua/5.1/lib/access.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
As you can see my .stxxl is used but some libs are not found.
Can I just 'send' the .stxxl file in docker /opt/ without set a new workspace ?
Thank you very much for your help.
you can set the environment variable STXXLCFG=/path/to/my/file
:
docker run -e STXXLCFG=/data/.stxxl -v $(pwd):/data osrm-backend osrm-extract ...
@Oyabi looks like you only copied the car profile but not the profiles/lib
directory the car profile depends on. The profiles/lib
directory contains shared code for all profiles.
https://github.com/Project-OSRM/osrm-backend/tree/master/profiles
Just copy it to where you saved your car profile.
Thank you very much boys, it's working !
Have a nice day.
Most helpful comment
@Oyabi looks like you only copied the car profile but not the
profiles/lib
directory the car profile depends on. Theprofiles/lib
directory contains shared code for all profiles.https://github.com/Project-OSRM/osrm-backend/tree/master/profiles
Just copy it to where you saved your car profile.