build_docker_image.sh #1

  • //
  • guest/
  • perforce_software/
  • sdp/
  • dev/
  • test/
  • build_docker_image.sh
  • View
  • Commits
  • Open Download .zip Download (1 KB)
#!/bin/bash
# Build the Docker containers for the SDP
# Goes together with run_docker_tests.sh
# This is provided as a useful tool for testing!
#
# Note that this file is expecting to be mapped into the root of the workspace
# and with the sdp directory in the same root.
# So workspace view should look something like:
#    View:
#        //guest/perforce_software/sdp/main/... //myws.sdp/sdp/...
#        //guest/perforce_software/sdp/main/test/* //myws.sdp/*

oses=""

# Allow the specific platform to be specified via parameter
if [ ,"$1" = ,"ubuntu" ] ; then
    oses="ubuntu"
elif [ ,"$1" = ,"centos" ] ; then
    oses="centos6"
elif [ ,"$1" = ,"centos6" ] ; then
    oses="centos6"
elif [ ,"$1" = ,"centos7" ] ; then
    oses="centos7"
else
    oses="ubuntu centos6 centos7"
    oses="centos6"  # Default override
fi

echo Building SDP docker containers
for os in $oses
do
    docker_dir=./docker
    dockerfile_base=${docker_dir}/Dockerfile.${os}.base
    dockerfile_sdp=${docker_dir}/Dockerfile.${os}.sdp
    # Build the base Docker for the OS, and then the SDP variant on top
    docker build --rm=true -t=perforce/${os}-base -f ${dockerfile_base} ${docker_dir}
    docker build --rm=true -t=perforce/${os}-sdp -f ${dockerfile_sdp} ${docker_dir}
done
# Change User Description Committed
#8 30845 Robert Cowham Base the podman/docker image on rocky9-ubi-init to get systemd
This supports systemd within the container if run under podman instead of docker
Remove centos7 docker files
#7 30356 C. Thomas Tyler Added Rocky 9 and Ubuntu 22 to test suite.

Dropped CentOS 6.

Changed default OS for tests from CentOS 7 to Rocky 9.

Adapted to using podman for the test suite.

Reduced minimum disk space requirement for testing
from 1G to 10M.

To be revisited:
* Disabled OOM killer defenese feature and systemd due to
compatibility issues with the test environment.
* Disabled systemd by moving systemctl aside

Enhanced build_docker_image.sh; added '-clean' option and added
support for more platforms.

Updated OS-specific packages as needed for all platforms, e.g.
adding 'file' and 'rsync' utils as needed in Docker definitions.

Added minimum performance recommendations for test containers in
config.

Updated env.sh utilities.

This change test on:
[X] centos7
[X] rocky8
[X] rocky9
[X] ubuntu20
[X] ubuntu22

#review-30357 @robert_cowham

TO DO:
* This builds using the official SDP test suite run manually on
Tom's laptop. Next step: Get it working on our shiny new Jenkins
Rocky 9 server machine.
#6 30295 Robert Cowham Fix tests to run under podman SDP-1106
#5 28850 C. Thomas Tyler Test suite tweaks:
* Added command line usage notes in scripts.
* Enhanced comand line processing.
* Added aliases for building on Rocky Linux 8.

#review-28851
#4 28137 C. Thomas Tyler Added Rocky Linux 8 test image.

Added 'all' argument to build on all OSes except unsupported ones (
e.g. CentOS 6).

Added 'ALL' argument to build on all OSes, including unsupported ones.
#3 27002 C. Thomas Tyler Updated ubuntu tests to add needed utilities, and change from
testing Ubuntu 16.04 to 20.04.  Changed 'centos' to imply cento7
rather than centos6 (which we shoud drop soon).
#2 25153 Robert Cowham Change scripts to be able to be run from workspace root
sdp/test/run_docker_tests.sh

So no longer requires funny mapping in workspace view (see README.md for view)
#1 25150 Robert Cowham Utiltiy script to help build docker images
//guest/robert_cowham/perforce/sdp/test/build_docker_image.sh
#5 25116 Robert Cowham Docker compose tests starting to get there...
#4 23433 Robert Cowham Got it working with basic ssh stuff if sshd run manually on a box
#3 22485 Robert Cowham Update python to 3.5
Refactor tests to simplify workspace (no mapping into root), and to allow easy setup
#2 20827 Robert Cowham Default to centos6 for nowç
#1 20813 Robert Cowham Using docker-compose