Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Oracle support on Metricbeat Docker images #12890

Merged
merged 17 commits into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion dev-tools/mage/integtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,15 @@ func dockerComposeBuildImages() error {
return err
}

args := []string{"-p", dockerComposeProjectName(), "build", "--pull", "--force-rm"}
args := []string{"-p", dockerComposeProjectName(), "build", "--force-rm"}
if _, noCache := os.LookupEnv("DOCKER_NOCACHE"); noCache {
args = append(args, "--no-cache")
}

if _, forcePull := os.LookupEnv("DOCKER_PULL"); forcePull {
args = append(args, "--pull")
}
jsoriano marked this conversation as resolved.
Show resolved Hide resolved

out := ioutil.Discard
if mg.Verbose() {
out = os.Stderr
Expand Down
7 changes: 6 additions & 1 deletion libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ COMMIT_ID=$(shell git rev-parse HEAD)
DOCKER_COMPOSE_PROJECT_NAME?=${BEAT_NAME}${TESTING_ENVIRONMENT//-}${BEAT_VERSION//-}${COMMIT_ID} ## @testing The name of the docker-compose project used by the integration and system tests
DOCKER_COMPOSE?=TESTING_ENVIRONMENT=${TESTING_ENVIRONMENT} ES_BEATS=${ES_BEATS} docker-compose -p ${DOCKER_COMPOSE_PROJECT_NAME} -f docker-compose.yml
DOCKER_CACHE?=1 ## @miscellaneous If set to 0, all docker images are created without cache
DOCKER_PULL?=1 ## @miscellaneous If set to 0, disable the force pull on docker-compose build
GOPACKAGES_COMMA_SEP=$(subst $(space),$(comma),$(strip ${GOPACKAGES}))
PYTHON_EXE?=python3
PYTHON_ENV?=${BUILD_DIR}/python-env
Expand All @@ -115,6 +116,10 @@ ifeq ($(DOCKER_CACHE),0)
DOCKER_NOCACHE=--no-cache
endif

ifeq ($(DOCKER_PULL),1)
DOCKER_FORCE_PULL=--pull
endif

# Conditionally enable the race detector when RACE_DETECTOR=1.
ifeq ($(RACE_DETECTOR),1)
RACE=-race
Expand Down Expand Up @@ -404,7 +409,7 @@ $(.OVER)import-dashboards: update ${BEAT_NAME}
# Builds the environment to test beat
.PHONY: build-image
build-image: write-environment
${DOCKER_COMPOSE} build ${DOCKER_NOCACHE} --pull --force-rm
${DOCKER_COMPOSE} build ${DOCKER_NOCACHE} ${DOCKER_FORCE_PULL} --force-rm

# Runs the environment so the redis and elasticsearch can also be used for local development
# To use it for running the test, set ES_HOST and REDIS_HOST environment variable to the ip of your docker-machine.
Expand Down
15 changes: 13 additions & 2 deletions metricbeat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM golang:1.13.8

RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
apt update \
&& apt install -qq -y --no-install-recommends \
netcat \
python3 \
python3-pip \
python3-venv \
libaio-dev \
unzip \
&& rm -rf /var/lib/apt/lists/*

ENV PYTHON_ENV=/tmp/python-env
Expand All @@ -15,5 +17,14 @@ RUN pip3 install --upgrade pip
RUN pip3 install --upgrade setuptools
RUN pip3 install --upgrade docker-compose==1.23.2

# Oracle instant client
RUN cd /usr/lib \
&& curl -sLo instantclient-basic-linux.zip https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip \
&& unzip instantclient-basic-linux.zip \
&& rm instantclient-basic-linux.zip
ENV LD_LIBRARY_PATH=/usr/lib/instantclient_19_6
jsoriano marked this conversation as resolved.
Show resolved Hide resolved

ENV PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/oracle/12.2/client64/bin

# Add healthcheck for the docker/healthcheck metricset to check during testing.
HEALTHCHECK CMD exit 0