Skip to content

Commit

Permalink
Remove DB-related files.
Browse files Browse the repository at this point in the history
  • Loading branch information
mopore committed Jul 31, 2023
1 parent 7cb1fb0 commit 7300246
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 812 deletions.
58 changes: 3 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
Marcel Know How Backend Project
===============================
This projects holds the backend functionality for Marcel's know how session.

The backend provides an API to query general knowledge questions to be used in a quiz game.



# Local Development Environment

## Using Visual Studio Code
Expand All @@ -36,7 +34,6 @@ Install the dependencies with:
pip install -r requirements.txt
```


# Shipping
## Local Docker Environment
Local Docker image build:
Expand All @@ -59,56 +56,7 @@ docker buildx build \
Push manually build image to registry
Use `docker push jnicontainerregistry.azurecr.io/marcel_knowhow_backend:latest` to push the image to the registry.

## Continuous Integration and Deployment with GitHub Actions
The project comes with a GitHub Actions workflow to build and push the image to the Azure Container Registry (see `./.github/workflows/backend.yaml`).


# Database
The backend projects relies on a neo4j database to store the questions and answering results.
All database related files are located in the `./db` folder.

## Import of Questions
To collect and import questions to the database the python script at
`./db/questions_input/create_questions.py` is doing the job.
This script is
- Querying questions from the OpenAI GPT-4 model
- Writes the question in JSON file
- Reads the JSON file and creates a cypher import file for neo4j
![Ingress Configuration](./images/backend_ingress.png)

The cypher import file will be written to `./db/docker_image/import/questsions_import.cypher`.
To run the script you have to provide a valid OpenAI API key in a `.env` file in the project's root.

Example for `.env` file:
```
openai.api_key=<YOUR_KEY>
```
The database Dockerfile in `./db/docker_image/Dockerfile` will take the import file to create
the containing questions as new nodes in the database when the database container starts up.

## Docker Setup
Always _cd_ into `./db/docker_image`.
### Local Docker Environment

Build a local Docker image with:
```bash
docker buildx build -t marcel_knowhow_db .
```

Use the docker compose file with `docker-compose up -d` to start the backend.
Connect to local neo4j browser with `http://localhost:7474/browser/`.

### Image for Azure Container Registry and Azure Container Apps Service
Build the docker image with:
```bash
docker buildx build \
--platform linux/amd64 \
-t jnicontainerregistry.azurecr.io/marcel_knowhow_db \
.
```

Push manually build image to registry
Use `docker push jnicontainerregistry.azurecr.io/marcel_knowhow_db:latest` to push the image to the registry.

### Continuous Integration and Deployment with GitHub Actions
TODO This is not yet implemented.
The project comes with a GitHub Actions workflow to build and push the image to the Azure Container Registry (see `./.github/workflows/db.yaml`).
## Continuous Integration and Deployment with GitHub Actions
The project comes with a GitHub Actions workflow to build and push the image to the Azure Container Registry (see `./.github/workflows/backend.yaml`).
20 changes: 0 additions & 20 deletions db/docker_image/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions db/docker_image/docker-compose.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions db/docker_image/import.sh

This file was deleted.

Loading

0 comments on commit 7300246

Please sign in to comment.