teleport/build.assets
Cam Hutchison 9072f3b980
build: Build webassets for CentOS 7 with buildbox-connect (#30322)
* build: Build webassets for CentOS 7 with Ubuntu buildbox

Build the webassets for the CentOS 7 binaries using the standard Ubuntu
buildbox prior to building the binaries. This allows us to use a later
version of node.js to build the UI than what is available on CentOS 7.

The `release-unix` and `clean` targets need to be rejigged a little as
`release-unix` first cleans any pre-build webassets. So we add a new
target `release-unix-preserving-webassets` that only cleans the build
and not the webassets and update the Makefile in `build.assets` to call
this new target when building CentOS 7 binaries.

* build: Conditionally build enterprise webassets

Only build enterprise webassets if the enterprise submodule is present.
For a normal release, this will always be the case, but for local
testing and people wishing to build just the OSS release, the enterprise
submodule may not be present.

* build: Build webassets with buildbox-connect

Use the Teleport Connect buildbox for building the webassets. That
ensures the same version of node is used for building all the node
stuff; the web UI as well as Teleport Connect. It makes maintenance of
the buildboxes easier as we can move to using only the one buildbox for
node in the future.

* build: Pre-build webassets for non-centos7 build targets

Add a dependency on `webassets` for the non-centos7 fips build/release
targets in build.assets/Makefile. These targets were recently changed to
actually use centos7 anyway, so we do need to pre-build webassets as
centos7 will soon no longer be able to build them.

NOTE: These updated targets should probably be removed. They are
effectively duplicates of their centos7 counterparts now and should
probably just chain to those targets. The `release-fips` target is
actually broken at the moment as it needs to use `scl enable ...` to
build now it uses centos7.

* Replace "standard Ubuntu buildbox" in comments with buildbox-connect

---------

Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>
2023-08-28 08:53:39 +00:00
..
charts Updates distroless Dockerfile to handle fips realeases (#25449) 2023-05-02 03:29:03 +00:00
download-hashes Updates buildbox osslsigncode to 2.6 (#29043) 2023-07-14 09:07:37 +00:00
flake Move most devbox packages to "latest" (#30295) 2023-08-10 20:47:57 +00:00
gpg Add docker cli to buildbox (#25729) 2023-05-10 08:44:19 +00:00
macos Update version in tsh.app Info.plist (#25616) 2023-05-15 22:42:54 +00:00
pam add PAM environment with interpolation support 2021-03-30 18:23:38 +02:00
pkgconfig fix: Bump libcrypto version in pkgconfig files (#29921) 2023-08-02 17:32:30 +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 Bump the build-assets-tooling-dependencies group (#30790) 2023-08-21 20:01:30 +00:00
windows Add Rust to dronegen (#30822) 2023-08-26 18:00:46 +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 release: Prepare for MacOS builds on GitHub Actions (#23407) 2023-03-27 03:11:35 +00:00
build-fido2-macos.sh chore: Bump openssl to 3.0.10 (#29876) 2023-08-02 13:25:18 +00:00
build-package.sh Fixed CPIO digest mismatch on RHEL 8 (#28745) 2023-07-06 00:30:01 +00:00
build-pkg-tsh.sh build: Support arm64 and universal binaries for MacOS (#25460) 2023-05-04 20:47:49 +00: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 web: Ignore .swc directory when computing web SHA (#29892) 2023-08-02 09:59:55 +00:00
changelog.sh Add changelog script (#29007) 2023-07-12 16:49:10 +00:00
Dockerfile Add a banner to Dockerfile used for CI testing (#30887) 2023-08-23 21:08:13 +00:00
Dockerfile-arm Fix ARM build process and environment setup (#30724) 2023-08-22 21:38:03 +00:00
Dockerfile-centos7 pins wasm-pack to --version 0.11.0 (#30778) 2023-08-22 17:03:06 +00:00
Dockerfile-centos7-assets Unify x86/ARM64 build process (#21660) 2023-02-15 15:38:59 +00:00
Dockerfile-centos7-fips pins wasm-pack to --version 0.11.0 (#30778) 2023-08-22 17:03:06 +00:00
Dockerfile-connect Move Connect build to a new Docker container (#27175) 2023-06-06 15:28:20 +00:00
Dockerfile-grpcbox Run latest golangci-lint and buf in Docker boxes (#30902) 2023-08-23 19:14:39 +00:00
Dockerfile-multiarch pins wasm-pack to --version 0.11.0 (#30778) 2023-08-22 17:03:06 +00:00
Dockerfile-multiarch-base (Buddy) Removed node from multiarch buildbox, added i386 and amd64 targets (#22979) 2023-03-14 18:00:20 +00:00
Dockerfile-multiarch-clang (Buddy) Removed node from multiarch buildbox, added i386 and amd64 targets (#22979) 2023-03-14 18:00:20 +00:00
genproto.sh Support non-gogo objects for auth service events. (#29056) 2023-07-17 15:32:03 +00:00
grpcbox.mk Run latest golangci-lint and buf in Docker boxes (#30902) 2023-08-23 19:14:39 +00:00
images.mk Remove unused FIPS build boxes (#26859) 2023-06-14 23:44:38 +00:00
install provide starting message for tar ball install (#25851) 2023-05-09 13:50:36 +00:00
keychain-setup.sh release: Update build for product signing (#23820) 2023-04-03 00:30:48 +00:00
locale.gen Jenkins build target 2015-12-23 10:41:51 -08:00
Makefile build: Build webassets for CentOS 7 with buildbox-connect (#30322) 2023-08-28 08:53:39 +00:00
profile Jenkins build target 2015-12-23 10:41:51 -08:00
README.md Add wasm-pack to docker images (#28105) 2023-06-23 17:54:55 +00:00
versions.mk Run latest golangci-lint and buf in Docker boxes (#30902) 2023-08-23 19:14:39 +00: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 apps 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.