Skip to content

Commit 819e881

Browse files
committed
fix torch install
1 parent 2986171 commit 819e881

File tree

4 files changed

+35
-8
lines changed

4 files changed

+35
-8
lines changed

.github/workflows/docker.yml

+27-1
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,36 @@ jobs:
234234
- run: |
235235
source ./tool.sh
236236
build_image py-cuda-10.0 latest docker_core/Dockerfile \
237-
--build-arg "ARG_PROFILE_PYTHON=tf1,datascience,nlp,cv" \
237+
--build-arg "ARG_PROFILE_PYTHON=tf1" \
238238
--build-arg "BASE_IMG=cuda_10.0"
239239
alias_image py-cuda-10.0 latest tf1 latest && push_image
240240
241+
qpod_tf2:
242+
name: qpod/tf2
243+
needs: qpod_cuda_11_2
244+
runs-on: ubuntu-latest
245+
steps:
246+
- uses: actions/checkout@v2
247+
- run: |
248+
source ./tool.sh
249+
build_image py-cuda-11.2 latest docker_core/Dockerfile \
250+
--build-arg "ARG_PROFILE_PYTHON=tf2" \
251+
--build-arg "BASE_IMG=cuda_11.2"
252+
alias_image py-cuda-11.2 latest tf2 latest && push_image
253+
254+
qpod_torch:
255+
name: qpod/torch
256+
needs: qpod_cuda_11_3
257+
runs-on: ubuntu-latest
258+
steps:
259+
- uses: actions/checkout@v2
260+
- run: |
261+
source ./tool.sh
262+
build_image py-cuda-11.3 latest docker_core/Dockerfile \
263+
--build-arg "ARG_PROFILE_PYTHON=torch" \
264+
--build-arg "BASE_IMG=cuda_11.3"
265+
alias_image py-cuda-11.3 latest torch latest && push_image
266+
241267
qpod_core-cuda:
242268
name: qpod/core-cuda
243269
needs: qpod_cuda_11_3

docker_atom/work/script-setup.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ setup_conda_postprocess() {
3333
}
3434

3535
setup_conda_with_mamba() {
36-
mamba install -y --root-prefix="${CONDA_PREFIX}" --prefix="${CONDA_PREFIX}" conda pip -c "conda-forge/linux-64"
36+
VERSION_PTYHON=$1; shift 1;
37+
mamba install -y --root-prefix="${CONDA_PREFIX}" --prefix="${CONDA_PREFIX}" -c "conda-forge" conda pip python="${VERSION_PTYHON:-3.9}"
3738
rm -rf /opt/conda/pkgs/*
3839
setup_conda_postprocess
3940
}

docker_core/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,16 @@ RUN source /opt/utils/script-utils.sh \
5454
&& ( which java && echo "py4j % Install py4j if Java exists" >> /opt/utils/install_list_PY_datascience.pip || true ) \
5555
|| true ) \
5656
&& for profile in $(echo $ARG_PROFILE_PYTHON | tr "," "\n") ; do ( install_pip "/opt/utils/install_list_PY_${profile}.pip" || true ) ; done \
57-
# Handle tensorflow installation 1.x/2.x, cpu/gpu
57+
# Handle tensorflow installation 1.x/2.x, cpu/gpu: https://www.tensorflow.org/install/source#gpu
5858
&& ( [[ ${ARG_PROFILE_PYTHON} == *"tf"* ]] \
5959
&& TF=$( [ -x "$(command -v nvcc)" ] && echo "tensorflow-gpu" || echo "tensorflow") \
6060
&& V=$([[ ${ARG_PROFILE_PYTHON} == *"tf1"* ]] && echo "1" || echo "2" ) \
6161
&& pip install --pre -U "${TF}==${V}.*" \
6262
|| true ) \
63-
# Handle pytorch installation 1.x only, cpu/gpu
63+
# Handle pytorch installation 1.x only, cpu/gpu: https://pytorch.org/get-started/locally/
6464
&& ( [[ ${ARG_PROFILE_PYTHON} == *"torch"* ]] \
65-
&& IDX=$( [ -x "$(command -v nvcc)" ] && echo "cu${CUDA_VER//./}" || echo "cpu" ) \
65+
&& CUDA_VER=$(echo "${CUDA_VERSION:0:4}" | sed 's/\.//' ) \
66+
&& IDX=$( [ -x "$(command -v nvcc)" ] && echo "cu${CUDA_VER:-113}" || echo "cpu" ) \
6667
&& pip install --pre -U torch -f "https://download.pytorch.org/whl/${IDX}/torch_stable.html" \
6768
|| true )
6869

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
% This file contains python packages to be installed with pip line by line.
22
% Use percent char as line comment separator.
33

4-
pyparsing astroid % Parsing, AST
5-
nltk spacy PyStemmer % NLP
6-
transformers % transformers
4+
pyparsing astroid nltk % Parsing, AST
5+
transformers datasets % transformers

0 commit comments

Comments
 (0)