Skip to content

Commit cac0549

Browse files
committed
Add benchmark shell
1 parent 0f533bd commit cac0549

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

test/stack/31-benchmark-shell.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: benchmark-shell
6+
spec:
7+
template:
8+
spec:
9+
containers:
10+
- name: benchmark-shell
11+
image: docker.stackable.tech/stackable/hadoop:3.4.0-stackable0.0.0-dev
12+
env:
13+
- name: HADOOP_CONF_DIR
14+
value: /stackable/conf/hdfs
15+
- name: KRB5_CONFIG
16+
value: /stackable/kerberos/krb5.conf
17+
- name: HADOOP_OPTS
18+
value: -Djava.security.krb5.conf=/stackable/kerberos/krb5.conf
19+
command:
20+
- /bin/bash
21+
- -c
22+
- |
23+
set -ex
24+
klist -k /stackable/kerberos/keytab
25+
26+
log_in () { kdestroy; kinit -kt /stackable/kerberos/keytab $1/benchmark-shell.default.svc.cluster.local; }
27+
28+
log_in admin
29+
30+
bin/hdfs dfs -mkdir -p /bench
31+
bin/hdfs dfs -ls /bench
32+
33+
# for i in $(seq 0 10); do echo "Creating $i" && bin/hdfs dfs -put -f /etc/hosts /bench/$i; done
34+
35+
# Watch out for the exact command you are using! (e.g. don't use "du -h /""). Checl the NameNode logs to
36+
# make sure you actually produce enough OPA calls.
37+
# time bin/hdfs dfs -du -h /bench
38+
39+
# So that you can run the benchmark manually
40+
sleep infinity
41+
42+
exit 0
43+
volumeMounts:
44+
- name: hdfs-config
45+
mountPath: /stackable/conf/hdfs
46+
- name: kerberos
47+
mountPath: /stackable/kerberos
48+
volumes:
49+
- name: hdfs-config
50+
configMap:
51+
name: simple-hdfs
52+
- name: kerberos
53+
ephemeral:
54+
volumeClaimTemplate:
55+
metadata:
56+
annotations:
57+
secrets.stackable.tech/class: kerberos-default
58+
secrets.stackable.tech/scope: service=benchmark-shell
59+
secrets.stackable.tech/kerberos.service.names: admin,alice,bob
60+
spec:
61+
storageClassName: secrets.stackable.tech
62+
accessModes:
63+
- ReadWriteOnce
64+
resources:
65+
requests:
66+
storage: "1"
67+
securityContext:
68+
fsGroup: 1000
69+
runAsGroup: 1000
70+
runAsUser: 1000
71+
restartPolicy: OnFailure

0 commit comments

Comments
 (0)