Vscdode exported docker-compose.yml file is not correct

I found a few issues on the docker-compose.yml file generated by vscode Torizon IDE/moses (F1: Torizon : export docker-compose file → choose release or debug)

1/ For the release configuration, the service depends on itself (depends_on …) which results in an error when invoking docker-compose up (this problem does not show on the debug configuration).
Here is the file snipet:

# docker-compose.yml
services:
  phosddvr_arm64v8-qt5-vivante-no-ssh_bullseye_release_513050ae-f541-4a8a-baef-1599a9e43911:
    depends_on:
    - phosddvr_arm64v8-qt5-vivante-no-ssh_bullseye_release_513050ae-f541-baef-1599a9e43-4a8a911
    - weston

2/ I use the application.dockercomposefile field to specify a custom file located in appconfig_0/docker-compose-usbcam.yml. The file is correctly taken into account in the debug configuration but not in the release configuration.

3/ application.extraparms in the IDE is not taken into account in both release and debug configuration. Maybe there is a “a” missing ? (documentation in Torizon IDE Backend Architecture and Internals | Toradex Developer Center indicates application.extraparams but the field name in the IDE cannot be changed)

Of course, I understand that I can edit the generated docker-compose.yml file but I am looking for a cleaner solution.

Files are given below :

My custom file in appconfig_0/docker-compuse-usbcam.yml
(I added custom volumes, ports, network_mode device_cgroup_rules and user)

# docker-compose-usbcam.yml
services:
  phosddvr_arm64v8-qt5-vivante-no-ssh_bullseye_release_513050ae-f541-4a8a-baef-1599a9e43911:
    depends_on:
    - weston
    devices: []
    image: phosddvr_arm64v8-qt5-vivante-no-ssh_bullseye_release_513050ae-f541-4a8a-baef-1599a9e43911
    ports: 5025
    network_mode: "host"
    volumes:
    - /tmp:/tmp:rw
    - /dev:/dev:rw
    - /run:/run:rw
    device_cgroup_rules:
    - c 189:* rmw
    - c 81:* rmw
    user : 0:0
  weston:
    cap_add:
    - CAP_SYS_TTY_CONFIG
    device_cgroup_rules:
    - c 4:0 rmw
    - c 4:7 rmw
    - c 13:* rmw
    - c 199:* rmw
    - c 226:* rmw
    environment:
    - ACCEPT_FSL_EULA=1
    image: torizon/weston-vivante:2
    network_mode: host
    volumes:
    - source: /tmp
      target: /tmp
      type: bind
    - source: /dev
      target: /dev
      type: bind
    - source: /run/udev
      target: /run/udev
      type: bind
version: '2.4'

File generated by moses in release configuration
It is not correct : service depends on itself and custom specifications are not added

# docker-compose.yml
services:
  phosddvr_arm64v8-qt5-vivante-no-ssh_bullseye_release_513050ae-f541-4a8a-baef-1599a9e43911:
    depends_on:
    - phosddvr_arm64v8-qt5-vivante-no-ssh_bullseye_release_513050ae-f541-baef-1599a9e43-4a8a911
    - weston
    devices: []
    image: phosddvr_arm64v8-qt5-vivante-no-ssh_bullseye_release_513050ae-f541-4a8a-baef-1599a9e43911
    ports: []
    volumes:
    - /tmp:/tmp:rw
    - /dev/dri:/dev/dri:rw
    - /dev/galcore:/dev/galcore:rw
  weston:
    cap_add:
    - CAP_SYS_TTY_CONFIG
    device_cgroup_rules:
    - c 4:0 rmw
    - c 4:7 rmw
    - c 13:* rmw
    - c 199:* rmw
    - c 226:* rmw
    environment:
    - ACCEPT_FSL_EULA=1
    image: torizon/weston-vivante:2
    network_mode: host
    volumes:
    - source: /tmp
      target: /tmp
      type: bind
    - source: /dev
      target: /dev
      type: bind
    - source: /run/udev
      target: /run/udev
      type: bind
version: '2.4'

File generated by moses in debug configuration
It seems correct : debug service depends on release service. Here the release service takes the custom parameters into account.

# docker-compose.yml
services:
  phosddvr_arm64v8-qt5-vivante-no-ssh_bullseye_debug_513050ae-f541-4a8a-baef-1599a9e43911:
    depends_on:
    - phosddvr_arm64v8-qt5-vivante-no-ssh_bullseye_release_513050ae-f541-4a8a-baef-1599a9e43911
    - weston
    devices: []
    image: phosddvr_arm64v8-qt5-vivante-no-ssh_bullseye_debug_513050ae-f541-4a8a-baef-1599a9e43911
    ports:
    - 6502/tcp
    volumes:
    - /tmp:/tmp:rw
    - /dev/dri:/dev/dri:rw
    - /dev/galcore:/dev/galcore:rw
    - /home/torizon/phosddvr:/phosddvr:rw
    - /home/torizon/phosddvr_core:/phosddvr_core:rw
  phosddvr_arm64v8-qt5-vivante-no-ssh_bullseye_release_513050ae-f541-4a8a-baef-1599a9e43911:
    depends_on:
    - weston
    device_cgroup_rules:
    - c 189:* rmw
    - c 81:* rmw
    devices: []
    image: phosddvr_arm64v8-qt5-vivante-no-ssh_bullseye_release_513050ae-f541-4a8a-baef-1599a9e43911
    network_mode: host
    ports: 5025
    user: 0:0
    volumes:
    - /tmp:/tmp:rw
    - /dev:/dev:rw
    - /run:/run:rw
  weston:
    cap_add:
    - CAP_SYS_TTY_CONFIG
    device_cgroup_rules:
    - c 4:0 rmw
    - c 4:7 rmw
    - c 13:* rmw
    - c 199:* rmw
    - c 226:* rmw
    environment:
    - ACCEPT_FSL_EULA=1
    image: torizon/weston-vivante:2
    network_mode: host
    volumes:
    - source: /tmp
      target: /tmp
      type: bind
    - source: /dev
      target: /dev
      type: bind
    - source: /run/udev
      target: /run/udev
      type: bind
version: '2.4'

Best regards,
Fabian

Greetings @fdortu,

I’m trying to reproduce each of your issues on my setup so I can give the IDE extensions team a bug report if needed. Let me go over my findings/questions for each issue you raised here:

  1. I created a dummy project via the extension and tried to export the docker-compose file. In the end I can’t seem to reproduce this. No matter if I export in release or debug configuration the resulting compose file doesn’t have this circular depends_on you are seeing. How exactly did you run into this? For example if you create a brand new fresh project in the extension and try to export the compose file, do you see the issue then? Or are their further configurations needed to see the issue?

  2. Again I can’t seem to reproduce this. If I supply an auxiliary compose file, and I export the complete compose file for the project it seems like it’s taken into account, far as I can tell at least.

  3. For this one I have questions. First of all extraparms is correct the documentation seems to be a type. Second what are you passing to extraparms that is not being take into account? This parameter can be a bit strict in terms of the syntax so it may be a case of your configurations not being read properly.

On a final note, I see the compose-file that you’re supplying the extension and I think I know what’s the issue here now with point 1 and possibly point 2.

You’re supply a compose file that already has the service for your application defined. You shouldn’t do this. What happens is that when you export a compose file with the extension it takes the auxiliary compose file that you supplied and then adds a new service corresponding to your application to create a new final compose file. But since you already have this service in the compose file that you supplied it’s probably creating issues.

In short, try giving the extension a compose file that only has the weston service and not your application service.

Best Regards,
Jeremias

Dear Jeremias,

Yes you were right, that was it !

Thank you,
Fabian

Glad I could help!