version: 1

# Rules to match for a machine to qualify
target:
  id: machine_id

timeouts:
  first_console_activity:  # This limits the time it can take to receive the first console log
    minutes: 2
    retries: 0
  console_activity:  # Reset every time we receive a message from the logs
    hours: 20
    retries: 0
  overall:           # Maximum time the job can take, not overrideable by the "continue" deployment
    hours: 20
    retries: 0
    # no retries possible here

console_patterns:
    session_end:
        regex: "^.*It's now safe to turn off your computer\r$"
    job_success:
        regex: "^.*Execution is over, pipeline status: 0\r$"

# Environment to deploy
deployment:
  # Initial boot
  start:
    kernel:
      url: '{{ minio_url }}/boot/default_kernel'
      cmdline:
        - b2c.minio="gateway,{{ minio_url }},{{ job_bucket_access_key }},{{ job_bucket_secret_key }}"
        - b2c.volume="job,mirror=gateway/{{ job_bucket }},pull_on=pipeline_start,push_on=pipeline_end,overwrite"
        - b2c.container="-ti --tls-verify=false -v job:/job_share/ --entrypoint=sh docker://{{ fdo_proxy_registry }}/gfx-ci/ci-tron/machine-registration:latest"
        - console={{ local_tty_device }},115200 SALAD.machine_id={{ machine_id }}
        - b2c.ntp_peer="ci-gateway" b2c.cache_device=none b2c.poweroff_delay=15 loglevel=6
    initramfs:
      url: '{{ minio_url }}/boot/default_boot2container.cpio.xz'
