Skip to content

Commit ae44805

Browse files
committed
Update the data-loader example to use the public image
1 parent f397390 commit ae44805

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

sample-apps/data-loader/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
FROM python:3.8-slim
22

3-
COPY app.py /
3+
COPY app.py /usr/local/bin
44

55
RUN pip install foundationdb==6.2.10
6+
RUN groupadd --gid 4059 fdb && \
7+
useradd --gid 4059 --uid 4059 --shell /usr/sbin/nologin fdb
68

7-
CMD python /app.py
9+
# Set to the numeric UID of fdb user to satisfy PodSecurityPolices which enforce runAsNonRoot
10+
USER 4059
11+
12+
ENTRYPOINT [ "python", "/usr/local/bin/app.py" ]

sample-apps/data-loader/app.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def write_batch(tr, batch_size, value_size):
2525
for _ in range(0, value_size):
2626
value.append(random.randint(0, 255))
2727
tr[key] = bytes(value)
28-
pass
2928

3029

3130
def load_data(keys, batch_size, value_size):
@@ -36,8 +35,6 @@ def load_data(keys, batch_size, value_size):
3635
print("Writing batch %d" % batch)
3736
write_batch(db, batch_size, value_size)
3837

39-
pass
40-
4138

4239
if __name__ == "__main__":
4340
parser = argparse.ArgumentParser(description="Load random data into FDB")

sample-apps/data-loader/job.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spec:
77
template:
88
spec:
99
containers:
10-
- image: fdb-data-loader
10+
- image: foundationdb/fdb-data-loader:latest
1111
imagePullPolicy: IfNotPresent
1212
name: fdb-data-loader
1313
env:
@@ -31,8 +31,6 @@ spec:
3131
- "--copy-library"
3232
- "6.3"
3333
- "--copy-library"
34-
- "6.1"
35-
- "--copy-library"
3634
- "6.2"
3735
- "--init-mode"
3836
- "--require-not-empty"
@@ -51,4 +49,4 @@ spec:
5149
- key: cluster-file
5250
path: fdb.cluster
5351
- name: dynamic-conf
54-
emptyDir: {}
52+
emptyDir: {}

0 commit comments

Comments
 (0)