Worker: allow configuring executor CloudWatch group
We need the ability to use different CloudWatch group for the osbuild-executor on Fedora workers in staging and production environment. Extend the worker confguration to allow configuring the CloudWatch group name used by the osbuild-executor. Extend the secure instance code to instruct cloud-init via user data to create /tmp/cloud_init_vars file with the CloudWatch group name in the osbuild-executor instance, to make it possible for the executor to configure its logging differently based on the value. Cover new changes by unit tests. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
ceddabc395
commit
e7743f17ec
7 changed files with 90 additions and 21 deletions
|
|
@ -13,8 +13,9 @@ import (
|
|||
)
|
||||
|
||||
type awsEC2Executor struct {
|
||||
iamProfile string
|
||||
keyName string
|
||||
iamProfile string
|
||||
keyName string
|
||||
cloudWatchGroup string
|
||||
}
|
||||
|
||||
func (ec2e *awsEC2Executor) RunOSBuild(manifest []byte, store, outputDirectory string, exports, exportPaths, checkpoints,
|
||||
|
|
@ -29,7 +30,7 @@ func (ec2e *awsEC2Executor) RunOSBuild(manifest []byte, store, outputDirectory s
|
|||
return nil, err
|
||||
}
|
||||
|
||||
si, err := aws.RunSecureInstance(ec2e.iamProfile, ec2e.keyName)
|
||||
si, err := aws.RunSecureInstance(ec2e.iamProfile, ec2e.keyName, ec2e.cloudWatchGroup)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -92,9 +93,10 @@ func (ec2e *awsEC2Executor) RunOSBuild(manifest []byte, store, outputDirectory s
|
|||
return &osbuildResult, nil
|
||||
}
|
||||
|
||||
func NewAWSEC2Executor(iamProfile, keyName string) Executor {
|
||||
func NewAWSEC2Executor(iamProfile, keyName, cloudWatchGroup string) Executor {
|
||||
return &awsEC2Executor{
|
||||
iamProfile,
|
||||
keyName,
|
||||
cloudWatchGroup,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue