Giter Site home page Giter Site logo

service-search's Introduction

EuroCC Service Search

Documentation Status

Simple service search for NCC Poland

Running with minikube

Working with minikube registry

Start your minikube cluster with ` minikube start --driver=kvm --addons=registry,ingress `

Check the registry is up using:

` curl -I $(minikube ip):5000 `

Check the registry ip:

` minikube ip `

Then add "insecure-registries" : [ "registry_ip:5000" ] to /etc/docker/daemon.json (replace registry_ip with minikuobe ip).

In order to apply above option you need to restart docker deamon:

` sudo systemctl daemon-reload; sudo systemctl restart docker `

Note: above procedure needs to be repeated after minikube restarts, since ip address is likely to change.

Relase process

Following instructions will build artifacts, including docker images. Currently they rely on minikubes' registry enabled.

  1. Run cc_service_search_frontend/build_and_deploy.sh. This will build all frontend files and update them in cc_service_search/website_data/ directory. Please note, that old files in this dir will be deleted

1. Change appVersion in helm chart to expected version after bump 1. Commit all changes 1. Bump version using:

` bumpversion patch # or minor or major ` this will update the package version and create a corresponding git tag

1. Run make dist to build python release files 1. Run kubernetes/image/build.sh to build and push docker images

  • note, that this automagically calls make dist
  • currently this pushes images to minikube image registry

Running localy with minikube

1. Go through steps described in "Release process" in order to build images (if no changes were made, only the last step is needed) 1. Deploy with

` cd kubernetes helm dep update helm helm dependency build helm helm install cc-service-search helm --create-namespace -n cc-service-search `

1. Get service url with minikube service -n cc-service-search --url cc-service-search-cc-service-search 1. Add ip from previous step to /etc/hosts with domain matching the one in helms' chart values.yaml file (by default - ccsearch.com)

Database initialization, data upload and managment

Currently all database operations are performed using provided cli script cc_service_search. Scripts expects one of the following actions:

  • initdb - initialize opensearch index
  • dropdb - drop opensearch index
  • upload - upload data the index from xlsx file
  • compare - compare exising data and candidate xlsx file (read only operation)

Script expects the following env variables to be set in the environment:

` DB_HOST= # for minikube deployments - obtain with `minikube ip` DB_PORT=32123 DB_USER=admin DB_PASSWORD= # must match value provided via admin_db_password variable in helms' chart values.yaml file DB_INDEX=cc_service_database ` Alternatively, you may create .env file with the following values set.

In order to initialize database run:

` cc_service_search initdb `

Next, upload data from xlsx file

` cc_service_search upload --file <xlsx file path> `

Localization support

  • i18next framework is used, with browserLanguageDetector (default settings, see https://github.com/i18next/i18next-browser-languageDetector) * Displayed language may be forced via query string parameter (http://localhost:3000/?lng=pl) or cookie (e.g. set cookie i18next=pl)

  • Place your translations inside cc_search_frontend/public/locales directory

  • note, that opensearch queries rely on language detection performed by i18next/LangugeDetector - detected language value is used to filter documents. Please note it is not strictly necessary to have a translation avaliable (i.e. placed in directory above),

  • note - if language is not set by your website via cookie or url query string param, LangugeDetector will try different methods for language determination, including browser language settings. In such case we may land with language set to unsopprted one.

    In order to handle such situation search page will render in english (or with locale defined by FALLBACK_LOCALE env variable - if visible within flask server env). All opensearch queries also use that language.

Features

  • TODO

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.