Merge "Create elastic-recheck container image"
This commit is contained in:
commit
0b3f6478ef
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.tox
|
||||||
|
.testrepository
|
13
.zuul.yaml
13
.zuul.yaml
@ -7,11 +7,13 @@
|
|||||||
- publish-tox-docs-infra
|
- publish-tox-docs-infra
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
|
- elastic-recheck-container
|
||||||
- elastic-recheck-tox-queries:
|
- elastic-recheck-tox-queries:
|
||||||
voting: false
|
voting: false
|
||||||
- openstack-tox-linters
|
- openstack-tox-linters
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
|
- elastic-recheck-container
|
||||||
- openstack-tox-linters
|
- openstack-tox-linters
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
@ -23,3 +25,14 @@
|
|||||||
Uses tox with the ``queries`` environment.
|
Uses tox with the ``queries`` environment.
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: queries
|
tox_envlist: queries
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: elastic-recheck-container
|
||||||
|
parent: opendev-build-docker-image
|
||||||
|
description: Build container images for elastic-recheck service
|
||||||
|
vars:
|
||||||
|
zuul_work_dir: src/opendev.org/opendev/elastic-recheck
|
||||||
|
docker_images:
|
||||||
|
- context: .
|
||||||
|
repository: opendevorg/elastic-recheck
|
||||||
|
target: elastic-recheck
|
||||||
|
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# syntax=docker/dockerfile:experimental
|
||||||
|
FROM opendevorg/python-builder:3.7 as elastic-recheck-builder
|
||||||
|
|
||||||
|
COPY . /tmp/src
|
||||||
|
RUN assemble
|
||||||
|
|
||||||
|
FROM opendevorg/python-base:3.7 as elastic-recheck
|
||||||
|
|
||||||
|
COPY --from=elastic-recheck-builder /output/ /output
|
||||||
|
RUN /output/install-from-bindep && \
|
||||||
|
rm -rf /output
|
||||||
|
COPY data/ /data/
|
||||||
|
COPY queries/ /opt/elastic-recheck/queries
|
||||||
|
|
||||||
|
# using root allows us to use same relative paths in configs for running outside
|
||||||
|
# containers, where ./data contains persistent configs and logs.
|
||||||
|
WORKDIR /
|
||||||
|
CMD /usr/local/bin/elastic-recheck -f data/elastic-recheck.conf ${ER_OPTS:-}
|
47
Makefile
Normal file
47
Makefile
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
.EXPORT_ALL_VARIABLES:
|
||||||
|
|
||||||
|
PYTHON ?= $(shell command -v python3 python|head -n1)
|
||||||
|
# Keep docker before podman due to:
|
||||||
|
# https://github.com/containers/podman/issues/7602
|
||||||
|
ENGINE ?= $(shell command -v docker podman|head -n1)
|
||||||
|
# localhost/ prefix must be present in order to assure docker/podman compatibility:
|
||||||
|
# https://github.com/containers/buildah/issues/1034
|
||||||
|
IMAGE_TAG=localhost/elastic-recheck
|
||||||
|
# Enable newer docker buildkit if available
|
||||||
|
DOCKER_BUILDKIT=1
|
||||||
|
|
||||||
|
.PHONY: default
|
||||||
|
default: help
|
||||||
|
|
||||||
|
define PRINT_HELP_PYSCRIPT
|
||||||
|
import re, sys
|
||||||
|
|
||||||
|
print("Usage: make <target>\n")
|
||||||
|
cmds = {}
|
||||||
|
for line in sys.stdin:
|
||||||
|
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
|
||||||
|
if match:
|
||||||
|
target, help = match.groups()
|
||||||
|
cmds.update({target: help})
|
||||||
|
for cmd in sorted(cmds):
|
||||||
|
print(f" {cmd:12} {cmds[cmd]}")
|
||||||
|
endef
|
||||||
|
export PRINT_HELP_PYSCRIPT
|
||||||
|
|
||||||
|
.PHONY: help
|
||||||
|
help:
|
||||||
|
@$(PYTHON) -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
build: ## Build image using docker
|
||||||
|
$(ENGINE) build -t $(IMAGE_TAG) .
|
||||||
|
@echo "Image size: $$(docker image inspect --format='scale=0; {{.Size}}/1024/1024' $(IMAGE_TAG) | bc)MB"
|
||||||
|
|
||||||
|
.PHONY: into
|
||||||
|
into: ## Starts bash inside docker image
|
||||||
|
$(ENGINE) run -it $(IMAGE_TAG) /bin/bash
|
||||||
|
|
||||||
|
.PHONY: dive
|
||||||
|
dive: ## Use `dive` tool to investigate container size
|
||||||
|
# https://github.com/wagoodman/dive
|
||||||
|
dive $(IMAGE_TAG)
|
@ -237,6 +237,12 @@ Notes
|
|||||||
generated files you will need to host a Kibana3 with that dashboard.
|
generated files you will need to host a Kibana3 with that dashboard.
|
||||||
* View the OpenStack ElasticSearch `cluster health here`_.
|
* View the OpenStack ElasticSearch `cluster health here`_.
|
||||||
|
|
||||||
|
Development
|
||||||
|
-----------
|
||||||
|
|
||||||
|
In addition to using ``tox`` you can also run ``make`` in order
|
||||||
|
to list current container build and testing commands.
|
||||||
|
|
||||||
Future Work
|
Future Work
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
21
bindep.txt
21
bindep.txt
@ -1,15 +1,18 @@
|
|||||||
# This is a cross-platform list tracking distribution packages needed by tests;
|
# This is a cross-platform list tracking distribution packages needed by tests;
|
||||||
# see http://docs.openstack.org/infra/bindep/ for additional information.
|
# see http://docs.openstack.org/infra/bindep/ for additional information.
|
||||||
|
|
||||||
dbus-devel [platform:rpm]
|
dbus-devel [platform:rpm test compile]
|
||||||
dbus-glib-devel [platform:rpm]
|
dbus-glib-devel [platform:rpm test compile]
|
||||||
|
build-essential [test compile]
|
||||||
|
gcc [test compile]
|
||||||
|
g++ [test compile]
|
||||||
language-pack-en [platform:ubuntu]
|
language-pack-en [platform:ubuntu]
|
||||||
libffi-dev [platform:dpkg]
|
libffi-dev [platform:dpkg test compile]
|
||||||
libffi-devel [platform:rpm]
|
libffi-devel [platform:rpm test compile]
|
||||||
# e-r->launchpadlib->keyring->secretstorage->cryptography->ssl
|
# e-r->launchpadlib->keyring->secretstorage->cryptography->ssl
|
||||||
libssl-dev [platform:dpkg]
|
libssl-dev [platform:dpkg test compile]
|
||||||
openssl-devel [platform:rpm !platform:suse]
|
openssl-devel [platform:rpm !platform:suse test compile]
|
||||||
libopenssl-devel [platform:suse !platform:rpm]
|
libopenssl-devel [platform:suse !platform:rpm test compile]
|
||||||
locales [platform:debian]
|
locales [platform:debian]
|
||||||
python3-dev [platform:dpkg]
|
python3-dev [platform:dpkg test compile]
|
||||||
python3-devel [platform:rpm]
|
python3-devel [platform:rpm test compile]
|
||||||
|
0
data/.gitignore
vendored
Normal file
0
data/.gitignore
vendored
Normal file
Loading…
x
Reference in New Issue
Block a user