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

Remove grpc-teleterm Make target and Dockerfile-teleterm #20032

Merged
merged 9 commits into from
Jan 26, 2023

Conversation

ravicious
Copy link
Member

@ravicious ravicious commented Jan 10, 2023

grpc-teleterm and Dockerfile-teleterm were originally added because generating JS protobufs on arm64 involved compiling grpc_node_plugin from source. It's a binary that needs a lot of deps and compiling it takes a few minutes even on new MBPs.

In order to not have every dev on arm64 pay this cost just so that the Connect team can generate JS protobufs, we decided to create a separate Dockerfile and use a separate Make target.

It's been a year and Connect became even more reliant on code outside of lib/teleterm. We now want to share protos with lib/prehog (#19774) and Dockerfile-teleterm started being used to create Linux packages for Connect. Having a separate target doesn't make sense anymore and thanks to what Alan did with libfido2 in the Dockerfile, I found a way to build grpc_node_plugin once and cache the result.

This allows us to remove grpc-teleterm in favor of adding lib/teleterm proto generation to make grpc.


Since Dockerfile-teleterm was used during tag builds, I made 12.0.0-dev.ravicious.2 that used changes from this PR and it passed successfully. That was before a rebase on master which didn't include some minor changes to JS protos, so I'm running another tag build, 12.0.0-dev.ravicious.3, to verify again that everything's okay.

@ravicious ravicious force-pushed the ravicious/remove-grpc-teleterm branch 2 times, most recently from b574001 to c5cceba Compare January 11, 2023 10:10
@ravicious ravicious force-pushed the ravicious/remove-grpc-teleterm branch from c5cceba to 4e86f38 Compare January 11, 2023 10:15
@@ -7,7 +7,11 @@
# teleport built on any newer Ubuntu version will not run on Centos 7 because
# of this.

ARG RUST_VERSION
Copy link
Member Author

Choose a reason for hiding this comment

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

RUST_VERSION was defined twice in Dockerfile.

Comment on lines +30 to +36
# Generate lib/teleterm & JS protos.
# TODO(ravicious): Refactor generating JS protos to follow the approach from above, that is have a
# separate call to generate Go protos and another for JS protos instead of having
# teleterm-specific buf.gen.yaml files.
# https://github.com/gravitational/teleport/pull/19774#discussion_r1061524458
buf generate --template=lib/prehog/buf-teleterm.gen.yaml lib/prehog/proto
buf generate --template=lib/teleterm/buf.gen.yaml lib/teleterm/api/proto
Copy link
Member Author

Choose a reason for hiding this comment

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

Originally I wanted to do this in this PR. But the list of changes is already big enough so I'll handle that in a separate PR (which I'm working on at the moment).

@ravicious ravicious marked this pull request as ready for review January 11, 2023 10:17
@github-actions github-actions bot requested review from fspmarshall and mdwn January 11, 2023 10:17

# A "conditional" FROM like this breaks up the number of steps in the progress bar of the given
# image, so let's use it at the end. This way the progress bar for buildbox stays mostly untouched.
FROM grpc_node_plugin_binary_${GRPC_NODE_PLUGIN_BINARY_TYPE} as buildbox
Copy link
Member Author

Choose a reason for hiding this comment

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

This conditional FROM is based on this SO answer: https://stackoverflow.com/a/60820156/742872

@ravicious ravicious force-pushed the ravicious/remove-grpc-teleterm branch from 4e86f38 to 2d6ad31 Compare January 12, 2023 09:41
It was used to format protos but we use Buf for that since v10.
This commit basically takes grpc_node_plugin compilation from
Dockerfile-teleterm and moves it to Dockerfile.
After moving grpc_node_plugin compilation to Dockerfile, the only remaining
thing that Dockerfile-teleterm does is installing rpm so that we can make
an RPM package for Connect during tag builds.

Installing this package can be simply moved to Dockerfile.
It looks like they're a result of someone changing protos in lib/prehog
without running `make grpc-teleterm` separately. Which is why we're getting
rid of grpc-teleterm as a separate Make target in the first place. ;)
@ravicious ravicious force-pushed the ravicious/remove-grpc-teleterm branch from 2d6ad31 to d983f38 Compare January 19, 2023 10:51
@ravicious
Copy link
Member Author

ravicious commented Jan 19, 2023

Rebased on master with very minimal changes. During the webapps merge, #20361 was merged as well which also added Node.js to build.assets/Dockerfile so I removed that from my commit.

I'm about to start a new tag build to verify that everything still works. https://drone.platform.teleport.sh/gravitational/teleport/19554

Edit: It went through!

@ravicious
Copy link
Member Author

@fspmarshall Ping.

@ravicious ravicious merged commit 6791b48 into master Jan 26, 2023
@github-actions
Copy link

@ravicious See the table below for backport results.

Branch Result
branch/v11 Failed
branch/v12 Create PR

@ravicious ravicious deleted the ravicious/remove-grpc-teleterm branch January 26, 2023 08:43
ravicious added a commit that referenced this pull request Feb 1, 2023
* Remove CLANG_FORMAT from Makefiles

It was used to format protos but we use Buf for that since v10.

* Move installing grpc_node_plugin into Dockerfile

This commit basically takes grpc_node_plugin compilation from
Dockerfile-teleterm and moves it to Dockerfile.

* Replace Dockerfile-teleterm with Dockerfile

After moving grpc_node_plugin compilation to Dockerfile, the only remaining
thing that Dockerfile-teleterm does is installing rpm so that we can make
an RPM package for Connect during tag builds.

Installing this package can be simply moved to Dockerfile.

* Remove grpc-teleterm Make target in favor of grpc
ravicious added a commit that referenced this pull request Feb 6, 2023
`make protos-up-to-date` and thus `make grpc` is now run as a part of CI.
Thus I cannot just change the buildbox Dockerfile when backporting #20032
as it will use the old buildbox image which won't be able to compile JS
protos.

I extracted relevant Dockerfile changes from the backport PR (#21064).
Once this commit lands in v11, I should be able to make CI pass for the
backport PR.
ravicious added a commit that referenced this pull request Feb 6, 2023
* Remove CLANG_FORMAT from Makefiles

It was used to format protos but we use Buf for that since v10.

* Move installing grpc_node_plugin into Dockerfile

This commit basically takes grpc_node_plugin compilation from
Dockerfile-teleterm and moves it to Dockerfile.

* Replace Dockerfile-teleterm with Dockerfile

After moving grpc_node_plugin compilation to Dockerfile, the only remaining
thing that Dockerfile-teleterm does is installing rpm so that we can make
an RPM package for Connect during tag builds.

Installing this package can be simply moved to Dockerfile.

* Remove grpc-teleterm Make target in favor of grpc
ravicious added a commit that referenced this pull request Feb 6, 2023
`make protos-up-to-date` and thus `make grpc` is now run as a part of CI.
Thus I cannot just change the buildbox Dockerfile when backporting #20032
as it will use the old buildbox image which won't be able to compile JS
protos.

I extracted relevant Dockerfile changes from the backport branch.
Once this commit lands in v10, I should be able to make CI pass for the
backport PR.
ravicious added a commit that referenced this pull request Feb 7, 2023
`make protos-up-to-date` and thus `make grpc` is now run as a part of CI.
Thus I cannot just change the buildbox Dockerfile when backporting #20032
as it will use the old buildbox image which won't be able to compile JS
protos.

I extracted relevant Dockerfile changes from the backport PR (#21064).
Once this commit lands in v11, I should be able to make CI pass for the
backport PR.
ravicious added a commit that referenced this pull request Feb 7, 2023
…1064)

* Remove CLANG_FORMAT from Makefiles

It was used to format protos but we use Buf for that since v10.

* Move installing grpc_node_plugin into Dockerfile

This commit basically takes grpc_node_plugin compilation from
Dockerfile-teleterm and moves it to Dockerfile.

* Replace Dockerfile-teleterm with Dockerfile

After moving grpc_node_plugin compilation to Dockerfile, the only remaining
thing that Dockerfile-teleterm does is installing rpm so that we can make
an RPM package for Connect during tag builds.

Installing this package can be simply moved to Dockerfile.

* Remove grpc-teleterm Make target in favor of grpc
ravicious added a commit that referenced this pull request Feb 7, 2023
`make protos-up-to-date` and thus `make grpc` is now run as a part of CI.
Thus I cannot just change the buildbox Dockerfile when backporting #20032
as it will use the old buildbox image which won't be able to compile JS
protos.

I extracted relevant Dockerfile changes from the backport branch.
Once this commit lands in v10, I should be able to make CI pass for the
backport PR.
ravicious added a commit that referenced this pull request Feb 8, 2023
* Remove grpc-teleterm Make target and Dockerfile-teleterm (#20032)

* Remove CLANG_FORMAT from Makefiles

It was used to format protos but we use Buf for that since v10.

* Move installing grpc_node_plugin into Dockerfile

This commit basically takes grpc_node_plugin compilation from
Dockerfile-teleterm and moves it to Dockerfile.

* Replace Dockerfile-teleterm with Dockerfile

After moving grpc_node_plugin compilation to Dockerfile, the only remaining
thing that Dockerfile-teleterm does is installing rpm so that we can make
an RPM package for Connect during tag builds.

Installing this package can be simply moved to Dockerfile.

* Remove grpc-teleterm Make target in favor of grpc

* Install protoc-gen-go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants