Skip to content

Commit ba570ae

Browse files
committed
remove build from source feature
it's obsolete and doesn't work Change-Id: I5a1bd3892c6740c552eb449382f8b50b6f4af7a9
1 parent c65fb63 commit ba570ae

File tree

138 files changed

+1
-1613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+1
-1613
lines changed

containers/analytics/base/Dockerfile.build_from_source

-7
This file was deleted.

containers/analytics/base/build_src/.copy_files

-2
This file was deleted.

containers/analytics/base/build_src/.deps

-36
This file was deleted.

containers/analytics/base/build_src/.docs

Whitespace-only changes.

containers/analytics/base/build_src/.src

-4
This file was deleted.

containers/base/Dockerfile

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ RUN BASE_EXTRA_RPMS=$(echo $BASE_EXTRA_RPMS | tr -d '"' | tr ',' ' ') && \
2424
fi && \
2525
wget -nv -c --tries=3 -O /tmp/get-pip.py https://bootstrap.pypa.io/2.7/get-pip.py && \
2626
python2 /tmp/get-pip.py 'pip==20.1' && \
27-
if [[ -z "$CONTRAIL_BUILD_FROM_SOURCE" ]] ; then \
28-
yum install -y contrail-lib contrail-setup contrail-utils python-contrail ; \
29-
fi && \
30-
yum install -y python3 && \
27+
yum install -y contrail-lib contrail-setup contrail-utils python-contrail python3 && \
3128
python3 -m pip install --no-compile "future==0.18.2" "six==1.13.0" && \
3229
yum clean all -y && \
3330
rm -rf /var/cache/yum && \

containers/base/Dockerfile.build_from_source

-12
This file was deleted.

containers/base/build_src/.copy_files

-4
This file was deleted.

containers/base/build_src/.copy_folders

-7
This file was deleted.

containers/base/build_src/.deps

-54
This file was deleted.

containers/base/build_src/.pip2

Whitespace-only changes.

containers/base/build_src/.pip3

-2
This file was deleted.

containers/base/build_src/.src

-5
This file was deleted.

containers/base/post_setup.sh

-13
This file was deleted.

containers/base/pre_setup.sh

-8
This file was deleted.

containers/build.sh

-56
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ function append_log_file() {
3737
}
3838

3939
log "Target platform: $LINUX_DISTR:$LINUX_DISTR_VER"
40-
[[ "${CONTRAIL_BUILD_FROM_SOURCE}" == 'true' ]] && log "Contrail source root: $CONTRAIL_SOURCE"
4140
log "Contrail container tag: $CONTRAIL_CONTAINER_TAG"
4241
log "Contrail registry: $CONTRAIL_REGISTRY"
4342
log "Contrail repository: $CONTRAIL_REPOSITORY"
@@ -87,11 +86,6 @@ function process_container() {
8786
log "Building $container_name" | append_log_file $logfile true
8887

8988
local build_arg_opts='--network host'
90-
if [[ "${CONTRAIL_BUILD_FROM_SOURCE}" == 'true' ]] ; then
91-
if [[ -e "${docker_file}.build_from_source" ]] ; then
92-
docker_file="${docker_file}.build_from_source"
93-
fi
94-
fi
9589
if [[ "$docker_ver" < '17.06' ]] ; then
9690
# old docker can't use ARG-s before FROM:
9791
# comment all ARG-s before FROM
@@ -116,9 +110,6 @@ function process_container() {
116110
build_arg_opts+=" --build-arg UBUNTU_DISTR=${UBUNTU_DISTR}"
117111
build_arg_opts+=" --build-arg VENDOR_NAME=${VENDOR_NAME}"
118112
build_arg_opts+=" --build-arg VENDOR_DOMAIN=${VENDOR_DOMAIN}"
119-
if [[ "${CONTRAIL_BUILD_FROM_SOURCE}" == 'true' ]] ; then
120-
build_arg_opts+=" --build-arg CONTRAIL_BUILD_FROM_SOURCE=${CONTRAIL_BUILD_FROM_SOURCE}"
121-
fi
122113

123114
if [[ -f ./$dir/.externals ]]; then
124115
local item=''
@@ -143,57 +134,10 @@ function process_container() {
143134
local duration=$(date +"%s")
144135
(( duration -= start_time ))
145136
log "Docker build duration: $duration seconds" | append_log_file $logfile
146-
local relative_build_src_path=${dir}/build_src
147-
if [[ ${exit_code} -eq 0 && "${CONTRAIL_BUILD_FROM_SOURCE}" == 'true' && -e "${relative_build_src_path}" ]] ; then
148-
local rel_build_src_path="contrail-container-builder/containers/${dir##./}/build_src"
149-
# Setup from source
150-
# RHEL has old docker that does not support neither staged build nor mount option
151-
# 'RUN --mount' (still experimental at the moment of writing this comment).
152-
# So, there is WA: previously build image is empty w/o RPMs but with all
153-
# other stuff required, so, now the final step to run a intermediate container,
154-
# install components inside and commit is as the final image.
155-
log "Rel build src path is ${rel_build_src_path}" | append_log_file $logfile
156-
local cmd=$(sudo docker inspect -f "{{json .Config.Cmd }}" ${target_name} )
157-
local entrypoint=$(sudo docker inspect -f "{{json .Config.Entrypoint }}" ${target_name} )
158-
local intermediate_base="${container_name}-src"
159-
local run_arguments="--name $intermediate_base --network host "
160-
if [[ $container_name == "contrail-base" || $container_name == "contrail-controller-webui-base" ]] ; then
161-
run_arguments+=" -e "BASE_EXTRA_RPMS=${BASE_EXTRA_RPMS}""
162-
fi
163-
if [[ $container_name == "contrail-general-base" ]] ; then
164-
run_arguments+=" -e "GENERAL_EXTRA_RPMS=${GENERAL_EXTRA_RPMS}""
165-
run_arguments+=" -e "YUM_ENABLE_REPOS=$YUM_ENABLE_REPOS""
166-
fi
167-
run_arguments+=" -e "CONTRAIL_SOURCE=/root/contrail" -e "CONTAINER_SOURCE_DATA_PATH=$rel_build_src_path" -e "LINUX_DISTR=${LINUX_DISTR}" -v ${CONTRAIL_SOURCE}:/root/contrail:z --entrypoint /root/contrail/contrail-container-builder/containers/build_from_src.sh ${target_name}"
168-
log "Run command is \"Docker run ${run_arguments}\"" | append_log_file $logfile
169-
sudo docker run ${run_arguments} 2>&1 | append_log_file $logfile
170-
exit_code=${PIPESTATUS[0]}
171-
if [ ${exit_code} -eq 0 ]; then
172-
if [[ "${cmd}" == 'null' ]]; then
173-
sudo docker commit --change "ENTRYPOINT ${entrypoint}" \
174-
${intermediate_base} ${intermediate_base} 2>&1 | append_log_file $logfile
175-
exit_code=${PIPESTATUS[0]}
176-
else
177-
sudo docker commit --change "CMD ${cmd}" \
178-
--change "ENTRYPOINT ${entrypoint}" \
179-
${intermediate_base} ${intermediate_base} 2>&1 | append_log_file $logfile
180-
exit_code=${PIPESTATUS[0]}
181-
fi
182-
# retag containers
183-
[ ${exit_code} -eq 0 ] && sudo docker tag $intermediate_base ${target_name} || exit_code=1
184-
fi
185-
local duration_src=$(date +"%s")
186-
(( duration_src -= duration ))
187-
log "Docker build from source duration: $duration_src seconds" | append_log_file $logfile
188-
fi
189137
if [ $exit_code -eq 0 -a ${CONTRAIL_REGISTRY_PUSH} -eq 1 ]; then
190138
sudo docker push $target_name 2>&1 | append_log_file $logfile
191139
exit_code=${PIPESTATUS[0]}
192140
fi
193-
if [[ -n "${intermediate_base}" && "${CONTRAIL_BUILD_FROM_SOURCE}" == 'true' ]] ; then
194-
log "Remove ${intermediate_base} temp build container" | append_log_file $logfile
195-
sudo docker rm -f ${intermediate_base} || true 2>&1 | append_log_file $logfile
196-
fi
197141
duration=$(date +"%s")
198142
(( duration -= start_time ))
199143
if [ ${exit_code} -eq 0 ]; then

0 commit comments

Comments
 (0)