Skip to content

Commit

Permalink
Merge branch 'master' into multiarch-builds
Browse files Browse the repository at this point in the history
  • Loading branch information
kaechele committed May 10, 2023
2 parents 11e8da5 + 26129dd commit 93be8e5
Show file tree
Hide file tree
Showing 747 changed files with 127,113 additions and 16,269 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ on:
pull_request:

env:
GO_VERSION: 1.16
GO_VERSION: 1.17

jobs:

build:
name: Build
runs-on: ubuntu-latest
Expand All @@ -22,7 +21,10 @@ jobs:
sudo apt-get install libpcap-dev
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Verify spec aggregation and code generation
run: make api3-verify

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down Expand Up @@ -106,7 +108,7 @@ jobs:
steps:

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: "0"
submodules: true
Expand All @@ -116,20 +118,29 @@ jobs:
run: find . -type f -name "values.yaml" -o -name "Chart.yaml" |
xargs sed -i -e s/latest/v1.0.0-${{ github.sha }}/g

- name: Replace wasm filter commit id and sha256
id: replace_wasm_filter_commit_id_for_kuma
run: |
WASM_COMMIT="$(git rev-parse HEAD:wasm-filters)"
WASM_SHA256="$(sha256sum wasm-filters/bin/release/http-trace-filter.wasm | cut -d' ' -f1)"
WASM_URI="https://raw.githubusercontent.com/openclarity/wasm-filters/${WASM_COMMIT}/bin/release/http-trace-filter.wasm"
sed -i -e "s/sha256:.*/sha256: \"${WASM_SHA256}\"/" plugins/kuma/charts/values.yaml
sed -i -e "s#wasmFilterURI:.*#wasmFilterURI: \"${WASM_URI}\"#" plugins/kuma/charts/values.yaml
- name: Set up Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v3.5
with:
version: v3.4.0
version: v3.10.3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4.4.0
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.1.0
uses: helm/chart-testing-action@v2.3.1

- name: Add Bitnami Repository
run: helm repo add bitnami https://charts.bitnami.com/bitnami

- name: Run chart-testing (lint)
run: ct lint --check-version-increment=false --validate-maintainers=false
run: ct lint --chart-dirs charts,plugins/kuma --check-version-increment=false --validate-maintainers=false
29 changes: 22 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
branches:
- master

env:
OTEL_COLLECTOR_VERSION: 0.60.0

jobs:
docker:
name: Docker
Expand Down Expand Up @@ -44,7 +47,7 @@ jobs:
with:
context: .
platforms: linux/amd64,linux/arm64
tags: ghcr.io/apiclarity/apiclarity:latest
tags: ghcr.io/openclarity/apiclarity:latest
file: Dockerfile
push: true
cache-from: type=local,src=/tmp/.buildx-cache
Expand All @@ -59,7 +62,7 @@ jobs:
with:
context: plugins
platforms: linux/amd64,linux/arm64
tags: ghcr.io/apiclarity/kong-plugin:latest
tags: ghcr.io/openclarity/kong-plugin:latest
file: plugins/Dockerfile.kong
push: true
cache-from: type=local,src=/tmp/.buildx-cache
Expand All @@ -69,15 +72,15 @@ jobs:
id: tyk-dep
run: |
cd plugins/gateway/tyk/v3.2.2
go mod edit -replace github.com/apiclarity/apiclarity/plugins/[email protected]=./../api
go mod edit -replace github.com/apiclarity/apiclarity/plugins/[email protected]=./../common
go mod edit -replace github.com/openclarity/apiclarity/plugins/[email protected]=./../api
go mod edit -replace github.com/openclarity/apiclarity/plugins/[email protected]=./../common
- name: Build Tyk Plugin
uses: docker/build-push-action@v2
with:
context: plugins
platforms: linux/amd64 # tykio/tyk-plugin-compiler does not currently support other architectures
tags: ghcr.io/apiclarity/tyk-plugin-v3.2.2:latest
tags: ghcr.io/openclarity/tyk-plugin-v3.2.2:latest
file: plugins/Dockerfile.tyk.v3.2.2
push: true
cache-from: type=local,src=/tmp/.buildx-cache
Expand All @@ -88,10 +91,22 @@ jobs:
with:
context: plugins
platforms: linux/amd64,linux/arm64
tags: ghcr.io/apiclarity/passive-taper:latest
tags: ghcr.io/openclarity/passive-taper:latest
file: plugins/Dockerfile.taper
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
VERSION=latest
VERSION=latest
- name: Build OpenTelemetry Collector with APIClarity plugin
uses: docker/build-push-action@v2
with:
context: plugins
tags: ghcr.io/openclarity/otel-apiclarityexporter:latest
file: plugins/Dockerfile.otel-collector
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
OTEL_COLLECTOR_VERSION=${{ env.OTEL_COLLECTOR_VERSION }}
65 changes: 47 additions & 18 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ on:
required: true

env:
GO_VERSION: 1.16
GO_VERSION: 1.17
OTEL_COLLECTOR_VERSION: 0.60.0

jobs:
verification:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
Expand Down Expand Up @@ -55,7 +56,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
Expand All @@ -72,10 +73,10 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
sed -i 's/image: ghcr.io\/apiclarity\/kong-plugin:latest/image: ghcr.io\/apiclarity\/kong-plugin:'"$tag"'/g' plugins/gateway/kong/deploy/patch-deployment.yaml
sed -i 's/image: ghcr.io\/openclarity\/kong-plugin:latest/image: ghcr.io\/openclarity\/kong-plugin:'"$tag"'/g' plugins/gateway/kong/deploy/patch-deployment.yaml
git commit plugins/gateway/kong/deploy/patch-deployment.yaml -m "workflow: update tag in kong deploy script"
sed -i 's/image: ghcr.io\/apiclarity\/tyk-plugin-v3.2.2:latest/image: ghcr.io\/apiclarity\/tyk-plugin-v3.2.2:'"$tag"'/g' plugins/gateway/tyk/deploy/patch-deployment.yaml
sed -i 's/image: ghcr.io\/openclarity\/tyk-plugin-v3.2.2:latest/image: ghcr.io\/openclarity\/tyk-plugin-v3.2.2:'"$tag"'/g' plugins/gateway/tyk/deploy/patch-deployment.yaml
git commit plugins/gateway/tyk/deploy/patch-deployment.yaml -m "workflow: update tag in tyk deploy script"
git tag --annotate --message "Tag for release $tag" "$tag"
Expand Down Expand Up @@ -111,7 +112,7 @@ jobs:
with:
context: .
platforms: linux/amd64,linux/arm64
tags: ghcr.io/apiclarity/apiclarity:${{ github.event.inputs.version }}
tags: ghcr.io/openclarity/apiclarity:${{ github.event.inputs.version }}
file: Dockerfile
push: true
cache-from: type=local,src=/tmp/.buildx-cache
Expand All @@ -126,7 +127,7 @@ jobs:
with:
context: plugins
platforms: linux/amd64,linux/arm64
tags: ghcr.io/apiclarity/kong-plugin:${{ github.event.inputs.version }}
tags: ghcr.io/openclarity/kong-plugin:${{ github.event.inputs.version }}
file: plugins/Dockerfile.kong
push: true
cache-from: type=local,src=/tmp/.buildx-cache
Expand All @@ -136,15 +137,15 @@ jobs:
id: tyk-dep
run: |
cd plugins/gateway/tyk/v3.2.2
go mod edit -replace github.com/apiclarity/apiclarity/plugins/[email protected]=./../api
go mod edit -replace github.com/apiclarity/apiclarity/plugins/[email protected]=./../common
go mod edit -replace github.com/openclarity/apiclarity/plugins/[email protected]=./../api
go mod edit -replace github.com/openclarity/apiclarity/plugins/[email protected]=./../common
- name: Build and Push Tyk plugin
uses: docker/build-push-action@v2
with:
context: plugins
platforms: linux/amd64 # tykio/tyk-plugin-compiler does not currently support other architectures
tags: ghcr.io/apiclarity/tyk-plugin-v3.2.2:${{ github.event.inputs.version }}
tags: ghcr.io/openclarity/tyk-plugin-v3.2.2:${{ github.event.inputs.version }}
file: plugins/Dockerfile.tyk.v3.2.2
push: true
cache-from: type=local,src=/tmp/.buildx-cache
Expand All @@ -159,14 +160,26 @@ jobs:
with:
context: plugins
platforms: linux/amd64,linux/arm64
tags: ghcr.io/apiclarity/passive-taper:${{ github.event.inputs.version }}
tags: ghcr.io/openclarity/passive-taper:${{ github.event.inputs.version }}
file: plugins/Dockerfile.taper
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
VERSION=${{ github.event.inputs.version }}
- name: Build and Push OpenTelemetry Collector with APIClarity plugin
uses: docker/build-push-action@v2
with:
context: plugins
tags: ghcr.io/openclarity/otel-apiclarityexporter:${{ github.event.inputs.version }}
file: plugins/Dockerfile.otel-collector
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
OTEL_COLLECTOR_VERSION=${{ env.OTEL_COLLECTOR_VERSION }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
Expand All @@ -183,7 +196,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: true

Expand All @@ -197,33 +210,49 @@ jobs:
run: find . -type f -name "values.yaml" -o -name "Chart.yaml" |
xargs sed -i -e s/latest/${{ github.event.inputs.version }}/g

- name: Replace wasm filter commit id and sha256
id: replace_wasm_filter_commit_id_for_kuma
run: |
WASM_COMMIT="$(git rev-parse HEAD:wasm-filters)"
WASM_SHA256="$(sha256sum wasm-filters/bin/release/http-trace-filter.wasm | cut -d' ' -f1)"
WASM_URI="https://raw.githubusercontent.com/openclarity/wasm-filters/${WASM_COMMIT}/bin/release/http-trace-filter.wasm"
sed -i -e "s/sha256:.*/sha256: \"${WASM_SHA256}\"/" plugins/kuma/charts/values.yaml
sed -i -e "s#wasmFilterURI:.*#wasmFilterURI: \"${WASM_URI}\"#" plugins/kuma/charts/values.yaml
- name: Set up Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v3.5
with:
version: v3.4.0
version: v3.10.3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4.4.0
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.1.0
uses: helm/chart-testing-action@v2.3.1

- name: Add Bitnami Repository
run: helm repo add bitnami https://charts.bitnami.com/bitnami

- name: Run chart-testing (lint)
run: ct lint --check-version-increment=false --validate-maintainers=false
run: ct lint --chart-dirs charts,plugins/kuma --check-version-increment=false --validate-maintainers=false --all

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.2.1
uses: helm/chart-releaser-action@v1.5.0
with:
charts_dir: charts
config: charts/cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Run chart-releaser for kuma plugin
uses: helm/[email protected]
with:
charts_dir: plugins/kuma
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ plugins/gateway/kong/bin/*
/bin/*
*.gob
goreleaser_artifacts/
site/*
.vscode/*
backend/.vscode/*
.DS_Store
data.txt
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "wasm-filters"]
path = wasm-filters
url = https://github.com/apiclarity/wasm-filters.git
url = https://github.com/openclarity/wasm-filters.git
7 changes: 5 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ run:
- api
- ui
- dist
skip-files:
- ".*\\.gen\\.go$"
timeout: 5m

linters-settings:
golint:
min-confidence: 0.1
goimports:
local-prefixes: github.com/apiclarity
local-prefixes: github.com/openclarity
errorlint:
# Check whether fmt.Errorf uses the %w verb for formatting errors. See the readme for caveats
errorf: false
Expand All @@ -19,6 +21,8 @@ linters-settings:
- github.com/jensneuse/graphql-go-tools
- github.com/up9inc/mizu/tap/api
- github.com/up9inc/mizu/shared
- github.com/openclarity/trace-sampling-manager/api
- github.com/labstack/echo/v4
# Allow local `replace` directives. Default is false.
replace-local: true
gosec:
Expand Down Expand Up @@ -52,7 +56,6 @@ linters:
- testpackage
- scopelint # deprecated
- golint # deprecated

# TODO:(fixme)
- gocognit
- godox
Expand Down
6 changes: 4 additions & 2 deletions .licensei.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ approved = [

ignored = [
"github.com/ghodss/yaml", # MIT - https://github.com/ghodss/yaml/blob/master/LICENSE
"github.com/invopop/yaml", # MIT - https://github.com/invopop/yaml/blob/main/LICENSE
"sigs.k8s.io/yaml", # MIT - https://github.com/kubernetes-sigs/yaml/blob/master/LICENSE
"go.mongodb.org/mongo-driver", # Apache 2.0 - https://github.com/mongodb/mongo-go-driver/blob/master/LICENSE
"github.com/xeipuuv/gojsonpointer", # Apache 2.0 - https://github.com/xeipuuv/gojsonpointer/blob/master/LICENSE-APACHE-2.0.txt
Expand All @@ -22,11 +23,12 @@ ignored = [
"github.com/jensneuse/abstractlogger", # no license file
"github.com/lonelycode/go-uuid", # 3-Clause BSD License - https://github.com/lonelycode/go-uuid/blob/master/uuid/LICENSE
"github.com/jensneuse/byte-template", # no license file
"github.com/invopop/yaml", # no license file
]

[header]
ignorePaths = ["api", "plugins/api"]
#ignoreFiles = ["zz_generated.*.go"]
ignoreFiles = ["mock_*.go", "*.gen.go"]
template = """// Copyright © :YEAR: Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
Expand All @@ -40,4 +42,4 @@ template = """// Copyright © :YEAR: Cisco Systems, Inc. and its affiliates.
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License."""
// limitations under the License."""
Loading

0 comments on commit 93be8e5

Please sign in to comment.