Disable the section for using tensorflow/python/keras/api, which has been removed.

The auto complete part should be picked up from the keras package itself.

PiperOrigin-RevId: 402908939
Change-Id: I804c175db9a5bbd26cc6578ed9ed4ef9db519a0f

#!/usr/bin/env bash
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# 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.
# ==============================================================================

set -e

function is_absolute {
  [[ "$1" = /* ]] || [[ "$1" =~ ^[a-zA-Z]:[/\\].* ]]
}

function real_path() {
  is_absolute "$1" && echo "$1" || echo "$PWD/${1#./}"
}

function cp_external() {
  local src_dir=$1
  local dest_dir=$2

  pushd .
  cd "$src_dir"
  for f in `find . ! -type d ! -name '*.py' ! -path '*local_config_cuda*' ! -path '*local_config_tensorrt*' ! -path '*local_config_syslibs*' ! -path '*org_tensorflow*' ! -path '*llvm-project/llvm/*'`; do
    mkdir -p "${dest_dir}/$(dirname ${f})"
    cp "${f}" "${dest_dir}/$(dirname ${f})/"
  done
  popd

  mkdir -p "${dest_dir}/local_config_cuda/cuda/cuda/"
  cp "${src_dir}/local_config_cuda/cuda/cuda/cuda_config.h" "${dest_dir}/local_config_cuda/cuda/cuda/"
}

function copy_xla_aot_runtime_sources() {
  local src_dir=$1
  local dst_dir=$2

  local srcs_txt="tensorflow/tools/pip_package/xla_compiled_cpu_runtime_srcs.txt"

  if [ ! -f "${src_dir}/${srcs_txt}" ]; then
    echo Could not find source list file "${src_dir}/${srcs_txt}". 1>&2
    return 0
  fi

  pushd $src_dir
  for file in $(cat "${srcs_txt}")
  do
    # Sometimes $file has a prefix bazel-out/host/ we want to remove.
    prefix=${file%%tensorflow/*}  # Find the location of "tensorflow/*"
    candidate_file=${file#$prefix}  # Remove the prefix
    if [ ! -z "$candidate_file" ]; then
      file=$candidate_file
    fi
    dn=$(dirname $file)
    if test -f "$file"; then
      mkdir -p "${dst_dir}/${dn}"
      cp $file "${dst_dir}/${file}"
    else
      echo "Missing xla source file: ${file}" 1>&2
    fi
  done
  cp tensorflow/tools/pip_package/xla_build/CMakeLists.txt "${dst_dir}"
  popd
}

function move_to_root_if_exists () {
  arg_to_move="$1"
  if [ -e "${arg_to_move}" ]; then
    mv ${arg_to_move} ./
  fi
}

function reorganize_includes() {
  TMPDIR="${1%/}"
  pushd "${TMPDIR}/tensorflow/include/"

  move_to_root_if_exists external/com_google_absl/absl

  move_to_root_if_exists external/eigen_archive/Eigen
  move_to_root_if_exists external/eigen_archive/unsupported

  move_to_root_if_exists external/jsoncpp_git/include
  rm -rf external/jsoncpp_git

  move_to_root_if_exists external/com_google_protobuf/src/google
  rm -rf external/com_google_protobuf/python

  popd
}

PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"
function is_windows() {
  if [[ "${PLATFORM}" =~ (cygwin|mingw32|mingw64|msys)_nt* ]]; then
    true
  else
    false
  fi
}

function prepare_src() {
  if [ $# -lt 1 ] ; then
    echo "No destination dir provided"
    exit 1
  fi

  TMPDIR="${1%/}"
  mkdir -p "$TMPDIR"
  EXTERNAL_INCLUDES="${TMPDIR}/tensorflow/include/external"
  XLA_AOT_RUNTIME_SOURCES="${TMPDIR}/tensorflow/xla_aot_runtime_src"

  echo $(date) : "=== Preparing sources in dir: ${TMPDIR}"

  if [ ! -d bazel-bin/tensorflow ]; then
    echo "Could not find bazel-bin.  Did you run from the root of the build tree?"
    exit 1
  fi

  if is_windows; then
    rm -rf ./bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip
    mkdir -p ./bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip
    echo "Unzipping simple_console_for_windows.zip to create runfiles tree..."
    unzip -o -q ./bazel-bin/tensorflow/tools/pip_package/simple_console_for_windows.zip -d ./bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip
    echo "Unzip finished."
    # runfiles structure after unzip the python binary
    cp -L \
      bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip/runfiles/org_tensorflow/LICENSE \
      "${TMPDIR}"
    cp -LR \
      bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip/runfiles/org_tensorflow/tensorflow \
      "${TMPDIR}"
    cp_external \
      bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip/runfiles \
      "${EXTERNAL_INCLUDES}/"
    copy_xla_aot_runtime_sources \
      bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip/runfiles/org_tensorflow \
      "${XLA_AOT_RUNTIME_SOURCES}/"
    RUNFILES=bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip/runfiles/org_tensorflow
    # If oneDNN was built with openMP then copy the omp libs over
    if [ -f "bazel-bin/external/llvm_openmp/libiomp5md.dll" ]; then
      cp bazel-bin/external/llvm_openmp/libiomp5md.dll ${TMPDIR}/tensorflow/python
      cp bazel-bin/external/llvm_openmp/libiomp5md.dll.if.lib ${TMPDIR}/tensorflow/python
    fi
  else
    RUNFILES=bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow
    if [ -d bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external ]; then
      # Old-style runfiles structure (--legacy_external_runfiles).
      cp -L \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/LICENSE \
        "${TMPDIR}"
      cp -LR \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/tensorflow \
        "${TMPDIR}"
      cp_external \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external \
        "${EXTERNAL_INCLUDES}"
      copy_xla_aot_runtime_sources \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow \
        "${XLA_AOT_RUNTIME_SOURCES}"
      # Copy MKL libs over so they can be loaded at runtime
      so_lib_dir=$(ls $RUNFILES | grep solib) || true
      if [ -n "${so_lib_dir}" ]; then
        mkl_so_dir=$(ls ${RUNFILES}/${so_lib_dir} | grep mkl) || true
        if [ -n "${mkl_so_dir}" ]; then
          mkdir "${TMPDIR}/${so_lib_dir}"
          cp -R ${RUNFILES}/${so_lib_dir}/${mkl_so_dir} "${TMPDIR}/${so_lib_dir}"
        fi
      fi
    else
      # New-style runfiles structure (--nolegacy_external_runfiles).
      cp -L \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/LICENSE \
        "${TMPDIR}"
      cp -LR \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/tensorflow \
        "${TMPDIR}"
      cp_external \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles \
        "${EXTERNAL_INCLUDES}"
      copy_xla_aot_runtime_sources \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow \
        "${XLA_AOT_RUNTIME_SOURCES}"
      # Copy MKL libs over so they can be loaded at runtime
      so_lib_dir=$(ls $RUNFILES | grep solib) || true
      if [ -n "${so_lib_dir}" ]; then
        mkl_so_dir=$(ls ${RUNFILES}/${so_lib_dir} | grep mkl) || true
        if [ -n "${mkl_so_dir}" ]; then
          mkdir "${TMPDIR}/${so_lib_dir}"
          cp -R ${RUNFILES}/${so_lib_dir}/${mkl_so_dir} "${TMPDIR}/${so_lib_dir}"
        fi
      fi
    fi
  fi

  mkdir -p ${TMPDIR}/third_party
  cp -R $RUNFILES/third_party/eigen3 ${TMPDIR}/third_party

  reorganize_includes "${TMPDIR}"

  cp tensorflow/tools/pip_package/MANIFEST.in ${TMPDIR}
  cp tensorflow/tools/pip_package/README ${TMPDIR}/README.md
  cp tensorflow/tools/pip_package/setup.py ${TMPDIR}

  rm -f ${TMPDIR}/tensorflow/libtensorflow_framework.so
  rm -f ${TMPDIR}/tensorflow/libtensorflow_framework.so.[0-9].*

  # TODO(annarev): copy over API files from tensorflow/api/_vN to tensorflow/
  #   except tensorflow/api/_vN/lite/.

  # TODO(b/150440817): support autocomplete for tf.keras
  # Copy over keras API folder to the root directory
  # so that autocomplete works as expected for all keras subimports.
  # if [ -d "${TMPDIR}/tensorflow/_api/v1/" ]
  # then
  #   cp -r ${TMPDIR}/tensorflow/python/keras/api/_v1/keras/ ${TMPDIR}/tensorflow/keras/
  #   sed -i'.original' -e 's/.python.keras.api._v1/tensorflow/g' ${TMPDIR}/tensorflow/__init__.py
  # else
  #   cp -r ${TMPDIR}/tensorflow/python/keras/api/_v2/keras/ ${TMPDIR}/tensorflow/keras/
  #   sed -i'.original' -e 's/.python.keras.api._v2/tensorflow/g' ${TMPDIR}/tensorflow/__init__.py
  # fi
}

function build_wheel() {
  if [ $# -lt 2 ] ; then
    echo "No src and dest dir provided"
    exit 1
  fi

  TMPDIR="$1"
  DEST="$2"
  PKG_NAME_FLAG="$3"

  # Before we leave the top-level directory, make sure we know how to
  # call python.
  if [[ -e tools/python_bin_path.sh ]]; then
    source tools/python_bin_path.sh
  fi

  pushd ${TMPDIR} > /dev/null

  rm -f MANIFEST
  echo $(date) : "=== Building wheel"
  "${PYTHON_BIN_PATH:-python}" setup.py bdist_wheel ${PKG_NAME_FLAG} >/dev/null
  mkdir -p ${DEST}
  cp dist/* ${DEST}
  popd > /dev/null
  echo $(date) : "=== Output wheel file is in: ${DEST}"
}

function usage() {
  echo "Usage:"
  echo "$0 [--src srcdir] [--dst dstdir] [options]"
  echo "$0 dstdir [options]"
  echo ""
  echo "    --src                 prepare sources in srcdir"
  echo "                              will use temporary dir if not specified"
  echo ""
  echo "    --dst                 build wheel in dstdir"
  echo "                              if dstdir is not set do not build, only prepare sources"
  echo ""
  echo "  Options:"
  echo "    --project_name <name> set project name to name"
  echo "    --cpu                 build tensorflow_cpu"
  echo "    --gpu                 build tensorflow_gpu"
  echo "    --gpudirect           build tensorflow_gpudirect"
  echo "    --rocm                build tensorflow_rocm"
  echo "    --nightly_flag        build tensorflow nightly"
  echo ""
  exit 1
}

function main() {
  PKG_NAME_FLAG=""
  PROJECT_NAME=""
  CPU_BUILD=0
  GPU_BUILD=0
  GPUDIRECT_BUILD=0
  ROCM_BUILD=0
  NIGHTLY_BUILD=0
  SRCDIR=""
  DSTDIR=""
  CLEANSRC=1
  while true; do
    if [[ "$1" == "--help" ]]; then
      usage
      exit 1
    elif [[ "$1" == "--nightly_flag" ]]; then
      NIGHTLY_BUILD=1
    elif [[ "$1" == "--gpu" ]]; then
      GPU_BUILD=1
    elif [[ "$1" == "--cpu" ]]; then
      CPU_BUILD=1
    elif [[ "$1" == "--gpudirect" ]]; then
      GPUDIRECT_BUILD=1
    elif [[ "$1" == "--rocm" ]]; then
      ROCM_BUILD=1
    elif [[ "$1" == "--project_name" ]]; then
      shift
      if [[ -z "$1" ]]; then
        break
      fi
      PROJECT_NAME="$1"
    elif [[ "$1" == "--src" ]]; then
      shift
      SRCDIR="$(real_path $1)"
      CLEANSRC=0
    elif [[ "$1" == "--dst" ]]; then
      shift
      DSTDIR="$(real_path $1)"
    else
      DSTDIR="$(real_path $1)"
    fi
    shift

    if [[ -z "$1" ]]; then
      break
    fi
  done

  if [[ $(( GPU_BUILD + CPU_BUILD + GPUDIRECT_BUILD + ROCM_BUILD )) -gt "1" ]]; then
    echo "Only one of [--gpu, --cpu, --gpudirect, --rocm] may be provided."
    usage
    exit 1
  fi

  if [[ -z "$DSTDIR" ]] && [[ -z "$SRCDIR" ]]; then
    echo "No destination dir provided"
    usage
    exit 1
  fi

  if [[ -z "$SRCDIR" ]]; then
    # make temp srcdir if none set
    SRCDIR="$(mktemp -d -t tmp.XXXXXXXXXX)"
  fi

  prepare_src "$SRCDIR"

  if [[ -z "$DSTDIR" ]]; then
      # only want to prepare sources
      exit
  fi

  if [[ -n ${PROJECT_NAME} ]]; then
    PKG_NAME_FLAG="--project_name ${PROJECT_NAME}"
  elif [[ ${NIGHTLY_BUILD} == "1" && ${GPU_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tf_nightly_gpu"
  elif [[ ${NIGHTLY_BUILD} == "1" && ${GPUDIRECT_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tf_nightly_gpudirect"
  elif [[ ${NIGHTLY_BUILD} == "1" && ${ROCM_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tf_nightly_rocm"
  elif [[ ${NIGHTLY_BUILD} == "1" && ${CPU_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tf_nightly_cpu"
  elif [[ ${NIGHTLY_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tf_nightly"
  elif [[ ${GPU_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tensorflow_gpu"
  elif [[ ${GPUDIRECT_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tensorflow_gpudirect"
  elif [[ ${ROCM_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tensorflow_rocm"
  elif [[ ${CPU_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tensorflow_cpu"
  fi

  build_wheel "$SRCDIR" "$DSTDIR" "$PKG_NAME_FLAG"

  if [[ $CLEANSRC -ne 0 ]]; then
    rm -rf "${TMPDIR}"
  fi
}

main "$@"

#!/usr/bin/env bash
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# 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.
# ==============================================================================

set -e

function is_absolute {
  [[ "$1" = /* ]] || [[ "$1" =~ ^[a-zA-Z]:[/\\].* ]]
}

function real_path() {
  is_absolute "$1" && echo "$1" || echo "$PWD/${1#./}"
}

function cp_external() {
  local src_dir=$1
  local dest_dir=$2

  pushd .
  cd "$src_dir"
  for f in `find . ! -type d ! -name '*.py' ! -path '*local_config_cuda*' ! -path '*local_config_tensorrt*' ! -path '*local_config_syslibs*' ! -path '*org_tensorflow*' ! -path '*llvm-project/llvm/*'`; do
    mkdir -p "${dest_dir}/$(dirname ${f})"
    cp "${f}" "${dest_dir}/$(dirname ${f})/"
  done
  popd

  mkdir -p "${dest_dir}/local_config_cuda/cuda/cuda/"
  cp "${src_dir}/local_config_cuda/cuda/cuda/cuda_config.h" "${dest_dir}/local_config_cuda/cuda/cuda/"
}

function copy_xla_aot_runtime_sources() {
  local src_dir=$1
  local dst_dir=$2

  local srcs_txt="tensorflow/tools/pip_package/xla_compiled_cpu_runtime_srcs.txt"

  if [ ! -f "${src_dir}/${srcs_txt}" ]; then
    echo Could not find source list file "${src_dir}/${srcs_txt}". 1>&2
    return 0
  fi

  pushd $src_dir
  for file in $(cat "${srcs_txt}")
  do
    # Sometimes $file has a prefix bazel-out/host/ we want to remove.
    prefix=${file%%tensorflow/*}  # Find the location of "tensorflow/*"
    candidate_file=${file#$prefix}  # Remove the prefix
    if [ ! -z "$candidate_file" ]; then
      file=$candidate_file
    fi
    dn=$(dirname $file)
    if test -f "$file"; then
      mkdir -p "${dst_dir}/${dn}"
      cp $file "${dst_dir}/${file}"
    else
      echo "Missing xla source file: ${file}" 1>&2
    fi
  done
  cp tensorflow/tools/pip_package/xla_build/CMakeLists.txt "${dst_dir}"
  popd
}

function move_to_root_if_exists () {
  arg_to_move="$1"
  if [ -e "${arg_to_move}" ]; then
    mv ${arg_to_move} ./
  fi
}

function reorganize_includes() {
  TMPDIR="${1%/}"
  pushd "${TMPDIR}/tensorflow/include/"

  move_to_root_if_exists external/com_google_absl/absl

  move_to_root_if_exists external/eigen_archive/Eigen
  move_to_root_if_exists external/eigen_archive/unsupported

  move_to_root_if_exists external/jsoncpp_git/include
  rm -rf external/jsoncpp_git

  move_to_root_if_exists external/com_google_protobuf/src/google
  rm -rf external/com_google_protobuf/python

  popd
}

PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"
function is_windows() {
  if [[ "${PLATFORM}" =~ (cygwin|mingw32|mingw64|msys)_nt* ]]; then
    true
  else
    false
  fi
}

function prepare_src() {
  if [ $# -lt 1 ] ; then
    echo "No destination dir provided"
    exit 1
  fi

  TMPDIR="${1%/}"
  mkdir -p "$TMPDIR"
  EXTERNAL_INCLUDES="${TMPDIR}/tensorflow/include/external"
  XLA_AOT_RUNTIME_SOURCES="${TMPDIR}/tensorflow/xla_aot_runtime_src"

  echo $(date) : "=== Preparing sources in dir: ${TMPDIR}"

  if [ ! -d bazel-bin/tensorflow ]; then
    echo "Could not find bazel-bin.  Did you run from the root of the build tree?"
    exit 1
  fi

  if is_windows; then
    rm -rf ./bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip
    mkdir -p ./bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip
    echo "Unzipping simple_console_for_windows.zip to create runfiles tree..."
    unzip -o -q ./bazel-bin/tensorflow/tools/pip_package/simple_console_for_windows.zip -d ./bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip
    echo "Unzip finished."
    # runfiles structure after unzip the python binary
    cp -L \
      bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip/runfiles/org_tensorflow/LICENSE \
      "${TMPDIR}"
    cp -LR \
      bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip/runfiles/org_tensorflow/tensorflow \
      "${TMPDIR}"
    cp_external \
      bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip/runfiles \
      "${EXTERNAL_INCLUDES}/"
    copy_xla_aot_runtime_sources \
      bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip/runfiles/org_tensorflow \
      "${XLA_AOT_RUNTIME_SOURCES}/"
    RUNFILES=bazel-bin/tensorflow/tools/pip_package/simple_console_for_window_unzip/runfiles/org_tensorflow
    # If oneDNN was built with openMP then copy the omp libs over
    if [ -f "bazel-bin/external/llvm_openmp/libiomp5md.dll" ]; then
      cp bazel-bin/external/llvm_openmp/libiomp5md.dll ${TMPDIR}/tensorflow/python
      cp bazel-bin/external/llvm_openmp/libiomp5md.dll.if.lib ${TMPDIR}/tensorflow/python
    fi
  else
    RUNFILES=bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow
    if [ -d bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external ]; then
      # Old-style runfiles structure (--legacy_external_runfiles).
      cp -L \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/LICENSE \
        "${TMPDIR}"
      cp -LR \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/tensorflow \
        "${TMPDIR}"
      cp_external \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external \
        "${EXTERNAL_INCLUDES}"
      copy_xla_aot_runtime_sources \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow \
        "${XLA_AOT_RUNTIME_SOURCES}"
      # Copy MKL libs over so they can be loaded at runtime
      so_lib_dir=$(ls $RUNFILES | grep solib) || true
      if [ -n "${so_lib_dir}" ]; then
        mkl_so_dir=$(ls ${RUNFILES}/${so_lib_dir} | grep mkl) || true
        if [ -n "${mkl_so_dir}" ]; then
          mkdir "${TMPDIR}/${so_lib_dir}"
          cp -R ${RUNFILES}/${so_lib_dir}/${mkl_so_dir} "${TMPDIR}/${so_lib_dir}"
        fi
      fi
    else
      # New-style runfiles structure (--nolegacy_external_runfiles).
      cp -L \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/LICENSE \
        "${TMPDIR}"
      cp -LR \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/tensorflow \
        "${TMPDIR}"
      cp_external \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles \
        "${EXTERNAL_INCLUDES}"
      copy_xla_aot_runtime_sources \
        bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow \
        "${XLA_AOT_RUNTIME_SOURCES}"
      # Copy MKL libs over so they can be loaded at runtime
      so_lib_dir=$(ls $RUNFILES | grep solib) || true
      if [ -n "${so_lib_dir}" ]; then
        mkl_so_dir=$(ls ${RUNFILES}/${so_lib_dir} | grep mkl) || true
        if [ -n "${mkl_so_dir}" ]; then
          mkdir "${TMPDIR}/${so_lib_dir}"
          cp -R ${RUNFILES}/${so_lib_dir}/${mkl_so_dir} "${TMPDIR}/${so_lib_dir}"
        fi
      fi
    fi
  fi

  mkdir -p ${TMPDIR}/third_party
  cp -R $RUNFILES/third_party/eigen3 ${TMPDIR}/third_party

  reorganize_includes "${TMPDIR}"

  cp tensorflow/tools/pip_package/MANIFEST.in ${TMPDIR}
  cp tensorflow/tools/pip_package/README ${TMPDIR}/README.md
  cp tensorflow/tools/pip_package/setup.py ${TMPDIR}

  rm -f ${TMPDIR}/tensorflow/libtensorflow_framework.so
  rm -f ${TMPDIR}/tensorflow/libtensorflow_framework.so.[0-9].*

  # TODO(annarev): copy over API files from tensorflow/api/_vN to tensorflow/
  #   except tensorflow/api/_vN/lite/.

  # Copy over keras API folder to the root directory
  # so that autocomplete works as expected for all keras subimports.
  if [ -d "${TMPDIR}/tensorflow/_api/v1/" ]
  then
    cp -r ${TMPDIR}/tensorflow/python/keras/api/_v1/keras/ ${TMPDIR}/tensorflow/keras/
    sed -i'.original' -e 's/.python.keras.api._v1/tensorflow/g' ${TMPDIR}/tensorflow/__init__.py
  else
    cp -r ${TMPDIR}/tensorflow/python/keras/api/_v2/keras/ ${TMPDIR}/tensorflow/keras/
    sed -i'.original' -e 's/.python.keras.api._v2/tensorflow/g' ${TMPDIR}/tensorflow/__init__.py
  fi
}

function build_wheel() {
  if [ $# -lt 2 ] ; then
    echo "No src and dest dir provided"
    exit 1
  fi

  TMPDIR="$1"
  DEST="$2"
  PKG_NAME_FLAG="$3"

  # Before we leave the top-level directory, make sure we know how to
  # call python.
  if [[ -e tools/python_bin_path.sh ]]; then
    source tools/python_bin_path.sh
  fi

  pushd ${TMPDIR} > /dev/null

  rm -f MANIFEST
  echo $(date) : "=== Building wheel"
  "${PYTHON_BIN_PATH:-python}" setup.py bdist_wheel ${PKG_NAME_FLAG} >/dev/null
  mkdir -p ${DEST}
  cp dist/* ${DEST}
  popd > /dev/null
  echo $(date) : "=== Output wheel file is in: ${DEST}"
}

function usage() {
  echo "Usage:"
  echo "$0 [--src srcdir] [--dst dstdir] [options]"
  echo "$0 dstdir [options]"
  echo ""
  echo "    --src                 prepare sources in srcdir"
  echo "                              will use temporary dir if not specified"
  echo ""
  echo "    --dst                 build wheel in dstdir"
  echo "                              if dstdir is not set do not build, only prepare sources"
  echo ""
  echo "  Options:"
  echo "    --project_name <name> set project name to name"
  echo "    --cpu                 build tensorflow_cpu"
  echo "    --gpu                 build tensorflow_gpu"
  echo "    --gpudirect           build tensorflow_gpudirect"
  echo "    --rocm                build tensorflow_rocm"
  echo "    --nightly_flag        build tensorflow nightly"
  echo ""
  exit 1
}

function main() {
  PKG_NAME_FLAG=""
  PROJECT_NAME=""
  CPU_BUILD=0
  GPU_BUILD=0
  GPUDIRECT_BUILD=0
  ROCM_BUILD=0
  NIGHTLY_BUILD=0
  SRCDIR=""
  DSTDIR=""
  CLEANSRC=1
  while true; do
    if [[ "$1" == "--help" ]]; then
      usage
      exit 1
    elif [[ "$1" == "--nightly_flag" ]]; then
      NIGHTLY_BUILD=1
    elif [[ "$1" == "--gpu" ]]; then
      GPU_BUILD=1
    elif [[ "$1" == "--cpu" ]]; then
      CPU_BUILD=1
    elif [[ "$1" == "--gpudirect" ]]; then
      GPUDIRECT_BUILD=1
    elif [[ "$1" == "--rocm" ]]; then
      ROCM_BUILD=1
    elif [[ "$1" == "--project_name" ]]; then
      shift
      if [[ -z "$1" ]]; then
        break
      fi
      PROJECT_NAME="$1"
    elif [[ "$1" == "--src" ]]; then
      shift
      SRCDIR="$(real_path $1)"
      CLEANSRC=0
    elif [[ "$1" == "--dst" ]]; then
      shift
      DSTDIR="$(real_path $1)"
    else
      DSTDIR="$(real_path $1)"
    fi
    shift

    if [[ -z "$1" ]]; then
      break
    fi
  done

  if [[ $(( GPU_BUILD + CPU_BUILD + GPUDIRECT_BUILD + ROCM_BUILD )) -gt "1" ]]; then
    echo "Only one of [--gpu, --cpu, --gpudirect, --rocm] may be provided."
    usage
    exit 1
  fi

  if [[ -z "$DSTDIR" ]] && [[ -z "$SRCDIR" ]]; then
    echo "No destination dir provided"
    usage
    exit 1
  fi

  if [[ -z "$SRCDIR" ]]; then
    # make temp srcdir if none set
    SRCDIR="$(mktemp -d -t tmp.XXXXXXXXXX)"
  fi

  prepare_src "$SRCDIR"

  if [[ -z "$DSTDIR" ]]; then
      # only want to prepare sources
      exit
  fi

  if [[ -n ${PROJECT_NAME} ]]; then
    PKG_NAME_FLAG="--project_name ${PROJECT_NAME}"
  elif [[ ${NIGHTLY_BUILD} == "1" && ${GPU_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tf_nightly_gpu"
  elif [[ ${NIGHTLY_BUILD} == "1" && ${GPUDIRECT_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tf_nightly_gpudirect"
  elif [[ ${NIGHTLY_BUILD} == "1" && ${ROCM_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tf_nightly_rocm"
  elif [[ ${NIGHTLY_BUILD} == "1" && ${CPU_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tf_nightly_cpu"
  elif [[ ${NIGHTLY_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tf_nightly"
  elif [[ ${GPU_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tensorflow_gpu"
  elif [[ ${GPUDIRECT_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tensorflow_gpudirect"
  elif [[ ${ROCM_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tensorflow_rocm"
  elif [[ ${CPU_BUILD} == "1" ]]; then
    PKG_NAME_FLAG="--project_name tensorflow_cpu"
  fi

  build_wheel "$SRCDIR" "$DSTDIR" "$PKG_NAME_FLAG"

  if [[ $CLEANSRC -ne 0 ]]; then
    rm -rf "${TMPDIR}"
  fi
}

main "$@"


excplicitly add textinput *.o files to library.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@39518 27541ba8-7e3a-0410-8455-c3a389f83636

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/dawehner/root.git/'


Adding script which can be used to remove tabs from source code,
and reindent the offending lines using Emacs.

May eventually be used as part of 'make beautify'.

#!/bin/bash

# This script detabs (and reindents) a file using emacs-style indentation.
if [[ $# -lt 1 ]]; then
    echo "Usage: $0 file.C"
    exit 1
fi

# Use perl to get a list of line numbers that have <TAB> characters
tabbed_lines=(`perl -ne "print \"$. \" if /\t/" $1`)

# Now actually use perl to remove those tab characters
perl -pli -e 's/\t//g' $1

# Print status message
echo "Reindenting ${#tabbed_lines[@]} lines in $1."

# Initialize the list of eval commands with the command which causes
# Emacs to use spaces for tabs.
eval_commands="--eval=\"(setq-default indent-tabs-mode nil)\""

# Make a long string of --eval commands
for i in "${tabbed_lines[@]}"
do
    eval_commands+=" --eval \"(goto-line $i)\" --eval \"(indent-for-tab-command)\""
done

# Construct the command you want to run as a string, and then use
# 'eval' to run it.  Note that this is *not* the same thing as
# running, say, `$cmd`.
cmd="/usr/bin/emacs -batch $1 $eval_commands -f save-buffer &> /dev/null"
eval $cmd

error: pathspec 'contrib/bin/detab.sh' did not match any file(s) known to git


Ubuntu distribution is now 14.04 LTS (saucy)

#!/bin/bash

# exit the script if any of the commands fail.
# further discussion: http://www.davidpashley.com/articles/writing-robust-shell-scripts/
set -e

# This script needs to be run as root for permission purposes
test $USER = 'root' || { echo run this as root >&2; exit 1; }

USERNAME=ubuntu
RAILS_ENV=production

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
apt-get install apt-transport-https ca-certificates

echo "deb https://oss-binaries.phusionpassenger.com/apt/passenger saucy main" | tee /etc/apt/sources.list.d/passenger.list

apt-get update

apt-get install nginx-extras passenger -y
# crash-watch gdb libc6-dbg libev4 liblua5.1-0 libperl5.14 nginx-common nginx-extras passenger passenger-dev passenger-doc ruby-daemon-controller ruby-rack

apt-get install nodejs nodejs-dev npm -y
ln -sf /usr/bin/nodejs /usr/bin/node

npm install -g coffee-script

# Config files for nginx installed via apt-get are located in /etc/nginx

cd /home/$USERNAME

test -e pixel-ping || su -c "git clone git://github.com/documentcloud/pixel-ping.git pixel-ping" $USERNAME

cd /home/$USERNAME/documentcloud

test -e /etc/nginx/nginx.conf && mv /etc/nginx/nginx.conf /etc/nginx/nginx.default.conf
test -e /etc/nginx/sites-enabled/default && rm /etc/nginx/sites-enabled/default

cp ./config/server/files/nginx/{nginx,documentcloud,passenger}.conf /etc/nginx/
cp ./config/server/files/nginx/{staging,production}.conf /etc/nginx/sites-available/
ln -s /etc/nginx/sites-available/$RAILS_ENV.conf /etc/nginx/sites-enabled/documentcloud-$RAILS_ENV.conf

service nginx restart
rake $RAILS_ENV ping:start

echo WEBSERVER SETUP COMPLETED SUCCESSFULLY

#!/bin/bash

# exit the script if any of the commands fail.
# further discussion: http://www.davidpashley.com/articles/writing-robust-shell-scripts/
set -e

# This script needs to be run as root for permission purposes
test $USER = 'root' || { echo run this as root >&2; exit 1; }

USERNAME=ubuntu
RAILS_ENV=production

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
apt-get install apt-transport-https ca-certificates

echo "deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main" | tee /etc/apt/sources.list.d/passenger.list

apt-get update

apt-get install nginx-extras passenger -y
# crash-watch gdb libc6-dbg libev4 liblua5.1-0 libperl5.14 nginx-common nginx-extras passenger passenger-dev passenger-doc ruby-daemon-controller ruby-rack

apt-get install nodejs nodejs-dev npm -y
ln -sf /usr/bin/nodejs /usr/bin/node

npm install -g coffee-script

# Config files for nginx installed via apt-get are located in /etc/nginx

cd /home/$USERNAME

test -e pixel-ping || su -c "git clone git://github.com/documentcloud/pixel-ping.git pixel-ping" $USERNAME

cd /home/$USERNAME/documentcloud

test -e /etc/nginx/nginx.conf && mv /etc/nginx/nginx.conf /etc/nginx/nginx.default.conf
test -e /etc/nginx/sites-enabled/default && rm /etc/nginx/sites-enabled/default

cp ./config/server/files/nginx/{nginx,documentcloud,passenger}.conf /etc/nginx/
cp ./config/server/files/nginx/{staging,production}.conf /etc/nginx/sites-available/
ln -s /etc/nginx/sites-available/$RAILS_ENV.conf /etc/nginx/sites-enabled/documentcloud-$RAILS_ENV.conf

service nginx restart
rake $RAILS_ENV ping:start

echo WEBSERVER SETUP COMPLETED SUCCESSFULLY


added new option for virgo injections, comments like FOUND, DID NOT FIND injections will be parsed by AP

#!/bin/bash

REPO_DIR=$(cat repoDir.txt)

# USAGE:: ./one_fake_gstlal.sh
FAKE_DB=${REPO_DIR}/approval_processorMP/test/FAKE_DB          # Directory where events will be created
OUT_DIR=${REPO_DIR}/approval_processorMP/test/OUT_DIR          # temporary directory to store upload files
CONFIG_FILE=${REPO_DIR}/approval_processorMP/test/virgoImplementation/gstlal.ini_1             # config file of the event created, will be written by script
NUM_EVENTS=1

# Event details
GROUP="CBC"
PIPELINE="gstlal"
SEARCH="LowMass"
INSTRUMENTS="H1,L1,V1"
FAR=1e-8		# Event FAR
HUMANS=1		# Add humans section?
HUMAN_RESPONSE=1	# 0 for ADVNO, 1 for ADVOK
SEGDB2GRCDB=0		# Add segdb2grcdb section?
VIRGODQ=1		# Add VirgoDQ section?
VIRGODQRESPONSE=1	# 0 for IS vetoed (fail); 1 for IS NOT vetoed (pass)
VIRGOINJ=0		# 0 for DID NOT FIND injections; 1 for FOUND injections
IDQ=1			# Add idq section?
IDQ_RESPONSE=1		# Pass/ fail criteria AP's IDQ threshold
SKYMAPS=0		# Adds various skymaps?
LVEM=0			# Add lvem tag?
EXT_TRIGGER=0		# Add ext-trigger section?
UNBLIND_INJ=0		# Add unblind-inj section?

if [ ! -d ${FAKE_DB} ];then
	mkdir -p ${FAKE_DB}
fi

if [ ! -d ${OUT_DIR} ];then
	mkdir -p ${OUT_DIR}
fi

if [ ! -d $(dirname ${CONFIG_FILE}) ];then
	mkdir -p $(dirname ${CONFIG_FILE})
fi

if [ ! -f ${CONFIG_FILE} ];then
	touch ${CONFIG_FILE}
fi

# Write the config file
echo "### Writing config file"
./build_testing_config \
	--file=${CONFIG_FILE} \
	--group=${GROUP} \
	--pipeline=${PIPELINE} \
	--search=${SEARCH} \
	--instruments=${INSTRUMENTS} \
	--humans=${HUMANS} \
	--human-response=${HUMAN_RESPONSE} \
	--segdb2grcdb=${SEGDB2GRCDB} \
	--virgodq=${VIRGODQ} \
	--virgodq-veto=${VIRGODQRESPONSE} \
	--virgo-inj=${VIRGOINJ} \
	--idq=${IDQ} \
	--idq-response=${IDQ_RESPONSE} \
	--skymaps=${SKYMAPS} \
	--lvem=${LVEM} \
	--ext-trigger=${EXT_TRIGGER} \
	--unblind-inj=${UNBLIND_INJ}

echo "### Config written to ${CONFIG_FILE}"
echo "### Simulating fake event creation"

${REPO_DIR}/lvalertTest/bin/simulate.py \
	--num-events=${NUM_EVENTS} \
	--far=${FAR} \
	--gracedb-url=${FAKE_DB} \
	--instruments=${INSTRUMENTS} \
	--output-dir=${OUT_DIR} \
	-s \
	-v \
	${CONFIG_FILE}

error: pathspec 'test/virgoImplementation/one_fake_gstlal_virgodq.sh' did not match any file(s) known to git


Add conformance test script to phi results

#!/bin/sh

sizes=(31 63 127 255 511 1023)

for s in "${sizes[@]}"
do
    echo $s
    cmp out$s ../../../../previous_work/ocl4/results/out$s
done

error: pathspec 'axle/phi/ocl4/results/test.sh' did not match any file(s) known to git


Added webmin

Added webmin

mkdir webmin_temp
cd webmin_temp
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.870.tar.gz
gunzip webmin-1.870.tar.gz
tar xf webmin-1.870.tar
cd webmin-1.870
./setup.sh /usr/local/webmin
cd ../..
rm -rf webmin_temp

error: pathspec 'Scripts/webmin.sh' did not match any file(s) known to git


moved

moved

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/at7/work.git/'


Investigate hsql problem

Investigate hsql problem

#!/bin/sh
java -cp "$1" org.hsqldb.Server -database.0 file:"$2" -dbname.0 "$2" > /home/haulmont/info.log 2 > /home/haulmont/errors.log


update

update

#!/bin/sh

BIN_DIR=`dirname $0`
HOME_DIR=$BIN_DIR/..
CONF_DIR=$HOME_DIR/conf

if [ "$LOG_DIR" == "" ]; then
  LOG_DIR=/tmp/
fi

if [ -f $CONF_DIR/setenv.sh ] ;then
  . $CONF_DIR/setenv.sh
fi

PID_FILE=$LOG_DIR/hdfs_etl.pid

if [ -f $PID_FILE ]; then
  if [ -f /proc/$(cat $PID_FILE)/status ] ;then
    echo hdfs_etl is running..
    exit 0
  fi
  echo hdfs_etl is no running..
  exit 1
fi

error: pathspec 'bin/hdfs_etl_server_status.sh' did not match any file(s) known to git


Updated linux script for IB controller

Updated linux script for IB controller

#/bin/sh
# Launch IB Gateway

# IB Controller Sourced-Modified from https://github.com/ib-controller/ib-controller

IBC_PATH=$1   #/Lean/Interactive/IBController
TWS_PATH=$2   #/Lean/Interactive/IBJts
TWSUSERID=$3
TWSPASSWORD=$4
TWS_MAJOR_VRSN=952
TRADING_MODE=
IBC_INI=$IBC_PATH/IBController.ini
LOG_PATH=$IBC_PATH/Logs

DATE=`date +%Y%m%d%H%M`

# Clean Process Space:
kill -9 `pidof xvfb-run`
kill -9 `pidof java`
kill -9 `pidof Xvfb`

# Launch a virtual screen
Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null &
export DISPLAY=:1

# Launch the IB Controller + IB Gateway

APP=GATEWAY
TWS_CONFIG_PATH="$TWS_PATH"

export TWS_MAJOR_VRSN
export IBC_INI
export TRADING_MODE
export IBC_PATH
export TWS_PATH
export TWS_CONFIG_PATH
export LOG_PATH
export TWSUSERID
export TWSPASSWORD
export FIXUSERID
export FIXPASSWORD
export JAVA_PATH
export APP

xvfb-run "${IBC_PATH}/Scripts/DisplayBannerAndLaunch.sh" &

history -c

#/bin/sh
# Launch IB Gateway

# IB Controller Sourced-Modified from https://github.com/ib-controller/ib-controller

IBCDIR=$1 #/Lean/Interactive/IBController
TWSDIR=$2 #/Lean/Interactive/IBJts
TWSUSERID=$3
TWSPASSWORD=$4
DATE=`date +%Y%m%d%H%M`
LOGFILE=/tmp/ibg_running_${DATE}.log

# Clean Process Space:
kill -9 `pidof xvfb-run`
kill -9 `pidof java`
kill -9 `pidof Xvfb`

# The IBController ini file:
IBCINI=$IBCDIR/IBController.ini

TWSCP=jts.jar:total.2013.jar

JAVAOPTS='-Xmx768M -XX:MaxPermSize=256M'

pushd $TWSDIR

# Launch a virtual screen
Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null &
export DISPLAY=:1

# Launch the IB Controller + IB Gateway
xvfb-run java -cp  $TWSCP:$IBCDIR/IBController.jar $JAVAOPTS ibcontroller.IBGatewayController $IBCINI $TWSUSERID $TWSPASSWORD

popd

history -c


Build script for Ubuntu

Build script for Ubuntu

Thanks to Andrew Matusiewicz (andrew.matusiewicz@gmail.com) for the patch.

#! /bin/bash
#
#  Andrew Matusiewicz     andrew.matusiewicz@gmail.com      2013-09-20
#
#  Build script for Ubuntu 12.04.
#
#  Not fully tested, USE AT YOUR OWN RISK. The standard mechanism is
#  to manually do these processes, but if you find this script helpful,
#  by all means use it!
#
#  This script installs the prereqs for Qt5, VTK6, and OpenView and then
#  downloads and builds each of these three pieces of software in the current directory.
#  This takes a really long time, but the nice thing about it is that
#  once you enter your password for the first "sudo apt-get install" command, the
#  rest is completely automatic and you should be able to walk away from it and come
#  back to a clean build of OpenView and VTK.
#
#  This script is based on https://github.com/Kitware/openview/wiki/Build-instructions
#  and has been tested on Ubuntu 12.04 32 bit and 64 bit.

###### install dependencies, answering yes to all queries of "really install this?"
sudo apt-get install -y cmake cmake-curses-gui mesa-common-dev freeglut3-dev  g++ git libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-glx0-dev

###### get Qt5
##build from source
if [ ! -d qt-everywhere-opensource-src-5.1.1 ] ;
then
  wget 'http://download.qt-project.org/official_releases/qt/5.1/5.1.1/single/qt-everywhere-opensource-src-5.1.1.tar.gz'
  tar xzf qt-everywhere-opensource-src-5.1.1.tar.gz
fi

Qt_dir="$PWD/Qt-5.1.1"
if [ ! -d  $Qt_dir ] ;
then
  cd qt-everywhere-opensource-src-5.1.1
  #pipe in the correct keyboard strokes to avoid having the installation stall here for user input
  printf "o\nyes\n" | ./configure -opengl desktop -prefix $Qt_dir
  make -j5
  make install
  cd ..
fi

##64 bit binary
#wget 'http://download.qt-project.org/official_releases/qt/5.1/5.1.1/qt-linux-opensource-5.1.1-x86_64-offline.run'
#chmod 700 qt-linux-opensource-5.1.1-x86_64-offline.run
#./qt-linux-opensource-5.1.1-x86_64-offline.run

###32 bit binary
#wget 'http://download.qt-project.org/official_releases/qt/5.1/5.1.1/qt-linux-opensource-5.1.1-x86-offline.run'
#chmod 700 qt-linux-opensource-5.1.1-x86-offline.run
#./qt-linux-opensource-5.1.1-x86-offline.run

###### Get and install VTK.  If you get "iostream.h not found" error, delete build directory and try again
if [ ! -d VTK-build ] ;
then
 wget 'http://www.vtk.org/files/release/6.0/vtk-6.0.0.tar.gz'
 tar xvf vtk-6.0.0.tar.gz
 mkdir VTK-build
 cd VTK-build
 cmake ../VTK6.0.0
 make -j5
 cd ..
fi

####### Now download and build openview
git clone git://github.com/Kitware/openview.git
export VTK_DIR="$PWD/VTK-build"
export Qt5Widgets_DIR="${Qt_dir}/lib/cmake/Qt5Widgets/"
export Qt5Quick_DIR="${Qt_dir}/lib/cmake/Qt5Quick/"

mkdir openview-build
cd openview-build
cmake ../openview
make -j5
cd ..

error: pathspec 'scripts/build_linux_ubuntu.sh' did not match any file(s) known to git


Add script to update Vagrant guest additions.

#!/bin/bash

set -e

sudo apt-get update
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:debfx/virtualbox
sudo apt-get install dkms
sudo apt-get install "linux-headers-`uname -r`"

cd /opt
test -f 'VirtualBox-GuestAdditions-4.1.4.iso' || sudo wget 'http://download.virtualbox.org/virtualbox/4.1.4/VBoxGuestAdditions_4.1.4.iso' -O VirtualBox-GuestAdditions-4.1.4.iso

sudo mount VirtualBox-GuestAdditions-4.1.4.iso -o loop /mnt

cd /mnt

set +e
sudo sh VBoxLinuxAdditions.run --nox11
set -e

echo "-------------------------------------------------------------------------"
echo "Guest additions installed, restart the VM to finish."
echo "-------------------------------------------------------------------------"

error: pathspec 'deploy/update_vagrant_guest_additions.sh' did not match any file(s) known to git


Adding script to build EasyDEX-GUI

Adding script to build EasyDEX-GUI

#!/bin/bash
# Script to build gui for Agama App

[ -d ${WORKSPACE}/gui/EasyDEX-GUI ] && cd ${WORKSPACE}/gui/EasyDEX-GUI
[ -d ../gui/EasyDEX-GUI ] && cd ../gui/EasyDEX-GUI
[ -d gui/EasyDEX-GUI ] && cd gui/EasyDEX-GUI

echo "Building EasyDEX-GUI"
echo "Actual directory is: ${PWD}"

echo "Checkout to redux branch."
git checkout redux
git pull origin redux

echo "Installing nodejs modules."
npm install
npm install webpack

echo "Building EasyDEX-GUI app."
npm run build
echo "EasyDEX-GUI is built!"

error: pathspec 'buildscripts/easydex-build.sh' did not match any file(s) known to git


Added build script for consul/sdk sdk/v0.4.0 (#1988)

Co-authored-by: Muskaan Sheik <c4cd04fb7a5cf305fbdbd3ebb66765d5c1ab6352@ibm.com>

#!/bin/bash -e
# -----------------------------------------------------------------------------
#
# Package	: github.com/hashicorp/consul/sdk
# Version	: v0.3.0
# Source repo	: https://github.com/hashicorp/consul
# Tested on	: UBI: 8.5
# Language      : Go
# Travis-Check  : True
# Script License: Apache License, Version 2 or later
# Maintainer	: Muskaan Sheik <Muskaan.Sheik@ibm.com>
#
# Disclaimer: This script has been tested in root mode on given
# ==========  platform using the mentioned version of the package.
#             It may not work as expected with newer versions of the
#             package and/or distribution. In such case, please
#             contact "Maintainer" of this script.
#
# ----------------------------------------------------------------------------

PACKAGE_NAME=sdk
PACKAGE_VERSION=${1:-sdk/v0.4.0}
PACKAGE_URL=https://github.com/hashicorp/consul

yum install -y wget tar zip gcc-c++ make git procps diffutils

wget https://golang.org/dl/go1.17.5.linux-ppc64le.tar.gz
tar -C /bin -xf go1.17.5.linux-ppc64le.tar.gz

mkdir -p /home/tester/go/src /home/tester/go/bin /home/tester/go/pkg

export PATH=$PATH:/bin/go/bin
export GOPATH=/home/tester/go
export PATH=$GOPATH/bin:$PATH
export GO111MODULE=on

go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2
go install gotest.tools/gotestsum@latest

git clone $PACKAGE_URL
cd consul
git checkout $PACKAGE_VERSION
go mod download

make tools
make dev

ulimit -n 2048
umask 0022

cd $PACKAGE_NAME

if ! gotestsum   --format=short-verbose ./...; then
	echo "------------------$PACKAGE_NAME:test_fails---------------------"
	echo "$PACKAGE_VERSION $PACKAGE_NAME"
	echo "$PACKAGE_NAME  | $PACKAGE_VERSION |"
else
	echo "------------------$PACKAGE_NAME:install_and_test_success-------------------------"
	echo "$PACKAGE_VERSION $PACKAGE_NAME"
	echo "$PACKAGE_NAME  | $PACKAGE_VERSION |"
fi

error: pathspec 'c/consul/consul_sdk_ubi8.5.sh' did not match any file(s) known to git


add the jsh to fixup a virtualbox bosh-lite

#!/bin/bash
_USERID=$(id --name -u)
sudo chown -R $_USERID .

if [[ ! -f ~/did-apt-get-update ]]; then
    sudo apt-get update
    date >> ~/did-apt-get-update
fi

DUMMY_RELEASE=~/workspace/dummy
export OUR_AWS_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
export  UUID=$(bosh -n status |grep UUID| awk '{print $NF}')

[[ -f ~/.ssh/id_rsa ]] || {
    mkdir -p ~/.ssh
    chmod 700 ~/.ssh
    ssh-keygen -t rsa -P foobar -f ~/.ssh/id_rsa
}

type -a git || sudo apt-get install -y git

mkdir -p ~/workspace ~/tmp

if [[ ! -d ~/basic-env ]] ; then
    cd && git clone https://github.com/pivotal-cf-experimental/basic-env.git
    . basic-env/.profile
    new_env
    rm -rf ~/parrallel-*
    ln -svf .profile .bashrc
fi

if [[ ! -d $DUMMY_RELEASE ]]; then
    git clone https://github.com/pivotal-cf-experimental/dummy-boshrelease.git $DUMMY_RELEASE
    cd  $DUMMY_RELEASE
    mkdir -p $DUMMY_RELEASE/meetup
    echo -e "---\nname: dummy-${OUR_AWS_ID}\ndirector_uuid: $UUID" > $DUMMY_RELEASE/meetup/this-bosh-lite.yml
    cat  $DUMMY_RELEASE/meetup/this-bosh-lite.yml
    echo -e "---\nname: all-dummy-${OUR_AWS_ID}\ndirector_uuid: $UUID" > $DUMMY_RELEASE/meetup/this-all-dummy-bosh-lite.yml
fi

type -a spiff 2>&1 > /dev/null || {
    cd ~/tmp/ && wget -q https://github.com/cloudfoundry-incubator/spiff/releases/download/v1.0.6/spiff_linux_amd64.zip
    type -a unzip || sudo apt-get install -y zip unzip
    unzip spiff_linux_amd64.zip
    sudo cp -av spiff /usr/local/bin/
    type -a spiff
}

if [[  ! -f  $DUMMY_RELEASE/meetup/deploy-${OUR_AWS_ID}-manifest.yml ]]; then
    echo "INFO: Generating dummy deploy manifest"
    cd  $DUMMY_RELEASE && {
        bash -x ./generate_deployment_manifest warden  $DUMMY_RELEASE/meetup/this-bosh-lite.yml >  $DUMMY_RELEASE/meetup/deploy-${OUR_AWS_ID}-manifest.yml
        spiff merge $DUMMY_RELEASE/templates/all-jobs-dummy-deployment.yml \
              $DUMMY_RELEASE/meetup/this-all-dummy-bosh-lite.yml > $DUMMY_RELEASE/meetup/all-dummy-deploy-${OUR_AWS_ID}-manifest.yml
        ls -al  $DUMMY_RELEASE/meetup/
    }
    cd -
else
    echo "INFO: dummy deploy manifest already generated"
fi

if [[ ! -f ~/bosh-stemcell-389-warden-boshlite-ubuntu-trusty-go_agent.tgz ]]; then
    cd && wget -q https://bosh-jenkins-artifacts.s3.amazonaws.com/bosh-stemcell/warden/bosh-stemcell-389-warden-boshlite-ubuntu-trusty-go_agent.tgz
    ls -lart bosh-stemcell-389-warden-boshlite-ubuntu-trusty-go_agent.tgz
else
    echo "INFO: Stemcell is already downloaded"
fi

if ( ! (egrep -q sFnRXKn6gwnutEwDSvxwyl19pk4EKtQz ~/.ssh/authorized_keys) ); then
    echo "adding pub key file"
cat<<EOF >> ~/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsc8KIhDSPz5bl+KbGvqU9r3CbIJDICxfMrhW9fqNMu27HIL8oVvQOdPo8D+oTAOQUvObzDMw98dm0W7cQYaEh3L41IWQeV/ueaJnwvMsDvYZb3JPYWIYB72fEzf/Bg/J3RxloTU5W9sn9G2otMPEXjVC17Fsy8q4dlSnu3iNs9koiNWR+5mDenRSHFB/FllI+AB2HhlGzH0HewWuBZCNBbV4vT4sy9kkiisYmziOMwnUB32xGtOWH6wJFex/RZxX9FsqbP6GqxCfLzBNr81ZCHjGnG8NomNeqCEKX+qPT353ZBCHWFBamsFnRXKn6gwnutEwDSvxwyl19pk4EKtQz thansmann@bullfinch
EOF
else
    echo "INFO: pub key file has already been added"
fi
sudo updatedb

echo "PATH+=:/var/vcap/bosh/bin" >> ~/.profile

sudo perl -i.old -pe 's{(minimum_down_jobs:).*$}{$1 1\n}xms' /var/vcap/jobs/health_monitor/config/health_monitor.yml

error: pathspec 'scripts/jsh_virtual_box_bosh-lite-box-prep.bash' did not match any file(s) known to git


Added docker volume for mysql conf.

Added docker volume for mysql conf.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/daniellavoie/Kubik.git/'


Upgrade properly to version 4.1 directly.

#!/bin/bash

dir="$1"
if [[ "x$dir" == "x" ]]
then
  dir="."
fi

find "$dir" -name '*.gapp' -o -name '*.xgapp' | while read f
do
  echo "Updating file $f"
  sed -i.bak '
s/PYTORCH_CL_WRAPPER_DENSE/PytorchWrapper_CL_DR/g
s/PYTORCH_SEQ_WRAPPER_DENSE/PytorchWrapper_SEQ_DR/g
s/KERAS_CL_WRAPPER_DENSE/KerasWrapper_CL_DR/g
s/KERAS_SEQ_WRAPPER_DENSE/KerasWrapper_SEQ_DR/g
s/MALLET_CL_BALANCED_WINNOW/MalletBalancedWinnow_CL_MR/g
s/MALLET_CL_C45/MalletC45_CL_MR/g
s/MALLET_CL_DECISION_TREE/MalletDecisionTree_CL_MR/g
s/MALLET_CL_MAX_ENT/MalletMaxEnt_CL_MR/g
s/MALLET_CL_NAIVE_BAYES_EM/MalletNaiveBayesEM_CL_MR/g
s/MALLET_CL_NAIVE_BAYES/MalletNaiveBayes_CL_MR/g
s/MALLET_CL_WINNOW/MalletWinnow_CL_MR/g
s/MALLET_SEQ_CRF_SG/MalletCRFSG_SEQ_MR/g
s/MALLET_SEQ_CRF_VG/MalletCRFVG_SEQ_MR/g
s/MALLET_SEQ_CRF/MalletCRF_SEQ_MR/g
s/COSTCLA_CL_WRAPPER/CostclaWrapper_CL_MR/g
s/MALLET_SEQ_MEMM/MalletMEMM_SEQ_MR/g
s/WEKA_CL_WRAPPER/WekaWrapper_CL_MR/g
s/SKLEARN_CL_WRAPPER/SklearnWrapper_CL_MR/g
s/KERAS_CL_WRAPPER/KerasWrapper_CL_MR/g
s/LIBSVM_RG/LibSVM_RG_MR/g
s/WEKA_RG_WRAPPER/WekaWrapper_RG_MR/g
s/PYTORCH_RG_WRAPPER_Dense/PytorchWrapper_RG_DR/g
s/SKLEARN_RG_WRAPPER/SklearnWrapper_RG_MR/g
s/KERAS_RG_WRAPPER/WekaWrapper_RG_MR/g
s/EXPORTER_ARFF_CLASS/ARFF_CL_MR/g
s/EXPORTER_ARFF_REGRESSION/ARFF_RG_MR/g
s/EXPORTER_CSV_CLASS/CSV_CL_MR/g
s/EXPORTER_CSV_REGRESSION/CSV_RG_MR/g
s/EXPORTER_JSON_SEQ/JSON_CL_MR/g
s/EXPORTER_JSON_REGRESSION/JSON_RG_MR/g
s/EXPORTER_JSON_CLASS/JSON_SEQ_MR/g
s/EXPORTER_LIBSVM_CLASS/LibSVM_CL_MR/g
s/EXPORTER_LIBSVM_REGRESSION/LibSVM_RG_MR/g
s/EXPORTER_MATRIXMARKET2_CLASS/MatrixMarket2_CL_MR/g
s/EXPORTER_MATRIXMARKET2_REGRESSION/MatrixMatket2_RG_MR/g
s/LIBSVM_CL/LibSVM_CL_MR/g
s/learningframework.Exporter/learningframework.export.Exporter/g
' $f
done

error: pathspec 'bin/upgrade-pipelines-3_0-4_1.sh' did not match any file(s) known to git


Create install-mam.sh

Create install-mam.sh

#!/bin/bash
# http://wiki.bash-hackers.org/howto/conffile
# https://github.com/nicholaswilde/mac-address-monitor/tree/master/smartapps/nicholaswilde/mac-address-monitor.src

# Check if run as sudo
if [ $USER = "root" ]; then
    echo Please run as sudo
    exit 1
fi

### Define variables ###
user=`who am i | awk '{print $1}'` >&2  # User who ran script using sudo
homeDir=`eval echo ~$user` >&2          # Home directory of user
installFile=`basename "$0"` >&2         # Name of install file

scriptName="MAC Address Monitor"    # Name of script
installDir="mac-address-monitor"    #
scriptFile="$installDir.sh"         #
configFile="$installDir.cfg"        #
defaultDir="$homeDir/$installDir"   #
installPath=""                      # Installation path
filePath=""                         # Path of script file
deviceName=""                       # Name of device

downloadUrl='https://github.com/nicholaswilde/$installDir/blob/master/smartapps/nicholaswilde/$installDir.src/$scriptFile'

appId=""
secretKey=""

### User input ###
#-- Device Name --#
echo -n "Enter the device name and press [ENTER]: "
read deviceName

# Replace all spaces with dashes
deviceName=${deviceName// /-}

# Conver to lowercase
echo "$deviceName" | awk '{print tolower($0)}'

# Redefine variables based on device name
scriptFile="$deviceName.sh"
configFile="$deviceName.cfg"
defaultDir="$homeDir/$deviceName"

#-- AppID --#
echo -n "Enter the AppID and press [ENTER]: "
read appId

if [ $secretKey = "" ]; then
    echo An AppID was not entered
    echo Exiting ...
    exit 1
fi

#-- Secret Key --#
echo -n "Enter the Secret Key and press [ENTER]: "
read secretKey

if [ $secretKey = "" ]; then
    echo "A Secret Key was not entered!"
    echo "Exiting ..."
    exit 1
fi

#-- Installation Directory --#
echo "Script installation directory [$defaultDir]:"
read -n installPath

if [ $installPath = "" ]; then
    installPath=$defaultDir
fi

filePath="$installPath/$scriptFile"

#-- Cron Interval --#
echo -n "Cron interval: "
# PS3='Please enter your choice: '
options=("15s" "30s" "60s" "Quit")
select opt in "${options[@]}"; do
    case $opt in
        "15s")
            echo "you chose 15s"
            cronInterval=15
            ;;
        "30s")
            echo "you chose 30s"
            cronInterval=30
            ;;
        "60s")
            echo "you chose 60s"
            cronInterval=60
            ;;
        "Quit")
            break
            ;;
        *) echo invalid option;;
    esac
done

#-- Check for required packages --#
echo Checking for required packages ...
bNmap=`which nmap` >&2

if [ bNmap = "" ]; then
    echo -n "nmap is not installed. Would you like to install it? [Y/N]: "
    read nmapRes

    if [ nmapRes = "Y" ]; then
        echo "Installing nmap ..."
        # sudo apt-get -y install nmap
        # Check that nmap was installed properly
        bNmap=`which nmap` >&2

    else
        echo "nmap is needed for $scriptName"
        echo "Exiting ..."
        exit 1
    fi
fi

#-- MAC address --#
echo

echo -n "Device MAC address [00:00:00:00:00:00]:"
read -n macAddress

# Validate macAddress

echo Making directory ...
#if [ -d t ]; then
#   if [ -L t ]; then
#      rm t
#   else
#      rmdir t
#   fi
#fi

### Installation ###
# Download the script
echo Downloading script ...
# wget $downloadUrl -O $filePath

# Change file permissions
echo Making the script executable ...
# chmod +x $filePath

# Add script to cron
echo Adding script to cron ...

# case "$cronInterval" in
#   "15")
        # cru a $scriptName "* * * * * $filePath"
        # cru a $scriptName30 "* * * * * sleep 15; $filePath"
        # cru a $scriptName30 "* * * * * sleep 30; $filePath"
        # cru a $scriptName30 "* * * * * sleep 45; $filePath"
        #;;
# "30")
        # cru a $scriptName "* * * * * $filePath"
        # cru a $scriptName30 "* * * * * sleep 30; $filePath"
        #;;
# "60")
        # cru a $scriptName "* * * * * $filePath"
        #;;
# esac

echo "Installation finished!"

error: pathspec 'smartapps/nicholaswilde/mac-address-monitor.src/install-mam.sh' did not match any file(s) known to git


add installation script for cloud_conductor_utils (gem)

#!/bin/sh

GEM_NAME=cloud_conductor_utils
GIT_URL=https://github.com/cloudconductor/cloud_conductor_utils.git

TOOLS_DIR=/opt/chefdk/embedded/bin
GEM_TOOL=${TOOLS_DIR}/gem
RAKE_TOOL=${TOOLS_DIR}/rake

WORK_DIR=`pwd`

export PATH=/opt/chefdk/embedded/bin:$PATH
cd ${WORK_DIR}

${GEM_TOOL} list | grep ${GEM_NAME}
if [ $? -eq 0 ] ; then
  exit
fi

ls ./${GEM_NAME}
if [ $? -ne 0 ] ; then
  git clone ${GIT_URL}
fi

cd ${GEM_NAME}/
git checkout develop

${RAKE_TOOL} build
${GEM_TOOL} install pkg/${GEM_NAME}-0.0.1.gem
${GEM_TOOL} list | grep ${GEM_NAME}

error: pathspec 'ccu_gem_install.sh' did not match any file(s) known to git


Add script to determine doc publishing location.

Change-Id: I45e3922a7e06dd6338e8c772086e2d45d46d0c27

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/open-switch/infra_puppet-jenkins.git/'


Add Fedora-specific DB template creation script.

#!/usr/bin/env bash
POSTGIS_SQL_PATH=/usr/share/postgresql-8.3-postgis
createdb -E UTF8 template_postgis # Create the template spatial database.
createlang -d template_postgis plpgsql # Adding PLPGSQL language support.
psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';"
psql -d template_postgis -f $POSTGIS_SQL_PATH/lwpostgis-64.sql # Loading the PostGIS SQL routines
psql -d template_postgis -f $POSTGIS_SQL_PATH/spatial_ref_sys.sql
psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;" # Enabling users to alter spatial tables.
psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"

error: pathspec 'trunk/mobile_portal/create_template_postgis-fedora.sh' did not match any file(s) known to git


Add script for taking multiple pictures via <CR>

#!/bin/bash

while true
do
	read
	./take_calibration_picture.sh
done

error: pathspec 'test/test_messages/take_calibration_pictures.sh' did not match any file(s) known to git


Restore update passing ref (#2732)

Restore update passing ref (#2732)

* Restore UpdatePassingRef for now.

Co-authored-by: Sean Goller <33c367d9da78519d003a1ce344c24e2bc4254a37@pivotal.io>
Co-authored-by: Dick Cavender <f16ed8ecbeb0b0d17f9be4666a7e49be1441ba06@pivotal.io>

* Restore update-passing-ref.sh

Co-authored-by: Sean Goller <33c367d9da78519d003a1ce344c24e2bc4254a37@pivotal.io>
Co-authored-by: Dick Cavender <f16ed8ecbeb0b0d17f9be4666a7e49be1441ba06@pivotal.io>

#!/usr/bin/env bash

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#

export BUILDROOT=$(pwd)
REPOSITORY_DIR=$(pwd)/geode
LOCAL_FILE=${BUILDROOT}/results/passing.txt
DESTINATION_URL=gs://${ARTIFACT_BUCKET}/${MAINTENANCE_VERSION}/passing.txt
pushd ${REPOSITORY_DIR}
git rev-parse HEAD > ${LOCAL_FILE}
popd
echo "Updating passing reference file for ${MAINTENANCE_VERSION} to the following SHA:"
cat ${LOCAL_FILE}
gsutil -q -m cp ${LOCAL_FILE} ${DESTINATION_URL}
gsutil setmeta -h "Cache-Control:no-cache" ${DESTINATION_URL}

error: pathspec 'ci/scripts/update-passing-ref.sh' did not match any file(s) known to git


added slurm job for uniform and obiwan randoms

#!/bin/bash -l

#SBATCH -p debug
#SBATCH -N 10
#SBATCH -t 00:10:00
#SBATCH --account=desi
#SBATCH -J randoms
#SBATCH -L SCRATCH,project
#SBATCH -C haswell

export outdir=elg_dr5_500per
let tasks=32*${SLURM_JOB_NUM_NODES}
export bricks_fn=${CSCRATCH}/obiwan_out/${outdir}/bricks.txt

# Load production env
source $CSCRATCH/obiwan_code/obiwan/bin/run_atnersc/bashrc_desiconda_new

# NERSC / Cray / Cori / Cori KNL things
export KMP_AFFINITY=disabled
export MPICH_GNI_FORK_MODE=FULLCOPY
export MKL_NUM_THREADS=1
export OMP_NUM_THREADS=1

srun -n ${tasks} -c 1 \
    python $CSCRATCH/obiwan_code/obiwan/py/obiwan/runmanager/uniform_obiwan_randoms.py \
    --data_dir $CSCRATCH/obiwan_out/${outdir} --bricks_fn ${bricks_fn} --nproc ${tasks}

error: pathspec 'bin/slurm_uniform_obiwan_randoms.sh' did not match any file(s) known to git


update comments for internal ip update

update comments for internal ip update

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/hlx98007/deployment-scripts.git/'


tag-release.sh script

tag-release.sh script

This script tags the release and pushes the tag to paas-cf
repository via git and SSH.

#!/bin/sh

set -eu

TAG_PREFIX=$1
AWS_ACCOUNT=$2
DEPLOY_ENV=$3

GIT_EMAIL="the-multi-cloud-paas-team+deployer-ci@digital.cabinet-office.gov.uk"
GIT_USER="gov-paas-${AWS_ACCOUNT}"
GIT_REPO_URL="git@github.com:alphagov/paas-cf.git"

echo Configure SSH
tar xzf git-keys/git-keys.tar.gz
mkdir -p ~/.ssh

cat <<EOF > ~/.ssh/config
Host github.com
  StrictHostKeyChecking no
  IdentityFile $(pwd)/git-key
EOF

version=$(cat release-version/number)
tag="${TAG_PREFIX}${version}"

echo Configure Git
cd paas-cf
git config --global user.email "${GIT_EMAIL}"
git config --global user.name "${GIT_USER}"
git remote add ssh "${GIT_REPO_URL}"

echo "Create tag ${tag}"
git tag -a "${tag}" -m "Version ${version} passed ${AWS_ACCOUNT} \
in environment ${DEPLOY_ENV}"

echo "Push tag ${tag}"
git push ssh "${tag}"

error: pathspec 'concourse/scripts/tag-release.sh' did not match any file(s) known to git


More fixxxxxes

More fixxxxxes

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/ssmereka/art.git/'


Analysis job script

Analysis job script

#PBS -q tng
#PBS -l select=1:ncpus=1
#PBS -N analyse
#PBS -l walltime=01:00:00

#uncomment as appropriate
PROGRAM=$HOME/ImperialNESS-Sep14/ConfigurationalTemperature/analysis/C++/analyse
#PROGRAM=$HOME/ImperialNESS-Sep14/ConfigurationalTemperature/analysis/FORTRAN/analyse

cp $PBS_O_WORKDIR/out.lammpstrj.bin $TMPDIR

$PROGRAM out.lammpstrj.bin

mv $TMPDIR/temperatures.dat $PBS_O_WORKDIR/temperatures.dat

error: pathspec 'ConfigurationalTemperature/simulation/analyse.sh' did not match any file(s) known to git


Update sensor-analytics latest version

Update sensor-analytics latest version

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/cuongquay/citus-iot-ecosystem.git/'


add bashrc.sh for history controlling

add bashrc.sh for history controlling

HISTSIZE=100000
HISTFILESIZE=200000
HISTCONTROL=ignoredups:erasedups:ignorespace
HISTIGNORE="*personal*:*secret*:cd*"

error: pathspec 'aliases/bashrc.sh' did not match any file(s) known to git


working on install script

working on install script

echo 'Installing GPIO_Control service'
echo

FILE=$HOME/.config/phoniebox/gpio_settings.ini
if test -f "$FILE"; then
    echo "$FILE exist"
    echo "Script will not install a configuration"
else
    unset options i
    while IFS= read -r -d $'\0' f; do
      options[i++]="$f"
    done < <(find ./example_configs/ -maxdepth 1 -type f -name "*.ini" -print0 )

    echo  'Please choose a default configuration'
    select opt in "${options[@]}" "Stop the script"; do
      case $opt in
        *.ini)
          echo "Configuration  file $opt selected"
          echo "Copy file to $FILE"
          echo cp -v $opt $FILE
          cp -v $opt $FILE
          break
          ;;
        "Stop the script")
          echo "You chose to stop"
          break
          ;;
        *)
          echo "This is not a number"
          ;;
      esac
    done

fi
echo
echo 'Installing GPIO_Control service, this will require to enter your password up to 3 times to enable the service'
read -p "Press enter to continue " -n 1 -r
SERVICE_FILE=/etc/systemd/system/phoniebox_gpio_control.service
if test -f "$SERVICE_FILE"; then
   echo "$SERVICE_FILE exists.";
   read -p "Press enter to continue " -n 1 -r;
    #echo "systemctl daemon-reload"
    #systemctl daemon-reload
else
    sudo cp -v ./example_configs/phoniebox_gpio_control.service /etc/systemd/system/
    echo "systemctl start phoniebox_gpio_control.service"
    systemctl start phoniebox_gpio_control.service
    echo "systemctl enable phoniebox_gpio_control.service"
    systemctl enable phoniebox_gpio_control.service
fi
systemctl status phoniebox_gpio_control.service

error: pathspec 'components/gpio_control/install.sh' did not match any file(s) known to git


Add usage info to env script

Add usage info to env script

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/pedrohml/smartbot.git/'


Roll clang back 132018:131989

Roll clang back 132018:131989

BUG=85289
TEST=none
TBR=evan

Review URL: http://codereview.chromium.org/6995065

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@88275 0039d316-1c4b-4281-b951-d872f2087c98

#!/bin/bash
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# This script will check out llvm and clang into third_party/llvm and build it.

CLANG_REVISION=131989

THIS_DIR="$(dirname "${0}")"
LLVM_DIR="${THIS_DIR}"/../../../third_party/llvm
CLANG_DIR="${LLVM_DIR}"/tools/clang

# Die if any command dies.
set -e

# Echo all commands.
set -x

# Check out.
svn co --force http://llvm.org/svn/llvm-project/llvm/trunk@"${CLANG_REVISION}" \
  "${LLVM_DIR}"
svn co --force http://llvm.org/svn/llvm-project/cfe/trunk@"${CLANG_REVISION}" \
  "${CLANG_DIR}"

# Build clang (in a separate directory).
# The clang bots have this path hardcoded in built/scripts/slave/compile.py,
# so if you change it you also need to change these links.
mkdir -p "${LLVM_DIR}"/../llvm-build
cd "${LLVM_DIR}"/../llvm-build
if [ ! -f ./config.status ]; then
  ../llvm/configure --enable-optimized
fi

NUM_JOBS=3
if [ "$(uname -s)" = "Linux" ]; then
  NUM_JOBS="$(grep -c "^processor" /proc/cpuinfo)"
elif [ "$(uname -s)" = "Darwin" ]; then
  NUM_JOBS="$(sysctl -n hw.ncpu)"
fi
make -j"${NUM_JOBS}"
cd -

# Build plugin.
# Copy it into the clang tree and use clang's build system to compile the
# plugin.
PLUGIN_SRC_DIR="${THIS_DIR}"/../plugins
PLUGIN_DST_DIR="${LLVM_DIR}"/../llvm/tools/clang/tools/chrome-plugin
PLUGIN_BUILD_DIR="${LLVM_DIR}"/../llvm-build/tools/clang/tools/chrome-plugin
rm -rf "${PLUGIN_DST_DIR}"
cp -R "${PLUGIN_SRC_DIR}" "${PLUGIN_DST_DIR}"
rm -rf "${PLUGIN_BUILD_DIR}"
mkdir -p "${PLUGIN_BUILD_DIR}"
cp "${PLUGIN_SRC_DIR}"/Makefile "${PLUGIN_BUILD_DIR}"
make -j"${NUM_JOBS}" -C "${PLUGIN_BUILD_DIR}"

#!/bin/bash
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# This script will check out llvm and clang into third_party/llvm and build it.

CLANG_REVISION=132017

THIS_DIR="$(dirname "${0}")"
LLVM_DIR="${THIS_DIR}"/../../../third_party/llvm
CLANG_DIR="${LLVM_DIR}"/tools/clang

# Die if any command dies.
set -e

# Echo all commands.
set -x

# Check out.
svn co --force http://llvm.org/svn/llvm-project/llvm/trunk@"${CLANG_REVISION}" \
  "${LLVM_DIR}"
svn co --force http://llvm.org/svn/llvm-project/cfe/trunk@"${CLANG_REVISION}" \
  "${CLANG_DIR}"

# Build clang (in a separate directory).
# The clang bots have this path hardcoded in built/scripts/slave/compile.py,
# so if you change it you also need to change these links.
mkdir -p "${LLVM_DIR}"/../llvm-build
cd "${LLVM_DIR}"/../llvm-build
if [ ! -f ./config.status ]; then
  ../llvm/configure --enable-optimized
fi

NUM_JOBS=3
if [ "$(uname -s)" = "Linux" ]; then
  NUM_JOBS="$(grep -c "^processor" /proc/cpuinfo)"
elif [ "$(uname -s)" = "Darwin" ]; then
  NUM_JOBS="$(sysctl -n hw.ncpu)"
fi
make -j"${NUM_JOBS}"
cd -

# Build plugin.
# Copy it into the clang tree and use clang's build system to compile the
# plugin.
PLUGIN_SRC_DIR="${THIS_DIR}"/../plugins
PLUGIN_DST_DIR="${LLVM_DIR}"/../llvm/tools/clang/tools/chrome-plugin
PLUGIN_BUILD_DIR="${LLVM_DIR}"/../llvm-build/tools/clang/tools/chrome-plugin
rm -rf "${PLUGIN_DST_DIR}"
cp -R "${PLUGIN_SRC_DIR}" "${PLUGIN_DST_DIR}"
rm -rf "${PLUGIN_BUILD_DIR}"
mkdir -p "${PLUGIN_BUILD_DIR}"
cp "${PLUGIN_SRC_DIR}"/Makefile "${PLUGIN_BUILD_DIR}"
make -j"${NUM_JOBS}" -C "${PLUGIN_BUILD_DIR}"


Adds Linux / OS X pfx creation script

Adds Linux / OS X pfx creation script

#!/bin/bash

# Copyright 2013 Cloudbase Solutions Srl
#
#    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.

set -e

USER_NAME=${1:-cloudbase-init-user-$RANDOM}
UPN=$USER_NAME@localhost
SUBJECT="/CN=$USER_NAME"

PFX_FILE=${2:-winrm_client_cert}.pfx
PEM_FILE=${PFX_FILE%.*}.pem

PRIVATE_DIR=`mktemp -d -t cloudbase-initXXXXXX`
chmod 700 $PRIVATE_DIR

EXT_CONF_FILE=`mktemp -t cloudbase-initXXXXXX.conf`

KEY_FILE=$PRIVATE_DIR/cert.key

cat > $EXT_CONF_FILE << EOF
distinguished_name  = req_distinguished_name
[req_distinguished_name]
[v3_req_client]
extendedKeyUsage = clientAuth
subjectAltName = otherName:1.3.6.1.4.1.311.20.2.3;UTF8:$UPN
EOF

export OPENSSL_CONF=$EXT_CONF_FILE
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -out $PEM_FILE \
-outform PEM -keyout $KEY_FILE -subj $SUBJECT \
-extensions v3_req_client 2> /dev/null

rm $EXT_CONF_FILE
unset OPENSSL_CONF

# This will ask for an export password.
# To avoid it, add: -password pass:yourpassword
openssl pkcs12 -export -in $PEM_FILE -inkey $KEY_FILE -out $PFX_FILE

rm -rf $PRIVATE_DIR

THUMBPRINT=`openssl x509 -inform PEM -in $PEM_FILE -fingerprint -noout | \
sed -e 's/\://g' | sed -n 's/^.*=\(.*\)$/\1/p'`

echo "Certificate Subject: $(echo $SUBJECT | sed -e 's/\///g')"
echo "Certificate Thumbprint: $THUMBPRINT"

error: pathspec 'create-winrm-client-cert.sh' did not match any file(s) known to git


Added disk initialize script, initialize-disk.sh

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/nosuz/ubuntu-instant-root-on-zfs.git/'