-
Notifications
You must be signed in to change notification settings - Fork 73
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 support for dynflow_sidekiq #292
Conversation
d911fef
to
1ff1412
Compare
1ff1412
to
0753000
Compare
8afb9b5
to
64146d7
Compare
definitions/features/redis.rb
Outdated
@@ -0,0 +1,22 @@ | |||
class Features::Redis < ForemanMaintain::Feature | |||
SCL_PREFIX = 'rh-redis5'.freeze | |||
SERVICE_NAME = "#{SCL_PREFIX}-redis".freeze |
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 could be fine for now, but will be an issue for Debian if ever used there. This will also break on EL8 when we land there. Unfortunately other SCLs have syspaths
packages to allow using the classic service names. Redis does not appear to. @evgeni have you seen anything? would it be worth our shipping our own?
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.
We can ask the SCL team to provide one? :)
This seems generally good to go. Can it be dropped from WIP state? We will need this both merged and released to prevent nightly breakages when the corresponding installer changes are merged. |
definitions/features/redis.rb
Outdated
|
||
def config_files | ||
["/etc/opt/rh/#{SCL_PREFIX}/redis", | ||
"/etc/opt/rh/#{SCL_PREFIX}/redis.conf"] |
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.
These paths will also be different when there is no SCL. On non-SCL (EL8), it's /etc/redis.conf
. Debian(-based) uses /etc/redis/redis.conf
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.
Handled it similarly as with the scl prefix. When support for el8/deb lands, the etc_prefix method will need to contain a condition checking current platform
definitions/features/redis.rb
Outdated
end | ||
|
||
def config_files | ||
["/etc/opt/rh/#{SCL_PREFIX}/redis", |
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 think this is a directory puppet-redis adds to be ready for multiple instances but we don't intend to use those. AFAIK the RPM doesn't create this directory. Debian(-based) does have such a directory.
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.
We should be safe, if a file does not exist, f-m will just skip it. I'd say it is better to try to collect everything there is
This should allow us to modify them more easily when running on different platforms.
This should allow us to modify them more easily when running on different platforms.
61ccc3c
to
194351c
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.
From the platform point of view this looks like a good first version. Can't speak for foreman-maintain itself.
@kgaikwad Would a merge and release of this be possible within the next day? This would allow us to merge and get into nightly the new dynflow. |
|
||
confine do | ||
# Luckily, the service name is the same as the package providing it | ||
server? && find_package(service_name) |
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 block passed as argument to metadata
and its execution happens outside of this feature scope so it will raise an error for service_name
.
Either you can declare one more constant or use "#{SCL_NAME}-redis" directly.
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.
Oh, forgot about that. Fixed in a slightly different way
@@ -108,7 +108,7 @@ def fetch_tasks_status(state, spinner) | |||
end | |||
|
|||
def services | |||
[system_service(service_name, 30)] | |||
feature(:dynflow_sidekiq) ? [] : [system_service(service_name, 30)] |
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.
Does that mean rest of things from feature foreman_tasks
remain as it is and only services get changed?
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.
Exactly
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.
AFAIK foreman-tasks hasn't had a service ever since dynflowd was introduced. dynflowd is part of Foreman itself while foreman-tasks is an optional plugin. dynflowd.service always had the alias foreman-tasks so systemctl status foreman-tasks
continued to work.
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.
Thank you @adamruzicka.
Rubocop is not happy :-) I will merge this PR once tests become green.
68c363c
to
bb9c27c
Compare
We're 🍏 |
Thanks @adamruzicka! |
@adamruzicka, @ehelms, My Apologies, I didn't noticed all commit messages before merging this PR so except first inital commit I have modified the remaining commit messages from |
@kgaikwad thanks so much for quick reviews and the release! |
Thank you @kgaikwad , I'll add the tests to my todo. |
Still WIP, opening in current state for visibility