toradex / vscode-torizon-templates

VS Code Torizon Integrated Development Environment Templates
MIT License
15 stars 20 forks source link

`device_cgroup_rules` is not supported on `docker-compose.yml` version3 #163

Closed griloHBG closed 7 months ago

griloHBG commented 7 months ago

Hi all!

After trying to use the cppQML template, I found out that the device_cgroup_rules is not supported on docker-compose.yml using version 3. It is supported on version 2, though.

I got this error:

ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.testqt: 'device_cgroup_rules'
Unsupported config option for services.testqt-debug: 'device_cgroup_rules'
Unsupported config option for services.weston: 'device_cgroup_rules'

As a workaround, I modified the version to 2.4.

References:

microhobby commented 7 months ago

hey @griloHBG thanks for to report. Could you post, or share, the .vscode/tasks.json from your project? Thanks

leograba commented 7 months ago

It should work on Compose 3.9

https://github.com/docker/compose/pull/6974#issuecomment-628481243

microhobby commented 7 months ago

It should work on Compose 3.9

docker/compose#6974 (comment)

yeah, but probably is one of these cases where is still using the docker-compose v1 🥲 Because of it, I ask for the tasks.json file, to verify if is this case

microhobby commented 7 months ago

This possible was fixed by aa402a1ec6026255cb10dd37e4d835879fda1400 and c1a730fbed48aab2ecce30cc9019feb3e478752c

@griloHBG make sure you have the following packages updated on your Ubuntu 22.04 or Debian Bookworm:

docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
griloHBG commented 7 months ago

Hi all!

I just updated the packages on my computer:

                                     from                                  to
docker-buildx-plugin                 0.11.2-1~ubuntu.22.04~jammy           0.12.1-1~ubuntu.22.04~jammy
docker-ce                            5:24.0.7-1~ubuntu.22.04~jammy         5:25.0.1-1~ubuntu.22.04~jammy
docker-ce-cli                        5:24.0.7-1~ubuntu.22.04~jammy         5:25.0.1-1~ubuntu.22.04~jammy
docker-ce-rootless-extras            5:24.0.7-1~ubuntu.22.04~jammy         5:25.0.1-1~ubuntu.22.04~jammy
docker-compose-plugin                2.21.0-1~ubuntu.22.04~jammy           2.24.2-1~ubuntu.22.04~jammy

Version of containerd.io is 1.6.27-1.

Then I tried to deploy to Verdin iMX8MP using the Torizon ARMv8 launch option.

Trying with version: "2.4" on docker-compose.yml works.

Trying with version: "3.3" I get the following output:

ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.testqt: 'device_cgroup_rules'
Unsupported config option for services.testqt-debug: 'device_cgroup_rules'
Unsupported config option for services.weston: 'device_cgroup_rules'

Trying with version: "3.9" I get the following output:

ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

As asked, here is the .vscode/tasks.json of my project: tasks.json

You can see that it is indeed using docker-compose instead of docker compose. I tried to overcome it by triggering both try-update-template and try-update-template-accepting-all, but tasks.json was not modified/updated. In fact, I could not find out what changed... :thinking:

After try-update-template-accepting-all, I see on the DEBUG CONSOLE:

You are about to accept all incoming changes from the updated template
If the project is not versioned there is no way back
Accept all changes? [y/n]: y
⚠️  project updater updated, running it again                                 
You are about to accept all incoming changes from the updated template
If the project is not versioned there is no way back
Accept all changes? [y/n]: y
✅ always accept new                                                         
Applying common tasks ...
Renaming file contents ...                                                   
/path/to/project/testqt/.conf/tmp/__change__.pro
/path/to/project/testqt/.conf/tmp/.gitignore
/path/to/project/testqt/.conf/tmp/.gitlab-ci.yml
/path/to/project/testqt/.conf/tmp/build-application.yaml
/path/to/project/testqt/.conf/tmp/c_cpp_properties.json
/path/to/project/testqt/.conf/tmp/docker-compose.yml
/path/to/project/testqt/.conf/tmp/Dockerfile
/path/to/project/testqt/.conf/tmp/Dockerfile.debug
/path/to/project/testqt/.conf/tmp/launch.json
/path/to/project/testqt/.conf/tmp/README.md
/path/to/project/testqt/.conf/tmp/tasks-next.json
/path/to/project/testqt/.conf/tmp/c_cpp_properties.json
/path/to/project/testqt/.conf/tmp/launch.json
/path/to/project/testqt/.conf/tmp/tasks-next.json
✅ common                                                                    
✅ specific
✅ Update done

But tasks.json remains the same (it still uses docker-compose) and the tmp folder inside the .conf directory of my project doesn't exist.

griloHBG commented 7 months ago

If I trigger try-update-template-accepting-all while running watch -n.1 "ls -la ./testqt/.conf/tmp && ls -la ./testqt/.conf/tmp > xablau" on a terminal, at the end, I can see the contents of xablau:

 $ cat xablau
total 152
drwxrwxr-x 2 grilo grilo  4096 jan 27 00:03 .
drwxrwxr-x 4 grilo grilo  4096 jan 27 00:03 ..
-rw-rw-r-- 1 grilo grilo  2261 jan 27 00:03 build-application.yaml
-rw-rw-r-- 1 grilo grilo   411 jan 27 00:03 c_cpp_properties.json
-rw-rw-r-- 1 grilo grilo  1306 jan 27 00:03 __change__.pro
-rw-rw-r-- 1 grilo grilo  1959 jan 27 00:03 docker-compose.yml
-rw-rw-r-- 1 grilo grilo  4632 jan 27 00:03 Dockerfile
-rw-rw-r-- 1 grilo grilo  3632 jan 27 00:03 Dockerfile.debug
-rw-rw-r-- 1 grilo grilo   324 jan 27 00:03 .gitignore
-rw-rw-r-- 1 grilo grilo  2390 jan 27 00:03 .gitlab-ci.yml
-rw-rw-r-- 1 grilo grilo  6825 jan 27 00:03 launch.json
-rw-rw-r-- 1 grilo grilo  4557 jan 27 00:03 README.md
-rw-rw-r-- 1 grilo grilo 91546 jan 27 00:03 tasks-next.json

So seems like something is failing to actually perform the update of the template files.

microhobby commented 7 months ago

@griloHBG this seems to be another issuem could you open a new ticket please? Thanks

griloHBG commented 7 months ago

Hi @microhobby!

New issue created for the try-update-template[-accepting-all] problem: https://github.com/toradex/vscode-torizon-templates/issues/168

About the this issue specifically (related to device-cgroup-rules), I see this is closed, does it mean that updating the packages was the solution?

Or it is still related to the fact that my template is using docker-compose instead of docker compose?