Merge "Support armada to run on opensuse image leap15"

This commit is contained in:
Zuul 2019-05-15 15:12:01 +00:00 committed by Gerrit Code Review
commit b8328c9fa0
8 changed files with 122 additions and 16 deletions

View File

@ -23,16 +23,19 @@
- openstack-tox-pep8
- armada-chart-build-gate
- armada-chart-build-latest-htk
- armada-docker-build-gate
- armada-docker-build-gate-ubuntu
- armada-docker-build-gate-opensuse
- armada-airskiff-deploy
gate:
jobs:
- openstack-tox-pep8
- armada-chart-build-gate
- armada-docker-build-gate
- armada-docker-build-gate-ubuntu
- armada-docker-build-gate-opensuse
post:
jobs:
- armada-docker-publish
- armada-docker-publish-ubuntu
- armada-docker-publish-opensuse
- nodeset:
name: armada-single-node
@ -60,12 +63,25 @@
HTK_COMMIT: master
- job:
name: armada-docker-build-gate
name: armada-docker-build-gate-ubuntu
timeout: 1800
run: tools/gate/playbooks/docker-image-build.yaml
nodeset: armada-single-node
vars:
publish: false
distro: ubuntu_bionic
tags:
dynamic:
patch_set: true
- job:
name: armada-docker-build-gate-opensuse
timeout: 1800
run: tools/gate/playbooks/docker-image-build.yaml
nodeset: armada-single-node
vars:
publish: false
distro: opensuse_15
tags:
dynamic:
patch_set: true
@ -98,7 +114,7 @@
- ^swagger/.*$
- job:
name: armada-docker-publish
name: armada-docker-publish-ubuntu
timeout: 1800
run: tools/gate/playbooks/docker-image-build.yaml
nodeset: armada-single-node
@ -106,6 +122,24 @@
- armada_quay_creds
vars:
publish: true
distro: ubuntu_bionic
tags:
dynamic:
branch: true
commit: true
static:
- latest
- job:
name: armada-docker-publish-opensuse
timeout: 1800
run: tools/gate/playbooks/docker-image-build.yaml
nodeset: armada-single-node
secrets:
- armada_quay_creds
vars:
publish: true
distro: opensuse_15
tags:
dynamic:
branch: true

View File

@ -28,7 +28,8 @@ LABEL ?= org.airshipit.build=community
COMMIT ?= $(shell git rev-parse HEAD)
PYTHON = python3
CHARTS := $(patsubst charts/%/.,%,$(wildcard charts/*/.))
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
DISTRO ?= ubuntu_bionic
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}-${DISTRO}
UBUNTU_BASE_IMAGE ?=
# VERSION INFO
@ -108,7 +109,7 @@ ifeq ($(USE_PROXY), true)
--label "org.opencontainers.image.revision=$(COMMIT)" \
--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
--label "org.opencontainers.image.title=$(IMAGE_NAME)" \
-f ./Dockerfile \
-f images/armada/Dockerfile.$(DISTRO) \
$(_BASE_IMAGE_ARG) \
--build-arg http_proxy=$(PROXY) \
--build-arg https_proxy=$(PROXY) \
@ -121,7 +122,7 @@ else
--label "org.opencontainers.image.revision=$(COMMIT)" \
--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
--label "org.opencontainers.image.title=$(IMAGE_NAME)" \
-f ./Dockerfile \
-f images/armada/Dockerfile.$(DISTRO) \
$(_BASE_IMAGE_ARG) .
endif
ifeq ($(PUSH_IMAGE), true)

View File

@ -64,7 +64,7 @@ Afterward, you can launch the Armada container by executing:
$ sudo docker run -d --net host -p 8000:8000 --name armada \
-v ~/.kube/config:/armada/.kube/config \
-v $(pwd)/examples/:/examples quay.io/airshipit/armada:latest
-v $(pwd)/examples/:/examples quay.io/airshipit/armada:latest-ubuntu_bionic
Manual Installation
^^^^^^^^^^^^^^^^^^^

View File

@ -22,14 +22,19 @@ To use the docker container to develop:
#. Next, run the following commands to install ``tox``, generate sample policy
and configuration files, and build Armada charts as well as the Armada
container image::
container image. Armada Dockerfile.DISTRO files are located in images/armada.
Supported DISTROs are ubuntu_bionic and opensuse_leap15.
By default, DISTRO is ubuntu_bionic.
.. code-block:: bash
$ pip install tox
$ tox -e genconfig
$ tox -e genpolicy
$ docker build . -t armada/latest
$ export DISTRO=distro_name
$ docker build -f Dockerfile.${DISTRO} -t armada/latest
$ make images
@ -111,7 +116,7 @@ Follow the steps below to install the Armada CLI.
.. warning::
Armada is only tested against a Ubuntu 16.04 environment.
Armada is tested against a Ubuntu 16.04 and Opensuse(leap15.0)environment.
Clone the Armada repository, ``cd`` into it::

View File

@ -33,12 +33,12 @@ Usage
Pull:
docker pull quay.io/airshipit/armada:latest
docker pull quay.io/airshipit/armada:latest-ubuntu_bionic
Build:
git clone https://github.com/openstack/airship-armada && cd airship-armada/
docker build . -t quay.io/airshipit/armada:latest
docker build . -t quay.io/airshipit/armada:latest-ubuntu_bionic
2. Running Armada
@ -57,7 +57,7 @@ Usage
.. code:: bash
docker run -d --net host -p 8000:8000 --name armada -v $(pwd)/etc/:/etc/ -v ~/.kube/:/armada/.kube/ -v $(pwd)/examples/:/examples quay.io/airshipit/armada:latest
docker run -d --net host -p 8000:8000 --name armada -v $(pwd)/etc/:/etc/ -v ~/.kube/:/armada/.kube/ -v $(pwd)/examples/:/examples quay.io/airshipit/armada:latest-ubuntu_bionic
docker exec armada armada --help

View File

@ -0,0 +1,62 @@
ARG FROM=opensuse/leap:15.0
FROM ${FROM}
LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode'
LABEL org.opencontainers.image.url='https://airshipit.org'
LABEL org.opencontainers.image.documentation='https://airship-armada.readthedocs.org'
LABEL org.opencontainers.image.source='https://opendev.org/airship/armada'
LABEL org.opencontainers.image.vendor='The Airship Authors'
LABEL org.opencontainers.image.licenses='Apache-2.0'
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
EXPOSE 8000
ENTRYPOINT ["./entrypoint.sh"]
CMD ["server"]
RUN mkdir -p /armada && \
zypper refresh && \
zypper up -y && \
zypper --non-interactive install \
ca-certificates \
curl \
tar \
netcfg \
python3 \
python3-devel \
python3-setuptools \
python3-pip \
gcc \
git \
libopenssl-devel \
make && \
pip install --upgrade pip && \
python3 -m pip install -U pip && \
zypper clean -a && \
rm -rf \
/tmp/* \
/var/tmp/* \
/usr/share/man \
/usr/share/doc \
/usr/share/doc-base
WORKDIR /armada
COPY requirements.txt /tmp/
RUN \
pip3 install -r /tmp/requirements.txt && \
useradd -u 1000 -g users -d /armada armada && \
rm -rf /tmp/requirements.txt
COPY . /armada
RUN \
mv etc/armada /etc/ && \
cd /armada && \
chown -R armada:users /armada && \
python3 setup.py install
USER armada

View File

@ -4,7 +4,7 @@ FROM ${FROM}
LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode'
LABEL org.opencontainers.image.url='https://airshipit.org'
LABEL org.opencontainers.image.documentation='https://airship-armada.readthedocs.org'
LABEL org.opencontainers.image.source='https://git.openstack.org/openstack/airship-armada'
LABEL org.opencontainers.image.source='https://opendev.org/airship/armada'
LABEL org.opencontainers.image.vendor='The Airship Authors'
LABEL org.opencontainers.image.licenses='Apache-2.0'

View File

@ -20,6 +20,8 @@
block:
- debug:
var: publish
- debug:
var: distro
- debug:
var: tags
- debug:
@ -91,6 +93,7 @@
chdir: "{{ zuul.project.src_dir }}"
target: images
params:
DISTRO: "{{ distro }}"
IMAGE_TAG: "{{ item }}"
with_items: "{{ image_tags.stdout_lines }}"
@ -115,6 +118,7 @@
params:
DOCKER_REGISTRY: "quay.io"
IMAGE_PREFIX: "airshipit"
DISTRO: "{{ distro }}"
IMAGE_TAG: "{{ item }}"
COMMIT: "{{ zuul.newrev | default('') }}"
PUSH_IMAGE: "true"