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

instructions to build locally #291

Open
ngam opened this issue Dec 14, 2022 · 5 comments
Open

instructions to build locally #291

ngam opened this issue Dec 14, 2022 · 5 comments
Labels

Comments

@ngam
Copy link
Contributor

ngam commented Dec 14, 2022

Comment:

For OSX, from xhochy:

(Note this deletes ~/.condarc)

% cat nightly.sh build-logged.sh
#!/bin/bash

set -e

arch -x86_64 bash ./build-logged.sh osx_64_numpy1.18python3.7.____cpython
arch -x86_64 bash ./build-logged.sh osx_64_numpy1.18python3.8.____cpython
arch -x86_64 bash ./build-logged.sh osx_64_numpy1.19python3.9.____cpython
arch -x86_64 bash ./build-logged.sh osx_64_numpy1.21python3.10.____cpython
bash ./build-logged.sh osx_arm64_numpy1.19python3.8.____cpython
bash ./build-logged.sh osx_arm64_numpy1.19python3.9.____cpython
bash ./build-logged.sh osx_arm64_numpy1.21python3.10.____cpython
#!/bin/bash

set -exuo pipefail

VARIANT=$1

gh repo clone conda-forge/tensorflow-feedstock tensorflow-feedstock-${VARIANT}
pushd tensorflow-feedstock-${VARIANT}
gh pr checkout 189
rm -f ~/.condarc
OSX_SDK_DIR=/opt ./build-locally.py ${VARIANT} 2>&1 | tee ${VARIANT}.log
gh gist create ${VARIANT}.log

For Linux, from hmaarrfk:

#!/usr/env/bin bash

set -ex

docker system prune --force
configs=$(find .ci_support/ -type f -name 'linux_64_*' -printf "%p ")

# Assuming a powerful enough machine with many cores
# 10 seems to be a good point where things don't run out of RAM too much.
export CPU_COUNT=10

mkdir -p build_artifacts

for config_filename in $configs; do
    filename=$(basename ${config_filename})
    config=${filename%.*}
    if [ -f build_artifacts/conda-forge-build-done-${config} ]; then
        echo skipped $config
        continue
    fi

    python build-locally.py $config | tee build_artifacts/${config}-log.txt

    if [ ! -f build_artifacts/conda-forge-build-done-${config} ]; then
        echo "it seems there was a build failure. I'm going to stop now."
        echo The failure seems to have originated from
        echo ${config}
        exit 1
    fi
    # docker images get quite big clean them up after each build to save your disk....
    docker system prune --force
done

zip build_artifacts/log_files.zip build_artifacts/*-log.txt
@hmaarrfk hmaarrfk pinned this issue Dec 20, 2022
@ngam ngam changed the title build locally instructions instructions to build locally Dec 25, 2022
@hmaarrfk
Copy link
Contributor

hmaarrfk commented Jan 8, 2023

Adapting the command below accordingly can be useful in uploading all the generated packages:

LABEL=cfep03
DELEGATE=channel_to_copy_from
PACKAGE_VERSION=VERSION
for package in tensorflow-base tensorflow tensorflow-estimator libtensorflow libtensorflow_cc tensorflow-cpu tensorflow-gpu; do
  anaconda copy --from-label ${LABEL} --to-label main --to-owner conda-forge ${DELEGATE}/${package}/${PACKAGE_VERSION}
done

@Tobias-Fischer
Copy link
Contributor

The instructions to build linux-aarch64 on an osx-arm64 machine (nearly identical to linux-64 above, just replacing the non-posix printf with awk):

#!/usr/env/bin bash

set -ex

docker system prune --force
configs=$(find .ci_support/ -type f -name 'linux_aarch64_*' | awk '{printf "%s ", $0}')

# Assuming a powerful enough machine with many cores
# 10 seems to be a good point where things don't run out of RAM too much.
export CPU_COUNT=6

mkdir -p build_artifacts

for config_filename in $configs; do
    filename=$(basename ${config_filename})
    config=${filename%.*}
    if [ -f build_artifacts/conda-forge-build-done-${config} ]; then
        echo skipped $config
        continue
    fi

    python build-locally.py $config | tee build_artifacts/${config}-log.txt

    if [ ! -f build_artifacts/conda-forge-build-done-${config} ]; then
        echo "it seems there was a build failure. I'm going to stop now."
        echo The failure seems to have originated from
        echo ${config}
        exit 1
    fi
    # docker images get quite big clean them up after each build to save your disk....
    docker system prune --force
done

zip build_artifacts/log_files.zip build_artifacts/*-log.txt

This was referenced Mar 15, 2023
@hmaarrfk

This comment was marked as outdated.

@ngam
Copy link
Contributor Author

ngam commented Jul 15, 2023

I recently used the following to build in #325

Setup

SETUP:

~$ cat nightly.sh build-logged.sh

#!/bin/bash

set -e

arch -x86_64 bash ./build-logged.sh osx_64_numpy1.21python3.10.____cpython
arch -x86_64 bash ./build-logged.sh osx_64_numpy1.21python3.8.____cpython
arch -x86_64 bash ./build-logged.sh osx_64_numpy1.21python3.9.____cpython
arch -x86_64 bash ./build-logged.sh osx_64_numpy1.23python3.11.____cpython
bash ./build-logged.sh osx_arm64_numpy1.21python3.10.____cpython
bash ./build-logged.sh osx_arm64_numpy1.21python3.8.____cpython
bash ./build-logged.sh osx_arm64_numpy1.21python3.9.____cpython
bash ./build-logged.sh osx_arm64_numpy1.23python3.11.____cpython
set -exuo pipefail

VARIANT=$1

gh repo clone conda-forge/tensorflow-feedstock tensorflow-feedstock-${VARIANT}
pushd tensorflow-feedstock-${VARIANT}
gh pr checkout 325
CPU_COUNT=10 OSX_SDK_DIR=/opt ./build-locally.py ${VARIANT} 2>&1 | tee ${VARIANT}.log
gh gist create ${VARIANT}.log

@hmaarrfk
Copy link
Contributor

hmaarrfk commented Jan 21, 2024

xhochy specific instructions to copy


PACKAGE_VERSION=....
LABEL=main

# Typically linux
DELEGATE=uwe.korn-tf-gpu
for package in tensorflow-base tensorflow tensorflow-estimator libtensorflow libtensorflow_cc tensorflow-cpu tensorflow-gpu; do
  anaconda copy --from-label ${LABEL} --to-label main --to-owner conda-forge ${DELEGATE}/${package}/${PACKAGE_VERSION}
done

# OSX -- GPU builds expected to return error
DELEGATE=uwe.korn-tf-experimental
for package in tensorflow-base tensorflow tensorflow-estimator libtensorflow libtensorflow_cc tensorflow-cpu tensorflow-gpu; do
  anaconda copy --from-label ${LABEL} --to-label main --to-owner conda-forge ${DELEGATE}/${package}/${PACKAGE_VERSION}
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants