Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Add GitHub workflow for building+installing into toolchain via CMake. #1179

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dan-zheng
Copy link
Member

Add GitHub Actions workflow for:

  • Downloading and installing a swift.org/download macOS development snapshot
  • Building tensorflow/swift-apis via CMake
  • Installing tensorflow/swift-apis into the toolchain via CMake
  • Repackaging the toolchain into a .pkg
  • Publishing the toolchain .pkg artifact

This allows users to download standard swift.org/download toolchains with
TensorFlow and X10 installed.

@dan-zheng dan-zheng force-pushed the macos-cmake-toolchain branch 7 times, most recently from ce78044 to 7531c5c Compare January 6, 2021 15:03
Copy link
Contributor

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that if we are doing this, it would be nice to do all the targets (or at least the ones that are on GHA).

.github/workflows/macOS-CMake-toolchain.yml Outdated Show resolved Hide resolved
.github/workflows/macOS-CMake-toolchain.yml Show resolved Hide resolved
.github/workflows/macOS-CMake-toolchain.yml Outdated Show resolved Hide resolved
.github/workflows/macOS-CMake-toolchain.yml Outdated Show resolved Hide resolved
.github/workflows/macOS-CMake-toolchain.yml Outdated Show resolved Hide resolved
.github/workflows/macOS-CMake-toolchain.yml Outdated Show resolved Hide resolved
.github/workflows/macOS-CMake-toolchain.yml Outdated Show resolved Hide resolved
.github/workflows/macOS-CMake-toolchain.yml Outdated Show resolved Hide resolved
.github/workflows/macOS-CMake-toolchain.yml Outdated Show resolved Hide resolved
.github/workflows/macOS-CMake-toolchain.yml Outdated Show resolved Hide resolved
@dan-zheng dan-zheng force-pushed the macos-cmake-toolchain branch 7 times, most recently from 80765a9 to f1cf159 Compare January 6, 2021 22:43
uses: actions/upload-artifact@v2
with:
name: swift-tensorflow-DEVELOPMENT-SNAPSHOT-${{ env.toolchain-date }}-a-osx.pkg
path: '*.pkg'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this needs to be made conditional. This will do a GH release per PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. I wonder what do you think is a good condition, and how to add it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried adding some conditional steps, but they still seem to run unconditionally even when the guard condition is false. Any clue why or how to do better?

- name: Build toolchain package installer
if: env.should_build_toolchain_installer
run: |
TOOLCHAIN_ROOT_LOCATION="/Library/Developer/Toolchains/${TOOLCHAIN_NAME}.xctoolchain"
TF_TOOLCHAIN_NAME="swift-tensorflow-DEVELOPMENT-SNAPSHOT-${TOOLCHAIN_DATE}-a"
pkgbuild --identifier org.tensorflow-${TOOLCHAIN_SHORT_DATE} \
--install-location ${TOOLCHAIN_ROOT_LOCATION} \
--version 5.0.${TOOLCHAIN_SHORT_DATE} \
--root ${DEST_TOOLCHAIN_LOCATION} \
${TF_TOOLCHAIN_NAME}-osx.pkg
- name: Upload toolchain package installer
if: env.should_build_toolchain_installer
uses: actions/upload-artifact@v2
with:
name: swift-tensorflow-DEVELOPMENT-SNAPSHOT-${{ env.toolchain_date }}-a-osx.pkg
path: '*.pkg'

https://github.com/tensorflow/swift-apis/runs/1660455199

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that we could do this on tags only. I think that tags are uncommon enough where it may make sense for building on a tag even when its not an actual release but some point that we want to archive.

@dan-zheng dan-zheng force-pushed the macos-cmake-toolchain branch 4 times, most recently from 292a503 to 6dc2cce Compare January 7, 2021 04:07
Add GitHub Actions workflow for:
- Downloading and installing a swift.org/download macOS development snapshot
- Building tensorflow/swift-apis via CMake
- Installing tensorflow/swift-apis into the toolchain via CMake
- Repackaging the toolchain into a .pkg
- Publishing the toolchain .pkg artifact
  - Currently, this is done only for manually-triggered runs based on an
    input condition.

This allows users to download standard swift.org/download toolchains with
TensorFlow and X10 installed.
@dan-zheng
Copy link
Member Author

The repackaged toolchains built as part of this GitHub action are currently not right (way too small, much is missing). I'm not sure why, would be good to investigate. This action is still useful for testing CMake-based builds and installs.

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

Successfully merging this pull request may close these issues.

None yet

2 participants