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

chmods 777 for podman #1516

Closed
Closed
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
2 changes: 2 additions & 0 deletions cwltool/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,11 @@ def create_runtime(
runtime = [user_space_docker_cmd, "run"]
else:
runtime = ["docker", "run", "-i"]
os.chmod(os.path.realpath(self.outdir), 0o777)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

@fabricebrito fabricebrito Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this what we had to do.

While running, I get:

(base) [jovyan@jupyter-fbrito-dev workspace]$ ll -a /tmp/eatw95id
total 65932
drwxrwxrwx 2 jovyan users      4096 Sep 14 10:41 .
drwxrwxrwt 1 root   root       4096 Sep 14 10:39 ..
-rw-r--r-- 1 101000 100099 67505506 Sep 14 10:41 S2B_53HPA_20210723_0_L2A.tif

while running:

INFO [job band_math.cwl] /tmp/eatw95id$ docker \
    run \
    -i \
    --mount=type=bind,source=/tmp/eatw95id,target=/BixLsD \
    --mount=type=bind,source=/tmp/bnll6nbs,target=/tmp \
    --workdir=/BixLsD \
    --read-only=true \
    --user=1001:100 \
    --rm \
    --cidfile=/tmp/catzbo8t/20210914103914-031344.cid \
    --env=TMPDIR=/tmp \
    --env=HOME=/BixLsD \
    docker.io/terradue/otb-7.2.0 \
    otbcli_BandMathX \
    -out \
    S2B_53HPA_20210723_0_L2A.tif \
    -exp \
    '(im3b1 == 8 or im3b1 == 9 or im3b1 == 0 or im3b1 == 1 or im3b1 == 2 or im3b1 == 10 or im3b1 == 11) ? -2 : (im1b1 - im2b1) / (im1b1 + im2b1)' \
    -il \
    /vsicurl/https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/53/H/PA/2021/7/S2B_53HPA_20210723_0_L2A/B8A.tif \
    /vsicurl/https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/53/H/PA/2021/7/S2B_53HPA_20210723_0_L2A/B12.tif \
    /vsicurl/https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/53/H/PA/2021/7/S2B_53HPA_20210723_0_L2A/SCL.tif

with:

(base) [jovyan@jupyter-fbrito-dev workspace]$ id
uid=1001(jovyan) gid=100(users) groups=100(users)

So anything below 777, fails with a permission denied

self.append_volume(
runtime, os.path.realpath(self.outdir), self.builder.outdir, writable=True
)
os.chmod(os.path.realpath(self.tmpdir), 0o777)
self.append_volume(
runtime, os.path.realpath(self.tmpdir), self.CONTAINER_TMPDIR, writable=True
)
Expand Down