Skip to content

Commit b2c2bee

Browse files
committed
add tensorflow recipe
1 parent 03d8051 commit b2c2bee

File tree

3 files changed

+348
-0
lines changed

3 files changed

+348
-0
lines changed

.github/workflows/build-act-wheels.yml

+161
Original file line numberDiff line numberDiff line change
@@ -3099,3 +3099,164 @@ jobs:
30993099
name: torch-macos-aarch64
31003100
path: torch*.whl
31013101
if-no-files-found: error
3102+
opt_einsum-linux-amd64:
3103+
runs-on:
3104+
- self-hosted
3105+
- Linux
3106+
- X64
3107+
container: quay.io/pypa/manylinux_2_28_x86_64
3108+
needs: torch-linux-amd64
3109+
if: inputs.name == '' || inputs.name == 'opt_einsum'
3110+
steps:
3111+
- name: Install dependencies
3112+
run: |
3113+
dnf install -y epel-release
3114+
crb enable
3115+
dnf makecache --refresh
3116+
dnf module install -y nodejs:18
3117+
dnf install -y /usr/bin/patch
3118+
- name: Checkout
3119+
uses: actions/checkout@v3
3120+
- name: Setup custom GraalPy
3121+
if: inputs.graalpy != ''
3122+
run: |-
3123+
curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz
3124+
mkdir -p graalpy
3125+
tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz
3126+
graalpy/bin/graalpy -s -m ensurepip
3127+
graalpy/bin/graalpy -m pip install wheel
3128+
- name: Setup GraalPy
3129+
uses: actions/setup-python@main
3130+
if: inputs.graalpy == ''
3131+
with:
3132+
python-version: graalpy23.1
3133+
- name: Setup local GraalPy venv
3134+
if: inputs.graalpy == ''
3135+
run: python -m venv graalpy
3136+
- name: Download artifacts from torch
3137+
uses: actions/download-artifact@v3
3138+
with:
3139+
name: torch-linux-amd64
3140+
- name: Build wheel
3141+
run: |-
3142+
export PIP_FIND_LINKS=$(pwd)
3143+
export PATH=$(pwd)/graalpy/bin/:$PATH
3144+
graalpy/bin/graalpy -m pip wheel --find-links $(pwd) opt_einsum
3145+
- name: Store wheels
3146+
uses: umutozd/upload-artifact@5c459179e7745e2c730c50b10a6459da0b6f25db
3147+
with:
3148+
name: opt_einsum-linux-amd64
3149+
path: opt*einsum*.whl
3150+
if-no-files-found: error
3151+
keras_preprocessing-linux-amd64:
3152+
runs-on:
3153+
- self-hosted
3154+
- Linux
3155+
- X64
3156+
container: quay.io/pypa/manylinux_2_28_x86_64
3157+
needs: opt_einsum-linux-amd64
3158+
if: inputs.name == '' || inputs.name == 'keras_preprocessing'
3159+
steps:
3160+
- name: Install dependencies
3161+
run: |
3162+
dnf install -y epel-release
3163+
crb enable
3164+
dnf makecache --refresh
3165+
dnf module install -y nodejs:18
3166+
dnf install -y /usr/bin/patch
3167+
- name: Checkout
3168+
uses: actions/checkout@v3
3169+
- name: Setup custom GraalPy
3170+
if: inputs.graalpy != ''
3171+
run: |-
3172+
curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz
3173+
mkdir -p graalpy
3174+
tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz
3175+
graalpy/bin/graalpy -s -m ensurepip
3176+
graalpy/bin/graalpy -m pip install wheel
3177+
- name: Setup GraalPy
3178+
uses: actions/setup-python@main
3179+
if: inputs.graalpy == ''
3180+
with:
3181+
python-version: graalpy23.1
3182+
- name: Setup local GraalPy venv
3183+
if: inputs.graalpy == ''
3184+
run: python -m venv graalpy
3185+
- name: Download artifacts from opt_einsum
3186+
uses: actions/download-artifact@v3
3187+
with:
3188+
name: opt_einsum-linux-amd64
3189+
- name: Build wheel
3190+
run: |-
3191+
export PIP_FIND_LINKS=$(pwd)
3192+
export PATH=$(pwd)/graalpy/bin/:$PATH
3193+
graalpy/bin/graalpy -m pip wheel --find-links $(pwd) keras_preprocessing
3194+
- name: Store wheels
3195+
uses: umutozd/upload-artifact@5c459179e7745e2c730c50b10a6459da0b6f25db
3196+
with:
3197+
name: keras_preprocessing-linux-amd64
3198+
path: keras*preprocessing*.whl
3199+
if-no-files-found: error
3200+
tensorflow-linux-amd64:
3201+
runs-on:
3202+
- self-hosted
3203+
- Linux
3204+
- X64
3205+
container: quay.io/pypa/manylinux_2_28_x86_64
3206+
needs:
3207+
- opt_einsum-linux-amd64
3208+
- keras_preprocessing-linux-amd64
3209+
if: inputs.name == '' || inputs.name == 'tensorflow'
3210+
steps:
3211+
- name: Install dependencies
3212+
run: |-
3213+
dnf install -y epel-release
3214+
crb enable
3215+
dnf makecache --refresh
3216+
dnf module install -y nodejs:18
3217+
dnf install -y /usr/bin/patch
3218+
dnf install -y openblas-devel /usr/bin/cmake /usr/bin/sudo /usr/bin/curl java-11-openjdk-devel
3219+
- name: Checkout
3220+
uses: actions/checkout@v3
3221+
- name: Setup custom GraalPy
3222+
if: inputs.graalpy != ''
3223+
run: |-
3224+
curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz
3225+
mkdir -p graalpy
3226+
tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz
3227+
graalpy/bin/graalpy -s -m ensurepip
3228+
graalpy/bin/graalpy -m pip install wheel
3229+
- name: Setup GraalPy
3230+
uses: actions/setup-python@main
3231+
if: inputs.graalpy == ''
3232+
with:
3233+
python-version: graalpy23.1
3234+
- name: Setup local GraalPy venv
3235+
if: inputs.graalpy == ''
3236+
run: python -m venv graalpy
3237+
- name: Download artifacts from opt_einsum
3238+
uses: actions/download-artifact@v3
3239+
with:
3240+
name: opt_einsum-linux-amd64
3241+
- name: Download artifacts from keras_preprocessing
3242+
uses: actions/download-artifact@v3
3243+
with:
3244+
name: keras_preprocessing-linux-amd64
3245+
- name: Build wheel
3246+
run: |-
3247+
export PIP_FIND_LINKS=$(pwd)
3248+
pip install pip numpy wheel packaging requests opt_einsum
3249+
pip install keras_preprocessing --no-deps
3250+
curl -L https://github.com/bazelbuild/bazel/releases/download/6.4.0/bazel-6.4.0-linux-x86_64 -o $(pwd)/graalpy/bin/bazel
3251+
chmod +x graalpy/bin/bazel
3252+
export PATH=$(pwd)/graalpy/bin/:$PATH
3253+
bazel --version
3254+
export PIP_FIND_LINKS=$(pwd)
3255+
export PATH=$(pwd)/graalpy/bin/:$PATH
3256+
graalpy/bin/graalpy -m pip wheel --find-links $(pwd) tensorflow
3257+
- name: Store wheels
3258+
uses: umutozd/upload-artifact@5c459179e7745e2c730c50b10a6459da0b6f25db
3259+
with:
3260+
name: tensorflow-linux-amd64
3261+
path: tensorflow*.whl
3262+
if-no-files-found: error

.github/workflows/build-linux-amd64-wheels.yml

+162
Original file line numberDiff line numberDiff line change
@@ -842,3 +842,165 @@ jobs:
842842
name: torch-linux-amd64
843843
path: torch*.whl
844844
if-no-files-found: error
845+
opt_einsum-linux-amd64:
846+
runs-on:
847+
- self-hosted
848+
- Linux
849+
- X64
850+
container: quay.io/pypa/manylinux_2_28_x86_64
851+
needs: torch-linux-amd64
852+
if: inputs.name == '' || inputs.name == 'opt_einsum' || inputs.name == 'tensorflow'
853+
steps:
854+
- name: Install dependencies
855+
run: |
856+
dnf install -y epel-release
857+
crb enable
858+
dnf makecache --refresh
859+
dnf module install -y nodejs:18
860+
dnf install -y /usr/bin/patch
861+
- name: Checkout
862+
uses: actions/checkout@v3
863+
- name: Setup custom GraalPy
864+
if: inputs.graalpy != ''
865+
run: |-
866+
curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz
867+
mkdir -p graalpy
868+
tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz
869+
graalpy/bin/graalpy -s -m ensurepip
870+
graalpy/bin/graalpy -m pip install wheel
871+
- name: Setup GraalPy
872+
uses: actions/setup-python@main
873+
if: inputs.graalpy == ''
874+
with:
875+
python-version: graalpy23.1
876+
- name: Setup local GraalPy venv
877+
if: inputs.graalpy == ''
878+
run: python -m venv graalpy
879+
- name: Download artifacts from torch
880+
uses: actions/download-artifact@v3
881+
with:
882+
name: torch-linux-amd64
883+
- name: Build wheel
884+
run: |-
885+
export PIP_FIND_LINKS=$(pwd)
886+
export PATH=$(pwd)/graalpy/bin/:$PATH
887+
graalpy/bin/graalpy -m pip wheel --find-links $(pwd) opt_einsum
888+
- name: Store wheels
889+
uses: umutozd/upload-artifact@5c459179e7745e2c730c50b10a6459da0b6f25db
890+
with:
891+
name: opt_einsum-linux-amd64
892+
path: opt*einsum*.whl
893+
if-no-files-found: error
894+
keras_preprocessing-linux-amd64:
895+
runs-on:
896+
- self-hosted
897+
- Linux
898+
- X64
899+
container: quay.io/pypa/manylinux_2_28_x86_64
900+
needs: opt_einsum-linux-amd64
901+
if: inputs.name == '' || inputs.name == 'keras_preprocessing' || inputs.name ==
902+
'tensorflow'
903+
steps:
904+
- name: Install dependencies
905+
run: |
906+
dnf install -y epel-release
907+
crb enable
908+
dnf makecache --refresh
909+
dnf module install -y nodejs:18
910+
dnf install -y /usr/bin/patch
911+
- name: Checkout
912+
uses: actions/checkout@v3
913+
- name: Setup custom GraalPy
914+
if: inputs.graalpy != ''
915+
run: |-
916+
curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz
917+
mkdir -p graalpy
918+
tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz
919+
graalpy/bin/graalpy -s -m ensurepip
920+
graalpy/bin/graalpy -m pip install wheel
921+
- name: Setup GraalPy
922+
uses: actions/setup-python@main
923+
if: inputs.graalpy == ''
924+
with:
925+
python-version: graalpy23.1
926+
- name: Setup local GraalPy venv
927+
if: inputs.graalpy == ''
928+
run: python -m venv graalpy
929+
- name: Download artifacts from opt_einsum
930+
uses: actions/download-artifact@v3
931+
with:
932+
name: opt_einsum-linux-amd64
933+
- name: Build wheel
934+
run: |-
935+
export PIP_FIND_LINKS=$(pwd)
936+
export PATH=$(pwd)/graalpy/bin/:$PATH
937+
graalpy/bin/graalpy -m pip wheel --find-links $(pwd) keras_preprocessing
938+
- name: Store wheels
939+
uses: umutozd/upload-artifact@5c459179e7745e2c730c50b10a6459da0b6f25db
940+
with:
941+
name: keras_preprocessing-linux-amd64
942+
path: keras*preprocessing*.whl
943+
if-no-files-found: error
944+
tensorflow-linux-amd64:
945+
runs-on:
946+
- self-hosted
947+
- Linux
948+
- X64
949+
container: quay.io/pypa/manylinux_2_28_x86_64
950+
needs:
951+
- opt_einsum-linux-amd64
952+
- keras_preprocessing-linux-amd64
953+
if: inputs.name == '' || inputs.name == 'tensorflow'
954+
steps:
955+
- name: Install dependencies
956+
run: |-
957+
dnf install -y epel-release
958+
crb enable
959+
dnf makecache --refresh
960+
dnf module install -y nodejs:18
961+
dnf install -y /usr/bin/patch
962+
dnf install -y openblas-devel /usr/bin/cmake /usr/bin/sudo /usr/bin/curl java-11-openjdk-devel
963+
- name: Checkout
964+
uses: actions/checkout@v3
965+
- name: Setup custom GraalPy
966+
if: inputs.graalpy != ''
967+
run: |-
968+
curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz
969+
mkdir -p graalpy
970+
tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz
971+
graalpy/bin/graalpy -s -m ensurepip
972+
graalpy/bin/graalpy -m pip install wheel
973+
- name: Setup GraalPy
974+
uses: actions/setup-python@main
975+
if: inputs.graalpy == ''
976+
with:
977+
python-version: graalpy23.1
978+
- name: Setup local GraalPy venv
979+
if: inputs.graalpy == ''
980+
run: python -m venv graalpy
981+
- name: Download artifacts from opt_einsum
982+
uses: actions/download-artifact@v3
983+
with:
984+
name: opt_einsum-linux-amd64
985+
- name: Download artifacts from keras_preprocessing
986+
uses: actions/download-artifact@v3
987+
with:
988+
name: keras_preprocessing-linux-amd64
989+
- name: Build wheel
990+
run: |-
991+
export PIP_FIND_LINKS=$(pwd)
992+
pip install pip numpy wheel packaging requests opt_einsum
993+
pip install keras_preprocessing --no-deps
994+
curl -L https://github.com/bazelbuild/bazel/releases/download/6.4.0/bazel-6.4.0-linux-x86_64 -o $(pwd)/graalpy/bin/bazel
995+
chmod +x graalpy/bin/bazel
996+
export PATH=$(pwd)/graalpy/bin/:$PATH
997+
bazel --version
998+
export PIP_FIND_LINKS=$(pwd)
999+
export PATH=$(pwd)/graalpy/bin/:$PATH
1000+
graalpy/bin/graalpy -m pip wheel --find-links $(pwd) tensorflow
1001+
- name: Store wheels
1002+
uses: umutozd/upload-artifact@5c459179e7745e2c730c50b10a6459da0b6f25db
1003+
with:
1004+
name: tensorflow-linux-amd64
1005+
path: tensorflow*.whl
1006+
if-no-files-found: error

scripts/wheelbuilder/generate_workflow.py

+25
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,31 @@
156156
"BUILD_TEST": 0,
157157
},
158158
)
159+
opt_einsum = BuildSpec(
160+
name="opt_einsum",
161+
platforms=[LinuxX86],
162+
)
163+
keras_preprocessing = BuildSpec(
164+
name="keras_preprocessing",
165+
platforms=[LinuxX86],
166+
)
167+
BuildSpec(
168+
name="tensorflow",
169+
platforms=[LinuxX86],
170+
spec_dependencies=[opt_einsum, keras_preprocessing],
171+
before_build=[
172+
"export PIP_FIND_LINKS=$(pwd)",
173+
"pip install pip numpy wheel packaging requests opt_einsum",
174+
"pip install keras_preprocessing --no-deps",
175+
"curl -L https://github.com/bazelbuild/bazel/releases/download/6.4.0/bazel-6.4.0-linux-x86_64 -o $(pwd)/graalpy/bin/bazel",
176+
"chmod +x graalpy/bin/bazel",
177+
"export PATH=$(pwd)/graalpy/bin/:$PATH",
178+
"bazel --version",
179+
],
180+
system_dependencies=[
181+
"openblas-devel", "/usr/bin/cmake", "/usr/bin/sudo", "/usr/bin/curl", "java-11-openjdk-devel"
182+
],
183+
)
159184

160185

161186
if __name__ == "__main__":

0 commit comments

Comments
 (0)