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

[podman] Issue when running with podman > 3 #827

Closed
l0r1s opened this issue Mar 22, 2023 · 14 comments
Closed

[podman] Issue when running with podman > 3 #827

l0r1s opened this issue Mar 22, 2023 · 14 comments
Assignees
Labels
help wanted Extra attention is needed podman-provider

Comments

@l0r1s
Copy link
Contributor

l0r1s commented Mar 22, 2023

Problem

We can't run zombienet using podman version 4 because they removed the suffixing of the pod with "_pod".

Podman issue

Pictures

Screenshot from 2023-03-22 18-22-42

Screenshot from 2023-03-22 19-01-32

Actions taken

  • Updating documentation to alert users
@pepoviola
Copy link
Collaborator

Hi @l0r1s, we have more action items in this one?

@l0r1s
Copy link
Contributor Author

l0r1s commented Apr 18, 2023

Hi @pepoviola coulnd't make it work by just modifying pod name to include _pod suffix

@pepoviola
Copy link
Collaborator

Oks, I will try to give a a quick look to check if we can resolve.
Thanks!

@s0me0ne-unkn0wn
Copy link

I came across this one today. Patching the current master as follows did the trick for me, but the solution is neither complete nor backward compatible.

diff --git a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts
index d925390..8b6a347 100644
--- a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts
+++ b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts
@@ -215,7 +215,7 @@ export class PodmanClient extends Client {
   ): Promise<string> {
     const args = ["logs"];
     if (since && since > 0) args.push(...["--since", `${since}s`]);
-    args.push(`${podName}_pod-${podName}`);
+    args.push(`${podName}-${podName}`);
 
     const result = await this.runCommand(args, { scoped: false });
     return result.stdout;
@@ -240,7 +240,7 @@ export class PodmanClient extends Client {
   }
 
   async getPortMapping(port: number, podName: string): Promise<number> {
-    const args = ["inspect", `${podName}_pod-${podName}`, "--format", "json"];
+    const args = ["inspect", `${podName}-${podName}`, "--format", "json"];
     const result = await this.runCommand(args, { scoped: false });
     const resultJson = JSON.parse(result.stdout);
     const hostPort =
@@ -249,7 +249,7 @@ export class PodmanClient extends Client {
   }
 
   async getNodeIP(podName: string): Promise<string> {
-    const args = ["inspect", `${podName}_pod-${podName}`, "--format", "json"];
+    const args = ["inspect", `${podName}-${podName}`, "--format", "json"];
     const result = await this.runCommand(args, { scoped: false });
     const resultJson = JSON.parse(result.stdout);
     const podIp =
@@ -537,6 +539,6 @@ export class PodmanClient extends Client {
   }
 
   getLogsCommand(name: string): string {
-    return `podman logs -f ${name}_pod-${name}`;
+    return `podman logs -f ${name}-${name}`;
   }
 }

@l0r1s
Copy link
Contributor Author

l0r1s commented Jun 15, 2023

I came across this one today. Patching the current master as follows did the trick for me, but the solution is neither complete nor backward compatible.

diff --git a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts
index d925390..8b6a347 100644
--- a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts
+++ b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts
@@ -215,7 +215,7 @@ export class PodmanClient extends Client {
   ): Promise<string> {
     const args = ["logs"];
     if (since && since > 0) args.push(...["--since", `${since}s`]);
-    args.push(`${podName}_pod-${podName}`);
+    args.push(`${podName}-${podName}`);
 
     const result = await this.runCommand(args, { scoped: false });
     return result.stdout;
@@ -240,7 +240,7 @@ export class PodmanClient extends Client {
   }
 
   async getPortMapping(port: number, podName: string): Promise<number> {
-    const args = ["inspect", `${podName}_pod-${podName}`, "--format", "json"];
+    const args = ["inspect", `${podName}-${podName}`, "--format", "json"];
     const result = await this.runCommand(args, { scoped: false });
     const resultJson = JSON.parse(result.stdout);
     const hostPort =
@@ -249,7 +249,7 @@ export class PodmanClient extends Client {
   }
 
   async getNodeIP(podName: string): Promise<string> {
-    const args = ["inspect", `${podName}_pod-${podName}`, "--format", "json"];
+    const args = ["inspect", `${podName}-${podName}`, "--format", "json"];
     const result = await this.runCommand(args, { scoped: false });
     const resultJson = JSON.parse(result.stdout);
     const podIp =
@@ -537,6 +539,6 @@ export class PodmanClient extends Client {
   }
 
   getLogsCommand(name: string): string {
-    return `podman logs -f ${name}_pod-${name}`;
+    return `podman logs -f ${name}-${name}`;
   }
 }

Hi @s0me0ne-unkn0wn, thanks you for your comment, does it works for both podman v2 and v3 ? Because I had some issue making it works for both versions.

@s0me0ne-unkn0wn
Copy link

I'm afraid it's not universal and only works for Podman after the pod naming scheme change. So different podman versions should use different naming schemes. Some stupid ideas on how to resolve that:

  1. Create separate providers podman2 and podman3
  2. Create a dummy pod on startup and check which naming scheme is used on the host system

@pepoviola
Copy link
Collaborator

@wirednkod you are working on this right? podman v4

@pepoviola pepoviola assigned wirednkod and unassigned pepoviola Sep 7, 2023
@l0r1s
Copy link
Contributor Author

l0r1s commented Sep 7, 2023

I will try to add a markdown guide in a "Contributing" section of the docs today to switch between Podman v3/v4 easily using Nix

@pepoviola
Copy link
Collaborator

I will try to add a markdown guide in a "Contributing" section of the docs today to switch between Podman v3/v4 easily using Nix

Sounds good and will help us to support a wide range of users. Thx!

@FlorianFranzen
Copy link
Contributor

FlorianFranzen commented Aug 27, 2024

So this is a know unfixed issue? Just ran into that today on podman 5.2.0 trying the podman backend. Maybe you should mention that somewhere that the podman backend is broken.,.

There are such command as podman pod exists so this should certainly be detectable.

@pepoviola
Copy link
Collaborator

Hi @FlorianFranzen, thanks for the feedback. Yes, podman is only supported on versions below 3. But we add podman/docker support in the new sdk. Let me know if you have time to try the new version and if you have questions.

Thx!

@pepoviola pepoviola added question Further information is requested help wanted Extra attention is needed and removed question Further information is requested labels Aug 27, 2024
@pepoviola
Copy link
Collaborator

Also, I think the more easy way to fix this is just to use the sdk as example and re-write this provider to be docker/podman compatible. Please ping me if you want to work on this direction.

Thx!

@FlorianFranzen
Copy link
Contributor

I really only want to use zombienet to implement our more advanced integration tests. I do not mind using kind for that, especially since that does not require me to run ancient podman versions or docker.

I opened a PR to safe people from having to discover the lack of support of recent podman versions themselves by reading the issue tracker in #1862.

@pepoviola
Copy link
Collaborator

Hi 👋 , I will close this one since the new version of zombienet (https://github.com/paritytech/zombienet-sdk) is fully compatible with docker/podman. Please use the new version if you need to run on those providers.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed podman-provider
Projects
None yet
Development

No branches or pull requests

5 participants