Skip to content

Commit

Permalink
Fix binary staging on MacOS (#223)
Browse files Browse the repository at this point in the history
* 0.3.x: Update the publish-npm script to allow publishing from the release branch. (#203)

DEV

* Upgrade 0.3.x to 0.15.3 (#210)


<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/tensorflow/tfjs-node/210)
<!-- Reviewable:end -->

* Fix win GPU packaging. (#208) (#211)

Turns out that the windows GPU builds for TensorFlow 1.12 lack the directory structure and eager headers. A bug has been filed with core TF - but we should bake in some fixes for this.

This PR simply refactors the downloading logic to a new file. I'd like to use this logic in the node-gles package as well (maybe worth releasing as a stand-alone package in the future).

After the refactoring, I check the directory structure in Windows. If the folder structure is missing, but the required tensorflow.dll exists - I re-create the directory structure, move and download the proper header files.

The screenshot below shows the contents of TF 1.12 Windows GPU:
![capture](https://user-images.githubusercontent.com/306276/53048799-719f4b80-344a-11e9-9004-3eef2446a246.PNG)

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/tensorflow/tfjs-node/208)
<!-- Reviewable:end -->

* Bump 0.3.1

* Add TensorBoard callback for model training: tf.node.tensorBoard() (#202) (#213)

FEATURE

See example screenshot:
![image](https://user-images.githubusercontent.com/16824702/52491877-19d52a80-2b96-11e9-8c24-5a403c2450d3.png)

Fixes #686

* [0.3.x] Upgrade nyc package fo fix lodash security issue. (#218) (#219)

Bump for 0.3.x so we can get a security release spun.

https://github.com/tensorflow/tfjs-node/network/alert/yarn.lock/lodash/open

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/tensorflow/tfjs-node/219)
<!-- Reviewable:end -->

* Bump to 0.3.2

* Upgrade TS libraries and change binding from typings file to plain
TypeScript definition.

* Upgrade TS dependencies

* save

* Fix deps-stage

* save

* Revert TS changes and keep binary staging fixes.
  • Loading branch information
nkreeger authored Mar 12, 2019
1 parent 3f8f64a commit afb2881
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion scripts/deps-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const path = require('path');
const libName =
os.platform() === 'win32' ? 'tensorflow.dll' : 'libtensorflow.so';
const frameworkLibName =
os.platform() === 'linux' ? 'libtensorflow_framework.so' : '';
os.platform() !== 'win32' ? 'libtensorflow_framework.so' : '';

const depsPath = path.join(__dirname, '..', 'deps');
const depsLibPath = path.join(depsPath, 'lib');
Expand Down
19 changes: 6 additions & 13 deletions scripts/deps-stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,15 @@ async function symlinkDepsLib() {
}
try {
await symlink(depsLibTensorFlowPath, destLibPath);
if (os.platform() === 'linux') {
await symlink(
depsLibTensorFlowFrameworkPath,
destFrameworkLibPath);
if (os.platform() !== 'win32') {
await symlink(depsLibTensorFlowFrameworkPath, destFrameworkLibPath);
}
} catch (e) {
console.error(
` * Symlink of ${destLibPath} failed, creating a copy on disk.`);
await copy(depsLibTensorFlowPath, destLibPath);
// Linux will require this library as well:
if (os.platform() === 'linux') {
await copy(
depsLibTensorFlowFrameworkPath,
destFrameworkLibPath);
if (os.platform() !== 'win32') {
await copy(depsLibTensorFlowFrameworkPath, destFrameworkLibPath);
}
}
}
Expand All @@ -73,10 +68,8 @@ async function symlinkDepsLib() {
*/
async function moveDepsLib() {
await rename(depsLibTensorFlowPath, destLibPath);
if (os.platform() === 'linux') {
await rename(
depsLibTensorFlowFrameworkPath,
destFrameworkLibPath);
if (os.platform() !== 'win32') {
await rename(depsLibTensorFlowFrameworkPath, destFrameworkLibPath);
}
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/publish-npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ set -e
BRANCH=`git rev-parse --abbrev-ref HEAD`
ORIGIN=`git config --get remote.origin.url`

if [ "$BRANCH" != "master" ]; then
echo "Error: Switch to the master branch before publishing."
if [ "$BRANCH" != "master" ] && [ "$BRANCH" != "0.3.x" ]; then
echo "Error: Switch to the master or a release branch before publishing."
exit
fi

Expand Down

0 comments on commit afb2881

Please sign in to comment.