Browse Source

HPCC-25648 move ml directories to dockerfiles/

xwang2713 4 years ago
parent
commit
bf02af8ed5

+ 1 - 1
dockerfiles/buildall.sh

@@ -36,11 +36,11 @@ if [[ -n ${INPUT_USERNAME} ]] ; then
   PUSH=1
 fi
 
+BUILD_ML=    # all or ml,gnn,gnn-gpu
 [[ -n ${INPUT_BUILD_ML} ]] && BUILD_ML=${INPUT_BUILD_ML}
 
 set -e
 
-BUILD_ML=    # all or ml,gnn,gnn-gpu
 ml_features=(
   'ml'
   'gnn'

+ 0 - 53
dockerfiles/ml/README.md

@@ -1,53 +0,0 @@
-# HPCC Systems Machine Learning Docker Images
-
-## Current Machine Learning Features
-
-- ml:  Scikit-Learning
-- gnn:     Tensorflow 2 + Scikit-Learning
-- gnn-gpu: Tensorflow 2 with GPU support + Scikit-Learning
-
-## GNN and Tensorflow
-
-Current HPCC Systems GNN officially support Tensorflow version 1.x. But latest HPCC Systems Docker images are based on Ubuntu 20.04 and linked Python 3.8 libraries which doesn't support Tensorflow version 1.x.  To use Tensorflow 2 with GNN creating Tensorflow session as:
-
-```code
-import tensorflow as tf
-s = tf.compat.v1.Session()
-```
-
-## Tensorflow 2 with GPU support
-
-The new Tensorflow 2 and Nvidia Cuda libraries are not always compatible. It will be ideal if we can use Docker image by published by Tensorflow but the base image is Ubuntu 18.04 and we use Ubuntu 20.04. So instead we create the images by addiing Tensorflow 2 and Nvida Cuda, etc libraries on the top of hpccystems/platform-core image.
-
-When preparing the Dockerfile, specially for Tensorflow 2 with GPU support it is import to reference
-Tensorflow and Nvidia Cuda Dockerfiles and Docker images to pick compatible libabries.
-
-### Docker image and Dockerfile Reference
-
-#### Tensforflow
-
-- Dockerfile:
-  https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/dockerfiles/dockerfiles/gpu.Dockerfile
-- tensorflow/tensorflow:2.2.0-gpu
-   https://hub.docker.com/layers/tensorflow/tensorflow/2.2.0-gpu/images/sha256-3f8f06cdfbc09c54568f191bbc54419b348ecc08dc5e031a53c22c6bba0a252e?context=explore
-
-#### Nvidia Cuda
-
-- NVDA CUDA Dockerfile: https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/ubuntu18.04/10.1/base/Dockerfile
-- nvidia/cuda:10.1-base-ubuntu18.04:
-  https://hub.docker.com/layers/nvidia/cuda/10.1-base-ubuntu18.04/images/sha256-3cb86d1437161ef6998c4a681f2ca4150368946cc8e09c5e5178e3598110539f?context=explore
-
-## Build
-
-Make sure desired hpccsystems/platform-core Docker image is avaiable otherwise this need be build first with buildall.sh script.
-
-Go to ml images under <HPCC Platform>/dockerfiles/ml directory:
-
-```console
-./build -t <platform-core tag> -m <one of ml, gnn and gnn-gpu>
-```
-
-You can provide "-l" to build without version information as a default image.
-You need manually push the image to Docker repository such as Docker Hub.
-
-Machine Learning features can also be built with buildall.sh when environment variable BUILD_ML is defined. To build all set BUILD_ML=all. To build individual or subset set, for exampl, BUILD_ML=gnn or BUILD_ML="gnn gnn-gpu".

+ 0 - 87
dockerfiles/ml/build.sh

@@ -1,87 +0,0 @@
-#!/bin/bash
-##############################################################################
-#
-#    HPCC SYSTEMS software Copyright (C) 2020 HPCC Systems® .
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-##############################################################################
-
-# Use this script to build local images for Machine Learning HPCC Systems Docker images
-#
-
-usage()
-{
-  echo "Usage: build.sh [options]"
-  echo "    -h     Display help"
-  echo "    -l     Tag the images as the latest"
-  echo "    -m     ML feature: one of ml, gnn and gnn-gpu"
-  echo "    -t     Tag of base image hpccsystems/platform-core"
-  exit
-}
-LABEL=
-FEATURE=
-while getopts “hlm:t:” opt; do
-  case $opt in
-    l) TAGLATEST=1 ;;
-    m) FEATURE=$OPTARG ;;
-    t) LABEL=$OPTARG ;;
-    h) usage   ;;
-  esac
-done
-shift $(( $OPTIND-1 ))
-
-[[ -z ${FEATURE} ]] && usage
-
-ml_features=(
-  'ml'
-  'gnn'
-  'gnn-gpu'
-)
-
-found="false"
-for ml_feature in ${ml_features[@]}
-do
-  if [[ $ml_feature ==  $FEATURE ]]
-  then
-    found="true"
-    break
-  fi
-done
-
-if [[ "$found" == "false" ]]
-then
-	echo "Unknown ML feature $FEATURE"
-fi
-
-
-[[ -z ${LABEL} ]] && LABEL=latest
-
-
-
-build_image()
-{
-  name=$1
-  docker image build -t hpccsystems/platform-${name}:${LABEL} \
-     --build-arg DOCKER_REPO=hpccsystems \
-     --build-arg BUILD_LABEL=${LABEL} \
-     ${name}/
-
-  if [ "$TAGLATEST" = "1" ] && [ "${LABEL}" != "latest" ]; then
-     docker tag hpccsystems/platform-${name}:${LABEL}  hpccsystems/platform-${name}
-  fi
-
-}
-
-echo .
-echo "build_image $FEATURE"
-build_image $FEATURE

dockerfiles/ml/gnn-gpu/Dockerfile → dockerfiles/platform-gnn-gpu/Dockerfile


dockerfiles/ml/gnn/Dockerfile → dockerfiles/platform-gnn/Dockerfile


dockerfiles/ml/ml/Dockerfile → dockerfiles/platform-ml/Dockerfile