Skip to content

Commit b4ca5e0

Browse files
github-actions[bot]mathetake
andauthored
Merging tetrate-workflow with tetrate-release-1.9 (#457)
Co-authored-by: mathetake <[email protected]>
1 parent 7097d7a commit b4ca5e0

File tree

5 files changed

+40
-23
lines changed

5 files changed

+40
-23
lines changed

.github/workflows/make_release.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ on:
44
workflow_dispatch:
55
inputs:
66
tag:
7-
description: Manual Tag [e.g. 1.7.8-tetrate-v0]
7+
description: Tag [e.g. 1.7.8-tetrate-v0]
88
required: true
9-
type:
10-
description: Build Type [fips or default]
11-
required: true
12-
default: "default"
139

1410
jobs:
1511
build_fips_proxy:
1612
# Only run this job when the release type equals "fips".
17-
if: ${{ github.event.inputs.type == 'fips' }}
13+
if: contains(github.event.inputs.tag, 'fips')
1814
name: build fips proxy binary
1915
timeout-minutes: 1440 # 12 hours
2016
runs-on: ubuntu-latest
@@ -82,7 +78,7 @@ jobs:
8278
run: make push_release
8379

8480
make_release:
85-
name: release-builder-run
81+
name: release-builder-run (${{ github.event.inputs.tag }})
8682
if: ${{ ! failure() }} # Make sure that this job runs even if build == "fips".
8783
runs-on: ubuntu-latest
8884
needs: [build_fips_proxy]
@@ -115,6 +111,5 @@ jobs:
115111
CLOUDSMITH_USER: ${{ secrets.CLOUDSMITH_USER }}
116112
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
117113
TAG: ${{ github.event.inputs.tag }}
118-
BUILD: ${{ github.event.inputs.type }}
119114
REL_BRANCH_VER: ${{ steps.get_minor_ver.outputs.REL_BRANCH_VER }}
120-
run: bash ./tetrateci/create_istio_release.sh
115+
run: ./tetrateci/create_istio_release.sh

tetrateci/ci_workflow.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Github Workflows
2+
### backport_commits.yml
3+
Creates a backports PR for any commit made to the `tetrate-workflow` branch to any branch which conform those regexes
4+
- `origin/tetrate-release-[[:digit:]]+.[[:digit:]]+$`
5+
- `origin/tetratefips-release-[[:digit:]]+.[[:digit:]]+$`
6+
7+
The script is adapted from [here](https://github.com/repo-sync/pull-request). The catch is the script only ports changes if there are on the `tetrateci` or `.github/workflows` folders. Merging with a commit or rebasing is not used to avoid merge conflicts.
8+
9+
### sync_fork.yml
10+
Runs every midnight and checks if there are any new tag on `istio/istio`, if no new tags are founds the action is done. On the other hand if there are new tags, the script loops through them creating corresponding `test-tetrate-x.y.z-v0` & `test-tetratefips-x.y.z-v0` tags and merging them with `tetrate-release-x.y` & `tetratefips-release-x.y` branches.
11+
12+
Also pushes the archives from `istio/istio` release to the cloudsmith repo.
13+
14+
### e2e_tests.yml
15+
Runs if there are any tags pushed with `test-` prefix. Utilizes `istio/release-builder` to generate docker images which are to be used for subsequent testing. The one thing to keep in mind it, the same script is used for making the releases and we only differentiate that based on whether the `TEST` environment variable is defined or not.
16+
17+
Subsequent 4 jobs runs the istio integration tests on applicable versions of eks, gke, aks and eksd, though some of them are disable for various reasons for now. All the platforms have corresponding create and cleanup scripts. The `version_check.py` has a matrix of istio versions vs k8s versions which determines which versions we need to get the istio release tested on.
18+
19+
All the minor versions of istio have their own testing scripts, the reason being there are patches which need to be applied before testing so the tests dont fail. The tests being written for `kind` have some default assumptions which might not be applicable for all the platforms we test on.
20+
21+
After the tests pass, the `test-` prefix is stripped off the current tag and the tree is tagged with the remaining, cutting a release with something similar to `tetrate-x.y.z-vn`.
22+
23+
Then the release builder is again triggered to create the release images and archives with `tetrate-x.y.z-vn` tag but this time without defining the `TEST` environment variable. A fips compliant build is only triggered if the tag contains `fips` in it. The only difference between fips and non fips build is the `Go` we are using. The `create_istio_release.sh` script sets up the environment manually instead if using the docker image is due to some restrictions in the Github Actions, it becomes a bit hard to procure the logs and monitor the whole process.
24+
25+
### make_release.yml
26+
It is same as the last process of `e2e_tests.yml` but with a manual trigger. Changes made to any of them must be backported to the other one, since they more or less do the same thing.

tetrateci/create_istio_release.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ set -o pipefail
66
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
77

88
## Set up apporiate go version
9-
if [[ ${BUILD} == "fips" ]]; then
9+
if [[ ${TAG} =~ "fips" ]]; then
10+
echo "Set up FIPS compliant Golang"
1011
source ${BASEDIR}/tetrateci/setup_boring_go.sh
1112
else
13+
echo "Set up Golang"
1214
source ${BASEDIR}/tetrateci/setup_go.sh
1315
fi
1416

15-
# the go we just installed
16-
CUSTOM_GO_VERSION=$GOLANG_VERSION
17-
echo "Go version installed: $CUSTOM_GO_VERSION"
18-
1917
## Set up release-builder
2018
sudo gem install fpm
2119
sudo apt-get install go-bindata -y
@@ -39,7 +37,7 @@ export BUILD_WITH_CONTAINER=0
3937
# HACK : For FIPS change the distroless base image to include glibc
4038
# We would use the same distroless base image as istio-proxy for pilot and operator
4139
# HACK : change envoy/wasm base URL to point to FIPS compliant one
42-
if [[ ${BUILD} == "fips" ]]; then
40+
if [[ ${TAG} =~ "fips" ]]; then
4341
PROXY_DISTROLESS_BASE=$(grep 'as distroless' ${BASEDIR}/pilot/docker/Dockerfile.proxyv2)
4442
# Escape '/'
4543
PROXY_DISTROLESS_BASE_ESCAPED=$(sed 's/\//\\\//g' <<< ${PROXY_DISTROLESS_BASE})
@@ -76,12 +74,12 @@ CONTAINER_ID=$(docker create $HUB/pilot:$TAG)
7674
docker cp $CONTAINER_ID:/usr/local/bin/pilot-discovery pilot-bin
7775
# go version with which the binaries for the docker images wi
7876
BUILD_GO_VERSION=$(go version pilot-bin | cut -f2 -d" ")
79-
echo "Images are built with: $BUILD_GO_VERSION"
77+
echo "Images are built with: go $BUILD_GO_VERSION"
8078

81-
[ $BUILD_GO_VERSION == go$CUSTOM_GO_VERSION ] || exit 1
79+
[ $BUILD_GO_VERSION == go$GOLANG_VERSION ] || exit 1
8280

8381
# fips go versions are like 1.14.12b5, extra checking to not miss anything
84-
if [ $BUILD == "fips" ]; then
82+
if [ ${TAG} =~ "fips" ]; then
8583
[[ $BUILD_GO_VERSION =~ 1.[0-9]+.[0-9]+[a-z][0-9]$ ]] || exit 1
8684
fi
8785

@@ -94,7 +92,7 @@ if [[ -z $TEST ]]; then
9492
echo "Building archives..."
9593
mkdir /tmp/istio-release
9694
# if FIPS, need to use native go as boringgo as of now can't build archives for different platforms
97-
if [[ ${BUILD} == "fips" ]]; then
95+
if [[ ${TAG} =~ "fips" ]]; then
9896
sudo rm -rf /usr/local/go
9997
source ${BASEDIR}/tetrateci/setup_go.sh
10098
fi

tetrateci/setup_boring_go.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ if $(grep -q "1.10" <<< $TAG); then
1313
export GOLANG_VERSION=1.16.4b7
1414
fi
1515

16-
echo "Fetching FIPS compliant Go"
1716
url="https://go-boringcrypto.storage.googleapis.com/go$GOLANG_VERSION.linux-amd64.tar.gz"
1817

19-
wget -O go.tgz "$url"
18+
wget -q -O go.tgz "$url"
2019

2120
sudo tar -C /usr/local -xzf go.tgz
2221
rm go.tgz

tetrateci/setup_go.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ if $(grep -q "1.10" <<< $TAG); then
1313
export GOLANG_VERSION=1.16.4
1414
fi
1515

16-
echo "Fetching Go $GOLANG_VERSION"
1716
url="https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz"
1817

19-
wget -O go.tgz "$url"
18+
wget -q -O go.tgz "$url"
2019

2120
sudo tar -C /usr/local -xzf go.tgz
2221
rm go.tgz

0 commit comments

Comments
 (0)