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

Initial ABRT proxy support #133

Closed
wants to merge 1 commit into from

Conversation

mmilata
Copy link
Contributor

@mmilata mmilata commented Feb 12, 2014

This change makes it possible for the proxy to pretend it is ABRT
(Automatic Bug Reporting Tool[1]) server. When it receives a problem
report, it forwards notification of the error to Foreman, and optionally
also forwards the original report to an actual ABRT server.

Non strictly ABRT-related changes:

  • Move module Proxy::ChefProxy to Proxy::Request
  • Add :foreman_ssl_ options to settings example

[1] https://github.com/abrt/abrt/wiki/ABRT-Project

For some notes regarding usage, see https://groups.google.com/forum/#!topic/foreman-dev/Yk2GrW9ne20

I am quite new to Ruby so please let me know if anything should be done in a different way:)

@lzap
Copy link
Member

lzap commented Feb 12, 2014

Thanks for your contribution, the formal review will follow shortly. [test]

@@ -18,7 +18,8 @@ module Proxy
require "proxy/dns" if SETTINGS.dns
require "proxy/dhcp" if SETTINGS.dhcp
require "proxy/bmc" if SETTINGS.bmc
require "proxy/chefproxy" if SETTINGS.chefproxy
#require "proxy/chefproxy" if SETTINGS.chefproxy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Should I reopen the PR or wait after you finish the review?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us finish the review, then fix it, amend the changes and force-push into the same branch. Github will notice the changes, no need to close/open/reopen the PR.

When amending, please reword your commit message to:

fixes #4332 - initial abrt proxy support

I created feature for this: http://projects.theforeman.org/issues/4332

@lzap
Copy link
Member

lzap commented Feb 12, 2014

Initial code reading looks fine, can you paste some info how to configure the ABRT client. I will be happy to test this tomorrow.

@mmilata
Copy link
Contributor Author

mmilata commented Feb 12, 2014

The client configuration is described on https://groups.google.com/forum/#!topic/foreman-dev/Yk2GrW9ne20 (please note that # abrt-auto-reporting enabled and other lines below starting with # are commands to be run as root; lines starting with # above are config file comments).

If anything is unclear, you can also contact me via IRC (either internal or as b42 on #abrt@freenode).

#:foreman_url: http://127.0.0.1:3000
#:foreman_ssl_ca: ssl/certs/ca.pem
#:foreman_ssl_cert: ssl/certs/fqdn.pem
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm I am trying to find use of foreman_ssl_* variables in this patch and I am not succesful. I only see validations for the abrt_server_ssl* variables bellow. Am I searching correctly, or is this expected. I wonder what is unused settings for then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variables are used in lib/proxy/request.rb (which was renamed from lib/proxy/chefproxy.rb in the commit). They should probably have been added in the patch that introduced the chef proxy.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks.

@lzap
Copy link
Member

lzap commented Feb 13, 2014

Sidenote: In the instructions for this feature, we must make sure that abrt-addon-ccpp package is installed.

@lzap
Copy link
Member

lzap commented Feb 13, 2014

Ok this is working fine. The only issue I had was that abrt autoupload feature was not working properly on Fedora 20 minimal install. Workaround:

yum -y install abrt abrt-addon-ccpp abrt-python

I will look on the ruby code now.

ureport_json = request['file'][:tempfile].read
ureport = JSON.parse(ureport_json)

#forward to FAF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also enclose the whole FAF sending to a begin/rescue block catching all the Exceptions with a message "Unable to send to FAF"? Use log_halt to generate the error and return 503.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. [test]

Ok this needs some additional opinions from the team.

This change makes it possible for the proxy to pretend it is ABRT
(Automatic Bug Reporting Tool[1]) server. When it receives a problem
report, it forwards notification of the error to Foreman, and optionally
also forwards the original report to an actual ABRT server.

Non strictly ABRT-related changes:
- Move module Proxy::ChefProxy to Proxy::Request
- Add :foreman_ssl_ options to settings example

[1] https://github.com/abrt/abrt/wiki/ABRT-Project
@domcleal
Copy link
Contributor

I don't think this should be in the proxy core, especially as it masquerades via configuration management reports. This should be written as a plugin once the proxy has plugin support of its own.

@lzap
Copy link
Member

lzap commented Feb 14, 2014

Well my assumption was to generalize reports to some degree. I am fine
with the plugin.

Later,

Lukas "lzap" Zapletal
irc: lzap #theforeman

@mmilata
Copy link
Contributor Author

mmilata commented Feb 17, 2014

@domcleal Afaik it is planned for foreman to support multiple report types: http://projects.theforeman.org/issues/4332 http://projects.theforeman.org/issues/4151. Then the ABRT proxy can be rewritten to use its own report format. Would that be acceptable? Do you have any estimate for the smart-proxy plugin support?

@domcleal
Copy link
Contributor

Yes, Foreman should support different report types (http://projects.theforeman.org/issues/4151), but I don't think that would be appropriate still. Reports in Foreman's context are configuration management reports, so it would additionally require different treatment - e.g. we show a host as out of sync when it doesn't send in reports. If an ABRT "report" arrived, that would incorrectly imply that configuration management is working. I think it would require even more changes to how "reports" are handled, or simply to define a new object type.. which can already be done today in a plugin.

I don't know when proxy plugin support (http://projects.theforeman.org/issues/3351) will be done, as it's not on our current sprint and not prioritised in the backlog.

@mmilata
Copy link
Contributor Author

mmilata commented Feb 17, 2014

Oops, #4151 was what I meant to link.

I'll take a closer look at foreman plugins. From what you say it certainly makes sense to treat them separately from the configuration management reports.

@iNecas
Copy link
Member

iNecas commented Feb 18, 2014

@domcleal what about having reports more generic, and a subtype of them would be ConfigManagement related: this subtypes would update the sync status, while ABRT type would not cause it. Since the reports are all that similar, I don't see why we would need something completely different for the ABRT type of reports?

@domcleal
Copy link
Contributor

@iNecas indeed. Tthough I don't know what ABRT sends, that'd be sensible.

@mmilata
Copy link
Contributor Author

mmilata commented Feb 18, 2014

@ares
Copy link
Member

ares commented Feb 19, 2014

I think report is still a report. We may set host status based on config mgmt reports only but I think we could reuse a lot of existing report functionality.

  1. if ABRT report was imported, it would be displayed on dashboard
  2. ABRT report will later aggregate crashes, so counters (e.g. for failures) seems appropriate and each failure should be separate log in report

I think it would be better to make reports more general. If we make STI which separates "config reports" and "crash reports" it will be easy to keep hosts statuses based only on config reports.

Also maybe later we could have more host statuses based on reports type. E.g. crash report could make host in some failing state. I can imagine other reports from let's say monitoring tools.

EDIT: I should have reloaded the page before submitting, seems like @iNecas already said it.

@lzap
Copy link
Member

lzap commented Feb 20, 2014

I agree with Marek.

Having that said, I think this deserves some investigation of the field.
We should look on technologies we would like to see in Foreman and then
refactor this properly for once.

I suppose we aim for:

  • puppet reports
  • chef reports
  • ansible reports
  • abrt reports

In addition to that, it would be good to consider support for syslog to
some degree (syslog server integration). But this should be perhaps
better candidate for a plugin as this is something else than reporting.
It's a constant stream of logs.

Later,

Lukas "lzap" Zapletal
irc: lzap #theforeman

@iNecas
Copy link
Member

iNecas commented Feb 20, 2014

Maybe SCAP reports as well?

@mmilata
Copy link
Contributor Author

mmilata commented Mar 26, 2014

Thanks for the feedback! I've opened new pull request for this, since the code changed significantly: #144

@mmilata mmilata closed this Mar 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants