From 9fce180414a4cfbebea1f4b4acc2f67356b7e4fc Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Mon, 27 Jun 2016 09:35:06 -0400 Subject: Speed up copying OpenShift examples * The `copy` module does not scale to hundreds of files * Replace `copy` with `unarchive` Create a temp dir locally to tar all the OpenShift examples into. Make the dest dir on the remote side, drop examples in place with the `unarchive` module. --- roles/openshift_examples/tasks/main.yml | 43 ++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) (limited to 'roles/openshift_examples') diff --git a/roles/openshift_examples/tasks/main.yml b/roles/openshift_examples/tasks/main.yml index fb10188f2..e9966d735 100644 --- a/roles/openshift_examples/tasks/main.yml +++ b/roles/openshift_examples/tasks/main.yml @@ -1,9 +1,46 @@ --- -- name: Copy openshift examples - copy: - src: "examples/{{ content_version }}/" +###################################################################### +# Copying Examples +# +# We used to use the copy module to transfer the openshift examples to +# the remote. Then it started taking more than a minute to transfer +# the files. As noted in the module: +# +# "The 'copy' module recursively copy facility does not scale to +# lots (>hundreds) of files." +# +# The `synchronize` module is suggested as an alternative, we can't +# use it either due to changes introduced in Ansible 2.x. +- name: Create local temp dir for OpenShift examples copy + local_action: command mktemp -d /tmp/openshift-ansible-XXXXXXX + become: False + register: copy_examples_mktemp + run_once: True + +- name: Create tar of OpenShift examples + local_action: command tar -C "{{ role_path }}/files/examples/{{ content_version }}/" -cvf "{{ copy_examples_mktemp.stdout }}/openshift-examples.tar" . + become: False + register: copy_examples_tar + +- name: Create the remote OpenShift examples directory + file: + dest: "{{ examples_base }}" + state: directory + mode: 0755 + +- name: Unarchive the OpenShift examples on the remote + unarchive: + src: "{{ copy_examples_mktemp.stdout }}/openshift-examples.tar" dest: "{{ examples_base }}/" +- name: Cleanup the OpenShift Examples temp dir + become: False + local_action: file dest="{{ copy_examples_mktemp.stdout }}" state=absent + +# Done copying examples +###################################################################### +# Begin image streams + - name: Modify registry paths if registry_url is not registry.access.redhat.com shell: > find {{ examples_base }} -type f | xargs -n 1 sed -i 's|registry.access.redhat.com|{{ registry_host | quote }}|g' -- cgit v1.2.3 From 1448af9bfa2eea834de1426268f68ecdae7b8126 Mon Sep 17 00:00:00 2001 From: Andrew Butcher Date: Wed, 29 Jun 2016 10:28:21 -0400 Subject: Revert "Speed up copying OpenShift examples" --- roles/openshift_examples/tasks/main.yml | 43 +++------------------------------ 1 file changed, 3 insertions(+), 40 deletions(-) (limited to 'roles/openshift_examples') diff --git a/roles/openshift_examples/tasks/main.yml b/roles/openshift_examples/tasks/main.yml index e9966d735..fb10188f2 100644 --- a/roles/openshift_examples/tasks/main.yml +++ b/roles/openshift_examples/tasks/main.yml @@ -1,46 +1,9 @@ --- -###################################################################### -# Copying Examples -# -# We used to use the copy module to transfer the openshift examples to -# the remote. Then it started taking more than a minute to transfer -# the files. As noted in the module: -# -# "The 'copy' module recursively copy facility does not scale to -# lots (>hundreds) of files." -# -# The `synchronize` module is suggested as an alternative, we can't -# use it either due to changes introduced in Ansible 2.x. -- name: Create local temp dir for OpenShift examples copy - local_action: command mktemp -d /tmp/openshift-ansible-XXXXXXX - become: False - register: copy_examples_mktemp - run_once: True - -- name: Create tar of OpenShift examples - local_action: command tar -C "{{ role_path }}/files/examples/{{ content_version }}/" -cvf "{{ copy_examples_mktemp.stdout }}/openshift-examples.tar" . - become: False - register: copy_examples_tar - -- name: Create the remote OpenShift examples directory - file: - dest: "{{ examples_base }}" - state: directory - mode: 0755 - -- name: Unarchive the OpenShift examples on the remote - unarchive: - src: "{{ copy_examples_mktemp.stdout }}/openshift-examples.tar" +- name: Copy openshift examples + copy: + src: "examples/{{ content_version }}/" dest: "{{ examples_base }}/" -- name: Cleanup the OpenShift Examples temp dir - become: False - local_action: file dest="{{ copy_examples_mktemp.stdout }}" state=absent - -# Done copying examples -###################################################################### -# Begin image streams - - name: Modify registry paths if registry_url is not registry.access.redhat.com shell: > find {{ examples_base }} -type f | xargs -n 1 sed -i 's|registry.access.redhat.com|{{ registry_host | quote }}|g' -- cgit v1.2.3 From a072feb4f88ab120b7cb58128d728a64d60e58d4 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Fri, 1 Jul 2016 08:55:07 -0400 Subject: Update image streams with SCL 2.2 components --- .../v1.2/image-streams/image-streams-centos7.json | 130 ++++++++++++++---- .../v1.2/image-streams/image-streams-rhel7.json | 146 +++++++++++++++++---- 2 files changed, 228 insertions(+), 48 deletions(-) (limited to 'roles/openshift_examples') diff --git a/roles/openshift_examples/files/examples/v1.2/image-streams/image-streams-centos7.json b/roles/openshift_examples/files/examples/v1.2/image-streams/image-streams-centos7.json index 719aee772..d971e5e7a 100644 --- a/roles/openshift_examples/files/examples/v1.2/image-streams/image-streams-centos7.json +++ b/roles/openshift_examples/files/examples/v1.2/image-streams/image-streams-centos7.json @@ -7,8 +7,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "ruby", - "creationTimestamp": null + "name": "ruby" }, "spec": { "tags": [ @@ -23,7 +22,7 @@ }, "from": { "kind": "ImageStreamTag", - "name": "2.2" + "name": "2.3" } }, { @@ -55,6 +54,21 @@ "kind": "DockerImage", "name": "centos/ruby-22-centos7:latest" } + }, + { + "name": "2.3", + "annotations": { + "description": "Build and run Ruby 2.3 applications", + "iconClass": "icon-ruby", + "tags": "builder,ruby", + "supports": "ruby:2.3,ruby", + "version": "2.3", + "sampleRepo": "https://github.com/openshift/ruby-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "centos/ruby-23-centos7:latest" + } } ] } @@ -63,8 +77,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "nodejs", - "creationTimestamp": null + "name": "nodejs" }, "spec": { "tags": [ @@ -104,8 +117,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "perl", - "creationTimestamp": null + "name": "perl" }, "spec": { "tags": [ @@ -161,8 +173,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "php", - "creationTimestamp": null + "name": "php" }, "spec": { "tags": [ @@ -217,8 +228,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "python", - "creationTimestamp": null + "name": "python" }, "spec": { "tags": [ @@ -233,7 +243,7 @@ }, "from": { "kind": "ImageStreamTag", - "name": "3.4" + "name": "3.5" } }, { @@ -280,6 +290,21 @@ "kind": "DockerImage", "name": "centos/python-34-centos7:latest" } + }, + { + "name": "3.5", + "annotations": { + "description": "Build and run Python 3.5 applications", + "iconClass": "icon-python", + "tags": "builder,python", + "supports":"python:3.5,python", + "version": "3.5", + "sampleRepo": "https://github.com/openshift/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "centos/python-35-centos7:latest" + } } ] } @@ -288,8 +313,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "wildfly", - "creationTimestamp": null + "name": "wildfly" }, "spec": { "tags": [ @@ -359,8 +383,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "mysql", - "creationTimestamp": null + "name": "mysql" }, "spec": { "tags": [ @@ -409,8 +432,43 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "postgresql", - "creationTimestamp": null + "name": "mariadb" + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "description": "Provides a MariaDB database", + "iconClass": "icon-mariadb", + "tags": "mariadb" + }, + "from": { + "kind": "ImageStreamTag", + "name": "10.1" + } + }, + { + "name": "10.1", + "annotations": { + "description": "Provides a MariaDB v10.1 database", + "iconClass": "icon-mariadb", + "tags": "mariadb", + "version": "10.1" + }, + "from": { + "kind": "DockerImage", + "name": "centos/mariadb-101-centos7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "postgresql" }, "spec": { "tags": [ @@ -423,7 +481,7 @@ }, "from": { "kind": "ImageStreamTag", - "name": "9.4" + "name": "9.5" } }, { @@ -451,6 +509,19 @@ "kind": "DockerImage", "name": "centos/postgresql-94-centos7:latest" } + }, + { + "name": "9.5", + "annotations": { + "description": "Provides a PostgreSQL v9.5 database", + "iconClass": "icon-postgresql", + "tags": "postgresql", + "version": "9.5" + }, + "from": { + "kind": "DockerImage", + "name": "centos/postgresql-95-centos7:latest" + } } ] } @@ -459,8 +530,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "mongodb", - "creationTimestamp": null + "name": "mongodb" }, "spec": { "tags": [ @@ -473,7 +543,7 @@ }, "from": { "kind": "ImageStreamTag", - "name": "2.6" + "name": "3.2" } }, { @@ -501,6 +571,19 @@ "kind": "DockerImage", "name": "centos/mongodb-26-centos7:latest" } + }, + { + "name": "3.2", + "annotations": { + "description": "Provides a MongoDB v3.2 database", + "iconClass": "icon-mongodb", + "tags": "mongodb", + "version": "3.2" + }, + "from": { + "kind": "DockerImage", + "name": "centos/mongodb-32-centos7:latest" + } } ] } @@ -509,8 +592,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "jenkins", - "creationTimestamp": null + "name": "jenkins" }, "spec": { "tags": [ diff --git a/roles/openshift_examples/files/examples/v1.2/image-streams/image-streams-rhel7.json b/roles/openshift_examples/files/examples/v1.2/image-streams/image-streams-rhel7.json index 00635ec78..56c63263b 100644 --- a/roles/openshift_examples/files/examples/v1.2/image-streams/image-streams-rhel7.json +++ b/roles/openshift_examples/files/examples/v1.2/image-streams/image-streams-rhel7.json @@ -7,8 +7,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "ruby", - "creationTimestamp": null + "name": "ruby" }, "spec": { "tags": [ @@ -18,12 +17,12 @@ "description": "Build and run Ruby applications", "iconClass": "icon-ruby", "tags": "builder,ruby", - "supports": "ruby,ruby", + "supports": "ruby", "sampleRepo": "https://github.com/openshift/ruby-ex.git" }, "from": { "kind": "ImageStreamTag", - "name": "2.2" + "name": "2.3" } }, { @@ -55,6 +54,21 @@ "kind": "DockerImage", "name": "registry.access.redhat.com/rhscl/ruby-22-rhel7:latest" } + }, + { + "name": "2.3", + "annotations": { + "description": "Build and run Ruby 2.3 applications", + "iconClass": "icon-ruby", + "tags": "builder,ruby", + "supports": "ruby:2.3,ruby", + "version": "2.3", + "sampleRepo": "https://github.com/openshift/ruby-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/ruby-23-rhel7:latest" + } } ] } @@ -63,8 +77,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "nodejs", - "creationTimestamp": null + "name": "nodejs" }, "spec": { "tags": [ @@ -79,7 +92,7 @@ }, "from": { "kind": "ImageStreamTag", - "name": "0.10" + "name": "4" } }, { @@ -96,6 +109,21 @@ "kind": "DockerImage", "name": "registry.access.redhat.com/openshift3/nodejs-010-rhel7:latest" } + }, + { + "name": "4", + "annotations": { + "description": "Build and run NodeJS 4.x applications", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "supports":"nodejs:4,nodejs", + "version": "4", + "sampleRepo": "https://github.com/openshift/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/nodejs-4-rhel7:latest" + } } ] } @@ -104,8 +132,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "perl", - "creationTimestamp": null + "name": "perl" }, "spec": { "tags": [ @@ -161,8 +188,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "php", - "creationTimestamp": null + "name": "php" }, "spec": { "tags": [ @@ -217,8 +243,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "python", - "creationTimestamp": null + "name": "python" }, "spec": { "tags": [ @@ -233,7 +258,7 @@ }, "from": { "kind": "ImageStreamTag", - "name": "3.4" + "name": "3.5" } }, { @@ -280,6 +305,21 @@ "kind": "DockerImage", "name": "registry.access.redhat.com/rhscl/python-34-rhel7:latest" } + }, + { + "name": "3.5", + "annotations": { + "description": "Build and run Python 3.5 applications", + "iconClass": "icon-python", + "tags": "builder,python", + "supports":"python:3.5,python", + "version": "3.5", + "sampleRepo": "https://github.com/openshift/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/python-35-rhel7:latest" + } } ] } @@ -288,8 +328,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "mysql", - "creationTimestamp": null + "name": "mysql" }, "spec": { "tags": [ @@ -338,8 +377,43 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "postgresql", - "creationTimestamp": null + "name": "mariadb" + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "description": "Provides a MariaDB database", + "iconClass": "icon-mariadb", + "tags": "mariadb" + }, + "from": { + "kind": "ImageStreamTag", + "name": "10.1" + } + }, + { + "name": "10.1", + "annotations": { + "description": "Provides a MariaDB v10.1 database", + "iconClass": "icon-mariadb", + "tags": "mariadb", + "version": "10.1" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/mariadb-101-rhel7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "postgresql" }, "spec": { "tags": [ @@ -352,7 +426,7 @@ }, "from": { "kind": "ImageStreamTag", - "name": "9.4" + "name": "9.5" } }, { @@ -380,6 +454,19 @@ "kind": "DockerImage", "name": "registry.access.redhat.com/rhscl/postgresql-94-rhel7:latest" } + }, + { + "name": "9.5", + "annotations": { + "description": "Provides a PostgreSQL v9.5 database", + "iconClass": "icon-postgresql", + "tags": "postgresql", + "version": "9.5" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/postgresql-95-rhel7:latest" + } } ] } @@ -388,8 +475,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "mongodb", - "creationTimestamp": null + "name": "mongodb" }, "spec": { "tags": [ @@ -402,7 +488,7 @@ }, "from": { "kind": "ImageStreamTag", - "name": "2.6" + "name": "3.2" } }, { @@ -430,6 +516,19 @@ "kind": "DockerImage", "name": "registry.access.redhat.com/rhscl/mongodb-26-rhel7:latest" } + }, + { + "name": "3.2", + "annotations": { + "description": "Provides a MongoDB v3.2 database", + "iconClass": "icon-mongodb", + "tags": "mongodb", + "version": "3.2" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/mongodb-32-rhel7:latest" + } } ] } @@ -438,8 +537,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "jenkins", - "creationTimestamp": null + "name": "jenkins" }, "spec": { "tags": [ -- cgit v1.2.3