zuul-jobs/roles/set-zuul-log-path-fact/tasks/main.yaml
Clark Boylan b62efba8a4 Add option for object store friendly log paths
For logs stored in object storage services we want to be able to shard
into different containers. This improves scalability of the object
stores. To do this consistently we prefix all log paths with the first 3
characters of the build uuid. This way we get container names like
log_123, log_abc, and so on for a total of 4096 containers.

This behavior is off by default because users of filesystems stores
without a zuul dashboard may still want periodic/ to be filed into a top
level dir for browseability.

Change-Id: I8e72a6e587edcbdf89b793cad2d7c96c535601e7
2019-09-04 09:52:38 -07:00

36 lines
1.6 KiB
YAML

- name: Fileserver friendly log path specifications
when: not zuul_log_path_shard_build
block:
- name: Set log path for a change
when: zuul.change is defined
set_fact:
zuul_log_path: "{{ zuul.change[-2:] }}/{{ zuul.change }}/{{ zuul.patchset }}/{{ zuul.pipeline }}/{{ zuul.job }}/{{ zuul.build[:7] }}"
- name: Set log path for a ref update
when: zuul.newrev is defined
set_fact:
zuul_log_path: "{{ zuul.newrev[:2] }}/{{ zuul.newrev }}/{{ zuul.pipeline }}/{{ zuul.job }}/{{ zuul.build[:7] }}"
- name: Set log path for a periodic job
when: zuul.change is not defined and zuul.newrev is not defined
set_fact:
zuul_log_path: "{{ zuul.pipeline }}/{{ zuul.project.canonical_name }}/{{ zuul.branch }}/{{ zuul.job }}/{{ zuul.build[:7] }}"
- name: object store friendly log path specifications
when: zuul_log_path_shard_build
block:
- name: Set log path for a change
when: zuul.change is defined
set_fact:
zuul_log_path: "{{ zuul.build[:3] }}/{{ zuul.change }}/{{ zuul.patchset }}/{{ zuul.pipeline }}/{{ zuul.job }}/{{ zuul.build[:7] }}"
- name: Set log path for a ref update
when: zuul.newrev is defined
set_fact:
zuul_log_path: "{{ zuul.build[:3] }}/{{ zuul.newrev }}/{{ zuul.pipeline }}/{{ zuul.job }}/{{ zuul.build[:7] }}"
- name: Set log path for a periodic job
when: zuul.change is not defined and zuul.newrev is not defined
set_fact:
zuul_log_path: "{{ zuul.build[:3] }}/{{ zuul.pipeline }}/{{ zuul.project.canonical_name }}/{{ zuul.branch }}/{{ zuul.job }}/{{ zuul.build[:7] }}"