Skip to content

Commit

Permalink
Added bufsize parameter to copyApp and brought back the docker group
Browse files Browse the repository at this point in the history
  • Loading branch information
awicenec committed Feb 9, 2022
1 parent bcc6720 commit bf0175d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion daliuge-engine/dlg/apps/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def run(self):
# @param tag daliuge
# @param[in] param/appclass Application Class/dlg.apps.simple.CopyApp/String/readonly/
# \~English Application class
# @param[in] param/bufsize buffer size/65536/Integer/readwrite/
# \~English Application class
# @par EAGLE_END
class CopyApp(BarrierAppDROP):
"""
Expand All @@ -121,6 +123,8 @@ class CopyApp(BarrierAppDROP):
[dlg_streaming_input("binary/*")],
)

_bufsize = dlg_int_param("bufsize", 65536)

def run(self):
self.copyAll()

Expand All @@ -134,7 +138,7 @@ def copyRecursive(self, inputDrop):
self.copyRecursive(child)
else:
for outputDrop in self.outputs:
droputils.copyDropContents(inputDrop, outputDrop)
droputils.copyDropContents(inputDrop, outputDrop, bufsize=self._bufsize)


class SleepAndCopyApp(SleepApp, CopyApp):
Expand Down
2 changes: 2 additions & 0 deletions daliuge-engine/docker/prepare_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@
# get current user info
pw = pwd.getpwuid(os.getuid())
gr = grp.getgrgid(pw.pw_gid)
dgr = grp.getgrnam('docker')
with open(os.path.join(workdir, "passwd"), "wt") as file:
file.write(open(os.path.join(template_dir, "passwd.template"), "rt").read())
file.write(f"{pw.pw_name}:x:{pw.pw_uid}:{pw.pw_gid}:{pw.pw_gecos}:/:/bin/bash")
with open(os.path.join(workdir, "group"), "wt") as file:
file.write(open(os.path.join(template_dir, "group.template"), "rt").read())
file.write(f"{gr.gr_name}:x:{gr.gr_gid}:")

print(dgr.gr_gid)
3 changes: 2 additions & 1 deletion daliuge-engine/run_engine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ common_prep ()
mkdir -p ${DLG_ROOT}/testdata
mkdir -p ${DLG_ROOT}/code
# get current user and group id and prepare passwd and group files
python docker/prepare_user.py
DOCKER_GID=`python docker/prepare_user.py`
DOCKER_OPTS=${DOCKER_OPTS}" --group-add ${DOCKER_GID}"
DOCKER_OPTS=${DOCKER_OPTS}" -v ${DLG_ROOT}/workspace/settings/passwd:/etc/passwd"
DOCKER_OPTS=${DOCKER_OPTS}" -v ${DLG_ROOT}/workspace/settings/group:/etc/group"
DOCKER_OPTS=${DOCKER_OPTS}" -v ${PWD}/dlg/manager:/dlg/lib/python3.8/site-packages/dlg/manager"
Expand Down

0 comments on commit bf0175d

Please sign in to comment.