Skip to content

Run Packer Build on a Schedule from the job-runner #120

@runleveldev

Description

@runleveldev

The packer template builds should be scheduled via the job-runner service. To do so we first need to extend the job runner architecture with a ScheduledJobs model that can be used to create new pending Jobs at the given times.

  1. Create a new Sequelize model/migration(s) ScheduledJobs (id PK AUTOINCREMENT, schedule ???, command STRING). I am not sure what datatype schedule needs to be, perhaps STRING using cron-style schedules. This record will be read and when the schedule condition is met will create a "pending" Jobs record with the given command.
  2. A system is needed to convert the ScheduledJobs to Jobs. This could be an extra step in the job-runner to, before checking for pending jobs, check for scheduled jobs whose conditions are met and queue them, then continue as normal
  3. Implement a ScheduledJob for running the packer builds. This can use a Sequelize seed since all installations should include it.
  4. The command used by the SheduledJob for the packer builds should read all of it's configuration from the database directly (reminder that job commands will have full access to the create a container environment and models). This can be used to read the Nodes model and use the API URL and keys for uploading.
  5. The Nodes model may need extended to include defaultStorage which would be the storage that the container template would be uploaded to. In this case, the Nodes form will also need updated so administrators can configure that setting.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions