Skip to content

Commit

Permalink
IL-421 kubernetes yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixFehseTNG committed Apr 10, 2024
1 parent 4e35dcf commit 8fa4ccc
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
16 changes: 15 additions & 1 deletion src/examples/issue_classification_user_journey.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion src/examples/issue_classification_user_journey/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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\""]
Original file line number Diff line number Diff line change
@@ -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
Binary file modified src/examples/issue_classification_user_journey/requirements.txt
Binary file not shown.

0 comments on commit 8fa4ccc

Please sign in to comment.