teleport/build.assets
Rafał Cieślak 3ac5a0aedb
Refactor prehog & teleterm protos to match project conventions (#20810)
* Adjust go_package of lib/prehog Go protobufs

This makes them follow the pattern set out by api/proto and proto.

* Adjust go_package of lib/teleterm Go protobufs

* Use single buf.gen.yaml to generate JS protos

This also entailed changing the location of lib/teleterm protos and changing
the value of their package specifier to match the conventions in other parts
of the codebase. This is a breaking change but that is fine for Connect
as the protos are used locally only and each build ships with matching
protobufs.

* Make web/packages/teleterm use protobufs from gen-proto-js

We used to copy protobufs over to web/packages/teleterm/src/services/tshd
since webapps used to be in a separate repo.

This is no longer the case, so we can just make teleterm use protobufs
from gen-proto-js.

* Move prehog & teleterm protos into proto/teleport/lib

* Generate JS protos to gen/proto/js

* Move lib/teleterm Go protobufs to gen/proto/go

* Move lib/prehog Go protobufs to gen/proto/go

* Rename lib/teleterm proto package

* Re-enable linter rules for teleterm & prehog

* Update prehogv1 path in usagereporter_test.go

* Use except instead of ignore_only to allow Google API-style responses

* Add UNARY_RPC to api/proto & proto

* Ignore gen/ when running addlicense

* buf-js.gen.yaml: Remove comment about lack of go_package for JS

* Move prehog protos to proto/prehog/v1alpha

* Adjust prehog's go_package to match proto package
2023-02-03 14:47:06 +00:00
..
charts Added multiarch build support for Teleport (#17597) 2022-10-31 18:00:55 +00:00
macos Make tsh installer non relocatable and drop version from app (#15018) 2022-07-29 11:18:27 -03:00
pam add PAM environment with interpolation support 2021-03-30 18:23:38 +02:00
pkgconfig Update libfido2 to 1.12.0 (#16732) 2022-09-28 14:13:25 +00:00
rpm rpm: Don't include build-id artifacts in packages (#7080) 2021-05-31 09:52:30 -07:00
rpm-sign rpm: Don't include build-id artifacts in packages (#7080) 2021-05-31 09:52:30 -07:00
tooling Add flaky tests detector. (#20320) 2023-01-18 10:29:10 -08:00
windows Tcsc/v12 versioned windows builder (#18339) 2022-11-10 12:43:38 +00:00
.bashrc Integrated mkdocs into Teleport builds 2016-03-18 17:32:41 -07:00
.dockerignore Add node and yarn to the buildboxes in preparation for the webapps merge (#20339) 2023-01-18 17:56:04 +00:00
.gitignore pam: trigger pam_authenticate on login (#3966) 2020-07-10 20:28:33 +00:00
build-common.sh Use .json extension for Gon config file (#13667) 2022-06-21 20:03:32 +00:00
build-fido2-macos.sh Bump libcbor from v0.9.0 to v0.10.1 (#19797) 2023-01-04 15:26:46 +00:00
build-package.sh Update fpm images to use amazon ECR (#15274) 2022-08-15 23:28:34 +00:00
build-pkg-tsh.sh Make tsh installer non relocatable and drop version from app (#15018) 2022-07-29 11:18:27 -03:00
build-test-compat.sh Adds CI hooks for GLibc compatibility check (#15547) 2022-08-23 10:02:35 +10:00
build-webassets-if-changed.sh Conditionally build the UI if there are changes. (#20489) 2023-01-31 20:06:00 +00:00
Dockerfile Pin helm-unittest plugin because of a broken release (#21013) 2023-01-31 20:02:01 +00:00
Dockerfile-arm Update buildbox to push to ECR (#15058) 2022-08-16 21:07:07 +00:00
Dockerfile-arm-fips Update buildbox to push to ECR (#15058) 2022-08-16 21:07:07 +00:00
Dockerfile-centos7 Add node and yarn to the buildboxes in preparation for the webapps merge (#20339) 2023-01-18 17:56:04 +00:00
Dockerfile-centos7-assets Use CentOS 7 for building release binaries (#14062) 2022-07-02 02:11:37 +00:00
Dockerfile-centos7-fips Add node and yarn to the buildboxes in preparation for the webapps merge (#20339) 2023-01-18 17:56:04 +00:00
Dockerfile-fips Add BUILDARCH arg to fips dockerfile. (#20495) 2023-01-20 20:07:05 +00:00
Dockerfile-multiarch Add node and yarn to the buildboxes in preparation for the webapps merge (#20339) 2023-01-18 17:56:04 +00:00
genproto.sh Refactor prehog & teleterm protos to match project conventions (#20810) 2023-02-03 14:47:06 +00:00
images.mk Remove grpc-teleterm Make target and Dockerfile-teleterm (#20032) 2023-01-26 09:41:07 +01:00
install Include tbot binary in Teleport packages and installs (#10646) 2022-03-03 03:25:23 +00:00
locale.gen Jenkins build target 2015-12-23 10:41:51 -08:00
Makefile Update Go toolchain to 1.20 (#21111) 2023-02-02 14:22:04 +00:00
profile Jenkins build target 2015-12-23 10:41:51 -08:00
README.md Add docs on how to safely update build box Dockerfiles (#20559) 2023-01-26 14:13:28 +00:00
teleterm_linux_arm64.toolchain.cmake Add grpc-teleterm Makefile target 2022-04-01 13:02:56 +02:00

Dockerized Teleport Build

This directory is used to produce a containerized production Teleport build. No need to have Golang. Only Docker is required.

It is a part of Gravitational CI/CD pipeline. To build Teleport type:

make

Safely updating build box Dockerfiles

The build box images are used in Drone pipelines and GitHub Actions. The resulting image is pushed to Amazon ECR and ghcr.io. This means that to safely introduce changes to Dockerfiles, those changes should be split into two stages:

  1. First you open a PR which updates a Dockerfile and get the PR merged.
  2. Once it's merged, Drone is going to pick it up, build a new build box image and push it to Amazon ECR.
  3. Then you can open another PR which starts using the new build box image.

DynamoDB static binary docker build

The static binary will be built along with all nodejs assets inside the container. From the root directory of the source checkout run:

docker build -f build.assets/Dockerfile.dynamodb -t teleportbuilder .

Then you can upload the result to an S3 bucket for release.

docker run -it -e AWS_ACL=public-read -e S3_BUCKET=my-teleport-releases -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY teleportbuilder

Or simply copy the binary out of the image using a volume (it will be copied to current directory/build/teleport.

docker run -v $(pwd)/build:/builds -it teleportbuilder cp /gopath/src/github.com/gravitational/teleport/teleport.tgz /builds

OS package repo migrations

An OS package repo migration is semi-manually publishing specific releases to the new APT and YUM repos. This is required in several situations:

Multiple migrations can be performed at once. To run a migration do the following:

  1. Clone https://github.com/gravitational/teleport.git.
  2. Change to the directory the repo was cloned to.
  3. Create a new branch from master.
  4. Add the Teleport versions you wish to migration as demonstrated here: 151a2f489e (diff-2e3a64c97d186491e06fb2c7ead081b7ace2b67c4a4d974a563daf7c117a2c50).
  5. Set the migrationBranch variable to the name of the branch you created in (3) as demonstrated here: 151a2f489e (diff-2e3a64c97d186491e06fb2c7ead081b7ace2b67c4a4d974a563daf7c117a2c50).
  6. Get your Drone credentials from here: https://drone.platform.teleport.sh/account.
  7. Export your drone credentials as shown under "Example CLI Usage" on the Drone account page
  8. Open a new terminal.
  9. Run tsh app login drone and follow any prompts.
  10. Run tsh proxy app drone and copy the printed socket. This should look something like 127.0.0.1:60982
  11. Switch back to your previous terminal.
  12. Run export DRONE_SERVER=http://{host:port}, replacing {host:port} with the data you copied in (10)
  13. Run make dronegen
  14. Commit the two changed files and push/publish the branch
  15. Open a PR merging your changes into master via https://github.com/gravitational/teleport/compare
  16. Under the "checks" section, click "details" on the check labeled "continuous-integration/drone/push"
  17. Once the pipelines complete, comment out the versions you added and blank out the migrationBranch string set in (4, 5) as demonstrated here: 9095880560 (diff-2e3a64c97d186491e06fb2c7ead081b7ace2b67c4a4d974a563daf7c117a2c50)
  18. Run make dronegen
  19. Commit and push the changes.
  20. Merge the PR and backport if required.