argoproj / argoproj/argo-workflows

Mounted S3 artifact permissions are not consistent when disabling archivation

Open
#14,792 5 comments 0 reactions 0 assignees View on GitHub
area/artifacts good first issue
Dominant language
Go
Stars
17k
Forks
3.7k
Avg merge
1d 20h
Merged PRs (30d)
138

Description

### Pre-requisites

- [x] I have double-checked my configuration
- [x] I have tested with the `:latest` image tag (i.e. `quay.io/argoproj/workflow-controller:latest`) and can confirm the issue still exists on `:latest`. If not, I have explained why, **in detail**, in my description below.
- [x] I have searched existing issues and could not find a match for this bug
- [ ] I'd like to contribute the fix myself (see [contributing guide](https://github.com/argoproj/argo-workflows/blob/main/docs/CONTRIBUTING.md))

### What happened? What did you expect to happen?

When we store output artifacts to S3 and mount them back in a next step then the file mode is different when we disable archivation on the output artifact. Setting the mode explictly on the input artifact fixes the issue.

The issue can be reproduced using the workflow attached here. When you add the `archive: none: {}` to the output artifact then file permissions are 600. When you remove it then they will be 644.

### Version(s)

v3.6.10

### Paste a minimal workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflow that uses private images.

```YAML
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: "test-workflow"
namespace: argo-workflows
spec:
serviceAccountName: argo-workflow
entrypoint: check-permissions
templates:
- name: check-permissions
dag:
tasks:
- name: save-to-s3
template: create-and-save
- name: check-perms
template: check-file-perms
dependencies: [save-to-s3]

- name: create-and-save
container:
image: alpine:3
command: [sh, -c]
args: ["echo 'test content' > /tmp/myfile.txt && chmod 644 /tmp/myfile.txt"]
outputs:
artifacts:
- name: myfile
path: /tmp/myfile.txt
archive:
none: {}
s3:
key: myfile.txt

- name: check-file-perms
inputs:
artifacts:
- name: myfile
path: /tmp/myfile.txt
s3:
key: myfile.txt

container:
image: alpine:3
command: [sh, -c]
args: ["ls -l /tmp/myfile.txt"]
```

### Logs from the workflow controller

```text
No logs
```

### Logs from in your workflow's wait container

```text
No logs
```

Contributor guide

Open the contributing guide

Research direction

Run the supplied workflow twice, with and without `archive: none: {}`, and compare the mounted artifact permissions. Start by tracing the artifact upload, archiving, and download paths in the workflow controller; done means both cases preserve the original 644 mode without requiring an explicit input mode, with a regression test covering the reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go, kubernetes
Domain
backend, cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.