Skip to content

Commit

Permalink
Merge branch 'main' into feature/egress-gateway/add-egress-query
Browse files Browse the repository at this point in the history
  • Loading branch information
vankichi authored Jan 31, 2024
2 parents 45853e9 + aae1707 commit 28434e1
Show file tree
Hide file tree
Showing 57 changed files with 2,910 additions and 99 deletions.
7 changes: 2 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@
// To access grafana
"appPort": "3000:3000",

// Persist zsh history settings below
// overwrite HISTFILE to store history file in the named volume defined below
// also setting INC_APPEND_HISTORY to immediately flush command history to the file to keep history when rebuilding the devcontainer
"postStartCommand": "echo 'export HISTFILE=/commandhistory/.zsh_history' >> /root/.zshrc && echo 'setopt INC_APPEND_HISTORY' >> /root/.zshrc",
// define named volume to store zsh history file
"mounts": ["source=zshhistory-named-volume,target=/commandhistory,type=volume"],
"postAttachCommand": "mkdir -p /etc/server && ln -s $(pwd)/cmd/agent/core/ngt/sample.yaml /etc/server/config.yaml"

"postAttachCommand": ["/bin/bash", ".devcontainer/postAttachCommand.sh"]
}
53 changes: 53 additions & 0 deletions .devcontainer/postAttachCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash -eu

#
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# 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.
#
:

#
# This script is executed as postAttachCommand in devcontainer.json
# This script does...
# - create symbolic link of config.yaml for easier development
# - add command history setting to .zshrc to persist history
#

echo "creating symbolic link of config..."

LINK_TARGET="$(pwd)/cmd/agent/core/ngt/sample.yaml"
LINK_SRC="/etc/server/config.yaml"

mkdir -p /etc/server

if [ ! -e "$LINK_SRC" ]; then
ln -s "$LINK_TARGET" "$LINK_SRC"
echo "created symbolic link: $LINK_SRC -> $LINK_TARGET"
else
echo "$LINK_SRC already exists"
fi


echo "adding history setting to .zshrc..."

LINE1="export HISTFILE=/commandhistory/.zsh_history"
LINE2="setopt INC_APPEND_HISTORY"

ZSHRC="/root/.zshrc"

# write only if those lines don't exist
grep -qxF "$LINE1" "$ZSHRC" || echo "$LINE1" >> "$ZSHRC"
grep -qxF "$LINE2" "$ZSHRC" || echo "$LINE2" >> "$ZSHRC"

echo "added history setting to .zshrc"
3 changes: 2 additions & 1 deletion .github/helm/values/values-readreplica.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ agent:
readreplica:
enabled: true
snapshot_classname: "csi-hostpath-snapclass"
replica: 1
hpa:
enabled: true

discoverer:
minReplicas: 1
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

detect-ci-container:
uses: ./.github/workflows/_detect-ci-container.yml

build-linux:
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build-protobuf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

detect-ci-container:
uses: ./.github/workflows/_detect-ci-container.yml

build:
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v4

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

detect-ci-container:
uses: ./.github/workflows/_detect-ci-container.yml

codeql-build:
name: CodeQL
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

detect-ci-container:
uses: ./.github/workflows/_detect-ci-container.yml

coverage:
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/e2e-code-bench-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,15 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

detect-ci-container:
uses: ./.github/workflows/_detect-ci-container.yml

grpc-sequential:
name: grpc-sequential
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -87,8 +91,9 @@ jobs:
grpc-stream:
name: grpc-stream
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v4

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

detect-ci-container:
uses: ./.github/workflows/_detect-ci-container.yml

fossa-scan:
name: "trigger FOSSA scan"
needs: [dump-contexts-to-log]
runs-on: ubuntu-latest
needs: [dump-contexts-to-log, detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v4

Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/helm-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

detect-ci-container:
uses: ./.github/workflows/_detect-ci-container.yml

lint-vald-chart:
name: lint for vald chart
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- name: Check out code.
uses: actions/checkout@v4
Expand All @@ -54,8 +58,9 @@ jobs:
lint-vald-helm-operator-chart:
name: lint for vald-helm-operator chart
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- name: Check out code.
uses: actions/checkout@v4
Expand All @@ -79,6 +84,9 @@ jobs:
lint-values-schema:
name: lint for values schema
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- name: Check out code.
uses: actions/checkout@v4
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

detect-ci-container:
uses: ./.github/workflows/_detect-ci-container.yml

update-helm-chart:
name: Update Helm chart
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/issue-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# 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.
#
name: Monthly review time metrics
on:
workflow_dispatch:
inputs:
time_window:
required: false
description: 'Time window for the issue metrics report. e.g. 2021-01-01..2021-01-31. If not set, the previous month will be calculated.'
type: string
schedule:
- cron: '3 2 1 * *'
permissions:
issues: write
pull-requests: read
jobs:
build:
name: review time metrics
runs-on: ubuntu-latest
steps:
- name: Get dates for last month
shell: bash
run: |
# If TIME_WINDOW is set, use it as last_month
if [ -n "$TIME_WINDOW" ]; then
echo "last_month=$TIME_WINDOW" >> "$GITHUB_ENV"
else
# Calculate the first day of the previous month
first_day=$(date -d "last month" +%Y-%m-01)
# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
# Set an environment variable with the date range
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
fi
env:
TIME_WINDOW: ${{ github.event.inputs.time_window }}
- name: Run issue-metrics tool
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:vdaas/vald is:pr created:${{ env.last_month }}'
HIDE_TIME_TO_ANSWER: true
- name: Create issue
uses: peter-evans/create-issue-from-file@v4
with:
title: "Monthly review time metrics report: ${{ env.last_month }}"
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
12 changes: 9 additions & 3 deletions .github/workflows/reviewdog-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

detect-ci-container:
uses: ./.github/workflows/_detect-ci-container.yml

kubeval-conflint:
name: runner / kubeval-conflint
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: mumoshu/conflint:latest
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v4

Expand All @@ -53,8 +57,9 @@ jobs:
kubelinter-k8s-manifests:
name: runner / kubelinter
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v4

Expand All @@ -74,8 +79,9 @@ jobs:
kubelinter-vald-chart:
name: runner / kubelinter for vald chart
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v4

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

detect-ci-container:
uses: ./.github/workflows/_detect-ci-container.yml

golangci-lint:
name: runner / golangci-lint
runs-on: ubuntu-latest
needs: [detect-ci-container]
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v4

Expand Down
Loading

0 comments on commit 28434e1

Please sign in to comment.