-
Notifications
You must be signed in to change notification settings - Fork 617
Publish dev container #1888
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
Publish dev container #1888
Changes from all commits
1222eea
e8489e3
6058361
f77e5d8
f85e2af
8b0f05e
e456790
0b53e58
f2f782f
4fd6fb3
e89a515
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -x -e | ||
|
|
||
| df -h | ||
| docker info | ||
| # to get more disk space | ||
| rm -rf /usr/share/dotnet & | ||
|
|
||
| tools/build_dev_container.sh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,6 +82,7 @@ jobs: | |
| py-version: ['3.5', '3.6', '3.7', '3.8'] | ||
| tf-version: ['2.3.0'] | ||
| fail-fast: false | ||
| if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' | ||
| steps: | ||
| - uses: actions/download-artifact@v1 | ||
| with: | ||
|
|
@@ -92,7 +93,17 @@ jobs: | |
| ls -la dist/ | ||
| sha256sum dist/*.whl | ||
| - uses: pypa/[email protected] | ||
| if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' | ||
| with: | ||
| user: __token__ | ||
| password: ${{ secrets.pypi_token }} | ||
| upload-dev-container: | ||
| name: Upload dev container to DockerHub | ||
| needs: [release-wheel, test-with-bazel] | ||
| runs-on: ubuntu-18.04 | ||
| if: (github.event_name == 'push' && github.ref == 'refs/heads/master') | ||
| steps: | ||
| - run: | | ||
| set -e -x | ||
| docker login --username ${{ secrets.DOCKER_USER }} --password ${{ secrets.DOCKER_PW }} | ||
| bash bash .github/workflows/github_build_dev_container.sh | ||
| docker push tfaddons/dev_container:latest-cpu | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -267,7 +267,7 @@ to install any additional tools. | |
|
|
||
| CPU Docker: | ||
| ```bash | ||
| docker run --rm -it -v ${PWD}:/addons -w /addons tensorflow/tensorflow:2.1.0-custom-op-ubuntu16 | ||
| docker run --rm -it -v ${PWD}:/addons -w /addons tfaddons/dev_container:latest-cpu | ||
| ``` | ||
|
|
||
| GPU Docker: | ||
|
|
@@ -289,6 +289,7 @@ python3 -m pip install -r tools/install_deps/pytest.txt | |
|
|
||
| Compile the custom ops | ||
| ```bash | ||
| export TF_NEED_CUDA=1 # If GPU is to be used | ||
seanpmorgan marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that we need to set this only in the GPU image There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but also if it's built from source locally. |
||
| bash tools/install_so_files.sh | ||
| ``` | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -x -e | ||
|
|
||
| DOCKER_BUILDKIT=1 docker build \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could duplicate this command with the build_args to publish the GPU image. See the ARGS comment below. |
||
| -f tools/docker/dev_container.Dockerfile \ | ||
| --build-arg TF_VERSION=2.2.0 \ | ||
| --build-arg TF_PACKAGE=tensorflow-cpu \ | ||
| --target dev_container_cpu \ | ||
| -t tfaddons/dev_container:latest-cpu ./ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #syntax=docker/dockerfile:1.1.5-experimental | ||
| FROM tensorflow/tensorflow:2.1.0-custom-op-ubuntu16 as dev_container_cpu | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here you lost the build ARGS to prepare the switch between cpu and gpu that was in https://github.com/seanpmorgan/addons/pull/14/files#diff-76fe3c36c889ccfcf62f6e35439d030fR3-R5 |
||
| ARG TF_PACKAGE | ||
| ARG TF_VERSION | ||
|
|
||
| # Temporary until custom-op container is updated | ||
| RUN ln -sf /usr/bin/python3 /usr/bin/python | ||
| RUN ln -sf /usr/local/bin/pip3 /usr/local/bin/pip | ||
| RUN pip install --default-timeout=1000 $TF_PACKAGE==$TF_VERSION | ||
seanpmorgan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| COPY tools/install_deps /install_deps | ||
| COPY requirements.txt /tmp/requirements.txt | ||
| RUN pip install -r /install_deps/black.txt \ | ||
| -r /install_deps/flake8.txt \ | ||
| -r /install_deps/pytest.txt \ | ||
| -r /install_deps/typedapi.txt \ | ||
| -r /tmp/requirements.txt | ||
|
|
||
| RUN bash /install_deps/buildifier.sh | ||
| RUN bash /install_deps/clang-format.sh | ||
|
|
||
| ENV ADDONS_DEV_CONTAINER="1" | ||
|
|
||
| # Clean up | ||
| RUN apt-get autoremove -y \ | ||
| && apt-get clean -y \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| #!/usr/bin/env bash | ||
| # usage: bash tools/pre-commit.sh | ||
| # by default uses docker buildkit. | ||
| # to disable it: | ||
| # DOCKER_BUILDKIT=0 bash tools/pre-commit.sh | ||
|
|
||
|
|
||
| set -e | ||
|
|
||
| export DOCKER_BUILDKIT=1 | ||
| docker build -t tf_addons_formatting -f tools/docker/pre-commit.Dockerfile . | ||
| if [ -z "${ADDONS_DEV_CONTAINER}" ]; then | ||
| export DOCKER_BUILDKIT=1 | ||
| docker build -t tf_addons_formatting -f tools/docker/pre-commit.Dockerfile . | ||
|
|
||
| export MSYS_NO_PATHCONV=1 | ||
| docker run --rm -t -v "$(pwd -P):/addons" tf_addons_formatting | ||
| export MSYS_NO_PATHCONV=1 | ||
| docker run --rm -t -v "$(pwd -P):/addons" tf_addons_formatting | ||
| else | ||
| python tools/format.py | ||
| fi |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could duplicate this command to push the
latestwithout suffixes (that is the GPU image)