29 Commits

Author SHA1 Message Date
Clark Boylan
8d4f01b74a Cleanup remaining Ansible lint warnings
Make it easier for people to see lint errors by cleaning up the
remaining lint warnings.

Change-Id: I2b614b19f5dccd1aa2ad568ff31acabc9b87c383
2024-09-18 16:46:00 -07:00
Zuul
8374db870b Merge "prepare-workspace-git: Add ability to define synced pojects" 2024-03-19 14:59:28 +00:00
Lukas Kranz
5eca8feda9 prepare-workspace-git: Add ability to define synced pojects
The prepare_workspace_sync_required_projects_only variable allows
users to define which projects to sync to the node. This can prevent
syncing of unnecessary repositories. For some builds e.g. the
depends-on repositories dont need to be synced. The projects are
filtered based on the 'required' flag present in each zuul.project
entry and the required projects list also does not contain projects
which are present due to Depends-On or gate queue sequencing.
Having unnecessary repos in the workspace can for example also break
the analysis phase of bazel.

Change-Id: I3cc36cbfc60c81956caf5137da63973aeade4e21
Co-Authored-By: James E. Blair <jim@acmegating.com>
Co-Authored-By: Bernhard Berg <bernhard.berg@bearingpoint.com>
2024-02-28 10:56:48 -08:00
James E. Blair
509880073e Remove command.warn usage
This is no longer present in Ansible 9.

Removing these upsets ansible-lint, so those errors are ignored.

The base roles job has bitrotted on centos-7 and bionic due to
a bad voluptuous release used in an stestr test.  That is fixed in
this change as well.

Change-Id: I67886d5ad82ab590979f82bd102d6f974b9d4421
2024-02-14 15:17:52 -08:00
James E. Blair
2cf566f363 Unpin stestr and python-subunit in fetch-subunit-output test
It is unclear why stestr is pinned, so let's unpin to see if
latest works.

Change-Id: Ia3735fb7b6efc2d0f64b88b8c048db798fc7cb0b
2023-09-18 10:36:11 -07:00
James E. Blair
fbd9ba8144 Revert "Disable base role testing that runs code on localhost"
We can now run untrusted code on the executor, so we can re-enable
these tests.

This reverts commit 44d2187e7fcea0683c75db530458088b8371bb4e.

Change-Id: I65960af09a3cf3da1e780a96b6d13ddba3ce73d8
2023-09-18 10:36:11 -07:00
James E. Blair
10ffca9ba8 Pin python-subunit in fetch-subunit-output test
This test pins stestr (reason unclear) but does not pin python-subunit.
Python-subunit has made a release incompatible with that version of
stestr, so pin it.

Separately, it may be useful to see if we can unpin both.

Change-Id: Ia7cc45dc53ff0697e7ec84479c08c93e7d872a76
2023-09-18 10:36:11 -07:00
Ian Wienand
5cdfc1cfe7
ansible-lint: Ignore some command-instead-of-module warnings
Picked up by ansible-lint 6.12.0, we can ignore these

Note noqa flags not working; see
https://github.com/ansible/ansible-lint/issues/2970

Change-Id: I33dc7a4756cf382aef6ba13c0762951ae18005d3
2023-02-02 15:09:26 +11:00
Ian Wienand
c20a2435a6 configure-mirrors: fix stripped newline
I74b9de7092f182c942a58ac7a46b9fbd791889de hit a common ansible gotcha
where it likes to strip the trailing newline after a {% endif %}.
This has resulted in invalid lines in our sources.list.

Unfortunately we miss this because it still exits with 0.  Add a
simple test looking for warning output.

Change-Id: I46d393a5e67d10a52c4dcca803176ff368a4b5bd
2022-03-01 11:10:30 +11:00
Clark Boylan
44d2187e7f Disable base role testing that runs code on localhost
The workspace setup role requires local code execution on the executor.
This is not allowed from an untrusted context so we disable it.

The previous assertions about the zuul-cloner setup depend on the
workspace setup running successfully. Disable those extra assertions.

subunit fetching role assertions grepped the html file for validity on
localhost. Disable this as well.

Change-Id: I7449749f50b6e4a34c4615b00836a7148e01c768
2020-07-22 15:32:18 -07:00
Zuul
4bd67e2bbb Merge "Add option to prefer https/ssl in configure-mirrors" 2020-05-26 12:09:36 +00:00
Albin Vass
162daaebe5 test-base-roles: update include to import_playbook
Change-Id: If2703df37ac68ab667859c8e945ddb08992d432b
2020-05-26 05:05:05 +00:00
Clark Boylan
9471b8c42b Add option to prefer https/ssl in configure-mirrors
We should offer the option of https in addition to http in our
configure-mirrors role as users may want to consume mirrors using https.
This has become more viable in recent years with the releases of Debian
Buster and Ubuntu Bionic supporting it out of the box.

Change-Id: I747c1a379dfce9469e643d7fa199c8e8554f5289
2020-05-20 15:16:34 -07:00
Albin Vass
00d758af26 Ensure output dirs are empty
Change-Id: I813ecc32c9781091dc7faf67dcc99dfe88bbaa5d
2020-05-12 12:15:39 +02:00
Sorin Sbarnea
4af438d136 Made sequence indent consistent
Change-Id: I5ea4232ca4fd6e03d5b5f72eb6704bee84d04ea5
2020-05-07 14:13:55 +01:00
Sorin Sbarnea
33461bbecc Enable yamllint
Adds yamllint to the linters with a minimal configuration, some
rules are disabled to allow us to fix them in follow-ups, if
we agree on them.

Fixes invalid YAML file containing characters inside block.

Fixes few minor linting issues.

Change-Id: I936fe2c997597972d884c5fc62655d28e8aaf8c5
2020-05-04 17:47:11 +01:00
Ian Wienand
3fc3083456 fetch-subunit-output test: use ensure-pip
Call ensure-pip before installing the stest and subunit-output tools.
Use then ensure-pip virtualenv to create their environment.

Change-Id: I4c82867e29a8f3bdf902fac43b96cd6862fa9f48
2020-04-15 15:34:21 -07:00
Albin Vass
94e69147a7 Replace occurences of '/' in nodename to something more path friendly
Inventory hostnames like "abc/123" is valid in both ansible and zuul
but this role breaks since it uses it as part of a path. This sanitizes
the hostname from "abc/123" to "abc_123".

Change-Id: Ic89d595b6f004b5ca4805f1af8387e8ba56564aa
2020-03-16 11:27:10 +01:00
Clark Boylan
bbca430417 Stop compressing files during intermediate steps part 1
Stop compressing files that would otherwise be handled uncompressed in
intermediate log handling. The reason for this is final log/artifact
upload should decide if a file need to be compressed or not as some file
hosting services (like swift) may not return the expected data if we get
this wrong.

This was noticed when we used swift to store intermediate tar.gz
tarballs before final upload to permanent storage. When retrieving the
tar.gz files from swift we got them back as uncompressed .tar files
(because swift was being helpful) and then later when we try to
uncompress these files we break.

Instead we'll let the upload to swift (or other storage) decide if files
should be compressed further than their existing state.

This is the first change in the stack that updates this behavior for
fetch-subunit-output.

Change-Id: I5727b270d6d34c256fe78a443baa1ad6c3474108
2020-01-08 09:24:43 -08:00
Tristan Cacqueray
4a87a3a56b fetch-zuul-cloner: replace /home/zuul by ansible_user_dir
This change enables the zuul-cloner to be used with a custom user directory
location.

Change-Id: I2632abfbc05e985e4dca526bdce3d3ee870bb390
2019-11-21 22:17:14 +00:00
Andreas Jaeger
293b064d29 fetch_subunit: Change variable
Change new variable zuul_additional_subunit_dirs to
fetch_subunit_output_additional_dirs to name it after the role.

Change-Id: I7ac0b5d343701409a8741439334fe27f5374a258
2019-10-21 21:07:39 +02:00
Luigi Toscano
ab8f9fc403 fetch-subunit-output: collect additional subunits (2nd try)
In addition to the main subunit file from zuul_work_dir,
collect the subunit files from the elements (directories)
of the zuul_additional_subunit_dirs list.

The default behavior is unchanged.

While the documentation of this role states that zuul_work_dir
contains an absolute path, this is not always true.
So make sure to not make any assumption about zuul_work_dir
in order to not fail spectacularly as it happened with the
previous patch[0].

Add also some tests for the role: both the basic case
and with an additional test directory.

[0] https://review.opendev.org/673885

Change-Id: Iabf2e0cf6d86e36a174778367186bbd39a65c3dd
2019-10-17 00:42:28 +02:00
Zuul
8c15cdf4a0 Merge "Update the base-roles test to use prepare-workspace-git" 2019-09-17 17:47:01 +00:00
Tristan Cacqueray
dc9b63d7e6 zuul-test: update jenkins-job-builder location
This change fixes base-roles tests failure by using the new correct
jenkins-job-builder url.

Change-Id: Ie2b191f7dee3c2d56d951d4cec76d6db4b6d1235
2019-09-12 10:29:46 -04:00
James E. Blair
91a0d9b312 Update the base-roles test to use prepare-workspace-git
This is what this job should have been testing, as it's what we
recommend people use.  We simply didn't notice that OpenDev never
finished the transition away from use-cached-repos (which isn't
even defined in this repo).

Change-Id: I9be05f9c035441c3a0f84206b25580263663d179
2019-09-06 07:13:41 -07:00
Clark Boylan
002fdde898 Flip the order of the emit-job-header tests
This more accurate reflects how this is run by opendev. Note this is not
strictly necessary to get in as the post-logs.yaml playbooks determine
where things are uploaded anyway. However, this may be slightly easier
for people to read in logs if things line up more closely to each other.

Depends-On: https://review.opendev.org/680476
Change-Id: Ied902ea2b8c7b965447e16f91400586ca1f708e6
2019-09-05 10:28:32 -07:00
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
James E. Blair
2cece282cc Change the repo used in some base-roles tests
The fetch-zuul-cloner and use-cached-repos roles rely on an
unrelated repo appearing in required-projects.  To allow us to
move this repo to the Zuul tenant, change that to
opendev/base-jobs, a repo which will appear in both the current
and future tenants.

Change-Id: I06703638b69d94531ad396224669980db9ababd4
2019-07-08 07:45:09 -07:00
James E. Blair
a4e1f29468 Add base role integration jobs
These are jobs for the roles in this repo which are currently
tested by the "base-integration" job in openstack-zuul-jobs.
Move it into this repo and rename it "base-roles".

Change-Id: Ibd07964a08120e033bc5a2deca18649bd0e74a48
2019-07-04 14:16:15 +02:00