Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wakefield-movie-recommender
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Frank Sauerburger
wakefield-movie-recommender
Compare revisions
1c6395755a8d1cd861c235e516bda1e9ed9a9f46 to 77424910ae191e03c7c7092318f4891ce1cb6b07
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
frank/wakefield-movie-recommender
Select target project
No results found
77424910ae191e03c7c7092318f4891ce1cb6b07
Select Git revision
Branches
main
Swap
Target
frank/wakefield-movie-recommender
Select target project
frank/wakefield-movie-recommender
1 result
1c6395755a8d1cd861c235e516bda1e9ed9a9f46
Select Git revision
Branches
main
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Add healthz endpoint
· 4b445984
Frank Sauerburger
authored
2 years ago
Verified
4b445984
Add deployment
· 77424910
Frank Sauerburger
authored
2 years ago
Verified
77424910
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app.py
+7
-1
7 additions, 1 deletion
app.py
deployment.yaml
+61
-0
61 additions, 0 deletions
deployment.yaml
with
68 additions
and
1 deletion
app.py
View file @
77424910
...
...
@@ -16,7 +16,7 @@ index = qgram.QGramIndex()
for
title
,
_
in
titles
.
values
():
index
.
add_term
(
title
)
@app.route
(
"
/
"
)
@app.route
(
"
/
titles
"
)
def
suggest
():
"""
Serve movie title suggestions
"""
query
=
request
.
args
.
get
(
"
q
"
)
...
...
@@ -28,3 +28,9 @@ def suggest():
return
{
"
suggestions
"
:
results
[:
100
]
}
@app.route
(
"
/titles/healthz
"
)
def
healthz
():
"""
Show healthz status
"""
results
=
index
.
search
(
"
lord
"
)
return
{
"
ok
"
:
bool
(
results
)}
This diff is collapsed.
Click to expand it.
deployment.yaml
0 → 100644
View file @
77424910
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
movie-titles
labels
:
app
:
movie-titles
spec
:
replicas
:
1
selector
:
matchLabels
:
app
:
movie-titles
template
:
metadata
:
labels
:
app
:
movie-titles
spec
:
containers
:
-
name
:
limiter
image
:
gitlab.sauerburger.com:5049/frank/wakefield-movie-recommender:0.1.0
livenessProbe
:
httpGet
:
path
:
/titles/healthz
port
:
8000
periodSeconds
:
15
failureThreshold
:
3
---
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
movie-titles-service
spec
:
ports
:
-
port
:
8000
protocol
:
TCP
targetPort
:
8000
selector
:
app
:
movie-titles
---
apiVersion
:
networking.k8s.io/v1
kind
:
Ingress
metadata
:
annotations
:
cert-manager.io/cluster-issuer
:
"
letsencrypt-production"
kubernetes.io/ingress.class
:
nginx
name
:
"
movie-titles"
spec
:
rules
:
-
host
:
"
movie-recommender.ds.sit-servers.net"
http
:
paths
:
-
path
:
"
/titles"
pathType
:
Prefix
backend
:
service
:
name
:
"
movie-titles-service"
port
:
number
:
8000
tls
:
-
hosts
:
-
"
movie-recommender.ds.sit-servers.net"
secretName
:
movie-recommender-tls-secret
This diff is collapsed.
Click to expand it.