Commit Graph

14 Commits

Author SHA1 Message Date
Monty Taylor 5f31625a94 Add --all to skopeo copy from insecure registry
skopeo needs to be told to copy all instances of a given image,
otherwise it just grabs one of them.

https://github.com/containers/skopeo/pull/741

Change-Id: If78ad50602e745ef7747d983b987cf964ff6e67f
2020-05-08 15:25:12 -05:00
Albin Vass 4feb02f87e use zj_image instead of image as loopvar
Change-Id: I2b34253e736252994681b7c69eb051c8a0659671
2020-05-05 18:43:25 +00:00
Albin Vass d0e2016592 Add loop var policy to ansible-lint
This adds a custom ansible-lint rule at .rules/ZuulJobsNamespaceLoopVar.py
that enforces the loop var policy described at:
https://zuul-ci.org/docs/zuul-jobs/policy.html#ansible-loops-in-roles

It also updates existing roles to follow the policy.

Change-Id: I92b2ff56a1c2702542fc07b316f1809087a4c92f
2020-04-29 17:20:59 +02:00
James E. Blair d48667a3c5 use-buildset-registry: Add podman support
Change-Id: I41718073962c8e7eb3d8810276e550fb84bd6e99
2019-12-05 11:44:15 -08:00
James E. Blair ea00b6aa5a Use human-readable names for artifact returns
This will cause links to appear on the build page with text like
"Docs preview site".

Change-Id: I65f8990b65607e72190a871409c3e31014ce86df
2019-08-12 07:13:27 -07:00
Jeremy Stanley 2711d10186 Be consistent about spaces before and after vars
With the arrival of ansible-lint 4, Jinja2 variable expansions must
include spaces before and after the variable name inside the
brackets.

Adjust the new violations accordingly and remove the rule
206 exclusion.

Change-Id: Ib3ff7b0233a5d5cf99772f9c2adc81861cf34ffa
2019-08-07 20:17:41 +01:00
Monty Taylor 454b5349b0 Add retries to skopeo copy operations
We think that sometimes the network derps so the whole copy goes
bad. Add retries in to the mix since a copy command is idempotent.

Change-Id: I2d2891f2ebe3ca6a99874d9cf028addea888c3b7
2019-04-25 17:22:30 +00:00
Clark Boylan 23826e05a6 Only alias docker registries on test nodes
Skopeo has problems with ipv6 address literals just like docker as they
use the same underlying checks for url validity. However, we think we
can fix that by using a port forward from the executor to the buildset
registry so that skopeo can connect via ipv4

Go back to aliases the registries on test nodes via /etc/hosts.

Change-Id: I5f9316ffe84de06cb2fb2b65a7e1c31d9f8b0e35
Co-Authored-By: James E. Blair <jeblair@redhat.com>
2019-04-22 10:37:33 -07:00
Clark Boylan 3a29935f32 Revert "Use /etc/hosts with docker registries to handle ipv6"
This reverts commit a307259776.

We need to additionally handle this on localhost (the zuul executor)
where we cannot edit /etc/hosts. At least I don't think we can. We also
need to handle the case where buildset_regsitry is not yet defined.

Change-Id: I4928f7fcf58e88cf360de253f01b16546220aace
2019-04-09 10:10:03 -07:00
Clark Boylan a307259776 Use /etc/hosts with docker registries to handle ipv6
Docker doesn't appear to understand properly escaped ipv6 addrs in its
"urls". Address this by adding /etc/hosts entries for any
buildset_registry that is specified by an ip address (v4 or v6). This
allows us to use a named alias instead of the ipv6 address.

An example failure for posterity:

  "[2607:ff68:100:54:f816:3eff:fe7c:e98a]:5000/zuul/nodepool:latest" is not a valid repository/tag: invalid reference format

Change-Id: Id865dc7d3382174b61f9eaa76e29b637a85f5142
2019-04-08 13:40:58 -07:00
James E. Blair 325b666b6d Use ipwrap filter in registry roles
We need to escape some ipv6 addresses in URLs.

Change-Id: Ica5fe73dd65e138cdc4817de3903cdd271402941
2019-04-05 16:15:02 -07:00
James E. Blair f4db0f0979 buildset registry: don't put skopeo creds on command line
Use the docker user config file rather than the skopeo command line
when performing skopeo push/pull operations.  This should allow
us to log the command.

Change-Id: If6b1f3ab34461d77e619b188f48c5d209df7afce
2019-03-18 09:13:38 -07:00
James E. Blair 0d3b5278d1 Add no_log entries to skopeo copy commands
Now that these work, we should disable logging because the password
appears in the command.

Change-Id: I0c5d0be9bffb48bb576f61b7ff19f4451353b7e2
2019-03-11 14:29:04 -07:00
James E. Blair cbff0cc355 push-to-registry: handle undefined docker_images
So that this role may be used unconditionally in jobs which may
or may not actually build images, skip the tasks if the
docker_images variable is undefined.

Change-Id: I6ef0c80230de628f86f523878020c82ce81a1e60
2019-02-19 17:49:21 -08:00