Skip to content

Conversation

@seanpmorgan
Copy link
Member

Closes #1414

Discussion Points:

  1. This adds a bit of computation time to the action on commit push. I don't think this is a big deal as this doesn't slow down feedback to contributors
  2. There is no addons repository included in the docker image. I believe this is the correct pattern since we want users to load their own repository within the container
  3. Because of 2 there is no pre-compiled bazel cache. We could add it but then the calls to bazel in the repository would need to be pointed to that cache. Given that our build only takes a couple of minutes I'd prefer to do this in another PR if we want to.

I tested the image in VScode using a dev-container and it worked as expected.

@bhack
Copy link
Contributor

bhack commented May 26, 2020

I am looking at the compressed size of devel image TF vs TFA:

https://hub.docker.com/r/tensorflow/tensorflow/tags
https://hub.docker.com/r/tfaddons/tensorflow/tags

The TF CPU devel is 1/3 of our devel image and we have 1GB of compressed overhead over tensorflow GPU devel (uncompressed our is 9.2GB).

@bhack
Copy link
Contributor

bhack commented May 26, 2020

I think it could be useful to have a default small size 1GB image to lower the download overhead but I think that is still not possible to handle multiple configuration (GPU/CPU) in the dev-containers microsoft/vscode-remote-release#2143 (comment).

The new devcontainer support PR is at microsoft/vscode-dev-containers#347

@bhack
Copy link
Contributor

bhack commented May 26, 2020

Could you add

sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 100

@bhack
Copy link
Contributor

bhack commented May 26, 2020

If you could set the alias also for clang-format it could be useful

@seanpmorgan
Copy link
Member Author

I am looking at the compressed size of devel image TF vs TFA:

https://hub.docker.com/r/tensorflow/tensorflow/tags
https://hub.docker.com/r/tfaddons/tensorflow/tags

The TF CPU devel is 1/3 of our devel image and we have 1GB of compressed overhead over tensorflow GPU devel (uncompressed our is 9.2GB).

I think it could be useful to have a default small size 1GB image to lower the download overhead but I think that is still not possible to handle multiple configuration (GPU/CPU) in the dev-containers microsoft/vscode-remote-release#2143 (comment).

As discussed offline this is a consequence of tensorflow/tensorflow#38352 . There is not much we can do without deviating from the custom-op recommended images.

@seanpmorgan
Copy link
Member Author

Could you add

sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 100

Sure, but could you expand on why its needed. All of our documentation uses gcc and nvcc to compile. I know there was work on getting TF to compile using cuda-clang but not sure if we want to encourage that?

@bhack
Copy link
Contributor

bhack commented May 27, 2020

I've not checked in detail where we use what but I was thinking as a general rule to not going to ovveride to much settings properties in vsocde devcontainer about specific strings or to monitor if we change clang version cause there we are on another repository.
I prefer that we have the control in the image we are generating so we have constant alias.
If we don't care about clang probably we could do It only for clang-format?

@seanpmorgan seanpmorgan changed the title Publish dev container [WIP] Publish dev container May 27, 2020
@bhack

This comment has been minimized.

@bhack

This comment has been minimized.

@bhack
Copy link
Contributor

bhack commented May 30, 2020

I think that we need to update a little bit https://github.com/tensorflow/addons/blob/master/CONTRIBUTING.md after merging this. Can you open a ticket as a reminder?

@bhack

This comment has been minimized.

@seanpmorgan seanpmorgan changed the title [WIP] Publish dev container Publish dev container Jun 8, 2020
@@ -0,0 +1,25 @@
#syntax=docker/dockerfile:1.1.5-experimental
FROM tensorflow/tensorflow:2.1.0-custom-op-ubuntu16 as dev_container_cpu
Copy link
Contributor

Choose a reason for hiding this comment

The 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


set -x -e

DOCKER_BUILDKIT=1 docker build \
Copy link
Contributor

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 with the build_args to publish the GPU image. See the ARGS comment below.

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
Copy link
Contributor

@bhack bhack Jun 8, 2020

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 latest without suffixes (that is the GPU image)

@bhack
Copy link
Contributor

bhack commented Jun 16, 2020

As a reminder if you merge #1808 you need to add the requirements here.


Compile the custom ops
```
export TF_NEED_CUDA=1 # If GPU is to be used
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 we need to set this only in the GPU image

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but also if it's built from source locally.

@bhack
Copy link
Contributor

bhack commented Jul 10, 2020

@bhack bhack mentioned this pull request Aug 29, 2020
# Conflicts:
#	CONTRIBUTING.md
@seanpmorgan
Copy link
Member Author

@bhack @tensorflow/sig-addons-maintainers so there are still a few sharp edges here, but it aligns with the recent merge of SIG-IO:
tensorflow/io#1087

I would prefer that we merge this semi-hardcoded cpu devel build and then I'll open an issue and start work on a seperate GPU build. This got a bit stale and it'd be easier to get this merged and then upgrade it IMO. Also waiting for clarity from SIG-Build about custom-op images and their future. Does that seem okay?

@seanpmorgan seanpmorgan merged commit 6552d57 into tensorflow:master Sep 29, 2020
@seanpmorgan seanpmorgan deleted the dev-container branch September 29, 2020 19:03
jrruijli pushed a commit to jrruijli/addons that referenced this pull request Dec 23, 2020
* Add dev container build
* Add docker upload on commit push
* Modify pre-commit to work in dev container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish developer docker containers on dockerhub

3 participants