[freedict] Re: Docker network for Kosh deployment

  • From: Francisco Mondaca <f.mondaca@xxxxxxxxxxxx>
  • To: freedict@xxxxxxxxxxxxx
  • Date: Thu, 09 Apr 2020 17:10:38 +0200

Hallo zusammen!


Francisco Mondaca schrieb am 01.04.2020, 22:10 +0200:
Last week I could finally deploy Kosh at the freedict server within
the
host network.

Thanks for your work!

You are welcome! Thank you too for your work @freedict!


The only problem now is the lack of disk space. 
Docker places its images and containers in /var/lib/docker.

[…]

Ok, we have now a dramatically enlarged /var partition. Could you
please check
again whether this satisfies the requirements of Kosh?

Yes. Now the currently available 149 dicts have been indexed. Thanks!
Kosh is running in port 5000:

curl -X GET "
http://localhost:5000/kosh/afr_deu/restful/entries?field=headword&query=al&query_type=prefix
" -H "accept: application/json" 

curl -X GET "
http://localhost:5000/kosh/lat_eng/restful/entries?field=headword&query=*utus&query_type=wildcard
" -H "accept: application/json"

curl -X GET "
https://kosh.uni-koeln.de/freedict/eng_pol/restful/entries?field=translation&query=kszta%C5%82towa%C4%87&query_type=term
" -H "accept: application/json"

curl -X GET "
http://localhost:5000/kosh/eng_pol/restful/entries?field=translation&query=kszta%C5%82towa%C4%87&query_type=term
" -H "accept: application/json"



Anyway, as I was looking that /var was running out of space I
decided
to stop with the local deployment. I also noticed that inotify-
tools is
not installed. I wanted to synchronize any update of the freeedict
with
with the copies of the XMLs in my home folder.

I have installed inotify-tools. You can watch /var/www/freedict-
database.json.
However, I think you could also use a per-user systemd path unit.
This would
be fairly simple to write, just tell me if you want some pointers. In
case you
switch to systemd path units, please let me know so that I can remove
inotify-tools again.
 
I implemented systemd path locally and it worked. I will send you on a
separate email the files.

I then thought that I could make this with python, but 2.7 is
installed and I
could not install miniconda. 

Nope, Python 3.x is already installed. Debian (and Ubuntu) is
slightly
special. It installs python 2.x as `python` and python 3.x as
`python3`, so it
is in fact installed. If you want to install a module, try
`pip3 install --user FOO`.

I do have ubuntu 18.04 on my laptop and debian 9 in one of our VMs. I
both machines python2 and python3 are installed. In both when exec
'python --version' I can see as result the python3 version. When exec
'python3 --version' or 'python2 --version' I can see the related 2 or 3
version. As I do normally work with miniconda and thus I do not
normally work with 'native' python, it is good to know that I have to
explicitly call the python version that is required.


For these reasons, I decided to create a couple of scripts in order
to
allow anyone deploy the freedict collection in their own
servers/computers:
https://github.com/vocabulista/fd-kosh


I haven't checked the scripts yet and am still not 100 % sure whether
they are
required but what about documenting your steps on our wiki:

    https://github.com/freedict/fd-dictionaries/wiki

Thanks! There are two branches in 
https://github.com/vocabulista/fd-kosh: master and local_dep. local_dep
has been deployed at the freedict server. Those users interested in
deploying the APIs locally would be fine working with the master
branch.


I would also suggest placing your scripts under /freedict/, should I
add a
repository for you?

Great! Probably the easiest way to do this would be that you fork my
repo into the freedict account. Do you agree?


I implemented this workflow in one of our VMs. You can see the list
of
the APIs here: 

https://docs.google.com/spreadsheets/d/1vgHSGVLsn1tX5CMW_YDZYClOSy9BOld4cDFtiIFaXrY/edit#gid=0

Maybe you can send me this off-list or add this to our wiki. Thanks
:). Using
Google docs is, at least for me, not convenient.

Ok. This is only a temporary solution ;) I will probably place a table
with API info at the wiki. 


I still think that it would be nicer to deploy Kosh in the freedict
server and offer the APIs in something like freedict.org/kosh. But
I
understand that doing the required changes could be a hassle for
you at

No, it is not. Please, let's get the process smooth for us and later
for
everybody who wants to deploy Kosh and FreeDict on their own servers
by
documenting the steps and getting a complete list of dependencies.

Ok. Thank you very much for your help for deploying Kosh @freedict!


I would like to link it at Kosh's website and I also would like to
link it at
the freedict website too. What do you think?

I would prefer starting with a page on the Wiki first and move it to
the web
site as soon as we have a more stable experience. Is this fine with
you?


Sure. We still have to improve our own website. And the APIs have to be
tested. 

Best,

Francisco

-- 
FreeDict - Free And Open Dictionaries
Manage your subscription at https://www.freelists.org/list/freedict
Wiki: https://github.com/freedict/fd-dictionaries/wiki
Web: http://freedict.org

Other related posts: