Skip to content

Commit

Permalink
add deployment configuration examples
Browse files Browse the repository at this point in the history
  • Loading branch information
masci committed Feb 20, 2024
1 parent beb59d5 commit 55e2b4e
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 0 deletions.
13 changes: 13 additions & 0 deletions deploy/pipelines/double_number.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
components:
first_addition:
init_parameters:
add: 2
type: haystack.testing.sample_components.add_value.AddFixedValue
double:
init_parameters: {}
type: haystack.testing.sample_components.double.Double
connections:
- receiver: double.value
sender: first_addition.result
max_loops_allowed: 100
metadata: {}
14 changes: 14 additions & 0 deletions deploy/pipelines/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
components:
hello:
init_parameters: {}
type: hayhooks.testing.components.Hello
fstring:
init_parameters:
template: "This is the greeting: {greeting}!"
variables: ["greeting"]
type: haystack.testing.sample_components.fstring.FString
connections:
- receiver: fstring.greeting
sender: hello.output
max_loops_allowed: 100
metadata: {}
40 changes: 40 additions & 0 deletions deploy/service_with_confiigmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
kind: Pod
apiVersion: v1
metadata:
name: hayhooks
labels:
app: haystack
spec:
containers:
# We use the unstable release to keep this example fresh and relevant.
- image: deepset/hayhooks:main
name: hayhooks
# Since we're using the moving tag `main`, we have to always pull
# to be sure we're getting the latest.
imagePullPolicy: Always
# Mount the ConfigMap containing the pipelines under
# /opt/pipelines in the container
volumeMounts:
- name: config-volume
mountPath: /opt/pipelines
# Instruct Hayhooks that the pipelines we want to run at startup
# will be found under /opt/pipelines
env:
- name: HAYHOOKS_PIPELINES_DIR
value: /opt/pipelines
volumes:
- name: config-volume
configMap:
name: pipelines
---

kind: Service
apiVersion: v1
metadata:
name: haystack-service
spec:
selector:
app: haystack
ports:
# Default port used by the Hayhooks Docker image
- port: 1416
48 changes: 48 additions & 0 deletions deploy/service_with_deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: haystack-deployment
spec:
replicas: 3
selector:
matchLabels:
app: haystack
template:
metadata:
labels:
app: haystack
spec:
containers:
# We use the unstable release to keep this example fresh and relevant.
- image: deepset/hayhooks:main
name: hayhooks
# Since we're using the moving tag `main`, we have to always pull
# to be sure we're getting the latest.
imagePullPolicy: Always
# Mount the ConfigMap containing the pipelines under
# /opt/pipelines in the container
volumeMounts:
- name: config-volume
mountPath: /opt/pipelines
# Instruct Hayhooks that the pipelines we want to run at startup
# will be found under /opt/pipelines
env:
- name: HAYHOOKS_PIPELINES_DIR
value: /opt/pipelines
volumes:
- name: config-volume
configMap:
name: pipelines

---

kind: Service
apiVersion: v1
metadata:
name: haystack-service
spec:
selector:
app: haystack
ports:
# Default port used by the Hayhooks Docker image
- port: 1416
27 changes: 27 additions & 0 deletions deploy/simple_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
kind: Pod
apiVersion: v1
metadata:
name: hayhooks
labels:
app: haystack
spec:
containers:
# We use the unstable release to keep this example fresh and relevant.
- image: deepset/hayhooks:main
name: hayhooks
# Since we're using the moving tag `main`, we have to always pull
# to be sure we're getting the latest.
imagePullPolicy: Always

---

kind: Service
apiVersion: v1
metadata:
name: haystack-service
spec:
selector:
app: haystack
ports:
# Default port used by the Hayhooks Docker image
- port: 1416

0 comments on commit 55e2b4e

Please sign in to comment.