summaryrefslogtreecommitdiff
path: root/zuul
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Create link to previous buildset span"Zuul2022-09-283-13/+26
|\
| * Create link to previous buildset spanSimon Westphahl2022-09-193-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | Create a link to the previous buildset span on gate reset. To make this work we'll start the buildset span when the buildset is created instead of only when we set the configuration. This change also adds the `is_remote` flag of the span context of related links. This is required for creating a `SpanContext` in order to deserialize the links. Change-Id: If3a3a83739c1472659d71d05dcf67f84ddce4247
* | Merge "Trace node request phase"Zuul2022-09-284-3/+17
|\ \ | |/
| * Trace node request phaseSimon Westphahl2022-09-194-3/+17
| | | | | | | | | | | | | | | | Since we are mainly interested in the time taken until the request is failed or fulfilled we won't create a span for full the lifetime of the node request. Change-Id: Ia8d9aaaac3ab4a4791eace2024c1ecb1b9c7a6bd
* | Merge "Trace merge requests and merger operations"Zuul2022-09-284-13/+75
|\ \ | |/
| * Trace merge requests and merger operationsSimon Westphahl2022-09-194-13/+75
| | | | | | | | | | | | | | | | | | | | The span info for the different merger operations is stored on the request and will be returned to the scheduler via the result event. This also adds the request UUID to the "refstat" job so that we can attach that as a span attribute. Change-Id: Ib6ac7b5e7032d168f53fe32e28358bd0b87df435
* | Merge "Add span for builds and propagate via request"Zuul2022-09-284-20/+66
|\ \ | |/
| * Add span for builds and propagate via requestSimon Westphahl2022-09-194-20/+66
| | | | | | | | | | | | Change-Id: Ib10452862e7aa1355502bb381d3ff07c65ac7187 Co-Authored-By: James E. Blair <jim@acmegating.com> Co-Authored-By: Tristan Cacqueray <tdecacqu@redhat.com>
* | Merge "Fix instance check when refreshing dependencies"Zuul2022-09-271-1/+1
|\ \
| * | Fix instance check when refreshing dependenciesSimon Westphahl2022-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2022-09-23 10:01:32,395 ERROR zuul.Scheduler: Exception processing pipeline post in tenant foobar Traceback (most recent call last): File "/opt/zuul/lib/python3.10/site-packages/zuul/scheduler.py", line 2089, in process_pipelines refreshed = self._process_pipeline( File "/opt/zuul/lib/python3.10/site-packages/zuul/scheduler.py", line 2157, in _process_pipeline self.process_pipeline_trigger_queue(tenant, pipeline) File "/opt/zuul/lib/python3.10/site-packages/zuul/scheduler.py", line 2350, in process_pipeline_trigger_queue self._process_trigger_event(tenant, pipeline, event) File "/opt/zuul/lib/python3.10/site-packages/zuul/scheduler.py", line 2380, in _process_trigger_event pipeline.manager.refreshDeps(change, event) File "/opt/zuul/lib/python3.10/site-packages/zuul/manager/__init__.py", line 296, in refreshDeps for dep_change_ref in item.change.commit_needs_changes: AttributeError: 'Branch' object has no attribute 'commit_needs_changes' Change-Id: I740d277c59764acfe982a24e3c5e972e8d3179d6
* | | Merge "zuul-stream: Add variable to disable writing streaming files"Zuul2022-09-272-6/+18
|\ \ \ | |/ / |/| |
| * | zuul-stream: Add variable to disable writing streaming filesIan Wienand2022-09-142-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upon further discussion we recently found another case of leaking console streaming files; if the zuul_console is not running on port 19885, or can not be reached, the streaming spool files will still be leaked. The prior work in I823156dc2bcae91bd6d9770bd1520aa55ad875b4 has the receiving side indicate to the zuul_console daemon that it should remove the spool file. If this doesn't happen, either because the daemon was never there, or it is firewalled off, the streaming spool files are left behind. This modifies the command action plugin to look for a variable "zuul_console_disable" which will indicate to the library running the shell/command task not to write out the spool file at all, as it will not be consumed. It is expected this would be set at a host level in inventory for nodes that you know can not or will not have access to zuul_console daemon. We already have a mechanism to disable this for commands running in a loop; we expand this with a new string type. The advantage of this is it leaves the library/command.py side basically untouched. Documentation is updated, and we cover this with a new test. Change-Id: I0273993c3ece4363098e4bf30bfc4308bb69a8b4
* | | Merge "Handle reviews by anonymous github users"Zuul2022-09-231-1/+11
|\ \ \
| * | | Handle reviews by anonymous github usersDr. Jens Harbott2022-03-261-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some github users may choose not to publish their real name and/or email address in their profile. Instead of creating an ugly message like[0] Reviewed-by: None <None> try to work up something from the data we have available. [0] https://github.com/osism/ansible-defaults/commit/ed2b2ffa8a32a5b5fdc060a44d17f12655d6cbcf Signed-off-by: Dr. Jens Harbott <harbott@osism.tech> Change-Id: Ife4c325c278860c47b70b37462ebd7b1d6b97755
* | | | Merge "Remove support for Ansible 2"Zuul2022-09-2331-1404/+0
|\ \ \ \
| * | | | Remove support for Ansible 2James E. Blair2022-09-1431-1404/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Versions 2.8 and 2.9 are no longer supported by the Ansible project. Change-Id: I888ddcbecadd56ced83a27ae5a6e70377dc3bf8c
* | | | | Merge "Tracing: implement span save/restore"Zuul2022-09-233-15/+230
|\ \ \ \ \ | | |_|_|/ | |/| | |
| * | | | Tracing: implement span save/restoreJames E. Blair2022-09-193-15/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds methods to allow us to save and restore spans using ZooKeeper data. Additionally, we subclass the tracing.Span class so that we can transparently handle timestamps which are stored as floating point numbers rather than integer nanoseconds. To exercise the new features, emit spans for QueueItems and BuildSets. Because most of our higher-level (parent) spans may start on one host and end on another, we save the full information about the span in ZK and restore it whenever we do anything with it, including starting child spans. This works well for starting a Build span given a BuildSet, since both objects are used by the executor client and so the span information for both is available. However, there are cases where we would like to have child spans and we do not have the full information of the parent, such as any children of the Build span on the executor. We could duplicate all the information of the Build span in ZK and send it along with the build request, but we really only need a few bits of info to start a remote child span. In OpenTelemetry, this is called trace propogation, and there are some tools for this which assume that the implicit trace context is being used and formats information for an HTTP header. We could use those methods, but this change adds a simpler API that is well suited to our typical json-serialization method of propogation. To use it, we will add a small extra dictionary to build and merge requests. This should serialize to about 104 bytes. So that we can transparantly handle upgrades from having no saved state for spans and span context in our ZK data, have our tracing API return a NonRecordingSpan when we try to restore from a None value. This code uses tracing.INVALID_SPAN or tracing.INVALID_SPAN_CONTEXT which are suitable constants. They are sufficiently real for the purpose of context managers, etc. The only down side is that any child spans of these will be real, actual reported spans, so in these cases, we will emit what we intend to be child spans as actual parent traces. Since this should only happen when a user first enables tracing on an already existing system, that seems like a reasonable trade-off. As new objects are populated, the spans will be emitted as expected. The trade off here is that our operational code can be much simpler as we can avoid null value checks and any confusion regarding context managers. In particular, we can just assume that tracing spans and contexts are always valid. Change-Id: If55b06572b5e95f8c21611b2a3c23f7fd224a547
* | | | | Merge "Add support for configuring and testing tracing"Zuul2022-09-222-0/+113
|\ \ \ \ \ | |/ / / /
| * | | | Add support for configuring and testing tracingJames E. Blair2022-09-192-0/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for configuring tracing in Zuul along with basic documentation of the configuration. It also adds test infrastructure that runs a gRPC-based collector so that we can test tracing end-to-end, and exercises a simple test span. Change-Id: I4744dc2416460a2981f2c90eb3e48ac93ec94964
* | | | | Merge "Add semaphores to REST API"Zuul2022-09-214-4/+78
|\ \ \ \ \
| * | | | | Add semaphores to REST APIJames E. Blair2022-09-074-4/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds information about semaphores to the REST API. It allows for inspection of the known semaphores in a tenant, the current number of jobs holding the semaphore, and information about each holder iff that holder is in the current tenant. Followup changes will add zuul-client and zuul-web support for the API, along with docs and release notes. Change-Id: I6ff57ca8db11add2429eefcc8b560abc9c074f4a
* | | | | | Merge "Log more info on gerrit 403 errors"Zuul2022-09-191-11/+16
|\ \ \ \ \ \ | |_|/ / / / |/| | | | |
| * | | | | Log more info on gerrit 403 errorsJames E. Blair2022-09-061-11/+16
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If Gerrit returns a 403 on submit, log the text we get in reply to help diagnose the problem. Change-Id: I8c9b286bb63ba1703a6a8f3cd6cd9a4b86e62cf2
* | | | | Merge "Add nodeset alternatives"Zuul2022-09-164-52/+200
|\ \ \ \ \
| * | | | | Add nodeset alternativesJames E. Blair2022-09-084-52/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature instructs Zuul to attempt a second or more node request with a different node configuration (ie, possibly different labels) if the first one fails. It is intended to address the case where a cloud provider is unable to supply specialized high-performance nodes, and the user would like the job to proceed anyway on lower-performance nodes. Change-Id: Idede4244eaa3b21a34c20099214fda6ecdc992df
* | | | | | Merge "Remove deprecated pipeline queue configuration"Zuul2022-09-164-45/+9
|\ \ \ \ \ \
| * | | | | | Remove deprecated pipeline queue configurationJames E. Blair2022-09-084-45/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was deprecated quite some time ago and we should remove it as part of the next major release. Also remove a very old Zuul v1 layout.yaml from the test fixtures. Change-Id: I40030840b71e95f813f028ff31bc3e9b3eac4d6a
* | | | | | | Merge "Remove merge-failure pipeline configuration"Zuul2022-09-161-10/+4
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Remove merge-failure pipeline configurationJames E. Blair2022-09-021-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was previously deprecated and should be removed shortly before we release Zuul v7. Change-Id: Idbdfca227d2f7ede5583f031492868f634e1a990
* | | | | | | Merge "Add option to include returned data in MQTT reporter"Zuul2022-09-161-1/+10
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | |
| * | | | | | Add option to include returned data in MQTT reporterJames E. Blair2022-09-131-1/+10
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an option to include result data from a job in the MQTT reporter. It is off by default since it may be quite large for some jobs. Change-Id: I802adee834b60256abd054eda2db834f8db82650
* | | | | | Merge "Change custom type field to default one"6.4.0Zuul2022-09-131-1/+1
|\ \ \ \ \ \
| * | | | | | Change custom type field to default oneDaniel Pawlik2022-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the new Elasticsearch does not support custom field type [1]. [1] https://www.elastic.co/guide/en/elasticsearch/reference/7.17/removal-of-types.html#_custom_type_field Change-Id: I0b154da0a4736c6b7758f9936356d5b7097c35ad
* | | | | | | Merge "elasticsearch: Remove the deprecated document type"Zuul2022-09-131-1/+0
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | elasticsearch: Remove the deprecated document typeTristan Cacqueray2022-08-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the removal-of-types[1] documentation, it is no longer necessary to specify a document type. [1] https://www.elastic.co/guide/en/elasticsearch/reference/7.17/removal-of-types.html Change-Id: I02996ce328a48b5ae6493646abe08ebab31ec962
* | | | | | | Merge "Don't try to report build w/o buildset to DB"Zuul2022-09-091-0/+2
|\ \ \ \ \ \ \
| * | | | | | | Don't try to report build w/o buildset to DBSimon Westphahl2022-09-051-0/+2
| | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a build result arrives for a non-current buildset we should skip the reporting as we can no longer create the reference to the buildset. Traceback (most recent call last): File "/opt/zuul/lib/python3.10/site-packages/zuul/scheduler.py", line 2654, in _doBuildCompletedEvent self.sql.reportBuildEnd( File "/opt/zuul/lib/python3.10/site-packages/zuul/driver/sql/sqlreporter.py", line 143, in reportBuildEnd db_build = self._createBuild(db, build) File "/opt/zuul/lib/python3.10/site-packages/zuul/driver/sql/sqlreporter.py", line 180, in _createBuild tenant=buildset.item.pipeline.tenant.name, uuid=buildset.uuid) AttributeError: 'NoneType' object has no attribute 'item' Change-Id: Iccbe9ab8212fbbfa21cb29b84a17e03ca221d7bd
* | | | | | | Merge "Don't run cleanup playbooks after setup failure"Zuul2022-09-091-0/+5
|\ \ \ \ \ \ \
| * | | | | | | Don't run cleanup playbooks after setup failureSimon Westphahl2022-09-071-0/+5
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a job already fails during setup we never load the frozen hostvars. Since the cleanup playbooks depend on those, we can skip the cleanup runs if the dict is empty. As we always add "localhost" to the hostlist, the frozen hostvars will never be empty when loading was successful. This will get rid of the following exception: Traceback (most recent call last): File "/opt/zuul/lib/python3.10/site-packages/zuul/executor/server.py", line 1126, in execute self._execute() File "/opt/zuul/lib/python3.10/site-packages/zuul/executor/server.py", line 1493, in _execute self.runCleanupPlaybooks(success) File "/opt/zuul/lib/python3.10/site-packages/zuul/executor/server.py", line 1854, in runCleanupPlaybooks self.runAnsiblePlaybook( File "/opt/zuul/lib/python3.10/site-packages/zuul/executor/server.py", line 3042, in runAnsiblePlaybook self.writeInventory(playbook, self.frozen_hostvars) File "/opt/zuul/lib/python3.10/site-packages/zuul/executor/server.py", line 2551, in writeInventory inventory = make_inventory_dict( File "/opt/zuul/lib/python3.10/site-packages/zuul/executor/server.py", line 913, in make_inventory_dict node_hostvars = hostvars[node['name']].copy() KeyError: 'node' Change-Id: I33a6a9ab355482e471e79f3dd5d702589fee04b3
* | | | | | | Merge "Add Ansible 6"Zuul2022-09-0816-0/+18
|\ \ \ \ \ \ \ | | |_|_|/ / / | |/| | | | |
| * | | | | | Add Ansible 6James E. Blair2022-09-0216-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I0d450d9385b9aaab22d2d87fb47798bf56525f50
* | | | | | | Merge "zuul_stream : Use !127.0.0.1 for loopback"Zuul2022-09-081-7/+7
|\ \ \ \ \ \ \
| * | | | | | | zuul_stream : Use !127.0.0.1 for loopbackIan Wienand2022-09-071-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-on to Ia78ad9e3ec51bc47bf68c9ff38c0fcd16ba2e728 to use a different loopback address for the local connection to the Python 2.7 container. This way, we don't have to override the existing localhost/127.0.0.1 matches that avoid the executor trying to talk to a zuul_console daemon. These bits are removed. The comment around the port settings is updated while we're here. Change-Id: I33b2198baba13ea348052e998b1a5a362c165479
* | | | | | | | Merge "zuul-stream : Test against a Python 2.7 container"Zuul2022-09-081-2/+6
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | zuul-stream : Test against a Python 2.7 containerIan Wienand2022-09-071-2/+6
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change Ief366c092e05fb88351782f6d9cd280bfae96237 intoduced a bug in the streaming daemons because it was using Python 3.6 features. The streaming console needs to work on all Ansible managed nodes, which includes back to Python 2.7 nodes (while Ansible supports that). This introduces a regression test by building about the smallest Python 2.7 container that can be managed by Ansbile. We start this container and modify the test inventory to include it, then run the stream tests against it. The existing testing runs against the "new" console but also tests against the console OpenDev's Zuul starts to ensure backwards-compatability. Since this container wasn't started by Zuul it doesn't have this, so that testing is skipped for this node. It might be good to abstract all testing of the console daemons into separate containers for each Ansible supported managed-node Python version -- it's a bit more work than I want to take on right now. This should ensure the lower-bound though and prevent regressions for older platforms. Change-Id: Ia78ad9e3ec51bc47bf68c9ff38c0fcd16ba2e728
* | | | | | | Merge "Deprecate Ansible 2, make Ansible 5 default"Zuul2022-09-071-1/+3
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| * | | | | | Deprecate Ansible 2, make Ansible 5 defaultJames E. Blair2022-09-021-1/+3
| |/ / / / / | | | | | | | | | | | | | | | | | | Change-Id: I2576d0dcec7c8f7bbb76bdd469fd992874742edc
* | | | | | Merge "zuul_stream: handle non-string msg value"Zuul2022-09-071-6/+12
|\ \ \ \ \ \
| * | | | | | zuul_stream: handle non-string msg valueIan Wienand2022-08-241-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed in some of our testing a construct like debug: msg: '{{ ansible_version }}' was actually erroring out; you'll see in the console output if you're looking Ansible output: b'TASK [Print ansible version msg={{ ansible_version }}] *************************' Ansible output: b'[WARNING]: Failure using method (v2_runner_on_ok) in callback plugin' Ansible output: b'(<ansible.plugins.callback.zuul_stream.CallbackModule object at' Ansible output: b"0x7f502760b490>): 'dict' object has no attribute 'startswith'" and the job-output.txt will be empty for this task (this is detected by by I9f569a411729f8a067de17d99ef6b9d74fc21543). This is because the msg value here comes in as a dict, and in several places we assume it is a string. This changes places we inspect the msg variable to use the standard Ansible way to make a text string (to_text function) and ensures in the logging function it converts the input to a string. We test for this with updated tasks in the remote_zuul_stream tests. It is slightly refactored to do partial matches so we can use the version strings, which is where we saw the issue. Change-Id: I6e6ed8dba2ba1fc74e7fc8361e8439ea6139279e