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

Add Gitpod configuration #147

Merged
merged 1 commit into from
Jul 22, 2020
Merged

Add Gitpod configuration #147

merged 1 commit into from
Jul 22, 2020

Conversation

i-ky
Copy link
Contributor

@i-ky i-ky commented Jul 22, 2020

Gitpod provides development environment in your browser.

To simplify integration with Gitpod and improve development experience in general, I've tweaked Makefile a bit to allow builds outside of Zabbix source tree:

$ make ZABBIX_SOURCE=/path/to/zabbix

In this case copying files to src/modules/ of Zabbix is not required. But by default Makefile will behave like before (and Travis CI config didn't change).

@jangaraj jangaraj merged commit 5ccc07b into monitoringartist:master Jul 22, 2020
@i-ky i-ky deleted the gitpod branch July 22, 2020 20:04
@i-ky
Copy link
Contributor Author

i-ky commented Jul 23, 2020

I guess it would be nice to provide some explanations.

.gitpod.Dockerfile describes a container we will use for development. It is based on gitpod/workspace-full which comes with lots of development tools, but we still need few more:

  • Autotools to configure Zabbix sources;
  • Build EAR to capture compiler invocations into compilation database.

.gitpod.yml describes actions that need to be performed when you start a new workspace or jump into existing one. In our case we check out Zabbix sources and configure them. We do it in /workspace/ folder, because it is persisted between sessions. That way if you jump into existing workspace Zabbix is already configured and everything is ready to go.

Gitpod comes packed with C/C++ development tools, one of which is clangd language server. But for it to work properly, it needs to know how we compile our source files. So another thing we do when initialising workspace is building module using bear. This produces compile_commands.json file.

TODO for the future is to add compile_commands.json and .clangd/ (where clangd stores its stuff) to .gitignore).

Perhaps it also makes sense to install Docker and Zabbix agent into workspace. This will allow testing module without even leaving your browser.

@jangaraj
Copy link
Member

Perhaps it also makes sense to install Docker and Zabbix agent into workspace.

Yes, I was trying that, but running Docker in Docker (in the Gitpod container) will be tricky. Maybe some Docker service simulation and hardcoded cgroup structure will help with development/testing.

@i-ky
Copy link
Contributor Author

i-ky commented Jul 24, 2020

running Docker in Docker (in the Gitpod container) will be tricky

Indeed, currently it is not possible. Here is the issue.

Maybe some Docker service simulation and hardcoded cgroup structure will help with development/testing.

This could be the way to go. I can recall using SNMP simulator for testing SNMP monitoring. It can "record" actual devices and then "replay" them. Maybe a similar project exists for Docker.

@i-ky
Copy link
Contributor Author

i-ky commented Jan 3, 2021

@jangaraj
Copy link
Member

jangaraj commented Jan 4, 2021

Unfortunately, this is still something like Docker in Docker - the same problem for GitHub Action/Gitpod: cgroups are not visible, so only keys which use Docker API can be tested, but metrics from cgroups will fail:
image

The best way (also from the future point of view, where cgroup v2 will be used) will be to calculate everything from the Docker API container stat response - https://docs.docker.com/engine/api/v1.41/#operation/ContainerStats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants