Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENG-1756: (WIP!) Malloc Benchmark Testing #476

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
include src/macros.mk

REGISTRY := local
BASE_IMAGE ?= common
.DEFAULT_GOAL :=

.PHONY: default
default: \
out/qos_client/index.json \
Expand Down Expand Up @@ -76,6 +78,14 @@ out/qos_client/index.json: \
)
$(call build,qos_client)

out/benchmarking/index.json: \
out/$(BASE_IMAGE)/index.json \
src/images/benchmarking/Containerfile \
$(shell git ls-files \
src/benchmarking \
)
$(call build,benchmarking,,$(BASE_IMAGE))

out/common/index.json: \
src/images/common/Containerfile
$(call build,common)
Expand Down
67 changes: 67 additions & 0 deletions kustomize/base/qos_enclave/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: qos-enclave
spec:
template:
spec:
containers:
- name: container-name-placeholder
resources:
requests:
memory: 1054Mi
hugepages-2Mi: 1Gi
smarter-devices/nitro_enclaves: "1"
limits:
hugepages-2Mi: 1Gi
smarter-devices/nitro_enclaves: "1"
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MEMORY_MIB
valueFrom:
resourceFieldRef:
resource: requests.hugepages-2Mi
divisor: 1Mi
- name: ENCLAVE_NAME
value: $(POD_NAMESPACE)/$(POD_NAME)
- name: EIF_PATH
value: "/nitro.eif"
- name: ENCLAVE_CID
value: "16"
- name: CPU_COUNT
value: "2"
ports:
- name: nitro-health
containerPort: 8080
livenessProbe:
httpGet:
path: /
port: nitro-health
readinessProbe:
httpGet:
path: /
port: nitro-health
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsGroup: 0
runAsUser: 0
volumeMounts:
- name: run-enclave
mountPath: /run/nitro_enclaves
- name: log-enclave
mountPath: /var/log/nitro_enclaves
volumes:
- name: run-enclave
emptyDir: {}
- name: log-enclave
emptyDir: {}
2 changes: 2 additions & 0 deletions kustomize/base/qos_enclave/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources:
- deployment.yaml
62 changes: 3 additions & 59 deletions kustomize/components/qos_enclave/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: example
name: qos-enclave
labels:
qos.turnkey.io: app
spec:
template:
spec:
Expand All @@ -10,61 +12,3 @@ spec:
image: ghcr.io/tkhq/qos_enclave
command:
- /qos_enclave
resources:
requests:
memory: 1054Mi
hugepages-2Mi: 1Gi
smarter-devices/nitro_enclaves: "1"
limits:
hugepages-2Mi: 1Gi
smarter-devices/nitro_enclaves: "1"
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MEMORY_MIB
valueFrom:
resourceFieldRef:
resource: requests.hugepages-2Mi
divisor: 1Mi
- name: ENCLAVE_NAME
value: $(POD_NAMESPACE)/$(POD_NAME)
- name: EIF_PATH
value: "/nitro.eif"
- name: ENCLAVE_CID
value: "16"
- name: CPU_COUNT
value: "2"
ports:
- name: nitro-health
containerPort: 8080
livenessProbe:
httpGet:
path: /
port: nitro-health
readinessProbe:
httpGet:
path: /
port: nitro-health
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsGroup: 0
runAsUser: 0
volumeMounts:
- name: run-enclave
mountPath: /run/nitro_enclaves
- name: log-enclave
mountPath: /var/log/nitro_enclaves
volumes:
- name: run-enclave
emptyDir: {}
- name: log-enclave
emptyDir: {}
3 changes: 3 additions & 0 deletions kustomize/components/qos_enclave/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
resources:
- ../../base/qos_enclave

patches:
- target:
group: apps
Expand Down
14 changes: 14 additions & 0 deletions kustomize/components/qos_enclave_benchmarking/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: qos-enclave-benchmarking
labels:
qos.turnkey.io: benchmarking
spec:
template:
spec:
containers:
- name: qos-enclave-benchmarking
image: ghcr.io/tkhq/benchmarking/qos_enclave
command:
- /benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
resources:
- ../../base/qos_enclave

patches:
- target:
group: benchmarking
version: v1
kind: Deployment
labelSelector: qos.turnkey.io=benchmarking
path: deployment.yaml
Loading