Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix torch install #62

Merged
merged 2 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,36 @@ jobs:
- run: |
source ./tool.sh
build_image py-cuda-10.0 latest docker_core/Dockerfile \
--build-arg "ARG_PROFILE_PYTHON=tf1,datascience,nlp,cv" \
--build-arg "ARG_PROFILE_PYTHON=tf1" \
--build-arg "BASE_IMG=cuda_10.0"
alias_image py-cuda-10.0 latest tf1 latest && push_image

qpod_tf2:
name: qpod/tf2
needs: qpod_cuda_11_2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
source ./tool.sh
build_image py-cuda-11.2 latest docker_core/Dockerfile \
--build-arg "ARG_PROFILE_PYTHON=tf2" \
--build-arg "BASE_IMG=cuda_11.2"
alias_image py-cuda-11.2 latest tf2 latest && push_image

qpod_torch:
name: qpod/torch
needs: qpod_cuda_11_3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
source ./tool.sh
build_image py-cuda-11.3 latest docker_core/Dockerfile \
--build-arg "ARG_PROFILE_PYTHON=torch" \
--build-arg "BASE_IMG=cuda_11.3"
alias_image py-cuda-11.3 latest torch latest && push_image

qpod_core-cuda:
name: qpod/core-cuda
needs: qpod_cuda_11_3
Expand Down
3 changes: 2 additions & 1 deletion docker_atom/work/script-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ setup_conda_postprocess() {
}

setup_conda_with_mamba() {
mamba install -y --root-prefix="${CONDA_PREFIX}" --prefix="${CONDA_PREFIX}" conda pip -c "conda-forge/linux-64"
VERSION_PTYHON=$1; shift 1;
mamba install -y --root-prefix="${CONDA_PREFIX}" --prefix="${CONDA_PREFIX}" -c "conda-forge" conda pip python="${VERSION_PTYHON:-3.9}"
rm -rf /opt/conda/pkgs/*
setup_conda_postprocess
}
Expand Down
9 changes: 5 additions & 4 deletions docker_core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM ${BASE_NAMESPACE:+$BASE_NAMESPACE/}${BASE_IMG}

LABEL maintainer="haobibo@gmail.com"

ARG ARG_PROFILE_NODEJS=base
ARG ARG_PROFILE_NODEJS

ARG ARG_PROFILE_JAVA

Expand Down Expand Up @@ -54,15 +54,16 @@ RUN source /opt/utils/script-utils.sh \
&& ( which java && echo "py4j % Install py4j if Java exists" >> /opt/utils/install_list_PY_datascience.pip || true ) \
|| true ) \
&& for profile in $(echo $ARG_PROFILE_PYTHON | tr "," "\n") ; do ( install_pip "/opt/utils/install_list_PY_${profile}.pip" || true ) ; done \
# Handle tensorflow installation 1.x/2.x, cpu/gpu
# Handle tensorflow installation 1.x/2.x, cpu/gpu: https://www.tensorflow.org/install/source#gpu
&& ( [[ ${ARG_PROFILE_PYTHON} == *"tf"* ]] \
&& TF=$( [ -x "$(command -v nvcc)" ] && echo "tensorflow-gpu" || echo "tensorflow") \
&& V=$([[ ${ARG_PROFILE_PYTHON} == *"tf1"* ]] && echo "1" || echo "2" ) \
&& pip install --pre -U "${TF}==${V}.*" \
|| true ) \
# Handle pytorch installation 1.x only, cpu/gpu
# Handle pytorch installation 1.x only, cpu/gpu: https://pytorch.org/get-started/locally/
&& ( [[ ${ARG_PROFILE_PYTHON} == *"torch"* ]] \
&& IDX=$( [ -x "$(command -v nvcc)" ] && echo "cu${CUDA_VER//./}" || echo "cpu" ) \
&& CUDA_VER=$(echo "${CUDA_VERSION:0:4}" | sed 's/\.//' ) \
&& IDX=$( [ -x "$(command -v nvcc)" ] && echo "cu${CUDA_VER:-113}" || echo "cpu" ) \
&& pip install --pre -U torch -f "https://download.pytorch.org/whl/${IDX}/torch_stable.html" \
|| true )

Expand Down
5 changes: 2 additions & 3 deletions docker_core/work/install_list_PY_nlp.pip
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
% This file contains python packages to be installed with pip line by line.
% Use percent char as line comment separator.

pyparsing astroid % Parsing, AST
nltk spacy PyStemmer % NLP
transformers % transformers
pyparsing astroid nltk % Parsing, AST
transformers datasets % transformers