Search plugin development

In the .env file I had the server name (the one that run docker) and I added its ip address. But I the following error when I restart the services using make reload-env:

[root@indico-sup-dev cern-search-rest-api]# make reload-env
docker-compose -f docker-compose.full.yml down --volumes
Stopping cern-search-rest-api_worker_1        ... done
Stopping cern-search-rest-api_nginx_1         ... done
Stopping cern-search-rest-api_flower_1        ... done
Stopping cern-search-rest-api                 ... done
Stopping cern-search-rest-api_kibana_1        ... done
Stopping cern-search-rest-api_postgres_1      ... done
Stopping cern-search-rest-api_redis_1         ... done
Stopping cern-search-rest-api_elasticsearch_1 ... done
Stopping cern-search-rest-api_tika_1          ... done
Stopping cern-search-rest-api_rabbitmq_1      ... done
Removing cern-search-rest-api_worker_1        ... done
Removing cern-search-rest-api_nginx_1         ... done
Removing cern-search-rest-api_flower_1        ... done
Removing cern-search-rest-api                 ... done
Removing cern-search-rest-api_kibana_1        ... done
Removing cern-search-rest-api_postgres_1      ... done
Removing cern-search-rest-api_redis_1         ... done
Removing cern-search-rest-api_elasticsearch_1 ... done
Removing cern-search-rest-api_tika_1          ... done
Removing cern-search-rest-api_rabbitmq_1      ... done
Removing network cern-search-rest-api_default
Removing volume cern-search-rest-api_es-data
Removing volume cern-search-rest-api_pgsql-data
Removing volume cern-search-rest-api_nginx-run
Removing volume cern-search-rest-api_nginx-cache
Removing volume cern-search-rest-api_nginx-tls
Removing volume cern-search-rest-api_files
docker-compose -f docker-compose.full.yml rm -f
No stopped containers
sh scripts/gen-cert.sh
docker-compose -f docker-compose.full.yml up -d --remove-orphans
Creating network "cern-search-rest-api_default" with the default driver
ERROR: Failed to Setup IP tables: Unable to enable SKIP DNAT rule:  (iptables failed: iptables --wait -t nat -I DOCKER -i br-319e9cabf9f5 -j RETURN: iptables: No chain/target/match by that name.
 (exit status 1))
make: *** [build-env] Error 1

I’ll rebuilt the environment and see if this helps.

make destroy-env and make env. See if that helps.

This is exactly what I am doing.

On another topic that I just found out: When I am checking the various docker ports the connects are http. Today our security team rolled out a patch to allow only https. My question is how do I change docker to use https ?

You would have to configure nginx and other services with SSL certificates. However, can’t you just develop those services locally, without exposing them to the Internet?

This is what I am doing. They are local services, but I was wondering about the https implications.

I just tried my test code (to create a single entry in ES the same way the plugin is doing) and I get a 201 error (no entries are created in ES).:

 python test_backend.py
/opt/indico/.venv/lib/python2.7/site-packages/urllib3/connectionpool.py:986: InsecureRequestWarning: Unverified HTTPS request is being made to host 'indico-sup-dev.fnal.gov'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning,
Cannot create the search id mapping: 201 - {"created":"2020-06-25T14:50:51.541958+00:00","id":"1","links":{"self":"https://indico-sup-dev.fnal.gov:8080/api/record/1"},"metadata":{"_access":{"delete":[""],"owner":[""],"read":[""],"update":[""]},"_data":{"$schema":"https://indico-sup-dev.fnal.gov:8080/schemas/indico/indico-events_v1.0.0.json","category_path":["Committees/Meetings","FNAL Committees/Meetings","Run II PMG"],"description":"","event_type":"meeting","id":100,"location":"Comitium","speakers_chairs":[],"title":"Run II PMG","url":"https://indicoint.fnal.gov/event/100/"},"control_number":"1","creation_date":"2006-05-15T21:40:22.761000+00:00","end_date":"2007-09-20T19:30:00+00:00","start_date":"2007-09-20T18:00:00+00:00"},"updated":"2020-06-25T14:50:51.541963+00:00"}

This is your plugin code, you should probably check it out first and assess if it is buggy or not.

This is my plan too. The connectivity issue was the big issue and that is resolved. THANK YOU

The new entry was successfully inserted in the invenio PostgreSQL database but was never entered in ES. How can I find the error that ES created?

Use docker-compose to see the logs of the service.

Checking again at the https://cern-search.docs.cern.ch/example/ documentation I noticed that it has changed and response.status_code = 200 has been replaced by response.ok. This made the difference! Everything is working as it should.

THANK YOU!

Hey @penelopec,

can you share with us the news regarding the development progress of the plugin? The CERN Search Team is really pushing towards decommissioning of the old search service which Indico is forced to use until the plugin has been developed. We don’t want to end up in a situation in which we will not be able to use either the old or new service. Can you please let us know the following:

  • what is missing from the plugin to make it usable?
  • can you make an estimate when the plugin might be available?
  • is there anything we can help you with? (or we could also just take over the development of the plugin from this point)

Regards,
Michal