[PATCH conductor] RM 3181 - delayed_job support - revised
by Richard Su
rev2 - Rebased. Incorporated Jay's feedback; to leave db migration
the same as there are no changes and to update Gemfile.lock.
Add delayed_job version 2.1.4 back into our environment: db migration,
initializer, and script.
Created systemd configuration file. Spec file installs config file into
/lib/systemd/system.
The service is named conductor-delayed_job and can be controlled through
either of these two commands:
"systemctl start/stop/status conductor-delayed_job.service"
"service conductor-delayed_job start/stop/status"
Service brings up 2 workers to process the queue.
---
aeolus-conductor.spec.in | 28 ++++++++++++++++++++++++++++
conf/conductor-delayed_job.systemd | 16 ++++++++++++++++
src/Gemfile | 2 ++
src/Gemfile.lock | 2 ++
src/config/initializers/delayed_job.rb | 9 +++++++++
src/script/delayed_job | 5 +++++
6 files changed, 62 insertions(+), 0 deletions(-)
create mode 100644 conf/conductor-delayed_job.systemd
create mode 100644 src/config/initializers/delayed_job.rb
create mode 100755 src/script/delayed_job
diff --git a/aeolus-conductor.spec.in b/aeolus-conductor.spec.in
index f0cc305..123040a 100644
--- a/aeolus-conductor.spec.in
+++ b/aeolus-conductor.spec.in
@@ -45,6 +45,7 @@ Requires: rubygem(pg)
Requires: rubygem(ruby-net-ldap)
Requires: rubygem(oauth)
Requires: rubygem(rake)
+Requires: rubygem(delayed_job) >= 2.1.4
Requires: postgresql
Requires: postgresql-server
Requires: system-logos
@@ -77,6 +78,10 @@ Requires: rubygem(thin) >= 1.2.5
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+
%description daemons
The configuration and daemons necessary to run and proxy the Aeolus Conductor.
@@ -151,6 +156,7 @@ getent passwd aeolus >/dev/null || \
%{__mkdir} -p %{buildroot}%{app_root}
%{__mkdir} -p %{buildroot}%{doc_root}
%{__mkdir} -p %{buildroot}%{_initrddir}
+%{__mkdir} -p %{buildroot}%{_unitdir}/systemd/system
%{__mkdir} -p %{buildroot}%{_sysconfdir}/sysconfig
%{__mkdir} -p %{buildroot}%{_sysconfdir}/httpd/conf.d
%{__mkdir} -p %{buildroot}%{_sysconfdir}/logrotate.d
@@ -261,6 +267,7 @@ done
# copy over init scripts and various config
%{__cp} conf/aeolus-conductor %{buildroot}%{_initrddir}
%{__cp} conf/conductor-dbomatic %{buildroot}%{_initrddir}
+%{__cp} conf/conductor-delayed_job.systemd %{buildroot}%{_unitdir}/conductor-delayed_job.service
%{__cp} conf/aeolus-conductor-httpd.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/aeolus-conductor.conf
%{__cp} conf/aeolus-conductor.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/aeolus-conductor
%{__cp} conf/aeolus-conductor.sysconf %{buildroot}%{_sysconfdir}/sysconfig/aeolus-conductor
@@ -279,6 +286,10 @@ touch %{buildroot}%{_localstatedir}/log/%{name}/rails.log
touch %{buildroot}%{_localstatedir}/log/%{name}/dbomatic.log
%{__mkdir} -p %{buildroot}%{app_root}/log
+# delayed_job version 2.1.4 forces the log to be in this location
+# we should be able to change this to /var/log/aeolus-conductor/delayed_job.log
+# with version 3.0
+touch %{buildroot}%{app_root}/log/delayed_job.log
# copy script files over
%{__cp} -r src/script %{buildroot}%{app_root}
@@ -318,18 +329,33 @@ if [ ! -d %{app_root}/app ]; then
fi
%post daemons
+if [ $1 -eq 1 ] ; then
+ # Initial installation
+ /bin/systemctl daemon-reload >/dev/null 2>&1
+fi
# Register the services
/sbin/chkconfig --add aeolus-conductor
/sbin/chkconfig --add conductor-dbomatic
%preun daemons
if [ $1 = 0 ]; then
+ # Package removal, not upgrade
+ /bin/systemctl --no-reload disable conductor-delayed_job.service > /dev/null 2>&1
+ /bin/systemctl stop conductor-delayed_job.service > /dev/null 2>&1
/sbin/service aeolus-conductor stop > /dev/null 2>&1
/sbin/chkconfig --del aeolus-conductor
/sbin/service conductor-dbomatic stop > /dev/null 2>&1
/sbin/chkconfig --del conductor-dbomatic
fi
+%postun daemons
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /bin/systemctl try-restart conductor-delayed_job.service >/dev/null 2>&1
+fi
+
+
%files
%dir %{app_root}
%{app_root}/app
@@ -358,6 +384,7 @@ fi
%files daemons
%{_initrddir}/aeolus-conductor
%{_initrddir}/conductor-dbomatic
+%{_unitdir}/conductor-delayed_job.service
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{_sysconfdir}/sysconfig/aeolus-conductor
%config(noreplace) %{_sysconfdir}/sysconfig/conductor-rails
@@ -365,6 +392,7 @@ fi
%attr(-, aeolus, aeolus) %{_localstatedir}/lib/%{name}
%attr(-, aeolus, aeolus) %{_localstatedir}/run/%{name}
%attr(-, aeolus, aeolus) %{_localstatedir}/log/%{name}
+%attr(-, aeolus, aeolus) %{app_root}/log/delayed_job.log
%doc AUTHORS COPYING
%{_libdir}/../lib/tmpfiles.d/aeolus.conf
diff --git a/conf/conductor-delayed_job.systemd b/conf/conductor-delayed_job.systemd
new file mode 100644
index 0000000..6c1fc55
--- /dev/null
+++ b/conf/conductor-delayed_job.systemd
@@ -0,0 +1,16 @@
+[Unit]
+Description=aeolus delayed_job
+After=syslog.target
+After=postgresql.service
+
+[Service]
+Type=forking
+User=aeolus
+Environment=RAILS_ENV=production
+WorkingDirectory=/usr/share/aeolus-conductor/
+ExecStart=/usr/share/aeolus-conductor/script/delayed_job start -n 2 --pid-dir=/var/run/aeolus-conductor
+ExecStop=/usr/share/aeolus-conductor/script/delayed_job stop --pid-dir=/var/run/aeolus-conductor
+TimeoutSec=120
+
+[Install]
+WantedBy=multi-user.target
\ No newline at end of file
diff --git a/src/Gemfile b/src/Gemfile
index e17014d..387c13b 100644
--- a/src/Gemfile
+++ b/src/Gemfile
@@ -22,9 +22,11 @@ gem 'rails_warden'
gem 'ruby-net-ldap'
gem 'aeolus-image'
gem 'oauth'
+gem 'delayed_job'
platforms :ruby_18 do
gem 'fastercsv'
end
+
group :development, :test do
gem 'rspec-rails'
gem 'rspec-core'
diff --git a/src/Gemfile.lock b/src/Gemfile.lock
index ef7ac01..496e210 100644
--- a/src/Gemfile.lock
+++ b/src/Gemfile.lock
@@ -55,6 +55,7 @@ GEM
nokogiri (>= 1.4.6)
daemons (1.0.10)
database_cleaner (0.6.6)
+ delayed_job (2.1.4)
deltacloud-client (0.4.0)
nokogiri (>= 1.4.3)
rest-client (>= 1.6.1)
@@ -167,6 +168,7 @@ DEPENDENCIES
cucumber
cucumber-rails
database_cleaner
+ delayed_job
deltacloud-client
factory_girl_rails
fastercsv
diff --git a/src/config/initializers/delayed_job.rb b/src/config/initializers/delayed_job.rb
new file mode 100644
index 0000000..6e0d177
--- /dev/null
+++ b/src/config/initializers/delayed_job.rb
@@ -0,0 +1,9 @@
+require 'delayed_job'
+
+Delayed::Worker.backend = :active_record
+Delayed::Worker.destroy_failed_jobs = false
+#Delayed::Worker.sleep_delay = 60
+Delayed::Worker.max_attempts = 2
+#Delayed::Worker.max_run_time = 5.minutes
+#Delayed::Worker.read_ahead = 10
+#Delayed::Worker.delay_jobs = !Rails.env.test?
diff --git a/src/script/delayed_job b/src/script/delayed_job
new file mode 100755
index 0000000..edf1959
--- /dev/null
+++ b/src/script/delayed_job
@@ -0,0 +1,5 @@
+#!/usr/bin/env ruby
+
+require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
+require 'delayed/command'
+Delayed::Command.new(ARGV).daemonize
--
1.7.7.6
11 years, 11 months
Updated Aeolus in F17
by Mo Morsi
The rubygem-aeolus-image and aeolus-conductor git repos have been tagged
with the latest release and the corresponding RPMS have been build and
pushed to rawhide and F17-updates.
You may find the updates in bodhi here [1] [2]. The karma is set low (1)
since the builds are currently broken there.
I've also bumped up the project versions in the Rakefile / Makefile in
the git repo so that we can start working towards updating the RPMS in
both F16 and F17 after all the current sprint's features make it into
the codebase and have been tested by QE.
Any help trying out these rpms and giving them the necessary karma to
facilitate the push to Fedora would be more than appreciated.
-Mo
[1]
https://admin.fedoraproject.org/updates/rubygem-aeolus-image-0.4.0-1.fc17
[2] https://admin.fedoraproject.org/updates/aeolus-conductor-0.9.0-1.fc17
11 years, 11 months
[PATCH 0/5 conductor] (Rev 2) RM 3145 - create a basic event history page
by Tzu-Mainn Chen
This patchset creates a logs/ page that displays event history. It should work even without soft deletion implemented; although once soft deletiion is implemented, the changes will automatically be reflected.
This revision of the patchset implements many suggestions from matty_dubs and jprovazn, including:
- increasing the readability of the filter code in load_logs
- updating the haml to match current standards
- permission checks
- dealing with legacy data
- many minor stylistic fixes
It also includes:
- additional filters by state
- mouseover for additional details
Mainn
11 years, 11 months
Small main website updates just done
by Justin Clift
Hi all,
Just tweaked the main website with a few things:
* Added CentOS 6.2 to the potential list of platforms that Aeolus runs on
Tested it (briefly) last week, seemed ok. ;)
* On the Get It page, removed the 0.8.0 stable release.
It just leaves the dev/testing packages, which are what we want for now.
They're pretty much a "0.9.0" release, which we're trying to get out
the door anyway. ;)
In theory, we should have 0.9.0 properly ready soon anyway, at which time
we can add stable instructions for that.
Regards and best wishes,
Justin Clift
--
Aeolus Community Manager
http://www.aeolusproject.org
11 years, 11 months
(no subject)
by Pieter Baele
Hi,
On a new CentOS 6.2 system, I've this error when running
aeolus-configure (-d -v)
[root@lablxcm01 ~]# aeolus-configure -d -v
Launching aeolus configuration recipe...
info: Loading facts in
/usr/share/aeolus-configure/modules//aeolus/lib/facter/oauth.rb
Could not find class aeolus::conductor for lablxcm01.example.org on
node lablxcm01.example.org
Regards, PieterB
11 years, 11 months
aeolus + vsphere
by Pieter Baele
Hi,
I try to integrate and launch an instance on a single vsphere
hypervisor (v5), so without vCenter.
The connection to the hypervisor works, and I created an account
I disabled the mock and ec2 providers
To import an image I used the fedora 15 example xml.
But If I try a new deployable:
Deployable was not created: No route matches {:action=>"show",
:controller=>"catalogs"}
What are the correct steps after the initial configuration to create
import and deploy on ESX.
Did I oversee something?
cli:
aeolus-image push --account rootvsphere --image
87a01472-983f-11e1-9320-000000000000 --target vsphare
ERROR: TargetImageNotFound => Could not find an appropriate target
image for account rootvsphere
[root@lablxaeolus ~]# aeolus-image list --images
ID Name OS OS
Version Arch Description
------------------------------------ ---- ------
---------- ------ ----------------------------------
87a01472-983f-11e1-9320-000000
11 years, 11 months