The Web UI (Web console) is a rails application.
All kuroko2 daemons backend is serverengine gem.
Example systemd unit files are available here.
./bin/rails runner Kuroko2::Servers::JobScheduler.new.run
./bin/rails runner Kuroko2::Servers::WorkflowProcessor.new.run
./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
Kuroko2’s configuration file is config/kuroko2.yml
.
A your Kuroko2 application URL.
url: 'my.kuroko2.host.expample.com'
The options to ActionMailer. See details at Action Mailer Basics in Ruby on Rails Guides.
action_mailer:
delivery_method: 'smtp'
smtp_settings:
address: 'your.smtp.example.com'
port: 25
domain: 'example.com'
A hash table in the custom task name and class name.
custom_tasks:
custom_task1: CustomTaskClass
See details in Adding custom tasks.
Notifiers settings.
The mail
option is required, others is optional.
notifiers:
mail:
mail_from: 'no-reply@example.com'
mail_to: "kuroko+<%= Socket.gethostname %>@example.com"
slack:
webhook_url: 'https://localhost/test/slack'
webhook:
secret_token: '<%= ENV["KUROKO2_WEBHOOK_SECRET_TOKEN"] %>'
Select a execution logger storage and options.
Supported storages are
execution_logger:
type: 'CloudWatchLogs'
option:
group_name: 'kuroko2'
Authentication settings. It supports only Google OAuth.
app_authentication:
google_oauth2:
client_id: '<%= ENV["GOOGLE_CLIENT_ID"] %>'
client_secret: '<%= ENV["GOOGLE_CLIENT_SECRET"] %>'
options:
hd: '<%= ENV["GOOGLE_HOSTED_DOMAIN"] %>'
Environment variable | Details | Required |
---|---|---|
HOSTNAME | A hostname to display on Web UI. | NO |
QUEUE | A queue name to execute. Default value is “@default”. | NO |
NUM_WORKERS | The number of workers. Default value is 4. | NO |
$ cd your_kuroko2_rails_apps/
$ mkdir -p lib/kuroko2/workflow/task/
module Kuroko2
module Workflow
module Task
class MyProjectRunner < Execute
def chdir
'/home/alice/my_project'
end
def shell
"bundle exec ./bin/rails runner -e production #{Shellwords.escape(option)}"
end
end
end
end
end
config/kuroko2.yml
.custom_tasks:
my_project_runner: MyProjectRunner
env: VAL1=A
env: VAL2=B
my_project_runner: MyProject::Batch1.run
You can monitor the Kuroko2 statuses at below endpoints.
$ bundle update kuroko2
$ ./bin/rake kuroko2:install:migrations
$ ./bin/rake db:migrate