Skip to content

Commit

Permalink
templates/packer: add worker-executor service
Browse files Browse the repository at this point in the history
  • Loading branch information
croissanne committed Feb 12, 2024
1 parent 71b7b36 commit ea28739
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Worker Executor Service
ConditionPathExists=/tmp/worker-run-executor-service
Wants=cloud-final.service
After=cloud-final.service

[Service]
Type=oneshot
ExecStart=/usr/local/libexec/worker-initialization-scripts/worker_executor.sh

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -euo pipefail

# Subscribe the executor, this can be removed once the worker functions as a proxy for all sources.
SUBSCRIPTION_MANAGER_COMMAND_ARN=$(
secretsmanager list-secrets \
--filters Key=name,Values=executor-subscription-manager-command \
--query SecretList[0].ARN --output text
)

/usr/local/bin/aws secretsmanager get-secret-value \
--secret-id "${SUBSCRIPTION_MANAGER_COMMAND_ARN}" | jq -r ".SecretString" > /tmp/subscription_manager_command.json
jq -r ".subscription_manager_command" /tmp/subscription_manager_command.json | bash
rm -f /tmp/subscription_manager_command.json

echo "Starting osbuild-jobsite-builder."
/usr/libexec/osbuild-composer/osbuild-jobsite-builder &
disown $!
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ExecStart=/usr/local/libexec/worker-initialization-scripts/get_koji_creds.sh
ExecStart=/usr/local/libexec/worker-initialization-scripts/get_oci_creds.sh
ExecStart=/usr/local/libexec/worker-initialization-scripts/get_pulp_creds.sh
ExecStart=/usr/local/libexec/worker-initialization-scripts/worker_service.sh
ExecStart=/usr/local/libexec/worker-initialization-scripts/worker_builder.sh

[Install]
WantedBy=multi-user.target

0 comments on commit ea28739

Please sign in to comment.