diff --git a/src/examples/issue_classification_user_journey.ipynb b/src/examples/issue_classification_user_journey.ipynb index 47174d979..e011c0708 100644 --- a/src/examples/issue_classification_user_journey.ipynb +++ b/src/examples/issue_classification_user_journey.ipynb @@ -756,7 +756,21 @@ "\n", "### Docker\n", "\n", - "poetry export --without-hashes --format=requirements.txt > requirements.txt\n" + "Write dockerfile that will create a new docker container with the FastAPI program.\n", + "We assume, your github token for the Intelligence Layer is exported to the `GITHUB_TOKEN` environmental variable. \n", + "Build the docker container with [`GITHUB_TOKEN=$GITHUB_TOKEN `]\n", + "```shell\n", + "docker build . -t classification-service:local -f Dockerfile --secret id=GITHUB_TOKEN\n", + "```\n", + "Run the docker container and \n", + "```shell\n", + "docker run -p 8000:80 classification-service:local;2D \n", + "```\n", + "\n", + "poetry export --without-hashes --format=requirements.txt > requirements.txt\n", + "\n", + "### Kubernetes\n", + "\n" ] } ], diff --git a/src/examples/issue_classification_user_journey/Dockerfile b/src/examples/issue_classification_user_journey/Dockerfile index ce2449d44..b5ae130b1 100644 --- a/src/examples/issue_classification_user_journey/Dockerfile +++ b/src/examples/issue_classification_user_journey/Dockerfile @@ -27,4 +27,5 @@ COPY --from=builder /app /app COPY main.py /app/main.py ENV PATH="/app/venv/bin:$PATH" -ENTRYPOINT [ "uvicorn", "--host", "0.0.0.0", "--port", "80", "app.main:app" ] +WORKDIR /app +ENTRYPOINT [ "hypercorn", "main:app", "--bind", "0.0.0.0:80", "--access-logfile", "-", "--access-logformat", "%(h)s %(l)s %(l)s %(t)s \"%(r)s\" %(s)s %(b)s %(L)s \"%(f)s\" \"%(a)s\""] diff --git a/src/examples/issue_classification_user_journey/classification_deployment.yaml b/src/examples/issue_classification_user_journey/classification_deployment.yaml new file mode 100644 index 000000000..47b235a71 --- /dev/null +++ b/src/examples/issue_classification_user_journey/classification_deployment.yaml @@ -0,0 +1,23 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: banana +spec: + replicas: 1 + selector: + matchLabels: + app: banana + template: + metadata: + labels: + app: banana + spec: + containers: + - env: + - name: AA_TOKEN + valueFrom: + secretKeyRef: + key: AA_TOKEN + name: aa-token + image: classification-service:local + name: banana diff --git a/src/examples/issue_classification_user_journey/requirements.txt b/src/examples/issue_classification_user_journey/requirements.txt index 00f5ff0d3..6c27f5a4d 100644 Binary files a/src/examples/issue_classification_user_journey/requirements.txt and b/src/examples/issue_classification_user_journey/requirements.txt differ