Commit cdb53e74 authored by Matthias's avatar Matthias
Browse files

cleanup readme

parent 3acde840
Pipeline #29270 passed with stages
in 2 minutes and 29 seconds
......@@ -2,71 +2,4 @@
API to start, stop, manage import processes for memobase. Will be used in the Admin Interface (Drupal).
#Dependencies
See Dockerfile for dependencies.
# Deploy in Kubernetes
```
cd kubernetes-manifests
kubectl apply -f .
```
# Start the app
```
python3 -m venv venv
. venv/bin/activate
pip3 install -r requirements.txt
pip3 install -e .
export KAFKA_BOOTSTRAP_SERVERS=mb-ka1.memobase.unibas.ch:9092,mb-ka2.memobase.unibas.ch:9092,mb-ka3.memobase.unibas.ch:9092
cd import_api_app
mkdir charts
./pull-charts.sh
python3 main.py
cd ..
export FLASK_APP=import_api_app
export FLASK_ENV=development
export SFTP_HOST=mb-wf2.memobase.unibas.ch
export SFTP_PORT=80
export SFTP_USER=mb_sftp
export SFTP_PASSWORD=XXXXXXX
flask run
```
This will start a development web server hosting your application, which you will be able to see by navigating to http://127.0.0.1:5000/.
# Update the charts
Currently the app only use the helm charts stored in /charts. They are updated at deployment via the Dockerfile.
To update them use `/pull-charts.sh`. The source is <https://gitlab.switch.ch/memoriav/memobase-2020/services/import-process/import-process-cli/-/blob/master/afz/becker/pull-charts.sh>
# Run tests
The tests work locally if you have a connection to a kubernetes cluster, i.e. kubectl is configured. To run the tests, from the root directory, run `pytest`. It is not possible to run them in gitlab yet.
# Force code-style checking before committing
Done with pre-commits and flake8 : <https://flake8.pycqa.org/en/latest/user/using-hooks.html#>
Needs to run in the console of the venv
```
pre-commit install
```
# Automatically fix coding errors
```
autopep8 --in-place --aggressive --aggressive *.py
```
# How to work with microK8s if needed
- Install microK8s following https://ubuntu.com/tutorials/install-a-local-kubernetes-with-microk8s#1-overview (better than the microK8s site)
- Don't forget the firewall rules :
```
sudo ufw allow in on cni0 && sudo ufw allow out on cni0
sudo ufw default allow routed
```
- At the end do `sudo microk8s kubectl config view --raw > $HOME/.kube/config`. This way, the python client will find the kubernetes configuration
# Might be needed for tests to run
- in venv : pip install -e .
Check swagger for documentation of implemented endpoints.
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment