Skip to content

Commit

Permalink
Upgrade Go version/Knative/Spark Operator/Kubernetes Client/Docker Co…
Browse files Browse the repository at this point in the history
…mpose for dev environment. (#183)

* Bump versions for all k8s based libs

* Use proper context for each scenario.

* Upgrade virtual service version.

* Update k3d version to kubernetes 1.22.

* Upgrade Go to 1.16.

* Fix linting errors.

* Update k3d flags.

* Upgrade knative/istio/spark-operator versions in cluster init.

* Update default versions in cluster-init, change e2e test to new api

* Fail fast if default environment is wrong. Extra logging.

* Fix unit tests.

* Addressed PR comments.

* Pull requests to be run on any target branch.

* Upgrade to go 1.18, upgrade linter.

* Upgrade experiment and router to go 1.18.

* Update PR comments.

* Parameterise Go and Go Linter Versions.

* Update documentation with new versions and ports.
  • Loading branch information
ashwinath authored Mar 31, 2022
1 parent ca6fcba commit 3627d48
Show file tree
Hide file tree
Showing 92 changed files with 2,139 additions and 1,327 deletions.
8 changes: 4 additions & 4 deletions .github/actions/run-cluster-init/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ runs:
using: composite
steps:
- name: "Setup local k8s cluster"
uses: AbsaOSS/k3d-action@v1.5.0
uses: AbsaOSS/k3d-action@v2.0.0
with:
cluster-name: ${{ inputs.cluster_name }}
use-default-registry: true
args: >-
--servers 1
--agents 3
--port 80:80@loadbalancer
--k3s-server-arg "--no-deploy=traefik,metrics-server"
--port 80:80@agent:*
--registry-create ${{inputs.local_registry}}
--k3s-arg "--no-deploy=traefik,metrics-server@server:*"
- name: Publish images to local registry
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cluster-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
pull_request:
branches:
- main
- upgrade-knative
paths:
- ".github/workflows/cluster-init.yaml"
- "infra/cluster-init/**"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pyfunc-ensembler-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
pull_request:
branches:
- main
- upgrade-knative
paths:
- ".github/workflows/pyfunc-ensembler-job.yaml"
- "engines/pyfunc-ensembler-job/**"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pyfunc-ensembler-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
pull_request:
branches:
- main
- upgrade-knative
paths:
- ".github/workflows/pyfunc-ensembler-service.yaml"
- "engines/pyfunc-ensembler-service/**"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
pull_request:
branches:
- main
- upgrade-knative
paths:
- ".github/workflows/sdk.yaml"
- "sdk/**"
Expand Down
53 changes: 30 additions & 23 deletions .github/workflows/turing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ on:
pull_request:
branches:
- main
# TODO: remove after this feature is complete
- upgrade-knative
paths-ignore:
- "docs/**"
- "engines/pyfunc-ensembler-job/**"
Expand All @@ -38,6 +40,8 @@ on:

env:
ARTIFACT_RETENTION_DAYS: 7
GO_VERSION: 1.18
GO_LINT_VERSION: v1.45.2

jobs:
build-api:
Expand Down Expand Up @@ -211,10 +215,10 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Go 1.14
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.14"
go-version: ${{ env.GO_VERSION }}

- name: Cache Dependencies
uses: actions/cache@v2
Expand All @@ -236,7 +240,7 @@ jobs:
- name: Lint code
uses: golangci/golangci-lint-action@v2
with:
version: v1.41.1
version: ${{ env.GO_LINT_VERSION }}
working-directory: api
skip-go-installation: true
args: --timeout 3m --verbose
Expand All @@ -254,10 +258,10 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Go 1.14
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.14"
go-version: ${{ env.GO_VERSION }}

- name: Cache Dependencies
uses: actions/cache@v2
Expand All @@ -276,7 +280,7 @@ jobs:
- name: Lint code
uses: golangci/golangci-lint-action@v2
with:
version: v1.41.1
version: ${{ env.GO_LINT_VERSION }}
working-directory: engines/router
skip-go-installation: true
args: --verbose
Expand All @@ -289,10 +293,10 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Go 1.14
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.14"
go-version: ${{ env.GO_VERSION }}

- name: Cache Dependencies
uses: actions/cache@v2
Expand All @@ -309,7 +313,7 @@ jobs:
- name: Lint code
uses: golangci/golangci-lint-action@v2
with:
version: v1.41.1
version: ${{ env.GO_LINT_VERSION }}
working-directory: engines/experiment
skip-go-installation: true
args: --verbose
Expand Down Expand Up @@ -349,10 +353,10 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Go 1.14
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.14"
go-version: ${{ env.GO_VERSION }}

- name: Download Turing API Docker tar archive
uses: actions/download-artifact@v2
Expand All @@ -374,11 +378,6 @@ jobs:
with:
name: cluster-init.${{ env.CLUSTER_INIT_VERSION }}.tar

- name: Set up Go 1.14
uses: actions/setup-go@v2
with:
go-version: "1.14"

- name: Run action cluster-init
uses: ./.github/actions/run-cluster-init
with:
Expand Down Expand Up @@ -433,7 +432,7 @@ jobs:
VAULT_TOKEN: root
run: |
echo "::group::Wait for Vault to become available"
timeout --foreground 45 bash -c \
timeout --foreground 100 bash -c \
'until curl -s --fail -H "X-Vault-Token: ${{ env.VAULT_TOKEN }}" http://vault.127.0.0.1.nip.io/v1/sys/mounts; do sleep 2; done'
echo "::endgroup::"
Expand Down Expand Up @@ -481,7 +480,7 @@ jobs:
deployment/turing-mlp,
deployment/turing-merlin,
deployment/turing
timeout: 300 #seconds
timeout: 600 # seconds
max-restarts: -1

- name: Setup MLP project
Expand Down Expand Up @@ -522,25 +521,33 @@ jobs:
KUBECONFIG_USE_LOCAL: true
run: go test -v -parallel=2 ./e2e/... -tags=e2e -run TestEndToEnd

- if: (steps.wait-for-deployment.outcome == 'failure' || steps.run-e2e-test.outcome == 'failure') && always()
- if: (steps.wait-for-deployment.outcome == 'failure' || steps.run-e2e-test.outcome == 'failure') && always()
name: "Debug Deployment Failure"
run: |
echo "::group::describe deployment/turing-mlp"
kubectl describe deployment/turing-mlp
echo "::endgroup::"
echo "::group::describe deployment/turing-merlin"
kubectl describe deployment/turing-merlin
echo "::endgroup::"
echo "::group::describe deployment/turing"
kubectl describe deployment/turing
echo "::endgroup::"
echo "::group::secret/turing-api-config"
kubectl get secret/turing-api-config -o jsonpath='{.data.config\.yaml}' | base64 --decode
echo "::endgroup::"
echo "::group::logs deployment/turing-merlin"
kubectl logs deployment/turing-merlin
echo "::endgroup::"
echo "::group::logs deployment/turing-mlp"
kubectl logs deployment/turing-mlp
echo "::endgroup::"
echo "::group::logs deployment/turing"
kubectl logs deployment/turing
echo "::endgroup::"
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ in these getting started guide.

- [Docker](https://www.docker.com/get-started) v19.03
- [Docker compose](https://docs.docker.com/compose/) v1.27
- [Go](https://golang.org/dl/) v1.14
- [Go](https://golang.org/dl/) v1.18
- [Node.js](https://nodejs.org/en/download/) v14 and yarn 1.22.x
- [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) v1.19 (optional)
- [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) v1.22 (optional)
- Local ports 80, 8080, 8081, 8082, 8200, 5000, 6443 should be available

### Download Turing Source Code
Expand Down Expand Up @@ -381,9 +381,9 @@ to check them, they are installed in the following namespaces:

Alternatively, you could install the following components yourself with the following recommended versions:

- Knative: v0.18.3
- Knative Istio: v0.18.1
- Istio: 1.9.9
- Knative: v1.0.1
- Knative Istio: v1.0.0
- Istio: 1.12.5
- Spark On K8s Operator: 1.1.7 Helm charts

## Turing Router Components
Expand Down
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build turing-api binary
FROM golang:1.14-alpine as api-builder
FROM golang:1.18-alpine as api-builder
ARG API_BIN_NAME=turing-api

ENV GO111MODULE=on \
Expand Down
4 changes: 2 additions & 2 deletions api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ clean:
setup:
@echo "Setting up tools..."
@test -x $(shell go env GOPATH)/bin/golangci-lint || \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/v1.41.1/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.41.1
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/v1.45.2/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.45.2

.PHONY: fmt
fmt:
Expand Down Expand Up @@ -133,4 +133,4 @@ deploy_docker_stack: build-docker version
clean_docker_stack:
@echo "Cleaning up local docker stack..."
@docker stack rm turing_api_stack
@docker secret rm google_app_creds
@docker secret rm google_app_creds
2 changes: 1 addition & 1 deletion api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ API for the Turing experimentation service.
### Local Development

#### Requirements
- Golang 1.14
- Golang 1.18
- Docker

#### Setup
Expand Down
2 changes: 1 addition & 1 deletion api/config-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ BatchEnsemblingConfig:
BuildContextURI: git://github.com/gojek/turing.git#refs/heads/main
DockerfileFilePath: engines/pyfunc-ensembler-job/app.Dockerfile
Image: gcr.io/kaniko-project/executor
ImageVersion: v1.6.0
ImageVersion: v1.8.0
ResourceRequestsLimits:
Requests:
CPU: "1"
Expand Down
1 change: 0 additions & 1 deletion api/e2e/test/00_all_e2e_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build e2e
// +build e2e

package e2e

Expand Down
2 changes: 1 addition & 1 deletion api/e2e/test/01_create_router_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build e2e
//go:build e2e

package e2e

Expand Down
2 changes: 1 addition & 1 deletion api/e2e/test/02_update_router_invalid_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build e2e
//go:build e2e

package e2e

Expand Down
1 change: 0 additions & 1 deletion api/e2e/test/03_create_router_version_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build e2e
// +build e2e

package e2e

Expand Down
2 changes: 1 addition & 1 deletion api/e2e/test/04_undeploy_router_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build e2e
//go:build e2e

package e2e

Expand Down
2 changes: 1 addition & 1 deletion api/e2e/test/05_deploy_invalid_config_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build e2e
//go:build e2e

package e2e

Expand Down
2 changes: 1 addition & 1 deletion api/e2e/test/06_deploy_valid_config_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build e2e
//go:build e2e

package e2e

Expand Down
2 changes: 1 addition & 1 deletion api/e2e/test/07_delete_router_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build e2e
//go:build e2e

package e2e

Expand Down
2 changes: 1 addition & 1 deletion api/e2e/test/08_deploy_router_with_traffic_rules_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build e2e
//go:build e2e

package e2e

Expand Down
2 changes: 1 addition & 1 deletion api/e2e/test/helpers_api_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build e2e
//go:build e2e

package e2e

Expand Down
Loading

0 comments on commit 3627d48

Please sign in to comment.