Skip to content

Commit

Permalink
Merge pull request #545 from johscheuer/update-data-loader
Browse files Browse the repository at this point in the history
Update the data-loader example to use the public image
  • Loading branch information
johscheuer authored Mar 13, 2021
2 parents 976f02a + ae44805 commit 923e25f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
9 changes: 7 additions & 2 deletions sample-apps/data-loader/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
FROM python:3.8-slim

COPY app.py /
COPY app.py /usr/local/bin

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

CMD python /app.py
# Set to the numeric UID of fdb user to satisfy PodSecurityPolices which enforce runAsNonRoot
USER 4059

ENTRYPOINT [ "python", "/usr/local/bin/app.py" ]
3 changes: 0 additions & 3 deletions sample-apps/data-loader/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def write_batch(tr, batch_size, value_size):
for _ in range(0, value_size):
value.append(random.randint(0, 255))
tr[key] = bytes(value)
pass


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

pass


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Load random data into FDB")
Expand Down
6 changes: 2 additions & 4 deletions sample-apps/data-loader/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
template:
spec:
containers:
- image: fdb-data-loader
- image: foundationdb/fdb-data-loader:latest
imagePullPolicy: IfNotPresent
name: fdb-data-loader
env:
Expand All @@ -31,8 +31,6 @@ spec:
- "--copy-library"
- "6.3"
- "--copy-library"
- "6.1"
- "--copy-library"
- "6.2"
- "--init-mode"
- "--require-not-empty"
Expand All @@ -51,4 +49,4 @@ spec:
- key: cluster-file
path: fdb.cluster
- name: dynamic-conf
emptyDir: {}
emptyDir: {}

0 comments on commit 923e25f

Please sign in to comment.