Commit 9a2b97f7 authored by Raphael Defosseux's avatar Raphael Defosseux
Browse files

Docker: optimization on the test images


Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@openairinterface.org>
parent 601324f4
......@@ -240,11 +240,18 @@ pipeline {
}
stage('Build Test Images') {
stages {
stage('Create Builder-Image') {
steps {
script {
BUILDER_SHA_ONE = myShRetCmd('docker image ls | head -3 | grep none | sed -e "s#> *<#><#" | sed -e "s#<none><none> *##" | cut -d " " -f 1', new_host_flag, new_host_user, new_host)
myShCmd('docker image tag' + BUILDER_SHA_ONE + ' oai-smf-builder-installed:latest', new_host_flag, new_host_user, new_host)
}
}
stage('Build Test AMF-server') {
steps {
script {
gitlabCommitStatus(name: "Build AMF-server") {
myShCmd('docker build --target test-amf-server --tag test-amf-server:test-deploy --file docker/test-images/Dockerfile.amf-server.ubuntu18.04 --build-arg NEEDED_PROXY="http://proxy.eurecom.fr:8080" . > archives/amf_server_docker_image_build.log 2>&1', new_host_flag, new_host_user, new_host)
myShCmd('docker build --target test-amf-server --tag test-amf-server:test-deploy --file docker/test-images/Dockerfile.amf-server.ubuntu18.04 . > archives/amf_server_docker_image_build.log 2>&1', new_host_flag, new_host_user, new_host)
myShCmd('docker image ls >> archives/amf_server_docker_image_build.log', new_host_flag, new_host_user, new_host)
}
}
......@@ -267,7 +274,7 @@ pipeline {
steps {
script {
gitlabCommitStatus(name: "Build UDM-server") {
myShCmd('docker build --target test-udm-server --tag test-udm-server:test-deploy --file docker/test-images/Dockerfile.udm-server.ubuntu18.04 --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > archives/udm_server_docker_image_build.log 2>&1', new_host_flag, new_host_user, new_host)
myShCmd('docker build --target test-udm-server --tag test-udm-server:test-deploy --file docker/test-images/Dockerfile.udm-server.ubuntu18.04 . > archives/udm_server_docker_image_build.log 2>&1', new_host_flag, new_host_user, new_host)
myShCmd('docker image ls >> archives/udm_server_docker_image_build.log', new_host_flag, new_host_user, new_host)
}
}
......@@ -290,7 +297,7 @@ pipeline {
steps {
script {
gitlabCommitStatus(name: "Build AMF-client") {
myShCmd('docker build --target test-amf-client --tag test-amf-client:test-deploy --file docker/test-images/Dockerfile.amf-client.ubuntu18.04 --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > archives/amf_client_docker_image_build.log 2>&1', new_host_flag, new_host_user, new_host)
myShCmd('docker build --target test-amf-client --tag test-amf-client:test-deploy --file docker/test-images/Dockerfile.amf-client.ubuntu18.04 . > archives/amf_client_docker_image_build.log 2>&1', new_host_flag, new_host_user, new_host)
myShCmd('docker image ls >> archives/amf_client_docker_image_build.log', new_host_flag, new_host_user, new_host)
}
}
......@@ -529,7 +536,7 @@ pipeline {
echo "We failed to delete the OAI-SMF temp image"
}
try {
myShCmd('docker image rm --force test-amf-server:test-deploy test-udm-server:test-deploy test-amf-client:test-deploy', new_host_flag, new_host_user, new_host)
myShCmd('docker image rm --force oai-smf-builder-installed:latest test-amf-server:test-deploy test-udm-server:test-deploy test-amf-client:test-deploy', new_host_flag, new_host_user, new_host)
} catch (Exception e) {
echo "We failed to delete the test temp images"
}
......
......@@ -28,30 +28,9 @@
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as oai-smf-builder
FROM oai-smf-builder-installed:latest as oai-smf-builder
ARG NEEDED_GIT_PROXY
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
git \
&& rm -rf /var/lib/apt/lists/*
# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false
# Copying source code
WORKDIR /openair-smf
COPY . /openair-smf
# Installing and Building SMF
WORKDIR /openair-smf/build/scripts
RUN ./build_smf --install-deps --force
# Building AMF-Client
WORKDIR /openair-smf/src/test/amf_client
RUN mkdir build && cd build && cmake .. && make
......
......@@ -28,29 +28,9 @@
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as oai-smf-builder
FROM oai-smf-builder-installed:latest as oai-smf-builder
ARG NEEDED_GIT_PROXY
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
git \
&& rm -rf /var/lib/apt/lists/*
# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false
# Copying source code
WORKDIR /openair-smf
COPY . /openair-smf
# Installing and Building SMF
WORKDIR /openair-smf/build/scripts
# Building AMF-Server
RUN ./build_smf --install-deps --force
WORKDIR /openair-smf/src/test/amf
RUN mkdir build && cd build && cmake .. && make
......
......@@ -28,30 +28,9 @@
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as oai-smf-builder
FROM oai-smf-builder-installed:latest as oai-smf-builder
ARG NEEDED_GIT_PROXY
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
git \
&& rm -rf /var/lib/apt/lists/*
# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false
# Copying source code
WORKDIR /openair-smf
COPY . /openair-smf
# Installing and Building SMF
WORKDIR /openair-smf/build/scripts
RUN ./build_smf --install-deps --force
# Building UDM-server
WORKDIR /openair-smf/src/test/udm
RUN mkdir build && cd build && cmake .. && make
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment