dls-controls / dev-c7

A container for running the DLS Controls RHEL7 developer environment on a RHEL8 workstation
Apache License 2.0
0 stars 2 forks source link

Support for VSCode #15

Closed gilesknap closed 2 years ago

gilesknap commented 2 years ago
MJGaughran commented 2 years ago

RHEL7 containers still work for me in vscode 1.68.1. Can you please provide instructions for reproducing this error, as well as the exact error message?

All documentation on the relevant repositories state that RHEL7+ are supported: https://code.visualstudio.com/docs/remote/linux https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers and others.

There are no commits in the relevant repositories that appear to include such a restriction.

There are a few minor issues, but I'll have a go at updating my .devcontainer.json file to fix them.

MJGaughran commented 2 years ago

There is no image specification in your .devcontainer.json file: "image": "gcr.io/diamond-pubreg/controls/dev-c7:latest",

EDIT: I assume you removed it when moving to Python 3 build. Still, I am unable to reproduce your error:

(master) [root@pc0129 topup]$ cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)

pc0129 is because I lacked the -h=dev-c7 argument; adding it works fine.

MJGaughran commented 2 years ago

Also, it is worth pointing out that an important benefit of containers during development is to allow for a standard platform everywhere. Restricting it to a very specific Linux distribution would be incredibly stupid, and I would expect to see many complaints from the millions of users. Here are the fairly loose requirements: https://code.visualstudio.com/docs/remote/linux#_remote-host-container-wsl-linux-prerequisites

The main concern is the deprecation of glibc etc used by RHEL7, but we will hopefully be much further down the transition to RHEL8 / RHEL9 by that point.

MJGaughran commented 2 years ago

I've tested out the additions from before your Python 3 conversion: https://github.com/dls-controls/dev-c7/blob/0c7beee9a769308c86ee5ec82bef7a5339c3f87c/.devcontainer.json

Remaining issues:

  1. The following appeared to fail with my terminal setup. I'll see if I can resolve this conflict.

    "workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind,consistency=cached", 
    "workspaceFolder": "${localWorkspaceFolder}",
  2. All standard tools (pipenv, dls-python3 etc.) are not on the path. I don't believe this used to be the case. dev-c7 outside of vscode worked fine.

Also, what is the purpose of the following? Can we add a description somewhere? "-v/dev/ttyS0:/dev/ttyS0",

gilesknap commented 2 years ago

-v/dev/ttyS0:/dev/ttyS0 makes the serial port available. I needed it for an Arc IOC and it seemed like it might occasionally be useful.

Looking at vscode integration again now ...

gilesknap commented 2 years ago

We need to work out what is different between you and I.

I updated the devcontainer.json in the dev-c7 repo:

Saw this error image

gilesknap commented 2 years ago

I see the same issue running on pc0129.

Here is the devcontainer.json I'm using. Please can you post yours.

// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/ubuntu
{
    "name": "epics-python-dev",
    "image": "ghcr.io/dls-controls/dev-c7",
    // these two lines mount the local workspace folder so that the path is the same inside and outside the container.
    "workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind,consistency=cached",
    "workspaceFolder": "${localWorkspaceFolder}",
    "remoteEnv": {
        "DISPLAY": "${localEnv:DISPLAY}",
        "HOME": "${localEnv:HOME}"
    },
    "remoteUser": "${localEnv:USER}",
    // Set *default* container specific settings.json values on container create.
    "settings": {},
    // Add the IDs of extensions you want installed when the container is created.
    "extensions": [
        "ms-vscode.cpptools",
        "ms-python.python",
        "ms-python.vscode-pylance",
        "ms-vscode.cmake-tools",
        "streetsidesoftware.code-spell-checker",
        "ryanluker.vscode-coverage-gutters",
        "mhutchie.git-graph",
        "eamodio.gitlens",
        "gruntfuggly.todo-tree",
        "redhat.vscode-yaml",
        "nsd.vscode-epics",
        "alefragnani.bookmarks"
    ],
    "features": {
        "git": "os-provided"
        // "docker-from-docker": "20.10"
    },
    // commands run outside of the container before launch
    "initializeCommand": "echo 'Hello from initializeCommand'",
    // run in the container after creation
    "onCreateCommand": "sudo /start.sh",
    // run in the container after each start
    "postStartCommand": "echo 'Hello from postStartCommand'",
    "mounts": [
        "source=/dls/detectors,target=/dls/detectors,type=bind,consistency=cached",
        "source=/dls_sw/prod,target=/dls_sw/prod,type=bind,consistency=cached",
        "source=/dls_sw/work,target=/dls_sw/work,type=bind,consistency=cached",
        "source=/dls_sw/epics,target=/dls_sw/epics,type=bind,consistency=cached",
        "source=/dls_sw/targetOS/vxWorks/Tornado-2.2,target=//dls_sw/targetOS/vxWorks/Tornado-2.2,type=bind,consistency=cached",
        "source=/dls_sw/apps,target=/dls_sw/apps,type=bind,consistency=cached",
        "source=/dls_sw/etc,target=/dls_sw/etc,type=bind,consistency=cached",
        "source=/home,target=/home,type=bind,consistency=cached",
        "source=/scratch/,target=/scratch/,type=bind,consistency=cached",
        "source=/dls/science/users,target=/dls/science/users,type=bind,consistency=cached",
    ],
    "runArgs": [
        "-h=dev-c7",
        "-v/dev/ttyS0:/dev/ttyS0",
        "--privileged",
        "--net=host",
        "--security-opt=label=type:container_runtime_t",
        // "--userns=keep-id",
        "--annotation=run.oci.keep_original_groups=1",
        "--storage-opt=ignore_chown_errors=true",
        "--runtime=/usr/bin/crun"
    ]
}
gilesknap commented 2 years ago

OK posting that made me realise what the issue is.

    "features": {
        "git": "os-provided"

Is the culprit. Not something I actually need.

Now I'm blowing up for other reasons - investigating ...

gilesknap commented 2 years ago

All good!

The devcontainer is running with all the features of the launch script including keep-id

I'll update the repo and document the use of vscode.

Thanks for your persistence on this. I jumped to the wrong conclusion with that error too quickly.

gilesknap commented 2 years ago

@MJGaughran please can you try this the .devcontainer file below.

I'm finding that X11 apps wont launch. I am working over nx and ssh to my machine which may be the issue. The following error is appearing on the console that launched vscode.

X11 connection rejected because of wrong authentication.

https://raw.githubusercontent.com/dls-controls/dev-c7/dev/.devcontainer.json

MJGaughran commented 2 years ago

Deleted last comment; I get an error now, even with old config. Not sure why

MJGaughran commented 2 years ago

I always get errors similar to the following:

[54 ms] Remote-Containers 0.238.2 in VS Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630).
[54 ms] Start: Resolving Remote
[80 ms] Setting up container for folder or workspace: /scratch/lkz95212/vscode/projects/topup_dir/topup.code-workspace
[87 ms] Start: Check Docker is running
[87 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[251 ms] Server API version: 4.0.2
[251 ms] Start: Run: docker volume ls -q
[398 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/scratch/lkz95212/vscode/projects/topup_dir --filter label=vsch.quality=stable
[544 ms] Start: Run: /scratch/lkz95212/apps/VSCode-linux-x64/code /home/lkz95212/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/lkz95212/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /scratch/lkz95212/vscode/projects/topup_dir --workspace-mount-consistency cached --id-label devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir --log-level debug --log-format json --config /scratch/lkz95212/vscode/projects/topup_dir/.devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[664 ms] remote-containers 0.238.2.
[663 ms] Start: Run: docker buildx version
[700 ms] Start: Resolving Remote
[702 ms] Start: Run: git rev-parse --show-cdup
[706 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir
[847 ms] Start: Run: docker inspect --type image gcr.io/diamond-pubreg/controls/dev-c7:latest
[2102 ms] Error: EACCES: permission denied, mkdir '/tmp/vsch/container-features/0.238.2-1656508888505'
[2105 ms] Exit code 1
[2108 ms] Command failed: /scratch/lkz95212/apps/VSCode-linux-x64/code /home/lkz95212/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/lkz95212/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /scratch/lkz95212/vscode/projects/topup_dir --workspace-mount-consistency cached --id-label devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir --log-level debug --log-format json --config /scratch/lkz95212/vscode/projects/topup_dir/.devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2108 ms] Exit code 1

Could this be the result of updates to the dev-c7 image?

gilesknap commented 2 years ago

@MJGaughran I saw this error on your machine and moved the tmp/vsch folder out of the way on the host.

This might be an issue with vscode using the same tmp folder for different users?

gilesknap commented 2 years ago

looks like it:


[hgv27681@pc0129 ~]$ ll /tmp/vsch/container-features
total 0
drwxrwxr-x. 3 hgv27681 hgv27681 83 Jun 29 06:36 0.238.2-1656481000081
drwxrwxr-x. 2 hgv27681 hgv27681  6 Jun 29 06:40 0.238.2-1656481217621
[hgv27681@pc0129 ~]$ 
gilesknap commented 2 years ago

I've removed the folder on your machine so it should be OK now.

This seems like a serious issue with vscode.

MJGaughran commented 2 years ago

Okay, thanks, I was wondering why it was working now!

Is there some configuration we can change to include the username in the path?

MJGaughran commented 2 years ago

Here is the error from the .devcontainer.json you wanted me to try out:

[97 ms] Remote-Containers 0.238.2 in VS Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630).
[97 ms] Start: Resolving Remote
[122 ms] Setting up container for folder or workspace: /scratch/lkz95212/vscode/projects/topup_dir/topup.code-workspace
[128 ms] Start: Check Docker is running
[128 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[314 ms] Server API version: 4.0.2
[314 ms] Start: Run: docker volume ls -q
[476 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/scratch/lkz95212/vscode/projects/topup_dir --filter label=vsch.quality=stable
[629 ms] Start: Run: /scratch/lkz95212/apps/VSCode-linux-x64/code /home/lkz95212/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/lkz95212/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /scratch/lkz95212/vscode/projects/topup_dir --workspace-mount-consistency cached --id-label devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir --log-level debug --log-format json --config /scratch/lkz95212/vscode/projects/topup_dir/.devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[755 ms] remote-containers 0.238.2.
[755 ms] Start: Run: docker buildx version
[790 ms] Start: Resolving Remote
[793 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir
[948 ms] Start: Run: docker inspect --type image ghcr.io/dls-controls/dev-c7
[1098 ms] Start: Run: docker build -f /tmp/vsch/updateUID.Dockerfile-0.238.2 -t vsc-topup_dir-380fe2e2c0d5f19c1880a1c8201da6eb-uid --build-arg BASE_IMAGE=ghcr.io/dls-controls/dev-c7 --build-arg REMOTE_USER=lkz95212 --build-arg NEW_UID=1208238 --build-arg NEW_GID=1208238 --build-arg IMAGE_USER=root /tmp/vsch
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1/9: FROM ghcr.io/dls-controls/dev-c7
STEP 2/9: USER root
--> Using cache f27ae93d486a8326566ef7d8d3f4160802f9d267f5a7c9092af159c5de84a1fc
--> f27ae93d486
STEP 3/9: ARG REMOTE_USER
--> Using cache 71ced0a0cd782ae82e3959c4bddf3824a5a2d0971ef953bbf4c0411ffe7b101d
--> 71ced0a0cd7
STEP 4/9: ARG NEW_UID
--> Using cache f0f2c1cd0f98e20ba0fb49969758d5d038ba36e932521ec59f94bf5a9092cf98
--> f0f2c1cd0f9
STEP 5/9: ARG NEW_GID
--> Using cache 01daf27c7b21f36fbfcf2a56ab48280907bd158fa6b35e6867985e1cada0a93f
--> 01daf27c7b2
STEP 6/9: SHELL ["/bin/sh", "-c"]
--> Using cache 2a564e7cbe8b5ac1e9578a72c348a2fbd2408b01d9dc4cb1f513dc2d3ad097b8
--> 2a564e7cbe8
STEP 7/9: RUN eval $(sed -n "s/${REMOTE_USER}:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]*\).*/OLD_UID=\1;OLD_GID=\2;HOME_FOLDER=\3/p" /etc/passwd);       eval $(sed -n "s/\([^:]*\):[^:]*:${NEW_UID}:.*/EXISTING_USER=\1/p" /etc/passwd);        eval $(sed -n "s/\([^:]*\):[^:]*:${NEW_GID}:.*/EXISTING_GROUP=\1/p" /etc/group);      if [ -z "$OLD_UID" ]; then              echo "Remote user not found in /etc/passwd ($REMOTE_USER).";  elif [ "$OLD_UID" = "$NEW_UID" -a "$OLD_GID" = "$NEW_GID" ]; then            echo "UIDs and GIDs are the same ($NEW_UID:$NEW_GID).";  elif [ "$OLD_UID" != "$NEW_UID" -a -n "$EXISTING_USER" ]; then       echo "User with UID exists ($EXISTING_USER=$NEW_UID).";  elif [ "$OLD_GID" != "$NEW_GID" -a -n "$EXISTING_GROUP" ]; then      echo "Group with GID exists ($EXISTING_GROUP=$NEW_GID).";        else            echo "Updating UID:GID from $OLD_UID:$OLD_GID to $NEW_UID:$NEW_GID.";                 sed -i -e "s/\(${REMOTE_USER}:[^:]*:\)[^:]*:[^:]*/\1${NEW_UID}:${NEW_GID}/" /etc/passwd;              if [ "$OLD_GID" != "$NEW_GID" ]; then                   sed -i -e "s/\([^:]*:[^:]*:\)${OLD_GID}:/\1${NEW_GID}:/" /etc/group;          fi;             chown -R $NEW_UID:$NEW_GID $HOME_FOLDER;        fi;
--> Using cache cb2107a1ebfd253fa858260655b7044439cd000fd2d90938f3e2906542db18cc
--> cb2107a1ebf
STEP 8/9: ARG IMAGE_USER
--> Using cache 2447c56e6f6083e70b125a435e42d4a59e50550ae21a699c718cc73eadd13d15
--> 2447c56e6f6
STEP 9/9: USER $IMAGE_USER
--> Using cache e590a0180580b325df268135b9c328ac1e26236f83806e4751e2ad038c3ade58
COMMIT vsc-topup_dir-380fe2e2c0d5f19c1880a1c8201da6eb-uid
--> e590a018058
Successfully tagged localhost/vsc-topup_dir-380fe2e2c0d5f19c1880a1c8201da6eb-uid:latest
e590a0180580b325df268135b9c328ac1e26236f83806e4751e2ad038c3ade58
[34777 ms] Start: Run: docker -v
[34834 ms] Start: Run: docker events --format json --filter event=start
[34836 ms] Start: Starting container
[34836 ms] Start: Run: docker run --sig-proxy=false -a STDOUT -a STDERR --mount source=/scratch/lkz95212/vscode/projects/topup_dir,target=/scratch/lkz95212/vscode/projects/topup_dir,type=bind,consistency=cached --mount source=/dls/detectors,target=/dls/detectors,type=bind,consistency=cached --mount source=/dls_sw/prod,target=/dls_sw/prod,type=bind,consistency=cached --mount source=/dls_sw/work,target=/dls_sw/work,type=bind,consistency=cached --mount source=/dls_sw/epics,target=/dls_sw/epics,type=bind,consistency=cached --mount source=/dls_sw/targetOS/vxWorks/Tornado-2.2,target=//dls_sw/targetOS/vxWorks/Tornado-2.2,type=bind,consistency=cached --mount source=/dls_sw/apps,target=/dls_sw/apps,type=bind,consistency=cached --mount source=/dls_sw/etc,target=/dls_sw/etc,type=bind,consistency=cached --mount source=/home,target=/home,type=bind,consistency=cached --mount source=/scratch/,target=/scratch/,type=bind,consistency=cached --mount source=/dls/science/users,target=/dls/science/users,type=bind,consistency=cached --mount source=/tmp,target=/tmp,type=bind,consistency=cached --mount type=volume,src=vscode,dst=/vscode -l devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir -h=dev-c7 -v/dev/ttyS0:/dev/ttyS0 --privileged --net=host --security-opt=label=type:container_runtime_t --userns=keep-id --annotation=run.oci.keep_original_groups=1 --storage-opt=ignore_chown_errors=true --runtime=/usr/bin/crun --entrypoint /bin/sh vsc-topup_dir-380fe2e2c0d5f19c1880a1c8201da6eb-uid -c echo Container started
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: vfs driver does not support ignore_chown_errors options
[34896 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir
[34899 ms] Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.

[35043 ms] Error: Command failed: docker run --sig-proxy=false -a STDOUT -a STDERR --mount source=/scratch/lkz95212/vscode/projects/topup_dir,target=/scratch/lkz95212/vscode/projects/topup_dir,type=bind,consistency=cached --mount source=/dls/detectors,target=/dls/detectors,type=bind,consistency=cached --mount source=/dls_sw/prod,target=/dls_sw/prod,type=bind,consistency=cached --mount source=/dls_sw/work,target=/dls_sw/work,type=bind,consistency=cached --mount source=/dls_sw/epics,target=/dls_sw/epics,type=bind,consistency=cached --mount source=/dls_sw/targetOS/vxWorks/Tornado-2.2,target=//dls_sw/targetOS/vxWorks/Tornado-2.2,type=bind,consistency=cached --mount source=/dls_sw/apps,target=/dls_sw/apps,type=bind,consistency=cached --mount source=/dls_sw/etc,target=/dls_sw/etc,type=bind,consistency=cached --mount source=/home,target=/home,type=bind,consistency=cached --mount source=/scratch/,target=/scratch/,type=bind,consistency=cached --mount source=/dls/science/users,target=/dls/science/users,type=bind,consistency=cached --mount source=/tmp,target=/tmp,type=bind,consistency=cached --mount type=volume,src=vscode,dst=/vscode -l devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir -h=dev-c7 -v/dev/ttyS0:/dev/ttyS0 --privileged --net=host --security-opt=label=type:container_runtime_t --userns=keep-id --annotation=run.oci.keep_original_groups=1 --storage-opt=ignore_chown_errors=true --runtime=/usr/bin/crun --entrypoint /bin/sh vsc-topup_dir-380fe2e2c0d5f19c1880a1c8201da6eb-uid -c echo Container started
[35043 ms] trap "exit 0" 15
[35044 ms] exec "$@"
[35044 ms] while sleep 1 & wait $!; do :; done -
[35044 ms]     at NR (/scratch/lkz95212/vscode/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:239:1572)
[35044 ms]     at Jy (/scratch/lkz95212/vscode/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:239:1510)
[35044 ms]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[35044 ms]     at async zR (/scratch/lkz95212/vscode/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:2006)
[35044 ms]     at async nb (/scratch/lkz95212/vscode/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:3110)
[35044 ms]     at async JR (/scratch/lkz95212/vscode/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:13046)
[35044 ms]     at async KR (/scratch/lkz95212/vscode/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:12802)
[35047 ms] Exit code 1
[35049 ms] Command failed: /scratch/lkz95212/apps/VSCode-linux-x64/code /home/lkz95212/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/lkz95212/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /scratch/lkz95212/vscode/projects/topup_dir --workspace-mount-consistency cached --id-label devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir --log-level debug --log-format json --config /scratch/lkz95212/vscode/projects/topup_dir/.devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[35049 ms] Exit code 1
gilesknap commented 2 years ago

fix incoming: microsoft/vscode-remote-release#2347 (comment)

gilesknap commented 2 years ago

@MJGaughran

Please can you try this command and then retry the vscode with the latest https://raw.githubusercontent.com/dls-controls/dev-c7/main/.devcontainer.json

podman rmi -f $(podman images --filter=reference='*vsc-*' -q)
gilesknap commented 2 years ago

BTW - you could also try setting podman as the container CLI - you are currently working via docker-podman.

See Settings

MJGaughran commented 2 years ago

Similar error, although it also doesn't like your SHELL options:

[51 ms] Remote-Containers 0.238.2 in VS Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630).
[51 ms] Start: Resolving Remote
[62 ms] Setting up container for folder or workspace: /scratch/lkz95212/vscode/projects/topup_dir/topup.code-workspace
[74 ms] Start: Check Docker is running
[74 ms] Start: Run: podman version --format {{.Server.APIVersion}}
[742 ms] Server API version: 4.0.2
[743 ms] Start: Run: podman volume ls -q
[882 ms] Start: Run: podman inspect --type container 7d5b7727632f0188b4fea6de2e35895fc569a5df2b6ba67c8031ca4b17af9f1f
[918 ms] Start: Run: podman ps -q -a --filter label=vsch.local.folder=/scratch/lkz95212/vscode/projects/topup_dir --filter label=vsch.quality=stable
[1056 ms] Start: Run: podman ps -q -a --filter label=devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir
[1192 ms] Start: Run: /scratch/lkz95212/apps/VSCode-linux-x64/code /home/lkz95212/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/lkz95212/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --docker-path podman --workspace-folder /scratch/lkz95212/vscode/projects/topup_dir --workspace-mount-consistency cached --id-label devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir --log-level debug --log-format json --config /scratch/lkz95212/vscode/projects/topup_dir/.devcontainer.json --default-user-env-probe loginInteractiveShell --build-no-cache --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[1318 ms] remote-containers 0.238.2.
[1318 ms] Start: Run: podman buildx version
[1353 ms] Start: Resolving Remote
[1356 ms] Start: Run: podman ps -q -a --filter label=devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir
[1503 ms] Start: Run: podman inspect --type image ghcr.io/dls-controls/dev-c7
[1640 ms] Start: Run: podman build -f /tmp/vsch/updateUID.Dockerfile-0.238.2 -t vsc-topup_dir-380fe2e2c0d5f19c1880a1c8201da6eb-uid --build-arg BASE_IMAGE=ghcr.io/dls-controls/dev-c7 --build-arg REMOTE_USER=lkz95212 --build-arg NEW_UID=1208238 --build-arg NEW_GID=1208238 --build-arg IMAGE_USER=root /tmp/vsch
STEP 1/9: FROM ghcr.io/dls-controls/dev-c7
STEP 2/9: USER root
--> 3cf39637573
STEP 3/9: ARG REMOTE_USER
--> 8963dd8382f
STEP 4/9: ARG NEW_UID
--> b960e8f8194
STEP 5/9: ARG NEW_GID
--> 125f3adfa26
STEP 6/9: SHELL ["/bin/sh", "-c"]
WARN[0016] SHELL is not supported for OCI image format, [/bin/sh -c] will be ignored. Must use `docker` format 
--> 1c8d4b5b7d6
STEP 7/9: RUN eval $(sed -n "s/${REMOTE_USER}:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]*\).*/OLD_UID=\1;OLD_GID=\2;HOME_FOLDER=\3/p" /etc/passwd);         eval $(sed -n "s/\([^:]*\):[^:]*:${NEW_UID}:.*/EXISTING_USER=\1/p" /etc/passwd);       eval $(sed -n "s/\([^:]*\):[^:]*:${NEW_GID}:.*/EXISTING_GROUP=\1/p" /etc/group); if [ -z "$OLD_UID" ]; then              echo "Remote user not found in /etc/passwd ($REMOTE_USER).";    elif [ "$OLD_UID" = "$NEW_UID" -a "$OLD_GID" = "$NEW_GID" ]; then echo "UIDs and GIDs are the same ($NEW_UID:$NEW_GID)."; elif [ "$OLD_UID" != "$NEW_UID" -a -n "$EXISTING_USER" ]; then   echo "User with UID exists ($EXISTING_USER=$NEW_UID).";         elif [ "$OLD_GID" != "$NEW_GID" -a -n "$EXISTING_GROUP" ]; then                 echo "Group with GID exists ($EXISTING_GROUP=$NEW_GID).";       else            echo "Updating UID:GID from $OLD_UID:$OLD_GID to $NEW_UID:$NEW_GID.";           sed -i -e "s/\(${REMOTE_USER}:[^:]*:\)[^:]*:[^:]*/\1${NEW_UID}:${NEW_GID}/" /etc/passwd;               if [ "$OLD_GID" != "$NEW_GID" ]; then                    sed -i -e "s/\([^:]*:[^:]*:\)${OLD_GID}:/\1${NEW_GID}:/" /etc/group;            fi;             chown -R $NEW_UID:$NEW_GID $HOME_FOLDER;        fi;
Remote user not found in /etc/passwd (lkz95212).
WARN[0020] SHELL is not supported for OCI image format, [/bin/sh -c] will be ignored. Must use `docker` format 
--> 891fa83ddd6
STEP 8/9: ARG IMAGE_USER
WARN[0028] SHELL is not supported for OCI image format, [/bin/sh -c] will be ignored. Must use `docker` format 
--> c0367805595
STEP 9/9: USER $IMAGE_USER
COMMIT vsc-topup_dir-380fe2e2c0d5f19c1880a1c8201da6eb-uid
WARN[0031] SHELL is not supported for OCI image format, [/bin/sh -c] will be ignored. Must use `docker` format 
--> 4e8ca2d2ed5
Successfully tagged localhost/vsc-topup_dir-380fe2e2c0d5f19c1880a1c8201da6eb-uid:latest
4e8ca2d2ed5c94a0c65f915f42864dbac26078b1dceb384fb5eb945457cdd6c2
[42649 ms] Start: Run: podman -v
[42704 ms] Start: Run: podman events --format json --filter event=start
[42708 ms] Start: Starting container
[42708 ms] Start: Run: podman run --sig-proxy=false -a STDOUT -a STDERR --mount source=/scratch/lkz95212/vscode/projects/topup_dir,target=/scratch/lkz95212/vscode/projects/topup_dir,type=bind,consistency=cached --mount source=/dls/detectors,target=/dls/detectors,type=bind,consistency=cached --mount source=/dls_sw/prod,target=/dls_sw/prod,type=bind,consistency=cached --mount source=/dls_sw/work,target=/dls_sw/work,type=bind,consistency=cached --mount source=/dls_sw/epics,target=/dls_sw/epics,type=bind,consistency=cached --mount source=/dls_sw/targetOS/vxWorks/Tornado-2.2,target=//dls_sw/targetOS/vxWorks/Tornado-2.2,type=bind,consistency=cached --mount source=/dls_sw/apps,target=/dls_sw/apps,type=bind,consistency=cached --mount source=/dls_sw/etc,target=/dls_sw/etc,type=bind,consistency=cached --mount source=/home,target=/home,type=bind,consistency=cached --mount source=/scratch/,target=/scratch/,type=bind,consistency=cached --mount source=/dls/science/users,target=/dls/science/users,type=bind,consistency=cached --mount source=/tmp,target=/tmp,type=bind,consistency=cached --mount type=volume,src=vscode,dst=/vscode -l devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir -v/dev/ttyS0:/dev/ttyS0 --privileged --net=host --security-opt=label=type:container_runtime_t --userns=keep-id --annotation=run.oci.keep_original_groups=1 --storage-opt=ignore_chown_errors=true --runtime=/usr/bin/crun --entrypoint /bin/sh vsc-topup_dir-380fe2e2c0d5f19c1880a1c8201da6eb-uid -c echo Container started
Error: vfs driver does not support ignore_chown_errors options
[42749 ms] Start: Run: podman ps -q -a --filter label=devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir
[42892 ms] Error: Command failed: podman run --sig-proxy=false -a STDOUT -a STDERR --mount source=/scratch/lkz95212/vscode/projects/topup_dir,target=/scratch/lkz95212/vscode/projects/topup_dir,type=bind,consistency=cached --mount source=/dls/detectors,target=/dls/detectors,type=bind,consistency=cached --mount source=/dls_sw/prod,target=/dls_sw/prod,type=bind,consistency=cached --mount source=/dls_sw/work,target=/dls_sw/work,type=bind,consistency=cached --mount source=/dls_sw/epics,target=/dls_sw/epics,type=bind,consistency=cached --mount source=/dls_sw/targetOS/vxWorks/Tornado-2.2,target=//dls_sw/targetOS/vxWorks/Tornado-2.2,type=bind,consistency=cached --mount source=/dls_sw/apps,target=/dls_sw/apps,type=bind,consistency=cached --mount source=/dls_sw/etc,target=/dls_sw/etc,type=bind,consistency=cached --mount source=/home,target=/home,type=bind,consistency=cached --mount source=/scratch/,target=/scratch/,type=bind,consistency=cached --mount source=/dls/science/users,target=/dls/science/users,type=bind,consistency=cached --mount source=/tmp,target=/tmp,type=bind,consistency=cached --mount type=volume,src=vscode,dst=/vscode -l devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir -v/dev/ttyS0:/dev/ttyS0 --privileged --net=host --security-opt=label=type:container_runtime_t --userns=keep-id --annotation=run.oci.keep_original_groups=1 --storage-opt=ignore_chown_errors=true --runtime=/usr/bin/crun --entrypoint /bin/sh vsc-topup_dir-380fe2e2c0d5f19c1880a1c8201da6eb-uid -c echo Container started
[42892 ms] trap "exit 0" 15
[42892 ms] exec "$@"
[42892 ms] while sleep 1 & wait $!; do :; done -
[42892 ms]     at NR (/scratch/lkz95212/vscode/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:239:1572)
[42892 ms]     at Jy (/scratch/lkz95212/vscode/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:239:1510)
[42892 ms]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[42892 ms]     at async zR (/scratch/lkz95212/vscode/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:2006)
[42892 ms]     at async nb (/scratch/lkz95212/vscode/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:3110)
[42892 ms]     at async JR (/scratch/lkz95212/vscode/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:13046)
[42892 ms]     at async KR (/scratch/lkz95212/vscode/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:12802)
[42895 ms] Exit code 1
[42897 ms] Command failed: /scratch/lkz95212/apps/VSCode-linux-x64/code /home/lkz95212/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/lkz95212/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --docker-path podman --workspace-folder /scratch/lkz95212/vscode/projects/topup_dir --workspace-mount-consistency cached --id-label devcontainer.local_folder=/scratch/lkz95212/vscode/projects/topup_dir --log-level debug --log-format json --config /scratch/lkz95212/vscode/projects/topup_dir/.devcontainer.json --default-user-env-probe loginInteractiveShell --build-no-cache --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[42897 ms] Exit code 1
gilesknap commented 2 years ago

@MJGaughran Just re-read your error and I see the issue.

You need to do

sudo yum install crun

or just remove "--runtime=/usr/bin/crun" from your json file

gilesknap commented 2 years ago

And I somehow need to make the .devcontainer.json cope with the possibility that crun is not installed. I suppose I could make a devcontainer.json generator script - in future I'm expecting a RHEL8 wide rollout of crun.

gilesknap commented 2 years ago

FURTHER UPDATE:

There are TWO assumptions in both the launch script and the devcontainer json. Both of these assumptions will be met in an upcoming update to our RHEL8 workstations but are not true yet. It is the second point that @MJGaughran's log above is complaining about.

gilesknap commented 2 years ago

UPDATE: crun is now rolled out so we can forget about this one.

Instructions now include requirement to update to overlay filesysystem.

I'm going to close this - things are not ideal at the moment but once the new podman setup from Michael is rolled out all will be OK (kinda)