Skip to content

Commit

Permalink
update images
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeimonakhov committed Oct 15, 2023
1 parent 8742790 commit 2efd469
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
1 change: 1 addition & 0 deletions images/keras/cuda11-8/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Keras ML framework with various python runtime.

Non-root Docker image used by Puzl [Kubernetes cloud](https://puzl.cloud) service. Based on [official tensorflow](https://hub.docker.com/r/tensorflow/tensorflow) Docker image.
## Supported languages and interpreter versions
- python3.9
- python3.10
- python3.11

Expand Down
1 change: 1 addition & 0 deletions images/keras/cuda11-8/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"sourceTag":"2.14.0-gpu",
"version": "1.2.0",
"interpreters": [
"python3.9",
"python3.10",
"python3.11"
],
Expand Down
32 changes: 23 additions & 9 deletions template/required.j2
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,34 @@ RUN curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest
RUN ${INTERPRETER} -m pip install -r /tmp/requirements.txt
{% endmacro %}

{%- macro install_pip_package(packages) -%}
RUN ${INTERPRETER} -m pip install \
{%- macro convert_interpreter_to_cp(interpreter) -%}
{%- if interpreter == "python3.9" -%}
cp39
{%- elif interpreter == "python3.10" -%}
cp310
{%- elif interpreter == "python3.11" -%}
cp311
{%- else -%}
unknown
{%- endif %}
{% endmacro %}

{%- macro install_pip_package(packages, INTERPRETER) -%}
RUN \
{%- for package in packages -%}
{%- if package.type == "pip" -%}
{% if package.version is defined %}
{{ package.name }}=={{ package.version }} \
{%- if package.type == "pip" and package.name != "tensorflow" -%}
{%- if package.version is defined %}
${INTERPRETER} -m pip install {{ package.name }}=={{ package.version }} \
{%- else %}
{{ package.name }} \
${INTERPRETER} -m pip install {{ package.name }} \
{%- endif %}
{%- elif package.type == "pip" and package.name == "tensorflow" -%}
${INTERPRETER} -m pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-{{ package.version }}-{{ convert_interpreter_to_cp(INTERPRETER) }}-{{ convert_interpreter_to_cp(INTERPRETER) }}-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \
{%- endif %}
{%- endfor %}
--index-url https://download.pytorch.org/whl/cu118 \
--extra-index-url https://pypi.org/simple \
&& ${INTERPRETER} -m pip cache purge
--index-url https://download.pytorch.org/whl/cu118 \
--extra-index-url https://pypi.org/simple \
&& ${INTERPRETER} -m pip cache purge
{% endmacro %}

{%- macro install_yarn_package(packages) -%}
Expand Down

0 comments on commit 2efd469

Please sign in to comment.