910 Commits

Author SHA1 Message Date
Elod Illes
f51be0504b Explanatory comment for Editable Git install
This patch is a follow up for patch:
I3573c067f63a09f22377612f53c80c80252965e4

Comment explains the string matching lines for the pip freeze output.

Change-Id: Ifc5b2ae002859c1ca7405c8e1f64380b311e983d
2019-02-27 13:21:58 +01:00
Zuul
2428945c21 Merge "Fix Editable Git install package name parsing" 2019-02-26 02:49:32 +00:00
James E. Blair
8998838d7a run-buildset-container: fix username/password for proxy registry
This configuration is intended to mask the creds supplied by the
local docker configuration when the registry is used as a
pull-through proxy to upstream.  But we need to set the creds
to the empty string, rather than null, which ends up as the string
"None" in the docker config.

Change-Id: Ic36a5c764dec8df4fa460f6735ff5668a1dd3b50
2019-02-22 13:22:19 -08:00
Zuul
5b43abfffc Merge "Assure iptables is installed inside multi-node-firewall role" 2019-02-22 19:06:55 +00:00
James E. Blair
a358f21736 Use buildset registry push endpoint
When copying images from the intermediate registry to the buildset
registry, use the new push endpoint of the dual-registry system.

Also, use the push endpoint after a docker build to push the
new image to the buildset registry.

Change-Id: I3a11036bb9fb7cb3457a3d744fa83647c1b1b085
2019-02-21 14:15:45 -08:00
James E. Blair
90fc18f621 Split docker mirror config into its own role
So that the docker mirror configuration can be used without the
install-docker role (e.g., if another process is used to install
docker on a target host), split the part of the role which
configures mirrors into its own role and include it in the
install-docker role.

Change-Id: I7cd7f61e2d1281cd2949c1f69a081c7217d0d328
2019-02-21 14:07:43 -08:00
James E. Blair
42df455705 use-buildset-registry: support running before docker installed
To accomodate running in a production-simulation environment,
make it safe to run this role on a host before docker is installed.

This also adds support for the new dual-registry configuration
that run-buildset-registry uses.

This removes the region-local proxy from the registry-mirrors
configuration.  Because the buildset registry acts as a pull-through
proxy, the region-local proxy won't be used even if we did include it.
Instead, we should update the run-buildset-registry role to proxy
to the region-local proxy if present.

Change-Id: I21011a3708f17ee61afd0034d90d75e8dc885575
2019-02-21 14:07:33 -08:00
James E. Blair
e7a0f0da8b run-buildset-registry: run a dual registry
The docker registry daemon can either act as a private registry,
or as a pull-through proxy, but not both.  Yet we need to be able
to serve private (speculative buildset) images as well as plain
upstream images.  Our registry is used as a mirror and requires
authentication, therefore docker's normal behavior of falling back
on docker.io won't work because it will attempt to use our
credentials.

However, the registry daemon stores all of its state in the
filesystem, therefore we can run two instances of the registry
service, both pointing at the same data store.  The first acts
as a pull-through proxy and will serve whatever files are already
in the local storage, or will fetch them from docker.io.  The second
can be used to upload images into the local storage.

To make a long story short, whenever we push into the buildset
registry, we will use the second endpoint.  Whenever the docker
daemon pulls from the buildset registry, it will use the first.

Change-Id: I296029068b5ef28ee56543741fe8c8deeefb5dfa
2019-02-21 13:49:49 -08:00
Sorin Sbarnea
9789943b85 Assure iptables is installed inside multi-node-firewall role
Avoids failure to run on fedora-28 due to missing iptables.

Change-Id: Id3e26508d6a5967c66aca49d968aac3c84e704dd
2019-02-21 13:08:25 +00:00
James E. Blair
c8c439e0d8 use-buildset-registry: configure as a pull-through proxy
Docker has a curious behavior with respect to the registry-mirror
setting: it will only use the credentials for dockerhub itself.
Therefore, configure the buildset registry to be a pull-through
cache for dockerhub, but with no credentials, so that we can set
buildset registry credentials under the dockerhub url without
their actually being used for dockerhub.

Change-Id: I5daf93868d408d71cf2766fbe1bb17f2cfa8a3c7
2019-02-20 17:16:38 -08: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
James E. Blair
7edb42008f Use list form of zuul artifact return
This relies on the list merge behavior in https://review.openstack.org/638005
however, this will work with the current code in Zuul as long as only
one artifact is returned, so a Depends-On is not necessary.

Change-Id: Ie5d3a61c8cc1038f3775a3aa81e94b9b909f265a
2019-02-19 12:58:54 -08:00
Tristan Cacqueray
3d5ee8637f install-kubernetes: fix minikube config permission
It seems like new minikube changed the default minikube config
permission. This change ensures the minikube config is owned by
the ansible_user

Change-Id: Ic1af1541fb1f32253678f989d7b62d21074514d5
2019-02-19 08:19:53 +00:00
James E. Blair
8567dddf97 Fix build-docker-image when using buildset_registry
This was incorrect ansible -- we need to run two commands here,
so let's just do it as two tasks.

Change-Id: I88c6382f7f41659217ae66f07d6e5d9db0bf3b38
2019-02-18 15:32:17 -08:00
James E. Blair
c58e2a51dc Load buildset_registry in intermediate pull
The intermediate registry pull role is designed to be used in
the same playbook as the run-buildset-registry role, which sets
the buildset_registry fact.  However, that fact is set on the
host where the registry runs, not localhost.  Theoretically we
should be able to delegate setting that fact to all hosts in
the inventory, plus localhost, however, that doesn't seem to
work in local testing.

Work around this by, once again, loading the buildset_registry
fact from the zuul_return file.

Change-Id: Ia16b3af8782c875e64ad5eeeeb5f107482a3e30a
2019-02-18 10:46:26 -08:00
James E. Blair
71b7cb0ae5 Update docker image roles
* In the build-image role, push to the buildset registry if it is defined.
* In the intermediate registry push and pull roles, ensure that the
  buildset registry TLS cert is in place.  This is a self-signed cert,
  and so needs to be written for each run.  This happens inside
  bubblewrap where we have permission to write to /etc, which is an
  ephemeral volume.

Change-Id: I47781d8a7adb93817dfe9266e2f4ad5fd829385c
2019-02-16 10:02:48 -08:00
James E. Blair
ee1b1ea2e4 Intermediate registry: correct arg order
The --insecure-policy argument must appear before copy.

Change-Id: If182405b57c026ced237bf152d323bdea6ff54b2
2019-02-15 17:46:42 -08:00
James E. Blair
c7818fe499 Intermediate registry: use --insecure-policy
There is no policy file available, and we aren't concerned with
verifying image signatures at this point.  Add this option to
tell skopeo to proceed regardless.

Change-Id: I15a4978ec0fb338bc05c974b0ec6a21f680c853e
2019-02-15 16:13:42 -08:00
James E. Blair
e6b1d2aa06 Correct host variable in push-to-intermediate-registry
Change-Id: I4472fde0c7b35bf9b7d54e29e02c6a49280cd714
2019-02-15 13:43:23 -08:00
James E. Blair
404ff1d97b Load buildset registry data from zuul_return
The push-to-intermediate-registry role is meant to be used in the
post playbook of a job which most likely started the buildset
registry in its pre-playbook.  The buildset_registry variable
is returned to zuul and therefore available to child jobs, but
not to further playbooks in this job.  Therefore, load the variable
back in to memory here.

We may add this functionality directly to Zuul, in which case this
can be removed later.

Change-Id: I81899a9be92789fc1e5858f985eac41871b9d87a
2019-02-15 10:33:36 -08:00
James E. Blair
2a3d69c8be Fix undefined attrs in registry push/pull roles
The attribute zuul.artifacts is only present if there are artifacts.
Use the empty list as default.

The default for image.tags should be 'latest' to match the rest
of the docker roles.

Change-Id: Iff6863043e3a0311cb1c8c2ef4cd3d37ff79cce5
2019-02-14 15:03:11 -08:00
James E. Blair
582e95db53 Enable logging on registry/push/pull jobs
This may expose credentials, but these don't work right now.

Change-Id: I8b55734d17329ecc6ac9d9a9ad4189482b6c07ee
2019-02-14 12:59:29 -08:00
Zuul
a06ff1ce19 Merge "Rework upload-forge role to use module" 2019-02-13 17:39:30 +00:00
Zuul
8040e3db08 Merge "Add intermediate registry push/pull roles" 2019-02-12 18:41:27 +00:00
James E. Blair
8efc1cf1af Add intermediate registry push/pull roles
Change-Id: Ie2554005f924d2736d1f1fd1c51cfd5ca9e09199
Depends-On: https://review.openstack.org/634825
2019-02-11 17:41:30 -08:00
Tobias Urdin
a9322c04b6 Rework upload-forge role to use module
Renames the role to upload-forge because you can actually
run your own Forge server if you want.

This patch adds a custom module to the upload-forge
role that provides the "forge_upload" module.

This directly interacts with the a Forge API to upload the
module. The only dependency is that the python requests
module is installed.

Change-Id: I5749364bd2c29ad6df866c2bd5a3584c8419f709
2019-02-09 10:32:34 +01:00
James E. Blair
54dd1db16e Remove "--verbose" from yarn commands
This apparently gets passed to the subcommand, which may not
support a "--verbose" argument.

Change-Id: I8326403ea01f0121f6ff14c10d2cd1e4e7ca7c70
2019-02-08 14:23:01 -08:00
James E. Blair
dd8c88354e Fix ownership change in stage-output
If the stage_dir/logs directory was a symlink, Ansible would refuse
to perform the chmod.  However, if we tell Ansible that it is a
directory, it's fine.  This (perhaps curiously) does not tell
Ansible to turn the symlink into a directory.  It just tells it
that everything is okay.

Change-Id: Idbd78b97b95ce50b23dda8f384e32359d31013e3
2019-02-05 09:32:02 -08:00
Zuul
bc5372817b Merge "Propose some job writing guidelines" 2019-02-05 17:14:35 +00:00
Zuul
4f71cfa849 Merge "Add docker insecure registries feature" 2019-02-05 16:11:35 +00:00
Zuul
bb0788ff0c Merge "upload-pypi: add option to register packages" 2019-02-05 16:11:34 +00:00
Sorin Sbarnea
58cf603ce7 Make install-docker compatible with centos
Allow custom docker_group which is needed on CentOS when
use_upstream_docker: false as is value is 'dockeroot'.

Assures that docker service is started, which is not always true
with all distributions.

Validates that we can talk with docker at the end.

Change-Id: I993c4ac35055a2a18b5b0fb32c8b230e04b7eb87
2019-02-04 15:21:46 +00:00
Zuul
a9ae9ffb0c Merge "Add role to use buildset registry" 2019-02-02 08:12:23 +00:00
Zuul
d30f69d2ab Merge "Add a role to run a buildset registry" 2019-02-02 08:10:39 +00:00
Zuul
c87bc8b9df Merge "stage-output: Add the ability to add .txt extensions to files" 2019-02-02 07:18:51 +00:00
Zuul
3ff7c16505 Merge "Allow stage-output to copy root-owned files" 2019-02-02 07:15:32 +00:00
James E. Blair
0f6796d12b Add role to use buildset registry
Change-Id: Ieacbd033c49afd0bac11cdb17891386c9e1d6a4b
2019-02-01 13:26:03 -08:00
James E. Blair
2292ce9aed Add a role to run a buildset registry
Part of a system to interact with an intermediate registry.

Change-Id: I2f4662cc587f9379e9ba3b7b705c85793a41864e
2019-02-01 13:25:11 -08:00
Zuul
b46ac3ea88 Merge "Allow different filenames for Dockerfiles" 2019-02-01 07:58:04 +00:00
James E. Blair
98628f718a stage-output: Add the ability to add .txt extensions to files
So that this can more easily work with files like '/var/log/syslog',
make it so that if the user specifies "logs_txt" then the file gets
a .txt extension before being placed in the logs directory.

The existing extensions_to_txt variable doesn't work for this because
it requires an existing extension.

Change-Id: I34fea0c44030c04a5540d6b62976557143289196
2019-01-31 10:48:58 -08:00
James E. Blair
2abb8a1302 Allow stage-output to copy root-owned files
This makes it easier to tell stage-output to copy files such
as syslog from remote nodes.

Change-Id: Ica2397a50de1054f5d5ec81b54ab36fda9bdc333
2019-01-30 15:38:58 -08:00
Sean McGinnis
ee5d385343
Block installation of requests-toolbelt 0.9.0
This release of requests-toolbelt expects pyOpenSSL to be installed for
urllib3, but does not have it in its default requirements. This is being
tracked in [0], so should be fixed post 0.9.0. For now, block the use of
the 0.9.0 version.

[0] https://github.com/requests/toolbelt/compare/0.8.0...0.9.0

Change-Id: I06445adaaeecf244f6482b6db26db58a09426489
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-01-29 16:15:25 -06:00
Monty Taylor
b2c5e4a132
Update playbook paths for docker image build jobs
When these were copied in from system-config, the paths to the
upload and promote playbooks weren't updated.

Change-Id: I9da5d7dfb980b2b7690652ee186723ee9ab64cd5
2019-01-26 15:42:50 +00:00
Jean-Philippe Evrard
0e50a2bb89 Allow different filenames for Dockerfiles
In certain build projects, multiple Dockerfiles exist (for example,
one per distro) to simplify reading. However, this role is hardwired
to use dockerfiles only named "Dockerfile".

This is a problem, as you can't override the filename neither per
image, or globally.

This should fix the problem, allowing certain images to be build
by providing the dockerfile argument in docker_images, but also
have a globally overridable flag if you are using a different
convention (for example Dockerfile.distro_minordistroversion).

Change-Id: I075c365bc9f4f85f9ada832d22d1f1e213e68e21
2019-01-26 08:26:06 +00:00
Elod Illes
44b4702eb3 Fix Editable Git install package name parsing
In pip 19.0 release [1] the

 Editable Git installs without a remote now freeze as editable. (#4759) [2]

bug is fixed. Now the output of pip freeze for such package looks like:

 # Editable Git install with no remote (neutron==10.0.8.dev66)
 -e /home/zuul/src/git.openstack.org/openstack/neutron

instead of:

 ## !! Could not determine repository location
 neutron==10.0.8.dev66

Since for listing the package names the module uses the lines that contains
'==' the new behaviour leaves some garbage in front of the package name. So
in case the string contains '(' then remove the first part of the string.

[1] https://pip.pypa.io/en/stable/news/#id15
[2] https://github.com/pypa/pip/issues/4759

Change-Id: I3573c067f63a09f22377612f53c80c80252965e4
2019-01-24 21:36:52 +00:00
Zuul
cce734c667 Merge "Default private_ipv4 to use public_ipv4 address when null" 2019-01-24 12:16:11 +00:00
Zuul
caebca1387 Merge "Document upload-logs reliance on add-fileserver" 2019-01-24 07:36:59 +00:00
Monty Taylor
0ac452ea28
Apply requested tags locally for docker build
When doing the local build, go ahead and apply the tags to the
local image, so that one can use the role for building local
images for testing that will eventually be published with the given
tag.

Change-Id: I0249ddc4f9a8a2e17466f96a5711672282ce025c
2019-01-23 18:06:47 +00:00
Zuul
2e46b8b9cf Merge "Add docker image build jobs" 2019-01-23 15:16:46 +00:00
Ronelle Landy
9853d3608f Default private_ipv4 to use public_ipv4 address when null
The static zuul driver returns only a public_ipv4 address for
nodes in use. The multinode bridge role accesses the node
private_ipv4 address. As such, when the private address is
empty/null the role fails.

This review defaults that private address so that the role
uses the public address when the private address is null.

Change-Id: I32fb17bae98f13f735da4d5b9a6a01e948f21678
2019-01-23 10:30:20 +01:00