content: # Options:
  #   tensorflow
  #   tensorflow-gpu
  #   tf-nightly
  #   tf-nightly-gpu
  ARG TF_PACKAGE=tensorflow
  RUN apt-get update && apt-get install -y curl libhdf5-dev wget
  RUN python3 -m pip install --no-cache-dir --global-option=build_ext \
              --global-option=-I/usr/include/hdf5/serial/ \
              --global-option=-L/usr/lib/powerpc64le-linux-gnu/hdf5/serial \
              h5py
  
  # CACHE_STOP is used to rerun future commands, otherwise downloading the .whl will be cached and will not pull the most recent version
  ARG CACHE_STOP=1
  RUN if [ ${TF_PACKAGE} = tensorflow-gpu ]; then \
          BASE=https://powerci.osuosl.org/job/TensorFlow_PPC64LE_GPU_Release_Build/lastSuccessfulBuild/; \
      elif [ ${TF_PACKAGE} = tf-nightly-gpu ]; then \
          BASE=https://powerci.osuosl.org/job/TensorFlow_PPC64LE_GPU_Nightly_Artifact/lastSuccessfulBuild/; \
      elif [ ${TF_PACKAGE} = tensorflow ]; then \
          BASE=https://powerci.osuosl.org/job/TensorFlow_PPC64LE_CPU_Release_Build/lastSuccessfulBuild/; \
      elif [ ${TF_PACKAGE} = tf-nightly ]; then \
          BASE=https://powerci.osuosl.org/job/TensorFlow_PPC64LE_CPU_Nightly_Artifact/lastSuccessfulBuild/; \
      fi; \
      MAJOR=`python3 -c 'import sys; print(sys.version_info[0])'`; \
      MINOR=`python3 -c 'import sys; print(sys.version_info[1])'`; \
      PACKAGE=$(wget -qO- ${BASE}"api/xml?xpath=//fileName&wrapper=artifacts" | grep -o "[^<>]*cp${MAJOR}${MINOR}[^<>]*.whl"); \
      wget ${BASE}"artifact/tensorflow_pkg/"${PACKAGE}; \
      python3 -m pip install --no-cache-dir ${PACKAGE}
  