Skip to content

Commit

Permalink
Merge pull request #312 from istio-ecosystem/release-2.0
Browse files Browse the repository at this point in the history
Release 2.0
  • Loading branch information
shriramsharma authored Aug 9, 2024
2 parents 81e4462 + eae41b7 commit 6a100b3
Show file tree
Hide file tree
Showing 247 changed files with 46,515 additions and 10,028 deletions.
20 changes: 4 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
machine:
image: ubuntu-2004:202010-01
environment:
K8S_VERSION: v1.20.14
K8S_VERSION: v1.25.2
KUBECONFIG: /home/circleci/.kube/config
MINIKUBE_VERSION: v1.18.1
MINIKUBE_WANTUPDATENOTIFICATION: false
Expand Down Expand Up @@ -88,26 +88,14 @@ jobs:
cd tests
export IS_LOCAL=false
- run:
name: Run Integration Test for Istio 1.10
name: Run Integration Test for Istio 1.20.2
command: |
cd tests
export IS_LOCAL=false
./run.sh "1.20.14" "1.10.6" "../out"
- run:
name: Run Integration Test for Istio 1.11
command: |
cd tests
export IS_LOCAL=false
./run.sh "1.20.14" "1.11.4" "../out"
- run:
name: Run Integration Test for Istio 1.12
command: |
cd tests
export IS_LOCAL=false
./run.sh "1.20.14" "1.12.2" "../out"
echo "SKIP" #./run.sh "1.25.2" "1.20.2" "../out"
publish-github-release:
docker:
- image: circleci/golang:1.17
- image: cimg/go:1.21
working_directory: /go/pkg/mod/github.com/admiral
steps:
- attach_workspace:
Expand Down
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@aattuluri
@nirvanagit
@shriramsharma
@kpharasi
@vinay-g
@vrushalijoshi
@virajrk
@rtay1188
@Punakshi
@psikka1
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Checklist
🚨 Please review this repository's [contribution guidelines](./CONTRIBUTING.md).

- [ ] I've read and agree to the project's contribution guidelines.
- [ ] I'm requesting to **pull a topic/feature/bugfix branch**.
- [ ] I checked that my code additions will pass code linting checks and unit tests.
- [ ] I updated unit and integration tests (if applicable).
- [ ] I'm ready to notify the team of this contribution.

### Description
What does this change do and why?

[Link to related ISSUE]

Thank you!
72 changes: 36 additions & 36 deletions .github/workflows/golang-ci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
with:
go-version: '1.17.7'
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.47.3
skip-go-installation: true

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
args: >-
--skip-dirs=admiral/pkg/client/clientset/versioned
--tests=false
--timeout=5m
# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
#name: golangci-lint
#on:
# push:
# tags:
# - v*
# branches:
# - master
# - main
# pull_request:
#jobs:
# golangci:
# name: lint
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-go@v3
# with:
# go-version: '1.22.2'
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v2
# with:
# # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
# version: v1.58.1
# skip-go-installation: true
#
# # Optional: working directory, useful for monorepos
# # working-directory: somedir
#
# # Optional: golangci-lint command line arguments.
# args: >-
# --skip-dirs=admiral/pkg/client/clientset/versioned
# --tests=false
# --timeout=5m
#
# # Optional: show only new issues if it's a pull request. The default value is `false`.
# # only-new-issues: true
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
.idea
.idea/vcs.xml

out*
out/*
out.yaml
*.tar.gz
*.out
*.prof
istio-*
.DS_Store
cobertura-coverage.xml
36 changes: 36 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#name: golangci-lint
#on:
# push:
# tags:
# - v*
# branches:
# - master
# - main
# pull_request:
#jobs:
# golangci:
# name: lint
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-go@v3
# with:
# go-version: '1.22.3'
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v2
# with:
# # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
# version: v1.58.1
# skip-go-installation: true
#
# # Optional: working directory, useful for monorepos
# # working-directory: somedir
#
# # Optional: golangci-lint command line arguments.
# args: >-
# --skip-dirs=admiral/pkg/client/clientset/versioned
# --tests=false
# --timeout=5m || true
#
# # Optional: show only new issues if it's a pull request. The default value is `false`.
# # only-new-issues: true
54 changes: 51 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export KUBECONFIG=~/.kube/config
```
* Install [Prerequisites](./docs/Examples.md#Prerequisite) and make sure to install istio control plane in cluster. Alternatively, you can use the script to install istio control plane on the cluster created in previous step:

Mac: `$ADMIRAL_HOME/tests/install_istio.sh 1.7.4 osx`
Mac: `$ADMIRAL_HOME/tests/install_istio.sh 1.10.4 osx`

Mac (Apple Silicon): `$ADMIRAL_HOME/tests/install_istio.sh 1.7.4 osx-arm64`

Expand Down Expand Up @@ -73,7 +73,38 @@ minikube service prometheus -n istio-system --url
```

## Protobuf code generation
* If you've made changes to protobuf model objects and need to re-generate their clientsets, use `sh hack/update-codegen.sh` and checkin the generated files
* Required installations and their versions -

### Initial Setup
```bash
Install protobuf
go install sigs.k8s.io/[email protected]
go install k8s.io/code-generator v0.24.2
go install google.golang.org/[email protected]
make setup
```

### Generate `*.pb.go` files from `*.proto` files
```bash
go generate ./...
```

### Generate deepcopy functions
```bash
make model-gen
```

* If you've made changes to protobuf model objects and need to re-generate their clientsets, use following steps and checkin the generated files
### Generate clientsets
```bash
sh hack/update-codegen.sh
```

### Generate CRD
```bash
set $GOPATH based on your go setup
chmod +x $GOPATH/pkg/mod/sigs.k8s.io/[email protected]/.run-in.sh && sh $GOPATH/pkg/mod/sigs.k8s.io/[email protected]/.run-controller-gen.sh crd paths=./admiral/pkg/apis/admiral/v1/... output:stdout > admiral/crd/out.yaml
```

## Integration tests
### Single cluster
Expand All @@ -87,4 +118,21 @@ cd $ADMIRAL_HOME/tests
```
TODO
```


## Before PR
1. Clone repository
1. Add unit tests and fmea tests(in case applicable) along with the checked in code.
1. Confirm that the unit test coverage did not drop with your change.
1. Run regression and make sure it is not failing
1. Please update any bdd tests in case applicable

## During PR
1. Create Pull Request from your branch to the master branch.
1. Make sure the build succeeds
1. Maintainers on Admiral Repository will review the pull request.
1. PR will be merged after code is reviewed and all checks are passing

## After PR
1. When merging the PR, ensure that all commits are squashed into a single commit. (This can be done in advance via interactive rebase or through the github UI)
1. Once the changes are deployed to qal environment, verify the fix looks good and bdds are successful.

1 change: 1 addition & 0 deletions DESIGN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Admiral
49 changes: 46 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ SHELL := /bin/bash
GOCMD?=go
GOBUILD?=$(GOCMD) build
GOCLEAN?=$(GOCMD) clean
GOTEST?=$(GOCMD) test -race
GOTEST?=$(GOCMD) test
GOGET?=$(GOCMD) get
GOBIN?=$(GOPATH)/bin
OUT?=./out/
GOLINTER_VERSION=v1.58.1

BINARY_NAME?=$(OUT)admiral
BINARY_DARWIN?=$(BINARY_NAME)_darwin
Expand Down Expand Up @@ -45,7 +45,9 @@ build-mac:
$(GOBUILD) -o $(BINARY_DARWIN) -v $(MAIN_PATH_ADMIRAL)

test:
$(GOTEST) -v `go list ./... | grep -v client` -coverprofile=c.out
$(GOTEST) -v -failfast -race -timeout 0 `go list ./... | grep -v client | grep -v fmeatests | grep -v tests` -coverprofile=c.out
$(GOCMD) install github.com/boumenot/gocover-cobertura@latest
$(GOPATH)/bin/gocover-cobertura < c.out > cobertura-coverage.xml

clean:
$(GOCLEAN)
Expand Down Expand Up @@ -95,10 +97,16 @@ docker-build: set-tag
#NOTE: Assumes binary has already been built (admiral)
docker build -t $(IMAGE):$(TAG) -f ./admiral/docker/$(DOCKERFILE) .

podman-build: set-tag
#NOTE: Assumes binary has already been built (admiral)
podman build --storage-driver=overlay --isolation=chroot --ulimit=nofile=1048576:1048576 --cgroup-manager=cgroupfs --events-backend=file -t $(IMAGE):$(TAG) -f ./admiral/docker/$(DOCKERFILE) .

docker-publish:
ifndef DO_NOT_PUBLISH
ifndef PIPELINE_BUILD
echo "$(DOCKER_PASS)" | docker login -u $(DOCKER_USER) --password-stdin
endif
endif
ifeq ($(TAG),)
echo "This is not a Tag/Release, skipping docker publish"
else
Expand All @@ -115,6 +123,30 @@ else
endif
endif

podman-publish:
ifndef DO_NOT_PUBLISH
ifndef PIPELINE_BUILD
echo "$(DOCKER_PASS)" | podman login -u ${DOCKER_USERNAME} --password-stdin --storage-driver=overlay
endif
endif
ifeq ($(TAG),)
echo "This is not a Tag/Release, skipping docker publish"
else
ifndef DO_NOT_PUBLISH
podman push $(IMAGE):$(TAG) --storage-driver=overlay --cgroup-manager=cgroupfs --events-backend=file
podman pull $(IMAGE):$(TAG) --storage-driver=overlay --cgroup-manager=cgroupfs --events-backend=file
endif
endif
#no tag set and its master branch, in this case publish `latest` tag
ifeq ($(TAG),)
ifeq ($(BRANCH),master)
podman push $(IMAGE):latest --storage-driver=overlay --cgroup-manager=cgroupfs --events-backend=file
podman pull $(IMAGE):$(TAG) --storage-driver=overlay --cgroup-manager=cgroupfs --events-backend=file
else
echo "This is not master branch, skipping to publish 'latest' tag"
endif
endif

download-kustomize:
curl -s -O -L https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_${OPSYS}_amd64.tar.gz
tar xzf ./kustomize_v${KUSTOMIZE_VERSION}_${OPSYS}_amd64.tar.gz
Expand All @@ -141,3 +173,14 @@ gen-yaml:
cp ./install/prometheus/prometheus.yaml ./out/yaml/prometheus.yaml
cp ./install/sample/rp.yaml ./out/yaml/rp.yaml
cp ./install/scripts/*.sh ./out/scripts/

install_linter:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLINTER_VERSION}

lint:
echo "golangci-lint run --fast -c .golangci.yml"

perf:
go install github.com/onsi/ginkgo/v2/ginkgo
TOTAL_ASSETS=10 API_SERVER_DELAY_MULTIPLIER=1ms ginkgo -v --fail-fast ./tests/perf
TOTAL_ASSETS=25 API_SERVER_DELAY_MULTIPLIER=1ms ginkgo -v --fail-fast ./tests/perf
Loading

0 comments on commit 6a100b3

Please sign in to comment.