Page MenuHomePhabricator

[services] Tunnelbroker - Changes to build the Tunnelbroker using `cargo` in a Docker
ClosedPublic

Authored by max on Oct 21 2022, 11:51 AM.
Tags
None
Referenced Files
F3361514: D5458.id18126.diff
Sun, Nov 24, 5:50 PM
F3361356: D5458.id18124.diff
Sun, Nov 24, 4:44 PM
F3361254: D5458.id17869.diff
Sun, Nov 24, 3:57 PM
F3361132: D5458.id18023.diff
Sun, Nov 24, 3:27 PM
F3361104: D5458.id18125.diff
Sun, Nov 24, 3:23 PM
Unknown Object (File)
Sat, Nov 2, 9:43 PM
Unknown Object (File)
Sat, Nov 2, 9:43 PM
Unknown Object (File)
Sat, Nov 2, 9:42 PM

Details

Summary

This diff introduces changes to the Tunnelbroker's Dockerfile to change the build system from cmake to use cargo instead.
Also, deprecated cmake-related commands were removed from the Dockerfile.

This diff will also fix the CI (Docker) workflow fails for Tunnelbroker which are related to the Tunnelbroker's transition to Rust.

Related Linear task: ENG-2063

CI Notice:
The CI will fail on this diff on the Tunnelbroker Unit Tests (Nix) until the D5461 where all the changes to CI build commands are made.
This stack will be landed all in one to prevent CI from failing on diffs out of this stack.

Test Plan
  1. The Tunnelbroker Docker CI build should pass successfully.
  1. To test it manually:

Go to the Tunnelbroker service directory services/tunnelbroker and run the Docker compose build command docker compose build tunnelbroker-server.
The expected result is that the Docker image with the Tunnelbroker service is successfully built.

Diff Detail

Repository
rCOMM Comm
Branch
ci-update-docker-build
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

max held this revision as a draft.
max edited the test plan for this revision. (Show Details)
max added reviewers: varun, marcin. max added 1 blocking reviewer(s): jon.
max edited the summary of this revision. (Show Details)
services/docker-compose.yml
23

We are not using tunnelbroker-dev.ini anymore, this is a small fix for the config name to use tunnelbroker-sandbox.ini instead.

services/tunnelbroker/Dockerfile
5

Fixing the folders nesting to make it nested identically to the repo: services/tunnelbroker. This is necessary for future proto files compilation and including.

37–39

We are running cargo build and cargo run or cargo test now instead of cmake build commands.

max edited the test plan for this revision. (Show Details)

Reducing the file size by squashing commands.
Adding of annotations.
Adding of the building and running of the gTest for the legacy C++ codebase.

jon requested changes to this revision.Oct 26 2022, 2:06 PM
jon added inline comments.
services/tunnelbroker/Dockerfile
14–23 ↗(On Diff #17869)

it will be pretty common to have changes in the tunnelbroker directory, I would prefer to have it occur later so that we can cache the installation of the dependencies better

This revision now requires changes to proceed.Oct 26 2022, 2:06 PM
max marked an inline comment as done.

Changing the SDK install and sources copying commands order.

services/tunnelbroker/Dockerfile
14–23 ↗(On Diff #17869)

it will be pretty common to have changes in the tunnelbroker directory, I would prefer to have it occur later so that we can cache the installation of the dependencies better

Such command execution optimization makes sense to me. Thanks, @jon, I've changed the execution order.

This revision is now accepted and ready to land.Nov 2 2022, 11:48 AM
This revision now requires review to proceed.Nov 2 2022, 12:47 PM
tomek added inline comments.
services/tunnelbroker/Dockerfile
37 ↗(On Diff #18023)

Shouldn't this be run conditionally based on COMM_TEST_SERVICES flag?

43 ↗(On Diff #18023)

Shouldn't we prefer double brackets?

This revision is now accepted and ready to land.Nov 3 2022, 2:38 AM
services/tunnelbroker/Dockerfile
43 ↗(On Diff #18023)

Double brackets don't work here I think, as CMD isn't being run in bash for this image

max added inline comments.
services/tunnelbroker/Dockerfile
37 ↗(On Diff #18023)

Shouldn't this be run conditionally based on COMM_TEST_SERVICES flag?

I think that makes sense not to build the test app every time. I'll try to add a condition here. Thanks!

43 ↗(On Diff #18023)

Double brackets don't work here I think, as CMD isn't being run in bash for this image

Yes, that's correct!

max marked 2 inline comments as done.

Rebasing on master changes.

This revision was landed with ongoing or failed builds.Nov 7 2022, 6:21 AM
This revision was automatically updated to reflect the committed changes.