Multi container deployment via VS Code

Hi! I know that multi container support in VS Code IDE plugin should be experimental, but is there a way to deploy to Torizon cloud a multi container compose package?
I see only options for single containers (and just image is built, but no package).
Thanks!

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

Deploying a multi-container application to TorizonCore using the VS Code IDE plugin indeed supports multi-container Docker Compose applications, even though some features might still be in experimental phases. To deploy a multi-container compose package to Torizon, you should follow these steps:

  1. Prepare Your Docker Compose File: Ensure your docker-compose.yml file is correctly set up with all the services (containers) you intend to run on your Toradex device. Each service in the compose file represents a container.

  2. Use the Torizon Extension in VS Code: The Torizon VS Code extension provides functionality to build and deploy Docker containers. Make sure you have the latest version of the extension installed to access the most up-to-date features.

  3. Build Your Containers: Before deploying, you need to build the Docker images for your application. You can do this directly within VS Code by right-clicking the docker-compose.yml file and selecting the build option. Ensure all images are built successfully.

  4. Deploy the Docker Compose Project: After building your images, you can deploy the Docker Compose project to your Torizon device. Right-click the docker-compose.yml file and look for an option to deploy or run the compose project on your device. This process involves transferring the Docker images to your device and starting the containers as defined in your compose file.

  5. Verify Deployment: Once the deployment process is complete, you can verify that all containers are running as expected on your device. Use SSH to connect to your device or the Torizon extension’s integrated terminal to run Docker commands like docker ps to see the running containers.

If you do not see options for deploying multi-container applications directly, ensure that your VS Code and the Torizon extension are up to date. Sometimes, features are added or improved with new releases.

For complex scenarios or specific configurations not covered by the VS Code plugin, you might consider manually deploying your Docker Compose project. This involves transferring the Docker Compose file to your device and using Docker Compose commands directly on the device to start your application.

Remember, while deploying multi-container applications, to manage resources efficiently and ensure that your Toradex hardware can handle the workload of running multiple containers simultaneously.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Audio (Linux) | Toradex Developer Center.

Greetings @macolomb,

Just to make sure I understand what your goal is.

When you say you want to upload a “multi container docker compose package”. What are you expecting exactly?

A single docker compose file can define multiple container images already, so what do you mean by “multi container”?

Just to clarify when you push a compose package to our Torizon Cloud platform, you are just pushing the compose file not the container images themselves. For your purposes would it not suffice to just push a single compose file that defines all the container images your solution needs?

Best Regards,
Jeremias

Hi!
Yes, first I tried single container project and I was able to create and deploy an app with 2 containers. But, if I ret ro debug in this way, only debug container for application layer (the one mainly configured by project) is execute, and manually added container (a database) is removed.
So I tought I was wrong and I should have used a multi container project in order to be able to debug a multi container app.
So my requiredment is: “which is the recommended way to debug and deploy a multi container app in which we have 1:N commodity containers (like DB layer, etc) and main app (for which I could want to perform debug, in case)?”
Thanks!

Okay so to summarize. You have 1 application container that you developed yourselves. Alongside you have several auxiliary containers that are pre-made that you want to run along-side your application container. Is that more or less correct?

If these other containers are just existing pre-made container images. Then why not just edit your docker-compose.yml in the project and add the other containers? The extension launches all the containers defined in that file. That said the debugger will only act on the one container created by that project, but it sounds like you only have the one application container anyways.

See this docker-compose file from the Qt template: vscode-torizon-templates/cppQML/docker-compose.yml at dev · toradex/vscode-torizon-templates · GitHub

You can see it defines a secondary Weston container that is launched along-side the main application container. Would something like this suffice for your requirements?

Best Regards,
Jeremias

Thanks, depend_on was the missing link.
A side question. Once a compose application is deployed via package manager, is it possible to remove it? I see no option in UI.

Thanks again

Once a compose application is deployed via package manager, is it possible to remove it?

Could you clarify what you mean by “package manager” in this context? Are you talking about the extension or what exactly?

Best Regards,
Jeremias

I have deployed this application stack on a device. I see no option (in UI and API) to uninstall it from devices.
image
Is there any way?

Thanks

Our update solution is only for that, updating software on devices. There is no concept of uninstalling/removing software from a device. You can push another update that replaces the software with new software, but you can’t just remove the software.

I’m curious though. Is this something you would use in a production scenario? If yes, could you explain your use-case where you would uninstall software from a device in the field.

Best Regards,
Jeremias

Fornow, it’s more an understanding of the capabilities. A case would be to overcome to a user error.
If I understood correctly, all docker application deployed as Application stack are then started forcing a profile (torizon).
So the deploy of another stack with different containers will overwrite previously deployed stack.
Am I right?
Thanks!

So the deploy of another stack with different containers will overwrite previously deployed stack.
Am I right?

That is correct, by default our systems have a singular docker-compose “package”. Meaning there is one docker-compose.yml that defines the containers on that system. Updates operate on this one docker-compose.yml file replacing it with a new file via the update. The update process will then bring down the older containers, bring up the new containers, and clean-up the old containers from the system.

A rough workflow of how the update works is documented here: Torizon Updates Technical Overview | Toradex Developer Center

Best Regards,
Jeremias