odo
odo copied to clipboard
[WIP] Podman dev
What type of PR is this:
/kind feature
What does this PR do / why we need it:
Which issue(s) this PR fixes:
Fixes #6151
PR acceptance criteria:
-
[ ] Unit test
-
[ ] Integration test
-
[ ] Documentation
How to test changes / Special notes to the reviewer:
Deploy Preview for odo-docusaurus-preview ready!
Name | Link |
---|---|
Latest commit | 241b5d18d3ee44d6ea1234c8e7b3fc7e3b29ff09 |
Latest deploy log | https://app.netlify.com/sites/odo-docusaurus-preview/deploys/637b382205380800085973fd |
Deploy Preview | https://deploy-preview-6183--odo-docusaurus-preview.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Unit Tests on commit b83e4aa73e6596af70e2befac18f50678038f8d6 finished successfully. View logs: TXT HTML
Validate Tests on commit b83e4aa73e6596af70e2befac18f50678038f8d6 finished successfully. View logs: TXT HTML
OpenShift Tests on commit b83e4aa73e6596af70e2befac18f50678038f8d6 finished successfully. View logs: TXT HTML
Kubernetes Tests on commit b83e4aa73e6596af70e2befac18f50678038f8d6 finished successfully. View logs: TXT HTML
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from feloy by writing /assign @feloy
in a comment. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
Windows Tests (OCP) on commit b83e4aa73e6596af70e2befac18f50678038f8d6 finished successfully. View logs: TXT HTML
NoCluster Tests on commit b83e4aa73e6596af70e2befac18f50678038f8d6 finished successfully. View logs: TXT HTML
I started playing with this and it keeps failing on "sync".
✗ Command 'tar xf - -C /projects --no-same-owner' in container failed.
✗ stdout:
✗ stderr:
✗ err: exit status 2
✗ failed to sync to component with name demo: unable push files to pod: exit status 2
I started playing with this and it keeps failing on "sync".
✗ Command 'tar xf - -C /projects --no-same-owner' in container failed. ✗ stdout: ✗ stderr: ✗ err: exit status 2 ✗ failed to sync to component with name demo: unable push files to pod: exit status 2
Could you please share the podman version and the Devfile you are using? And also the complete output of the command (including the definition of the created Pod)?
I started playing with this and it keeps failing on "sync".
✗ Command 'tar xf - -C /projects --no-same-owner' in container failed. ✗ stdout: ✗ stderr: ✗ err: exit status 2 ✗ failed to sync to component with name demo: unable push files to pod: exit status 2
I was able to reproduce the problem when a podman volume is reused. It seems that in this case, tar does not have the permissions to overwrite the files on this volume.
I fixed odo which didn't correctly delete the volumes of the previous sessions.
Also, I made odo dev fail if a volume already exists.
Please check again with new patches to see if this is the same problem on your side.
@feloy I ran into a different issue than the one reported by Tomas. It is a panic
this time, after bootstrapping a new project and running odo dev
:
odo init --name my-quarkus-app --devfile java-quarkus --starter community
odo dev --run-on podman
I haven't looked into the stacktrace yet, but here is the output, and my podman version:
Output
x odo dev --run-on podman
__
/ \__ Developing using the "my-quarkus-app" Devfile
\__/ \ Namespace: default
/ \__/ odo version: v3.2.0
\__/
↪ Deploying to the cluster in developer mode
Deploying using Podman
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
name: my-quarkus-app-app
spec:
containers:
- args:
- tail
- -f
- /dev/null
env:
- name: DEBUG_PORT
value: "5858"
- name: PROJECTS_ROOT
value: /projects
- name: PROJECT_SOURCE
value: /projects
image: registry.access.redhat.com/ubi8/openjdk-17
imagePullPolicy: Always
name: tools
ports:
- containerPort: 8080
hostPort: 39001
name: http-quarkus
protocol: TCP
resources:
limits:
memory: 512Mi
volumeMounts:
- mountPath: /projects
name: odo-projects
- mountPath: /opt/odo/
name: odo-shared-data
volumes:
- name: odo-projects
persistentVolumeClaim:
claimName: odo-projects-my-quarkus-app-app-source
- name: odo-shared-data
persistentVolumeClaim:
claimName: odo-projects-my-quarkus-app-app-shared
status: {}
Trying to pull registry.access.redhat.com/ubi8/openjdk-17:latest...
Getting image source signatures
Checking if image destination supports signatures
Copying blob sha256:014d343fa5c5b8d0a78e9ff3cba23b330b140d59015cb2eb68520cd37599acb9
Copying blob sha256:488d0614fc378af3bd3dc61a94e61987e86d74a480b8fe0048d8a7e7574202de
Copying config sha256:eade82c16966390bfc56230b77e70a6a882e8981327c26a3f1f4f5fc734905c7
Writing manifest to image destination
Storing signatures
Pod:
c4a896cb48aa95743636dd2cfaf3501af4b5592686920dde6314b3782400fe0f
Container:
9fed987d9ad14c811b39c98a2e6accca28a2be48620368b1d27d7775e11fb621
• Executing the application (command: dev-run) ...
✗ Finished executing the application (command: dev-run) [1s]
⚠ Devfile command "dev-run" exited with an error status in 20 second(s)
⚠ Last 100 lines of log:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x300 pc=0x27f146c]
goroutine 1 [running]:
github.com/redhat-developer/odo/pkg/component.Log({0x7f415017cf98, 0x46a0528}, {0xc000bf3e70, 0xe}, {0x2e9ee5c, 0xc00065cae8}, 0x90, {{0xc000bf3c00, 0x7}, 0x0, ...})
/home/asoro/work/projects/odo/pkg/component/component.go:97 +0x8c
github.com/redhat-developer/odo/pkg/component.checkRemoteCommandStatus({0x323ee00, 0xc00045d760}, {0x7f415017cf98, 0x46a0528}, {{0xc000bf3c00, 0x7}, 0x0, {{0x0, 0x0}, 0xc000b5d490, ...}}, ...)
/home/asoro/work/projects/odo/pkg/component/execute_run.go:157 +0x1e6
github.com/redhat-developer/odo/pkg/component.ExecuteRunCommand({0x323ee00, 0xc00045d760}, {0x7f415017cf98, 0x46a0528}, {{0xc000bf3c00, 0x7}, 0x0, {{0x0, 0x0}, 0xc000b5d490, ...}}, ...)
/home/asoro/work/projects/odo/pkg/component/execute_run.go:112 +0xab9
github.com/redhat-developer/odo/pkg/dev/podmandev.commandHandler.Execute(...)
/home/asoro/work/projects/odo/pkg/dev/podmandev/command.go:34
github.com/redhat-developer/odo/pkg/libdevfile.(*execCommand).Execute(0xc00047ee48, {0x326b9b0, 0xc0000adb00})
/home/asoro/work/projects/odo/pkg/libdevfile/command_exec.go:30 +0xa4
github.com/redhat-developer/odo/pkg/libdevfile.executeCommand({{{0xc00047ee48, 0x5}, {0xc0000632c0, 0x58}, {0xc0000632c0, 0x58}, {0xc0001b1800, 0x7d0, 0x800}, {0x2fd2987, ...}, ...}, ...}, ...)
/home/asoro/work/projects/odo/pkg/libdevfile/libdevfile.go:76 +0x11b
github.com/redhat-developer/odo/pkg/libdevfile.ExecuteCommandByNameAndKind({{{0xc00047ee48, 0x5}, {0xc0000632c0, 0x58}, {0xc0000632c0, 0x58}, {0xc0001b1800, 0x7d0, 0x800}, {0x2fd2987, ...}, ...}, ...}, ...)
/home/asoro/work/projects/odo/pkg/libdevfile/libdevfile.go:67 +0x3c5
github.com/redhat-developer/odo/pkg/dev/podmandev.(*DevClient).Start(0xc000536270, {0x3288838, 0xc000bea340}, {0xc0000632c0, 0x4b}, {0x0, 0x0}, {0xc000bf3ca0, 0x7}, {{0xc00069b6c0, ...}, ...})
/home/asoro/work/projects/odo/pkg/dev/podmandev/podmandev.go:132 +0x7e5
github.com/redhat-developer/odo/pkg/odo/cli/dev.(*DevOptions).Run(0xc00055a280, {0x32888e0, 0xc00070e1b0})
/home/asoro/work/projects/odo/pkg/odo/cli/dev/dev.go:147 +0x5e5
github.com/redhat-developer/odo/pkg/odo/genericclioptions.GenericRun({0x3289280, 0xc00055a280}, 0xc0006d7b80, {0xc0006a8a00, 0x0, 0x2})
/home/asoro/work/projects/odo/pkg/odo/genericclioptions/runnable.go:244 +0x15c4
github.com/redhat-developer/odo/pkg/odo/cli/dev.NewCmdDev.func1(0xc0006d7b80, {0xc0006a8a00, 0x2, 0x2})
/home/asoro/work/projects/odo/pkg/odo/cli/dev/dev.go:189 +0x38
github.com/spf13/cobra.(*Command).execute(0xc0006d7b80, {0xc0006a89e0, 0x2, 0x2})
/home/asoro/work/projects/odo/vendor/github.com/spf13/cobra/command.go:860 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0xc0006d6280)
/home/asoro/work/projects/odo/vendor/github.com/spf13/cobra/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
/home/asoro/work/projects/odo/vendor/github.com/spf13/cobra/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
/home/asoro/work/projects/odo/vendor/github.com/spf13/cobra/command.go:895
main.main()
/home/asoro/work/projects/odo/cmd/odo/odo.go:70 +0x425
$ podman version
Client: Podman Engine
Version: 4.2.1
API Version: 4.2.1
Go Version: go1.18.5
Built: Wed Sep 7 21:58:19 2022
OS/Arch: linux/amd64
@feloy I ran into a different issue than the one reported by Tomas. It is a
panic
this time, after bootstrapping a new project and runningodo dev
:odo init --name my-quarkus-app --devfile java-quarkus --starter community odo dev --run-on podman
I haven't looked into the stacktrace yet, but here is the output, and my podman version:
Output
$ podman version Client: Podman Engine Version: 4.2.1 API Version: 4.2.1 Go Version: go1.18.5 Built: Wed Sep 7 21:58:19 2022 OS/Arch: linux/amd64
This devfile defines a postStart event, I don't think this is supported yet
@feloy I ran into a different issue than the one reported by Tomas. It is a
panic
this time, after bootstrapping a new project and runningodo dev
:odo init --name my-quarkus-app --devfile java-quarkus --starter community odo dev --run-on podman
I haven't looked into the stacktrace yet, but here is the output, and my podman version: Output
$ podman version Client: Podman Engine Version: 4.2.1 API Version: 4.2.1 Go Version: go1.18.5 Built: Wed Sep 7 21:58:19 2022 OS/Arch: linux/amd64
This devfile defines a postStart event, I don't think this is supported yet
I have added support for postStart, but the support of devfile volumes is also missing.
This will need some work on refactoring the pkg/envinfo
(and probably also the pkg/storage
) package.
Another thing I noticed: maybe I missed something, but I was not able to run odo dev --run-on=podman
without an active Kubernetes context. Is that intended?
$ odo dev --run-on=podman -v 7
I1107 09:11:27.475546 2094577 implem.go:106] The path for preference file is /home/asoro/.config/odo/preferences.yaml
I1107 09:11:27.475620 2094577 util.go:733] HTTPGetRequest: https://raw.githubusercontent.com/redhat-developer/odo/main/build/VERSION
I1107 09:11:27.475639 2094577 segment.go:268] Checking telemetry enable status
I1107 09:11:27.475645 2094577 segment.go:298] Sending telemetry enabled by preference
I1107 09:11:27.475661 2094577 util.go:754] Response will be cached in /tmp/odohttpcache for 1h0m0s
✗
Please ensure you have an active kubernetes context to your cluster.
Consult your Kubernetes distribution's documentation for more details.
Error: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
Another thing I noticed: maybe I missed something, but I was not able to run
odo dev --run-on=podman
without an active Kubernetes context. Is that intended?
Good catch, thanks. It was working before some rebase. I fixed the problem.
/hold
Holding this PR, because we need to wait for the following issues/PRs:
- https://github.com/redhat-developer/odo/issues/6150
- https://github.com/redhat-developer/odo/pull/6293.
New changes are detected. LGTM label has been removed.
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
13 Code Smells
No Coverage information
0.0% Duplication
Rebased on main to use go v1.18
We might need more logging. For example I forgot to start podman machine on MacOS` , so podman cli was not working.
odo just fail with exist status 125
without any additional information :-(
If podman
commands fail we should show users the error message from podman so they know what is happening.
▶ odo dev -v 5 --run-on podman
I1116 16:06:57.629182 82014 implem.go:106] The path for preference file is /Users/tkral/.odo/preference.yaml
I1116 16:06:57.629196 82014 util.go:733] HTTPGetRequest: https://raw.githubusercontent.com/redhat-developer/odo/main/build/VERSION
I1116 16:06:57.629421 82014 util.go:754] Response will be cached in /var/folders/z1/br1bg03n1fjc9bntwmxg4zwm0000gn/T/odohttpcache for 1h0m0s
I1116 16:06:57.629494 82014 segment.go:268] Checking telemetry enable status
I1116 16:06:57.629506 82014 segment.go:298] Sending telemetry enabled by preference
I1116 16:06:57.629577 82014 util.go:767] Cached response used.
I1116 16:06:57.631929 82014 implem.go:106] The path for preference file is /Users/tkral/.odo/preference.yaml
I1116 16:06:57.632160 82014 context.go:141] absolute devfile path: '/Users/tkral/Code/odo-examples/nodejs-starter/devfile.yaml'
I1116 16:06:57.632264 82014 context.go:92] absolute devfile path: '/Users/tkral/Code/odo-examples/nodejs-starter/devfile.yaml'
I1116 16:06:57.632672 82014 content.go:33] converted devfile YAML to JSON
I1116 16:06:57.632722 82014 apiVersion.go:45] devfile schemaVersion: '2.1.0'
I1116 16:06:57.632729 82014 helper.go:41] devfile apiVersion '2.1.0' is supported
I1116 16:06:57.634384 82014 schema.go:46] validated devfile schema
I1116 16:06:57.635274 82014 validate.go:45] Successfully validated devfile sections
I1116 16:06:57.635281 82014 validate.go:45] Successfully validated devfile sections
I1116 16:06:57.635303 82014 component.go:84] name of component is "nodejs-starter", and sanitized name is "nodejs-starter"
__
/ \__ Developing using the "nodejs-starter" Devfile
\__/ \ Platform: podman
/ \__/ odo version: v3.2.0
\__/
↪ Deploying to podman in developer mode
• Deploying pod ...
I1116 16:06:57.635496 82014 utils.go:73] Updating container runtime with mandatory volume mounts
✗ Deploying pod [15ms]
✗ exit status 125
▶ podman ps
Error: failed to connect: dial tcp 127.0.0.1:50110: connect: connection refused
Rebased to fix conflict on pkg/dev/dev.go
We might need more logging. For example I forgot to start podman machine on MacOS` , so podman cli was not working.
@kadel I have added more info on error reporting on commit More info on ExitError errors.
Could you please check if this fixes the problem?
@feloy With the new changes on writing into the devstate file (https://github.com/redhat-developer/odo/pull/6183/commits/118bcbbe419be7e88d1f25019aeb7a665031bea8), I'm now getting a open ./.odo/devstate.json: no such file or directory
error when running odo dev
on Podman.
This makes odo dev
exit right away.
I guess we need to create this file.
I ran odo dev
right after bootstrapping a new NodeJS starter project with odo init
$ ODO_EXPERIMENTAL_MODE=true odo dev --run-on=podman -v 7
Experimental mode enabled for flag: --run-on. Use at your own risk. More details on https://odo.dev/docs/user-guides/advanced/experimental-mode
I1117 15:05:43.279350 1045943 implem.go:106] The path for preference file is /home/asoro/.config/odo/preferences.yaml
I1117 15:05:43.279425 1045943 segment.go:268] Checking telemetry enable status
I1117 15:05:43.279431 1045943 segment.go:298] Sending telemetry enabled by preference
I1117 15:05:43.279431 1045943 util.go:733] HTTPGetRequest: https://raw.githubusercontent.com/redhat-developer/odo/main/build/VERSION
I1117 15:05:43.279481 1045943 util.go:754] Response will be cached in /tmp/odohttpcache for 1h0m0s
I1117 15:05:43.282051 1045943 implem.go:106] The path for preference file is /home/asoro/.config/odo/preferences.yaml
I1117 15:05:43.282165 1045943 context.go:141] absolute devfile path: '/tmp/node/devfile.yaml'
I1117 15:05:43.282176 1045943 context.go:92] absolute devfile path: '/tmp/node/devfile.yaml'
I1117 15:05:43.282393 1045943 content.go:33] converted devfile YAML to JSON
I1117 15:05:43.282440 1045943 apiVersion.go:45] devfile schemaVersion: '2.1.0'
I1117 15:05:43.282454 1045943 helper.go:41] devfile apiVersion '2.1.0' is supported
I1117 15:05:43.284214 1045943 schema.go:46] validated devfile schema
I1117 15:05:43.286128 1045943 validate.go:45] Successfully validated devfile sections
I1117 15:05:43.286140 1045943 validate.go:45] Successfully validated devfile sections
I1117 15:05:43.286173 1045943 component.go:84] name of component is "test-nodejs-on-podman", and sanitized name is "test-nodejs-on-podman"
__
/ \__ Developing using the "test-nodejs-on-podman" Devfile
\__/ \ Platform: podman
/ \__/ odo version: v3.2.0
\__/
↪ Deploying to podman in developer mode
• Deploying pod ...
I1117 15:05:43.286286 1045943 utils.go:73] Updating container runtime with mandatory volume mounts
I1117 15:05:43.386492 1045943 podman.go:57] Trying to pull registry.access.redhat.com/ubi8/nodejs-16:latest...
I1117 15:05:43.578930 1045943 util.go:767] Cached response used.
I1117 15:05:46.729760 1045943 podman.go:57] Getting image source signatures
Checking if image destination supports signatures
I1117 15:05:46.729838 1045943 podman.go:57] Copying blob sha256:53b802d1b2f7c20f47362b06b90ddc0ab921dd2b63f891ab3de060df602983a4
I1117 15:05:46.729885 1045943 podman.go:57] Copying blob sha256:75800ed868ab0a3f29f2addac2109a77aec89445d85f001da2fc73a88f17a8a0
I1117 15:05:46.729900 1045943 podman.go:57] Copying blob sha256:c8408bdc05406550cf8ab25336f9bb12eefce9ee697281330f02bcbe80931fa2
I1117 15:05:46.731291 1045943 podman.go:57] Copying config sha256:c4507b2a0bf33a7422231f306cd478e22404f180bfd98d18bb0d4346c60f0879
I1117 15:05:46.745458 1045943 podman.go:57] Writing manifest to image destination
I1117 15:05:46.745480 1045943 podman.go:57] Storing signatures
I1117 15:05:47.032997 1045943 podman.go:57] Pod:
af89e18a946e186acb0ea62ac89e22b8e3d859fc69ab2093ab244bf6b7b20ded
Container:
fb793c2ecae25b02378d559a628ff49bf0947189451fb0925616391e102f5fcc
I1117 15:05:47.035479 1045943 podman.go:57]
✓ Deploying pod [4s]
- Forwarding from 127.0.0.1:39001 -> 3000
- Forwarding from 127.0.0.1:39002 -> 5858
✗ open ./.odo/devstate.json: no such file or directory
@kadel I have added more info on error reporting on commit More info on ExitError errors.
Could you please check if this fixes the problem?
Yes, this looks good.
Previously I also had an issue that the odo dev
was infinitely waiting for run
command to finish, it looks like this has been fixed as well.
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
14 Code Smells
No Coverage information
0.0% Duplication
/approve Functionality lgtm, except what Armel mentioned in https://github.com/redhat-developer/odo/pull/6183/files#r1015565454.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: valaparthvi
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [valaparthvi]
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
/test v4.11-integration-e2e
/override ci/prow/v4.11-integration-e2e Tests pass on IBM Cloud
@feloy: Overrode contexts on behalf of feloy: ci/prow/v4.11-integration-e2e
In response to this:
/override ci/prow/v4.11-integration-e2e Tests pass on IBM Cloud
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.