Changes in container builder

* do not log the login command
* change dockerhub creds
* fix reference of tag in the push images task
* add retries
* remove repository parameter
* pull fedora from docker.io
* name docker_image tasks for each kubernetes and magnum images
* drop async logs

Change-Id: Iead202bdf9d7d42d0b7e21bea73a298678be714b
Signed-off-by: Spyros Trigazis <spyridon.trigazis@cern.ch>
This commit is contained in:
Spyros Trigazis 2018-12-14 22:43:44 +01:00
parent 20d965c864
commit 60c996d2b4
7 changed files with 41 additions and 53 deletions

View File

@ -2,27 +2,27 @@
name: magnum_docker_login name: magnum_docker_login
data: data:
user: !encrypted/pkcs1-oaep user: !encrypted/pkcs1-oaep
- rxOFTiiWYyvD5fzSRM3uMXoLKAF9rUzgY3AhyLbIkQ5dUfKO8cJ5zasJG+3qVOyT6hjOO - LfP9zghLZsxH4uz1SWMQpjdvuni01WSTtSJyp0V1mb1X6B8VqX4H/Z5AaI2oQF/ZfcbiL
sCkWC7Cta74cxDr7cMjH4m80R8hD5o6/Q7m3xMnwRz/6s12vpd1LXOMp6R7ahXCmH/Cxe H2mnwGPVDvFIncuUgCib48PaDu3SHHWIkuSmGGFgVJSfenm4mKnH2DT/zmsyoQ7UuIGkC
2O7UeFUN7vX0JKIWw47ioitqqQ1GywFzBgiCN9f8Qg7sIdaner5MmQD+3x8XmqKMEqr88 uzCVTK6Zc6c1f6lFaeu6c2jlSf18XuS1z6U0ou5TRl1dQv0FDlbNfBNIXkDXviY6oTZZ3
/j2Nxc4UHvhK+zkjDMM21+7RH33vC2KVteA8hbnKLd621D+8ocPQRihdQ221xiXtij38C AttA6C34OnLp7Vs8PMVcAXt5cH2ibcpxget4MZG+De2AiTaojKZ0pMw+HRFeke+Pq37uk
hTSHvYYgphEbZK2G/iwbG+Ol+orc215UE+ZnDXrxI6f20rit2KVboaWrUkuKgwHqJJ8mx zwtqxsSZkCgxdxPJsvhUziJzy2GhljyIRfbhf+/bze/3MFUkedk32wFsAjbWg6SJByXos
SQ/QFFhe4gW2b3WkB18eDb1APob+sGFCxd6gjWO9D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tsss9U/7EKeVpvjCv
JzGabDgl/PdtXVzCS9Xhg6RP1Vdq/JeVPNuERFYvZWM7YvxbTXMRp7/V83tLy7UtCXusi zzcuYP9WtFmBvUn+5Jyev8evwTVFZIqT8eimOtAfK4KLlT6K17kT8kUuDAMWeub7BGtVB
ge8LaYgTMuBMioBaD7snmI08HZilo34hKg5fRHkf4ZRvbC+baJxEumSX5zfWoO10Jw8Dc Jln6AsXetnYmo5VF6vDbp7tZrFO9tBKm2LNjDvtgahcilh2yt5DK9QfjUo4I0tmeLoK01
4FK8d0O2+2erAwvyZIWSdj/EGlwUqPJ0qHIMbOl3ahMEHujQ42UHhtUpYS4kMEdBcdOOU ZYogPLfjVyUQNhCiZOuwgVsIiB6OkGK8F/re3CyR5Ff1c0oD0TqWhREoqWKM9fSMhLxKn
C3eruiqligGbClK3Mpf1MVlJC8jmkeRofseQmSt7arQ6RAlMn64k8kr1/biMs0saaGKbw fAVW/kOZdqQxTwGj3JYiqtqnZAD4P7vdujhZWzb1LPJLD+42j6BaM4H0YQ8cvM+q9LtbF
Nw7PhUQTf67yemJvB1zHOI4i9SEkApRNoBmtOe9UxeJxlsDnvOUUteOja3EnIrdIt8Qnk DrcSsxmi+krRwE8u8Yvxr5PPNv/2kNFspAQ9C5L5u2t0uUpb7rZ26iKdPEY/XHca7bpYI
N+yvPc0MhDVNU0SHJp+AiHJ6jk/tXDkKNnoZJH0BHGPDNp+/pC2ckLxzOrXLPGJkVglwA P4CkqWvPbnWL9CwUCeJDdo9WDV3Evd/+dXcK0EtTCgDzEzTiv/YsERIbwKF0pFnwjYme2
4gTl0N/3dRouxVITTmeVwGfffCo/jrdrr1gIr5FAzbiz2jQxF0OOXqRA1YRHn8= SX+Z3JkB5ne4VY+zKL3hltZHzMnu5yfitWWwcqYj4lETkkAZhNVa4aJPMQ1dXA=
- job: - job:
name: magnum-functional-base name: magnum-functional-base

View File

@ -1,4 +1,4 @@
FROM registry.fedoraproject.org/fedora:rawhide FROM fedora:rawhide
# Fill out the labels # Fill out the labels
LABEL name="heat-container-agent" \ LABEL name="heat-container-agent" \

View File

@ -1,6 +1,6 @@
ARG KUBE_VERSION=v1.13.0 ARG KUBE_VERSION=v1.13.0
FROM registry.fedoraproject.org/fedora:rawhide FROM fedora:rawhide
RUN curl -o /root/kubectl -O https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/bin/linux/amd64/kubectl RUN curl -o /root/kubectl -O https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/bin/linux/amd64/kubectl
FROM gcr.io/google-containers/kube-apiserver-amd64:${KUBE_VERSION} FROM gcr.io/google-containers/kube-apiserver-amd64:${KUBE_VERSION}

View File

@ -1,13 +1,5 @@
- hosts: all - hosts: all
tasks: tasks:
- name: collect ansible_async logs
synchronize:
src: '/home/zuul/.ansible_async'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
- shell: - shell:
cmd: | cmd: |
set +o errexit set +o errexit

View File

@ -1,6 +1,6 @@
magnum_src_dir: "src/git.openstack.org/openstack/magnum" magnum_src_dir: "src/git.openstack.org/openstack/magnum"
repository: docker.io/openstackmagnumtest magnum_repository: openstackmagnumtest
kubernetes_version: v1.11.3 kubernetes_version: v1.11.3
kubernetes_images: kubernetes_images:
- name: kubernetes-apiserver - name: kubernetes-apiserver

View File

@ -2,33 +2,26 @@
tasks: tasks:
- include_vars: container-builder-vars.yaml - include_vars: container-builder-vars.yaml
- name: Build images - name: "Build magnum images"
block: block:
- docker_image: - name: "Build {{ magnum_repository }}/{{ item.name }}:{{ item.tag }} image"
docker_image:
path: "{{ magnum_src_dir }}/dockerfiles/{{ item.name }}" path: "{{ magnum_src_dir }}/dockerfiles/{{ item.name }}"
name: "{{ item.name }}" name: "{{ magnum_repository }}/{{ item.name }}"
repository: "{{ repository }}/{{ item.name }}" tag: "{{ item.tag }}"
tag: "{{ item.tag}}"
push: no push: no
with_items: "{{ magnum_images }}" with_items: "{{ magnum_images }}"
- docker_image: retries: 10
- name: "Build kubernetes images"
block:
- name: "Build {{ magnum_repository }}/{{ item.name }}:{{ item.tag }} image"
docker_image:
path: "{{ magnum_src_dir }}/dockerfiles/{{ item.name }}" path: "{{ magnum_src_dir }}/dockerfiles/{{ item.name }}"
name: "{{ item.name }}" name: "{{ magnum_repository }}/{{ item.name }}"
repository: "{{ repository }}/{{ item.name }}"
tag: "{{ kubernetes_version }}" tag: "{{ kubernetes_version }}"
buildargs: buildargs:
KUBE_VERSION: "{{ kubernetes_version }}" KUBE_VERSION: "{{ kubernetes_version }}"
push: no push: no
with_items: "{{ kubernetes_images }}" with_items: "{{ kubernetes_images }}"
async: 1000 retries: 10
poll: 0
register: pull
- async_status:
jid: "{{ item.ansible_job_id }}"
with_items: "{{ pull.results }}"
register: pull_result
until:
- pull_result.finished is defined
- pull_result.finished
retries: 1000
delay: 5

View File

@ -5,8 +5,11 @@
- name: Push images to DockerHub - name: Push images to DockerHub
block: block:
- command: docker login -u {{ magnum_docker_login.user }} -p {{ magnum_docker_login.password }} - command: docker login -u {{ magnum_docker_login.user }} -p {{ magnum_docker_login.password }}
no_log: False no_log: True
- command: docker push {{ repository }}/{{ item.name }}:{{ tag }} retries: 5
- command: docker push {{ repository }}/{{ item.name }}:{{ item.tag }}
with_items: "{{ magnum_images }}" with_items: "{{ magnum_images }}"
retries: 10
- command: docker push {{ repository }}/{{ item.name }}:{{ kubernetes_version }} - command: docker push {{ repository }}/{{ item.name }}:{{ kubernetes_version }}
with_items: "{{ kubernetes_images }}" with_items: "{{ kubernetes_images }}"
retries: 10