Skip to content

Commit

Permalink
[Docs] Document how to build and deploy tunnelbroker
Browse files Browse the repository at this point in the history
Summary:
After testing the deployment, document how it was able to be built
and ran.

Part of https://linear.app/comm/issue/ENG-4104

Test Plan: N/A. Documentation

Reviewers: varun, ashoat, bartek

Reviewed By: ashoat, bartek

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D8312
  • Loading branch information
jonringer-comm committed Jul 10, 2023
1 parent 84958a8 commit 64b6154
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/nix_dev_env.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ Run `nix develop` to create a dev environment. Nix will handle the installation
- [Committing a diff](./nix_shared_workflows.md#committing-a-diff)
- [Final notes](./nix_shared_workflows.md#final-notes)

## Production workflows

- [Services deployment](./nix_services_deployment.md)
- [Tunnelbroker](./nix_services_deployment.md#tunnelbroker)

## Using alternate shells with Nix

Alternate shells such as zsh or fish can also be used with Nix. To use an alternate shell, run:
Expand Down
28 changes: 28 additions & 0 deletions docs/nix_services_deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Services Deployment

## Tunnelbroker

Deploying Tunnelbroker consists of building its Docker image and deploying that image as a Docker container.

### Building Tunnelbroker Image

The Docker image for Tunnelbroker can be built using the following command from the project root:

```
docker build -f services/tunnelbroker -t commapp/tunnelbroker:<tag> .
# Alternatively, there's a script which creates a very small docker context before building
services/tunnelbroker/make_docker_image.sh -t commapp/tunnelbroker:<tag> .
```

### Running the container

Tunnelbroker can be run in production using the following command:

```
docker run -d commapp/tunnelbroker:<tag> \
-p 50051:50051 \
-p 80:51001 \
-v $HOME/.aws:/home/comm/.aws:ro \
tunnelbroker \
--amqp-uri=<amqp-uri> \
```
2 changes: 1 addition & 1 deletion services/tunnelbroker/make_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ cp -r "${SCRIPT_DIR}/../../shared/tunnelbroker_messages" \
cp -r "${SCRIPT_DIR}"/{Cargo.toml,Cargo.lock,build.rs,src} \
"$BUILD_DIR"/services/tunnelbroker/

docker build -f "${SCRIPT_DIR}/Dockerfile" "$BUILD_DIR"
docker build "$@" -f "${SCRIPT_DIR}/Dockerfile" "$BUILD_DIR"

0 comments on commit 64b6154

Please sign in to comment.