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

virtiofs, weird behaviour with extended attributes, and amazonlinux2 docker image #1115

Open
1 of 5 tasks
avoidik opened this issue Aug 19, 2024 · 1 comment
Open
1 of 5 tasks

Comments

@avoidik
Copy link

avoidik commented Aug 19, 2024

Description

hello,

I am trying to understand the root cause of the following issue with the amazonlinux:2 docker image. Whenever I run cp inside of a running container the command behaves differently depending on the mount-type filesystem specified. Please check the repo-steps below where I was trying to run cp -au . dst-dir in 3 different scenarios. The first one was unexpectedly failing with No data available, while the other two were working as expected, in all test-cases the cp command was the same.

Version

colima version 0.7.3
git commit: a66b375e8df84ff2860797efc683e66632bcbce3
limactl version 0.23.1
qemu-img version 9.0.2

Operating System

  • macOS Intel <= 13 (Ventura)
  • macOS Intel >= 14 (Sonoma)
  • Apple Silicon <= 13 (Ventura)
  • Apple Silicon >= 14 (Sonoma)
  • Linux

Output of colima status

Please check the repro-steps below.

Reproduction Steps

Prepare a sample directory structure:

$ mkdir test ; cd test
$ mkdir src ; mkdir result
$ echo 'empty file' | tee ./src/dummy

Check a negative test-case scenario (expected - success, received - failure):

$ colima start colima-arm --cpu 2 --memory 4 --disk 20 --arch aarch64 --vm-type=vz --vz-rosetta --mount-type=virtiofs
INFO[0000] starting colima [profile=arm]
INFO[0000] runtime: docker
INFO[0001] creating and starting ...                     context=vm
INFO[0012] provisioning ...                              context=docker
INFO[0013] starting ...                                  context=docker
INFO[0014] done
$ colima status colima-arm
INFO[0000] colima [profile=arm] is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0000] socket: unix:///Users/user.name/.colima/arm/docker.sock
$ docker run -i --rm -u 0:0 -v $(pwd)/src:/asset-input:delegated -v $(pwd)/result:/asset-output:delegated -w /asset-input amazonlinux:2 \
    bash -c 'yum install -y -q util-linux; findmnt /asset-input; cp -au . /asset-output'
Failed to get D-Bus connection: Operation not permitted
TARGET       SOURCE                              FSTYPE   OPTIONS
/asset-input mount0[/temp/test/src] virtiofs rw,relatime
/usr/bin/cp: preserving permissions for '/asset-output/.': No data available
$ echo $?
1
$ colima delete colima-arm -f

Check a positive test-case scenario (vz, expected - success, received - success):

$ colima start colima-arm --cpu 2 --memory 4 --disk 20 --arch aarch64 --vm-type=qemu --cpu-type=host --mount-type=sshfs
INFO[0000] starting colima [profile=arm]
INFO[0000] runtime: docker
INFO[0000] creating and starting ...                     context=vm
INFO[0011] provisioning ...                              context=docker
INFO[0012] starting ...                                  context=docker
INFO[0013] done
$ colima status colima-arm
INFO[0000] colima [profile=arm] is running using QEMU
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/user.name/.colima/arm/docker.sock
$ docker run -i --rm -u 0:0 -v $(pwd)/src:/asset-input:delegated -v $(pwd)/result:/asset-output:delegated -w /asset-input amazonlinux:2 \
    bash -c 'yum install -y -q util-linux; findmnt /asset-input; cp -au . /asset-output'
Failed to get D-Bus connection: Operation not permitted
TARGET       SOURCE                                                   FSTYPE     OPTIONS
/asset-input :/Users/user.name[/temp/test/src] fuse.sshfs rw,nosuid,nodev,relatime,user_id=502,group_id=1000,allow_other
$ echo $?
0
$ colima delete colima-arm -f

Check a positive test-case scenario (rosetta, expected - success, received - success):

$ colima start colima-arm --cpu 2 --memory 4 --disk 20 --arch aarch64 --vm-type=vz --vz-rosetta --mount-type=sshfs
INFO[0000] starting colima [profile=arm]
INFO[0000] runtime: docker
INFO[0000] creating and starting ...                     context=vm
INFO[0011] provisioning ...                              context=docker
INFO[0012] starting ...                                  context=docker
INFO[0013] done
$ colima status colima-arm
INFO[0000] colima [profile=arm] is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/user.name/.colima/arm/docker.sock
$ docker run -i --rm -u 0:0 -v $(pwd)/src:/asset-input:delegated -v $(pwd)/result:/asset-output:delegated -w /asset-input amazonlinux:2 \
    bash -c 'yum install -y -q util-linux; findmnt /asset-input; cp -au . /asset-output'
docker run -i --rm -u 0:0 -v $(pwd)/src:/asset-input:delegated -v $(pwd)/result:/asset-output:delegated -w /asset-input amazonlinux:2     bash -c 'yum install -y -q util-linux; findmnt /asset-input; cp -au . /asset-output'
Failed to get D-Bus connection: Operation not permitted
TARGET       SOURCE                                                   FSTYPE     OPTIONS
/asset-input :/Users/user.name[/temp/test/src] fuse.sshfs rw,nosuid,nodev,relatime,user_id=502,group_id=1000,allow_other
$ echo $?
0
$ colima delete colima-arm -f

Expected behaviour

I would like to understand what's wrong with the virtiofs file-system, and make sure that cp command works as expected.

Additional context

if I try colima 0.5.6, it doesn't have this issue

@avoidik
Copy link
Author

avoidik commented Aug 19, 2024

probably, a coreutils bug unrelated to colima, which had been fixed a long time ago between these two versions:

  • amazonlinux:2023 has cp (GNU coreutils) 8.32
  • amazonlinux:2 has cp (GNU coreutils) 8.22

I cannot explain why it does work on 0.5.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant