Skip to content

Commit

Permalink
wip: add tensorflow-cpu
Browse files Browse the repository at this point in the history
Signed-off-by: Massimiliano Giovagnoli <massimiliano.giovagnoli@chainguard.dev>
  • Loading branch information
maxgio92 committed Dec 19, 2024
1 parent 01f544d commit 5bedf1f
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions py3-tensorflow-cpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
package:
name: py3-tensorflow-cpu
version: 0_git20241219
epoch: 1
description: tensorflow-cpu
copyright:
- license: Apache 2.0
dependencies:
provider-priority: 0

vars:
pypi-package: tensorflow-cpu
prefix: /usr

data:
- name: py-versions
items:
3.12: '312'
# 3.13 is not supported yet: https://pypi.org/project/tf-nightly/

environment:
contents:
packages:
- build-base
- busybox
- py3.12-pip
- python-3.12
environment:
# This is needed to work around the error "ValueError: ZIP does not support timestamps before 1980"
SOURCE_DATE_EPOCH: 315532800

pipeline:
- uses: git-checkout
with:
expected-commit: d311fe017c036143186f9185f491fa6d6461a84e
repository: https://github.com/tensorflow/build
branch: master

subpackages:
- range: py-versions
name: py${{range.key}}-${{vars.pypi-package}}
description: ${{vars.pypi-package}} installed for python${{range.key}}
dependencies:
runtime:
- python-${{range.key}}
- py${{range.key}}-pip
provider-priority: ${{range.value}}
pipeline:
- working-directory: tensorflow_runtime_dockerfiles
pipeline:
- name: Install cpu requirements
runs: |
pip${{range.key}} install \
--root ${{targets.contextdir}} \
--prefix ${{vars.prefix}} \
-r cpu.requirements.txt
- name: Install Tensorflow
runs: |
pip${{range.key}} install \
--root ${{targets.contextdir}} \
--prefix ${{vars.prefix}} \
tf-nightly
- name: Install jupyter requirements
runs: |
pip${{range.key}} install \
--root ${{targets.contextdir}} \
--prefix ${{vars.prefix}} \
-r jupyter.requirements.txt
- name: Install bashrc
runs: |
mkdir -p ${{targets.contextdir}}/etc
cp bashrc ${{targets.contextdir}}/etc/bash.bashrc
- name: Install tensorflow tutorials
runs: |
mkdir -p ${{targets.contextdir}}/tf/tensorflow-tutorials
cp jupyter.readme.md ${{targets.contextdir}}/tf/tensorflow-tutorials/README.md
test:
environment:
contents:
packages:
- curl
pipeline:
- name: Test import of IPython kernel for Jupyter
runs: |
python3 -m ipykernel.kernelspec
- name: Test import of Tensorflow
- runs: |
python -c 'import tensorflow as tf'
- name: Test Juputer notebook run
runs: |
mkdir /tmp/tf
jupyter notebook --notebook-dir=/tmp/tf --ip 0.0.0.0 --no-browser --allow-root >/dev/null 2>&1 &
pid=$!
sleep 5
curl --fail --location --request GET --head localhost:8888
kill $pid
update:
enabled: true
git: {}
schedule:
period: daily
reason: Upstream does not maintain tags or releases

0 comments on commit 5bedf1f

Please sign in to comment.