aboutsummaryrefslogtreecommitdiff
path: root/docker/base
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2017-01-31 17:55:12 +0100
committerMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2017-05-11 11:11:43 +0200
commit2e438918384447d52c958d61b9a377c375ec932b (patch)
tree13c3f800935e8873d18375a63d7130dd7d9bfb92 /docker/base
parent7b27262216d0bef65dc4c6ed24b96285bbba11db (diff)
downloadkolla-2e438918384447d52c958d61b9a377c375ec932b.tar.gz
kolla-2e438918384447d52c958d61b9a377c375ec932b.zip
Support non-x86 architectures (aarch64, ppc64le)
Based on ppc64le changes by Sajauddin Mohammad [1] 1. https://review.openstack.org/#/c/423239/6 Tested with centos, debian, ubuntu on aarch64 and ppc64le. Partially-Implements: blueprint multiarch-and-arm64-containers Change-Id: If0ccc58d436b2468cd477c222ebc2fe0073206e9
Diffstat (limited to 'docker/base')
-rw-r--r--docker/base/Dockerfile.j2103
-rw-r--r--docker/base/aarch64-cbs.repo26
-rw-r--r--docker/base/sources.list.ubuntu2
-rw-r--r--docker/base/sources.list.ubuntu.aarch6411
-rw-r--r--docker/base/sources.list.ubuntu.ppc64le14
5 files changed, 132 insertions, 24 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2
index ee19c3a26..30a3150f0 100644
--- a/docker/base/Dockerfile.j2
+++ b/docker/base/Dockerfile.j2
@@ -42,33 +42,52 @@ RUN CURRENT_DISTRO_RELEASE=$(awk '{match($0, /[0-9]+/,version)}END{print version
#### BEGIN REPO ENABLEMENT
{% set base_yum_repo_files = [
- 'elasticsearch.repo',
- 'grafana.repo',
- 'influxdb.repo',
- 'kibana.yum.repo',
- 'MariaDB.repo',
- 'td.repo',
- 'zookeeper.repo'
] %}
-{%- for repo_file in base_yum_repo_files | customizable('yum_repo_files') %}
-COPY {{ repo_file }} /etc/yum.repos.d/{{ repo_file }}
-{%- endfor %}
{% set base_yum_url_packages = [
- 'http://repo.percona.com/release/7/RPMS/x86_64/percona-release-0.1-4.noarch.rpm'
] %}
-{{ macros.install_packages(base_yum_url_packages | customizable("yum_url_packages")) }}
+
{% set base_yum_repo_keys = [
- 'http://yum.mariadb.org/RPM-GPG-KEY-MariaDB',
- '/etc/pki/rpm-gpg/RPM-GPG-KEY-Percona ',
- 'https://packages.elastic.co/GPG-KEY-elasticsearch',
- 'https://repos.influxdata.com/influxdb.key',
- 'https://packagecloud.io/gpg.key',
- 'https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana',
- 'https://packages.treasuredata.com/GPG-KEY-td-agent'
] %}
-{%- for key in base_yum_repo_keys | customizable('yum_repo_keys') %}
+{% if base_arch == 'aarch64' %}
+ {% set base_yum_repo_files = [
+ 'aarch64-cbs.repo'
+ ] %}
+
+{% elif base_arch == 'x86_64' %}
+ {% set base_yum_repo_files = [
+ 'elasticsearch.repo',
+ 'grafana.repo',
+ 'influxdb.repo',
+ 'kibana.yum.repo',
+ 'MariaDB.repo',
+ 'td.repo',
+ 'zookeeper.repo'
+ ] %}
+
+ {% set base_yum_url_packages = [
+ 'http://repo.percona.com/release/7/RPMS/x86_64/percona-release-0.1-4.noarch.rpm'
+ ] %}
+
+ {% set base_yum_repo_keys = [
+ 'http://yum.mariadb.org/RPM-GPG-KEY-MariaDB',
+ '/etc/pki/rpm-gpg/RPM-GPG-KEY-Percona',
+ 'https://packages.elastic.co/GPG-KEY-elasticsearch',
+ 'https://repos.influxdata.com/influxdb.key',
+ 'https://packagecloud.io/gpg.key',
+ 'https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana',
+ 'https://packages.treasuredata.com/GPG-KEY-td-agent'
+ ] %}
+{% endif %}
+
+{%- for repo_file in base_yum_repo_files | customizable('yum_repo_files') %}
+COPY {{ repo_file }} /etc/yum.repos.d/{{ repo_file }}
+{%- endfor %}
+
+{{ macros.install_packages(base_yum_url_packages | customizable("yum_url_packages")) }}
+
+{% for key in base_yum_repo_keys | customizable('yum_repo_keys') %}
{%- if loop.first %}RUN {% else %} && {% endif -%}
rpm --import {{ key }}
{%- if not loop.last %} \{% endif %}
@@ -100,17 +119,25 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
{% endblock %}
{% set base_centos_yum_repo_keys = [
- '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage',
- '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization'
] %}
{% set base_centos_yum_repo_packages = [
- 'centos-release-ceph-jewel',
- 'centos-release-qemu-ev',
'epel-release',
'yum-plugin-priorities'
] %}
+{% if base_arch == 'x86_64' %}
+ {% set base_centos_yum_repo_keys = base_centos_yum_repo_keys + [
+ '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage',
+ '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization'
+ ] %}
+
+ {% set base_centos_yum_repo_packages = base_centos_yum_repo_packages + [
+ 'centos-release-ceph-jewel',
+ 'centos-release-qemu-ev'
+ ] %}
+{% endif %}
+
{{ macros.install_packages(base_centos_yum_repo_packages | customizable("centos_yum_repo_packages")) }}
{% for key in base_centos_yum_repo_keys | customizable('centos_yum_repo_keys') %}
{%- if loop.first %}RUN {% else %} && {% endif -%}
@@ -171,6 +198,12 @@ RUN yum -y install \
{# We are back to the basic if conditional here which is:
if base_distro in ['centos', 'oraclelinux', 'rhel'] #}
+
+{% set base_compiler_packages = [
+ 'gcc',
+ 'glibc-static'
+] %}
+
{% block base_redhat_binary_versionlock %}{% endblock %}
{% if install_type == 'binary' %}
{% set base_centos_binary_packages = [
@@ -228,7 +261,11 @@ RUN apt-get update \
{% endblock %}
{% block base_ubuntu_package_sources_list %}
+{% if base_distro == 'debian' or ( base_distro == 'ubuntu' and base_arch == 'x86_64' ) %}
COPY sources.list.{{ base_distro }} /etc/apt/sources.list
+{% else %}
+COPY sources.list.{{ base_distro }}.{{ base_arch }} /etc/apt/sources.list
+{% endif %}
{% endblock %}
{% block base_ubuntu_package_apt_preferences %}
@@ -248,6 +285,9 @@ COPY apt_preferences.{{ base_distro }} /etc/apt/preferences
'sudo',
'tgt']
%}
+{% set base_compiler_packages = [
+ 'build-essential'
+] %}
{% if base_distro == 'ubuntu' %}
{# 05CE15085FC09D18E99EFB22684A14CF2582E0C5 -- InfluxDB Packaging Service <support@influxdb.com> #}
@@ -322,8 +362,23 @@ COPY sudoers /etc/sudoers
COPY curlrc /root/.curlrc
{% block dumb_init_installation %}
+
+{% if base_arch == 'x86_64' %}
+
RUN curl -sSL https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64 -o /usr/local/bin/dumb-init \
&& chmod +x /usr/local/bin/dumb-init
+
+{% else %}
+
+{{ macros.install_packages(base_compiler_packages) }}
+
+RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
+ && python get-pip.py \
+ && rm get-pip.py \
+ && pip --no-cache-dir install --prefix='/usr/local' dumb-init==1.1.3 \
+ && chmod +x /usr/local/bin/dumb-init
+
+{% endif %}
{% endblock %}
RUN touch /usr/local/bin/kolla_extend_start \
diff --git a/docker/base/aarch64-cbs.repo b/docker/base/aarch64-cbs.repo
new file mode 100644
index 000000000..4a60b4bb3
--- /dev/null
+++ b/docker/base/aarch64-cbs.repo
@@ -0,0 +1,26 @@
+[aarch64-ceph-jewel]
+name=CentOS Storage SIG repo with Ceph jewel
+baseurl=https://buildlogs.centos.org/centos/7/storage/aarch64/ceph-jewel/
+enabled=1
+gpgcheck=0
+
+# those three below are from delorean-deps.repo
+# we are in a middle of sorting that out at RDO
+
+[aarch64-kvm]
+name=CentOS Virt SIG repo
+baseurl=https://buildlogs.centos.org/centos/7/virt/aarch64/kvm-common/
+enabled=1
+gpgcheck=0
+
+[delorean-pike-testing]
+name=dlrn-pike-testing
+baseurl=https://buildlogs.centos.org/centos/7/cloud/$basearch/openstack-pike/
+enabled=1
+gpgcheck=0
+
+[delorean-pike-pending]
+name=dlrn-pike-pending
+baseurl=https://cbs.centos.org/repos/cloud7-openstack-common-pending/$basearch/os/
+gpgcheck=0
+enabled=0
diff --git a/docker/base/sources.list.ubuntu b/docker/base/sources.list.ubuntu
index d913a4044..9ec6da2e5 100644
--- a/docker/base/sources.list.ubuntu
+++ b/docker/base/sources.list.ubuntu
@@ -1,3 +1,5 @@
+# For non-x86 architectures we use sources.list.debian.ARCHITECTURENAME
+
# Default repos
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
diff --git a/docker/base/sources.list.ubuntu.aarch64 b/docker/base/sources.list.ubuntu.aarch64
new file mode 100644
index 000000000..cd742e96d
--- /dev/null
+++ b/docker/base/sources.list.ubuntu.aarch64
@@ -0,0 +1,11 @@
+# Default repos
+deb http://ports.ubuntu.com/ xenial main restricted universe multiverse
+deb http://ports.ubuntu.com/ xenial-updates main restricted universe multiverse
+deb http://ports.ubuntu.com/ xenial-security main restricted universe multiverse
+
+# Backports have a lower priority and must be explicitly installed to be used
+deb http://ports.ubuntu.com/ xenial-backports main restricted universe multiverse
+
+# We need to add the pike repo for the updated packages they provide. The main
+# ones are qemu, libvirt, and openvswitch.
+deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/pike main
diff --git a/docker/base/sources.list.ubuntu.ppc64le b/docker/base/sources.list.ubuntu.ppc64le
new file mode 100644
index 000000000..86745c59e
--- /dev/null
+++ b/docker/base/sources.list.ubuntu.ppc64le
@@ -0,0 +1,14 @@
+# Default repos
+deb http://ports.ubuntu.com/ xenial main restricted universe multiverse
+deb http://ports.ubuntu.com/ xenial-updates main restricted universe multiverse
+deb http://ports.ubuntu.com/ xenial-security main restricted universe multiverse
+
+# Backports have a lower priority and must be explicitly installed to be used
+deb http://ports.ubuntu.com/ xenial-backports main restricted universe multiverse
+
+# We need to add the pike repo for the updated packages they provide. The main
+# ones are qemu, libvirt, and openvswitch.
+deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/pike main
+
+# Mariadb
+deb http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu xenial main