Skip to content

Commit

Permalink
Merge branch 'istio-ecosystem:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
aattuluri authored Aug 15, 2024
2 parents 0ef1a24 + 0e8cee3 commit 67a6843
Show file tree
Hide file tree
Showing 300 changed files with 63,565 additions and 7,775 deletions.
24 changes: 6 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ orbs:

jobs:
build:
working_directory: /go/pkg/mod/github.com/admiral
working_directory: admiral
docker:
- image: circleci/golang:1.16
- image: cimg/go:1.21
steps:
- checkout
- run:
Expand Down 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
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
name: Run Integration Test for Istio 1.20.2
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.16
- 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!
68 changes: 36 additions & 32 deletions .github/workflows/golang-ci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,32 +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
- 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.43.0

# 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
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
.idea
.idea/vcs.xml

out*
*.tar.gz
out/*
out.yaml
*.tar.gz
*.out
*.prof
istio-*
.DS_Store
cobertura-coverage.xml
.vscode
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
93 changes: 86 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
We welcome contributions :)

## Submitting PRs
* Make sure to check existing issues and file an issue before starting to work on a feature/bug. This will help prevent duplication of work.
* Make sure to check existing issues and file an issue before starting to work on a feature/bug. This will help prevent duplication of work.
Also refer to [Collaboration](./README.md) for communication channels.

## Setting up for local Development
Expand All @@ -20,10 +20,12 @@ $ADMIRAL_HOME/tests/create_cluster.sh 1.16.8
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`

Linux: `$ADMIRAL_HOME/tests/install_istio.sh 1.7.4 linux`
Mac: `$ADMIRAL_HOME/tests/install_istio.sh 1.20.2 osx`

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

Linux: `$ADMIRAL_HOME/tests/install_istio.sh 1.20.2 linux`

* Set up necessary permissions and configurations for Admiral

Expand All @@ -40,8 +42,69 @@ $ADMIRAL_HOME/admiral/cmd/admiral/main.go --kube_config "<Path_to_Kubeconfig>"
$ADMIRAL_HOME/install/scripts/cluster-secret.sh <Path_to_Kubeconfig_Admiral_Cluster> <Path_to_Kubeconfig_Remote_Cluster> admiral
```

* `Optional`: Run `admiral` inside the minikube cluster
```bash
# point to the admiral primary cluster
export KUBECONFIG=<Path_to_Kubeconfig_Admiral_Cluster>

# build the yaml files
make gen-yaml

# run the install scripts
$ADMIRAL_HOME/install/scripts/install_admiral.sh $ADMIRAL_HOME/out/

# get the http url for admiral api
minikube service admiral-http -n admiral --url

# get the http url for admiral metrics api
minikube service admiral-metrics -n admiral --url
```

* `Optional`: Install prometheus for metrics.
```bash
# build the yaml files
make gen-yaml

# run the install scripts
$ADMIRAL_HOME/install/scripts/install_prometheus.sh $ADMIRAL_HOME/out

# get the http url for prometheus dashboard
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 @@ -51,8 +114,24 @@ make gen-yaml
cd $ADMIRAL_HOME/tests
./run.sh "1.16.8" "1.7.4" "../out"
```
* Multi-cluster
* Multi-cluster
```
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
Loading

0 comments on commit 67a6843

Please sign in to comment.