-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
HACKING: Add a section about Python bridge and debugging #18995
HACKING: Add a section about Python bridge and debugging #18995
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this is nice! I was previously hacking bridge.py. This should work in Debian etc. with pam_env, but I'm not sure if all distros use /etc/environment?
Works on Arch and Fedora so I suppose so? 🤔 |
facepalm totally forgot about
|
HACKING.md
Outdated
|
||
A test image with the Python image can be created with `image-prepare` for the operating systems which don't enable it yet. | ||
|
||
./test/image-prepare --python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now outdated, where do we not have the bridge yet? Just RHEL 9/8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RHEL/CentOS 8, debian-stable, ubuntu-2204. The rest has it.
HACKING.md
Outdated
@@ -182,14 +182,33 @@ git submodules: | |||
Refer to the [testing README](test/README.md) for details on running the Cockpit | |||
integration tests locally. | |||
|
|||
## Testing the Python bridge | |||
## Python bridge | |||
|
|||
Cockpit currently has an experimental replacement for `cockpit-bridge` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still experimental?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's been live for a while :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave that for a follow up.
HACKING.md
Outdated
To enable debug logging, you can set `COCKPIT_DEBUG`. In a test virtual | ||
machine this can be done by setting it in the global environment: | ||
|
||
echo 'COCKPIT_DEBUG=all' >> /etc/environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or uhh python3 -m cockpit.bridge --debug
@martinpitt how do you develop with the bridge locally? I usually create a wrapper script and then:
./cockpit-ws --local-session=./foo.sh --port 9999
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually develop in a VM, and iterate with something like
scp -r src/cockpit c:/usr/lib/python3.11/site-packages/; ssh c pkill -e cockpit-bridge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm can we do something silly and use systemd-ctypes to make a ./build.js -w
variant for Python.
cc45248
to
d5c340e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheers!
Explain the COCKPIT_DEBUG environment variable. Closes cockpit-project#19193
dcb91c2
to
e66e2ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheers!
Triggered fcos/other |
Explain the COCKPIT_DEBUG environment variable.