Merge "Docker image refinement and preparation for future development."
This commit is contained in:
commit
04fe68c944
67
.dockerignore
Normal file
67
.dockerignore
Normal file
@ -0,0 +1,67 @@
|
||||
# Docker image doesn't need any files that git doesn't track.
|
||||
#Therefore the .dockerignore largely follows the structure of .gitignore.
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Packages
|
||||
*.egg*
|
||||
*.egg-info
|
||||
dist
|
||||
build
|
||||
eggs
|
||||
parts
|
||||
bin
|
||||
var
|
||||
sdist
|
||||
develop-eggs
|
||||
.installed.cfg
|
||||
lib
|
||||
lib64
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
cover/
|
||||
.coverage*
|
||||
!.coveragerc
|
||||
.tox
|
||||
nosetests.xml
|
||||
.testrepository
|
||||
.venv
|
||||
.stestr/*
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
|
||||
# Mr Developer
|
||||
.mr.developer.cfg
|
||||
.project
|
||||
.pydevproject
|
||||
|
||||
# Complexity
|
||||
output/*.html
|
||||
output/*/index.html
|
||||
|
||||
# Sphinx
|
||||
doc/build
|
||||
doc/source/reference/api/
|
||||
|
||||
# pbr generates these
|
||||
AUTHORS
|
||||
ChangeLog
|
||||
|
||||
# Editors
|
||||
*~
|
||||
.*.swp
|
||||
.*sw?
|
||||
|
||||
# Files created by releasenotes build
|
||||
releasenotes/build
|
||||
|
||||
# Ansible specific
|
||||
hosts
|
||||
*.retry
|
||||
|
||||
#Vagrantfiles, since we are using docker
|
||||
Vagrantfile.*
|
14
Dockerfile
14
Dockerfile
@ -1,12 +1,14 @@
|
||||
FROM centos:latest
|
||||
|
||||
LABEL name="VF develoment dockerfile"
|
||||
LABEL version="0.2"
|
||||
LABEL version="0.3"
|
||||
LABEL description="Provides environment for development of new validations."
|
||||
|
||||
RUN dnf install -y git python3-pip gcc python3-devel jq
|
||||
|
||||
#We copy contents of the local validations-libs repo with all of our changes
|
||||
COPY . /root/validations-libs
|
||||
#validations-common repo is cloned
|
||||
RUN git clone https://opendev.org/openstack/validations-common /root/validations-common
|
||||
|
||||
RUN python3 -m pip install cryptography==3.3
|
||||
@ -19,7 +21,11 @@ RUN cd /root/validations-common && \
|
||||
python3 -m pip install . && \
|
||||
python3 -m pip install -r test-requirements.txt
|
||||
|
||||
RUN ln -s /usr/local/share/ansible /usr/share/ansible
|
||||
RUN mkdir /etc/ansible && \
|
||||
#Setting up the default directory structure for both ansible,
|
||||
#and the VF
|
||||
RUN ln -s /usr/local/share/ansible /usr/share/ansible && \
|
||||
mkdir -p /var/log/validations
|
||||
#Simplified ansible inventory is created, containing only localhost,
|
||||
#and defining the connection as local.
|
||||
RUN mkdir -p /etc/ansible && \
|
||||
echo "localhost ansible_connection=local" > /etc/ansible/hosts
|
||||
RUN mkdir -p /var/log/validations
|
||||
|
@ -19,11 +19,17 @@ Docker Quickstart
|
||||
=================
|
||||
|
||||
A Dockerfile is provided at the root of the Validations Library project in
|
||||
order to quickly set and hack the Validation Framework.
|
||||
order to quickly set and hack the Validation Framework, on a equivalent of a single machine.
|
||||
Build the container from the Dockerfile by running::
|
||||
|
||||
docker build -t "vf:dockerfile" .
|
||||
|
||||
From the validations-libs repo directory.
|
||||
|
||||
.. note::
|
||||
More complex images are available in the dockerfiles directory
|
||||
and require explicit specification of both build context and the Dockerfile.
|
||||
|
||||
Then you can run the container and start to run some builtin Validations::
|
||||
|
||||
docker run -ti vf:dockerfile /bin/bash
|
||||
|
31
dockerfiles/localvalidations/Dockerfile
Normal file
31
dockerfiles/localvalidations/Dockerfile
Normal file
@ -0,0 +1,31 @@
|
||||
FROM centos:latest
|
||||
|
||||
LABEL name="VF develoment dockerfile"
|
||||
LABEL version="0.3"
|
||||
LABEL description="Provides environment for development of new validations."
|
||||
|
||||
RUN dnf install -y git python3-pip gcc python3-devel jq
|
||||
|
||||
#We copy contents of the local validations-libs repo with all of our changes
|
||||
COPY . /root/validations-libs
|
||||
#validations-common repo is cloned
|
||||
RUN git clone https://opendev.org/openstack/validations-common /root/validations-common
|
||||
|
||||
RUN python3 -m pip install cryptography==3.3
|
||||
|
||||
RUN cd /root/validations-libs && \
|
||||
python3 -m pip install . && \
|
||||
python3 -m pip install -r test-requirements.txt
|
||||
|
||||
RUN cd /root/validations-common && \
|
||||
python3 -m pip install . && \
|
||||
python3 -m pip install -r test-requirements.txt
|
||||
|
||||
#Setting up the default directory structure for both ansible,
|
||||
#and the VF
|
||||
RUN ln -s /usr/local/share/ansible /usr/share/ansible && \
|
||||
mkdir -p /var/log/validations
|
||||
#Simplified ansible inventory is created, containing only localhost,
|
||||
#and defining the connection as local.
|
||||
RUN mkdir -p /etc/ansible && \
|
||||
echo "localhost ansible_connection=local" > /etc/ansible/hosts
|
7
dockerfiles/localvalidations/README.rst
Normal file
7
dockerfiles/localvalidations/README.rst
Normal file
@ -0,0 +1,7 @@
|
||||
Localhost validations dockerfile
|
||||
================================
|
||||
|
||||
Default dockerfile for development of new validations.
|
||||
Creates a container suitable for running validations requiring only a local machine.
|
||||
|
||||
More complex setup, such as Openstack deployment, requires further adjustment.
|
Loading…
Reference in New Issue
Block a user