SIGN IN SIGN UP
apache / mxnet UNCLAIMED

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more

0 0 1 C++
#!/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.
# Executes mxnet python images pipeline functions: build, test, publish
# Assumes script is run from the root of the mxnet repository
# Assumes script is being run within MXNet CD infrastructure
set -xe
usage="Usage: python_images.sh <build|test|push> MXNET-VARIANT"
command=${1:?$usage}
mxnet_variant=${2:?$usage}
cd_utils='cd/utils'
ci_utils='ci/'
docker_tags=($(./${cd_utils}/docker_tag.sh ${mxnet_variant}))
main_tag="${docker_tags[0]}_py3"
base_image=$(./${cd_utils}/mxnet_base_image.sh ${mxnet_variant})
repository="python"
image_name="${repository}:${main_tag}"
resources_path='cd/python/docker'
if [ ! -z "${RELEASE_PUBLIC_ECR_REPOSITORY}" ]; then
image_name="${RELEASE_PUBLIC_ECR_REPOSITORY}/${image_name}"
fi
build() {
[v1.x] Port #21055 from v1.9.x branch and fix CD docker python pipeline (#21062) * [v1.9.x] Website updates to address ASF website check tool results (#21055) * Switch from using Google Analytics to ASF Matmomo on MXNet website. * Add link to ASF privacy policy to MXNet website. * Remove live Medium blog integration and blog page and replace with link to blog in footer. * Add ASF header. * Add updated nvidia key to container. * Add updated nvidia key to container. * Fix download link (use https instead of http) for latest version. * Change page description to include Apache MXNet. * Update project name on trusted by page. * Update project name on features page. * Update contribute page. * Update ecosystem page. * Remove duplicate title. * Use local copies for js libraries. * Do not link to dmlc site for graphics, instead store copy locally. * Ignore temporary files. * Use local img for pip package list instead of to dmlc website. * Update project name on getting started page. * Simplify footer links. * Update homepage * Update MXNet to Apache MXNet. * Update python docs. * Update install selector page. * Update README to include new release, new URL to jenkins server and ensure it's clear this is an Apache project. * Move ASF links to main nav in python docs. * Move ASF links to main nav on MXNet site. * Make it clear this is an Apache project. * Skip flakey test test_quantization_mkldnn.test_quantized_rnn: tracked in #21061 * Remove skip of flakey test. * pass arg to dockerfile * fix LD path for cuda files * change cuda version arg name * update gpu base image in ci * update base image in Dockerfile.build.ubuntu_build_cuda Co-authored-by: Wei Chu <weichu@amazon.com>
2022-06-09 14:48:07 -07:00
# use this flag to set LD_LIBRARY_PATH for cuda files
if [[ $mxnet_variant = cu* ]]; then
cuda_variant=${mxnet_variant:2:-1}.${mxnet_variant: -1}
else
cuda_variant="false"
fi
# NOTE: Ensure the correct context root is passed in when building - Dockerfile expects ./wheel_build
[v1.x] Port #21055 from v1.9.x branch and fix CD docker python pipeline (#21062) * [v1.9.x] Website updates to address ASF website check tool results (#21055) * Switch from using Google Analytics to ASF Matmomo on MXNet website. * Add link to ASF privacy policy to MXNet website. * Remove live Medium blog integration and blog page and replace with link to blog in footer. * Add ASF header. * Add updated nvidia key to container. * Add updated nvidia key to container. * Fix download link (use https instead of http) for latest version. * Change page description to include Apache MXNet. * Update project name on trusted by page. * Update project name on features page. * Update contribute page. * Update ecosystem page. * Remove duplicate title. * Use local copies for js libraries. * Do not link to dmlc site for graphics, instead store copy locally. * Ignore temporary files. * Use local img for pip package list instead of to dmlc website. * Update project name on getting started page. * Simplify footer links. * Update homepage * Update MXNet to Apache MXNet. * Update python docs. * Update install selector page. * Update README to include new release, new URL to jenkins server and ensure it's clear this is an Apache project. * Move ASF links to main nav in python docs. * Move ASF links to main nav on MXNet site. * Make it clear this is an Apache project. * Skip flakey test test_quantization_mkldnn.test_quantized_rnn: tracked in #21061 * Remove skip of flakey test. * pass arg to dockerfile * fix LD path for cuda files * change cuda version arg name * update gpu base image in ci * update base image in Dockerfile.build.ubuntu_build_cuda Co-authored-by: Wei Chu <weichu@amazon.com>
2022-06-09 14:48:07 -07:00
docker build -t "${image_name}" --build-arg BASE_IMAGE="${base_image}" --build-arg MXNET_COMMIT_ID=${GIT_COMMIT} --build-arg MXNET_VARIANT=${mxnet_variant} --build-arg CUDA_VARIANT=${cuda_variant} -f ${resources_path}/Dockerfile ./wheel_build
}
test() {
local runtime_param=""
if [[ ${mxnet_variant} == cu* ]]; then
runtime_param="--runtime=nvidia"
fi
local test_image_name="${image_name}_test"
if [[ ${mxnet_variant} == "aarch64_cpu" ]]; then
requirements_file="./docker/install/requirements_aarch64"
else
requirements_file="./docker/install/requirements"
fi
# Ensure the correct context root is passed in when building - Dockerfile.test expects ci directory
docker build -t "${test_image_name}" --build-arg USER_ID=`id -u` --build-arg GROUP_ID=`id -g` --build-arg BASE_IMAGE="${image_name}" --build-arg REQUIREMENTS_FILE=${requirements_file} -f ${resources_path}/Dockerfile.test ./ci
}
push() {
if [ -z "${RELEASE_PUBLIC_ECR_REPOSITORY}" ]; then
echo "Cannot publish image without RELEASE_PUBLIC_ECR_REPOSITORY environment variable being set."
exit 1
fi
# Retrieve an authentication token and authenticate Docker client to registry
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/w6z5f7h2
# Push image
docker push "${image_name}"
}
case ${command} in
"build")
build
;;
"test")
test
;;
"push")
push
;;
*)
echo $usage
exit 1
esac