-
Notifications
You must be signed in to change notification settings - Fork 148
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
Fixes #28065 - package dynflow sidekiq service files #4194
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
%global confdir extras/packaging/rpm/sources | ||
%global foreman_rake %{_sbindir}/%{name}-rake | ||
%global executor_service_name dynflowd | ||
%global dynflow_sidekiq_service_name dynflow-sidekiq@ | ||
%global foreman_restart (touch %{homedir}/tmp/restart.txt ; /bin/systemctl try-restart %{name}.service) >/dev/null 2>&1 | ||
|
||
# explicitly define, as we build on top of an scl, not inside with scl_package | ||
|
@@ -10,7 +11,7 @@ | |
%global scl_ruby_bin /usr/bin/%{?scl:%{scl_prefix}}ruby | ||
%global scl_rake /usr/bin/%{?scl:%{scl_prefix}}rake | ||
|
||
%global release 10 | ||
%global release 11 | ||
%global prerelease develop | ||
|
||
Name: foreman | ||
|
@@ -707,6 +708,33 @@ Meta Package to install requirements for Redis caching support | |
%files redis | ||
%{_datadir}/%{name}/bundler.d/redis.rb | ||
|
||
%package dynflow-sidekiq | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this package conflict with the regular dynflow service? Can both run at the same time? What happens if they do? Is the new dynflow-sidekiq optional? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it doesn't conflict, and it is not trying to remove it, if someone runs both, they will share the load and loadbalance. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the singleton nature of the dynflow sidekiq orchestrator play well with the current dynflow executor if both are deployed simultaneously? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that doesn't really matter, the separation is not really affecting the old deployment. |
||
Summary: Foreman Redis caching support | ||
Group: Applications/System | ||
ezr-ondrej marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# start specfile redis Requires | ||
Requires: %{?scl_prefix}rubygem(sidekiq) >= 5.0 | ||
Requires: %{?scl_prefix}rubygem(sidekiq) < 6 | ||
Requires: %{?scl_prefix}rubygem(gitlab-sidekiq-fetcher) | ||
ezr-ondrej marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# end specfile redis Requires | ||
Requires: %{name} = %{version}-%{release} | ||
|
||
%description dynflow-sidekiq | ||
Meta Package to install dynflow sidekiq executor support | ||
|
||
%files dynflow-sidekiq | ||
%{_datadir}/%{name}/bundler.d/dynflow_sidekiq.rb | ||
%{_unitdir}/%{dynflow_sidekiq_service_name}.service | ||
%{_datadir}/%{name}/extras/dynflow-sidekiq.rb | ||
|
||
%post dynflow-sidekiq | ||
%systemd_post %{dynflow_sidekiq_service_name}.service | ||
|
||
%preun dynflow-sidekiq | ||
%systemd_preun %{dynflow_sidekiq_service_name}.service | ||
|
||
%postun dynflow-sidekiq | ||
%systemd_postun_with_restart %{dynflow_sidekiq_service_name}.service | ||
|
||
%package service | ||
Summary: Foreman systemd service support | ||
Group: Applications/System | ||
|
@@ -782,6 +810,7 @@ install -d -m0755 %{buildroot}%{_datadir}/%{name} | |
install -d -m0755 %{buildroot}%{_datadir}/%{name}/plugins | ||
install -d -m0755 %{buildroot}%{_sysconfdir}/%{name} | ||
install -d -m0755 %{buildroot}%{_sysconfdir}/%{name}/plugins | ||
install -d -m0755 %{buildroot}%{_sysconfdir}/%{name}/dynflow | ||
install -d -m0755 %{buildroot}%{_localstatedir}/lib/%{name} | ||
install -d -m0755 %{buildroot}%{_localstatedir}/lib/%{name}/tmp | ||
install -d -m0755 %{buildroot}%{_localstatedir}/lib/%{name}/tmp/pids | ||
|
@@ -791,6 +820,7 @@ install -d -m0750 %{buildroot}%{_localstatedir}/log/%{name}/plugins | |
#Copy init scripts and sysconfigs | ||
install -Dp -m0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/sysconfig/%{executor_service_name} | ||
install -Dp -m0644 %{SOURCE11} %{buildroot}%{_unitdir}/%{executor_service_name}.service | ||
install -Dp -m0644 extras/systemd/%{dynflow_sidekiq_service_name}.service %{buildroot}%{_unitdir}/%{dynflow_sidekiq_service_name}.service | ||
install -Dp -m0755 script/%{executor_service_name} %{buildroot}%{_sbindir}/%{executor_service_name} | ||
install -Dp -m0755 script/%{name}-debug %{buildroot}%{_sbindir}/%{name}-debug | ||
install -Dp -m0755 script/%{name}-rake %{buildroot}%{_sbindir}/%{name}-rake | ||
|
@@ -801,6 +831,7 @@ install -Dp -m0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/cron.d/%{name} | |
install -Dp -m0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/%{name}.conf | ||
install -Dp -m0644 extras/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service | ||
|
||
sed -i '/^ExecStart/ s|/usr/bin/sidekiq \(.\+\)$|/usr/bin/scl enable tfm "sidekiq \1"|' %{buildroot}%{_unitdir}/%{dynflow_sidekiq_service_name}.service | ||
sed -i '/^ExecStart/ s|/usr/bin/rails \(.\+\)$|/usr/bin/scl enable tfm "rails \1"|' %{buildroot}%{_unitdir}/%{name}.service | ||
|
||
cp -p Gemfile.in %{buildroot}%{_datadir}/%{name}/Gemfile.in | ||
|
@@ -823,6 +854,12 @@ mv %{buildroot}%{_datadir}/%{name}/config/$i %{buildroot}%{_sysconfdir}/%{name} | |
ln -sv %{_sysconfdir}/%{name}/$i %{buildroot}%{_datadir}/%{name}/config/$i | ||
done | ||
|
||
for i in orchestrator worker; do | ||
mv %{buildroot}%{_datadir}/%{name}/config/dynflow/$i.yml.example %{buildroot}%{_datadir}/%{name}/config/dynflow/$i.yml | ||
mv %{buildroot}%{_datadir}/%{name}/config/dynflow/$i.yml %{buildroot}%{_sysconfdir}/%{name}/dynflow/ | ||
ln -sv %{_sysconfdir}/%{name}/dynflow/$i.yml %{buildroot}%{_datadir}/%{name}/config/dynflow/$i.yml | ||
done | ||
|
||
# Put db in %{_localstatedir}/lib/%{name}/db | ||
cp -pr db/migrate db/seeds.rb db/seeds.d %{buildroot}%{_datadir}/%{name} | ||
mkdir %{buildroot}%{_localstatedir}/lib/%{name}/db | ||
|
@@ -1047,6 +1084,9 @@ exit 0 | |
%systemd_postun_with_restart %{name}.service | ||
|
||
%changelog | ||
* Tue Oct 22 2019 Ondrej Ezr <ezrik12@gmail.com> - 1.24.0-0.11.develop | ||
- Add dynflow-sidekiq package providing services for running dynflow on sidekiq | ||
|
||
* Fri Oct 11 2019 Eric D. Helms <ericdhelms@gmail.com> - 1.24.0-0.10.develop | ||
- Updates to support NodeJS packages built into SCL | ||
|
||
|
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.
Given the repetition I'm inclined to add
.service
here but I'm fine either way. I'd probably do a cleanup of all service handling later anyway.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 would like to stay consistent with the
dynflowd
service, otherwise I would agree 🤔