Remove building of intel image during install and build extension during startup.

pull/1066/head
Branton Davis 2021-10-06 18:58:05 -05:00
rodzic 6530cd7d1a
commit e9fc57dc17
6 zmienionych plików z 25 dodań i 61 usunięć

Wyświetl plik

@ -10,7 +10,7 @@ services:
environment:
- WO_DEFAULT_NODES
node-odm:
image: opendronemap/nodeodm:gpu.intel
image: opendronemap/nodeodm:gpu.intel.local
devices:
- "/dev/dri"
ports:

Wyświetl plik

@ -11,12 +11,10 @@ WEBODM_DPKG_NAME="webodm_${WEBODM_VERSION}-${WEBODM_DPKG_VERSION}"
BUILD_DIR="${HERE}/build"
DEB_DIR="${HERE}/deb"
WEBODM_DIR="${HERE}/${WEBODM_DPKG_NAME}/opt/WebODM"
NODEODM_DIR="${HERE}/${WEBODM_DPKG_NAME}/opt/NodeODM"
function build() {
prepareBuildDir
prepareDebDir
prepareNodeODMDir
prepareWebODMDir
moveToBuildDir
buildDeb
@ -55,11 +53,6 @@ function prepareDebDir() {
mkdir -p "${DEB_DIR}"
}
function prepareNodeODMDir() {
# This can go away when we can pull the image from Docker Hub.
git clone https://github.com/OpenDroneMap/NodeODM.git "${BUILD_DIR}/${WEBODM_DPKG_NAME}/${WEBODM_DPKG_NAME}/opt/NodeODM"
}
function prepareWebODMDir() {
TMP_DIR="/tmp/WebODM"
if [ -d "${BUILD_DIR}" ]; then

Wyświetl plik

@ -7,46 +7,15 @@ export WEBODM_USER=odm
export WEBODM_USER_HOME="/home/${WEBODM_USER}"
export WEBODM_DIR=/opt/WebODM
export WEBODM_VENV_DIR="${WEBODM_DIR}/python3-venv"
export NODEODM_DIR=/opt/NodeODM
function abortRemove() {
echo "Unable to remove webodm."
}
function addNodeODMGPUIntelDockerGroups() {
DOCKER_COMPOSE_FILE="${WEBODM_DIR}/docker-compose.nodeodm.gpu.intel.yml"
for gid in $(id -G "${WEBODM_USER}"); do
SED_SEARCH="/^\s\{4\}group_add/{:start /${gid}$/!"
SED_SEARCH="${SED_SEARCH}{N;b start};/${gid}$/p}"
SED_OUT=$(sed -n "${SED_SEARCH}" "${DOCKER_COMPOSE_FILE}")
if [ -z "${SED_OUT}" ]; then
sed -i "/^\s\{4\}image/a \ \ \ \ group_add:\n\ \ \ \ \ \ - ${gid}" "${DOCKER_COMPOSE_FILE}"
fi
done
}
function buildNodeODMGPUIntelDockerImage() {
cd "${NODEODM_DIR}"
# We won't have to do this after the image is on Docker Hub.
docker build -f Dockerfile.gpu -t opendronemap/nodeodm:gpu .
# This will continue to be necessary, since it needs to bake in the actual
# render group id on this system.
RENDER_GROUP_ID=$(getent group render | cut -d":" -f3)
docker build -f Dockerfile.gpu.intel -t opendronemap/nodeodm:gpu.intel --build-arg RENDER_GROUP_ID="${RENDER_GROUP_ID}" .
}
function configure() {
detectGPUs
createGroup
createUser
if [ "${GPU_INTEL}" = true ]; then
buildNodeODMGPUIntelDockerImage
addNodeODMGPUIntelDockerGroups
fi
createVenv
setFilePermissions
upgradePythonPip

Wyświetl plik

@ -7,7 +7,6 @@ export WEBODM_USER=odm
export WEBODM_USER_HOME="/home/${WEBODM_USER}"
export WEBODM_DIR=/opt/WebODM
export WEBODM_VENV_DIR="${WEBODM_DIR}/python3-venv"
export NODEODM_DIR=/opt/NodeODM
function abortInstall() {
purge

Wyświetl plik

@ -7,7 +7,6 @@ export WEBODM_USER=odm
export WEBODM_USER_HOME="/home/${WEBODM_USER}"
export WEBODM_DIR=/opt/WebODM
export WEBODM_VENV_DIR="${WEBODM_DIR}/python3-venv"
export NODEODM_DIR=/opt/NodeODM
function remove() {
stopService

Wyświetl plik

@ -43,6 +43,30 @@ while [[ $# -gt 0 ]]
do
key="$1"
detect_gpus(){
export GPU_AMD=false
export GPU_INTEL=false
export GPU_NVIDIA=false
if [ "${platform}" = "Linux" ]; then
source "${__dirname}/detect_gpus.sh"
set +ux
fi
}
prepare_intel_gpu_image(){
if [ "${GPU_INTEL}" = true ]; then
# curl -O https://raw.githubusercontent.com/OpenDroneMap/NodeODM/master/Dockerfile.gpu.intel
curl -O https://raw.githubusercontent.com/airmap/NodeODM/bkd/gpu-intel-workflow/Dockerfile.gpu.intel.local
RENDER_GROUP_ID=$(getent group render | cut -d":" -f3)
docker build -f Dockerfile.gpu.intel.local -t opendronemap/nodeodm:gpu.intel.local --build-arg RENDER_GROUP_ID="${RENDER_GROUP_ID}" .
rm Dockerfile.gpu.intel
fi
}
detect_gpus
prepare_intel_gpu_image
case $key in
--port)
export WO_PORT="$2"
@ -220,11 +244,6 @@ start(){
command="docker-compose -f docker-compose.yml"
if [[ $default_nodes > 0 ]]; then
if [ "${platform}" = "Linux" ]; then
source "${__dirname}/detect_gpus.sh"
set +ux
fi
if [ "${GPU_NVIDIA}" = true ]; then
command+=" -f docker-compose.nodeodm.gpu.nvidia.yml"
elif [ "${GPU_INTEL}" = true ]; then
@ -294,11 +313,6 @@ start(){
}
down(){
if [ "${platform}" = "Linux" ]; then
source "${__dirname}/detect_gpus.sh"
set +ux
fi
command="docker-compose -f docker-compose.yml"
if [ "${GPU_NVIDIA}" = true ]; then
@ -369,11 +383,6 @@ elif [[ $1 = "stop" ]]; then
environment_check
echo "Stopping WebODM..."
if [ "${platform}" = "Linux" ]; then
source "${__dirname}/detect_gpus.sh"
set +ux
fi
command="docker-compose -f docker-compose.yml"
if [ "${GPU_NVIDIA}" = true ]; then
@ -417,11 +426,6 @@ elif [[ $1 = "update" ]]; then
command="docker-compose -f docker-compose.yml"
if [[ $default_nodes > 0 ]]; then
if [ "${platform}" = "Linux" ]; then
source "${__dirname}/detect_gpus.sh"
set +ux
fi
if [ "${GPU_NVIDIA}" = true ]; then
command+=" -f docker-compose.nodeodm.gpu.nvidia.yml"
elif [ "${GPU_INTEL}" = true ]; then