Skip to content

Commit

Permalink
refactor update opentelemetry-go & faiss
Browse files Browse the repository at this point in the history
refactor/internal-o11y/update-otel

Signed-off-by: kpango <[email protected]>
  • Loading branch information
kpango committed Jan 29, 2024
1 parent 52ca812 commit ce685c8
Show file tree
Hide file tree
Showing 222 changed files with 9,681 additions and 1,787 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ assignees: ""

<!--- Please change the versions below along with your environment -->

- Go Version: 1.21.5
- Go Version: 1.21.6
- Docker Version: 20.10.8
- Kubernetes Version: v1.28.4
- Kubernetes Version: v1.29.1
- NGT Version: 2.1.6
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/security_issue_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ assignees: ""

<!--- Please change the versions below along with your environment -->

- Go Version: 1.21.5
- Go Version: 1.21.6
- Docker Version: 20.10.8
- Kubernetes Version: v1.28.4
- Kubernetes Version: v1.29.1
- NGT Version: 2.1.6
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<!--- Please change the versions below along with your environment -->

- Go Version: 1.21.5
- Go Version: 1.21.6
- Docker Version: 20.10.8
- Kubernetes Version: v1.28.4
- Kubernetes Version: v1.29.1
- NGT Version: 2.1.6

### Checklist:
Expand Down
8 changes: 2 additions & 6 deletions .github/actions/detect-docker-image-tags/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#
name: "Detect Docker image tags"
description: "A action to detect Docker image tags"

inputs:
tag_name:
description: "Tag name to check whether exists or not"
Expand All @@ -24,18 +23,14 @@ inputs:
images:
description: "Image names"
required: false
default: "vdaas/vald-agent-ngt \
vdaas/vald-discoverer-k8s \
vdaas/vald-lb-gateway \
vdaas/vald-manager-index"
default: "vdaas/vald-agent-ngt vdaas/vald-agent-faiss vdaas/vald-agent-sidecar vdaas/vald-discoverer-k8s vdaas/vald-lb-gateway vdaas/vald-filter-gateway vdaas/vald-mirror-gateway vdaas/vald-manager-index"
outputs:
HELM_EXTRA_OPTIONS:
description: "Helm extra options that specifies image tags"
value: ${{ steps.specify_container_versions.outputs.HELM_EXTRA_OPTIONS }}
IMAGE_TAGS:
description: "Specifies image tags"
value: ${{ steps.specify_container_versions.outputs.IMAGE_TAGS }}

runs:
using: "composite"
steps:
Expand All @@ -45,6 +40,7 @@ runs:
run: |
declare -A m=(
["vdaas/vald-agent-ngt"]="agent.image.tag"
["vdaas/vald-agent-faiss"]="agent.image.tag"
["vdaas/vald-agent-sidecar"]="agent.sidecar.image.tag"
["vdaas/vald-discoverer-k8s"]="discoverer.image.tag"
["vdaas/vald-lb-gateway"]="gateway.lb.image.tag"
Expand Down
3 changes: 0 additions & 3 deletions .github/actions/determine-docker-image-tag/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@
#
name: "Determine Docker image tag"
description: "A action to determine Docker image tag"

outputs:
PRIMARY_TAG:
description: "Primary tag"
value: ${{ steps.determine_tag_name.outputs.PRIMARY_TAG }}
DEFAULT_TAG:
description: "default tag. Tag to be used if the primary tag does not exist"
value: ${{ steps.determine_tag_name.outputs.DEFAULT_TAG }}

runs:
using: "composite"
steps:
Expand All @@ -35,7 +33,6 @@ runs:
echo "GITHUB_EVENT_PATH $GITHUB_EVENT_PATH"
echo "GITHUB_EVENT_NAME ${{ github.event_name }}"
echo "GITHUB_EVENT_NUMBER ${{ github.event.number }}"
- name: Determine tag name
shell: bash
id: determine_tag_name
Expand Down
5 changes: 1 addition & 4 deletions .github/actions/notify-slack/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#
name: "Notify Slack"
description: "A action to notify Slack"

inputs:
author_name:
description: "User name for slack notification"
Expand All @@ -30,14 +29,12 @@ inputs:
status:
description: "Specify success or failure or cancelled or custom"
required: false

runs:
using: "composite"
steps:
- uses: technote-space/workflow-conclusion-action@v2
- uses: technote-space/workflow-conclusion-action@v3
with:
GITHUB_TOKEN: ${{ inputs.token }}

- uses: 8398a7/action-slack@v3
with:
author_name: ${{ inputs.author_name }}
Expand Down
13 changes: 1 addition & 12 deletions .github/actions/setup-e2e/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#
name: "Setup E2E environment"
description: "A action to set up the environment for executing E2E test"

inputs:
require_libhdf5:
description: "If libhdf5 is not required, set this to false"
Expand Down Expand Up @@ -44,8 +43,7 @@ inputs:
target_images:
description: "Image names"
required: false
default: "vdaas/vald-agent-ngt vdaas/vald-discoverer-k8s vdaas/vald-lb-gateway vdaas/vald-manager-index"

default: "vdaas/vald-agent-ngt vdaas/vald-agent-faiss vdaas/vald-agent-sidecar vdaas/vald-discoverer-k8s vdaas/vald-lb-gateway vdaas/vald-filter-gateway vdaas/vald-mirror-gateway vdaas/vald-manager-index"
outputs:
HELM_EXTRA_OPTIONS:
description: "Helm extra options that specifies E2E target image tags"
Expand All @@ -56,7 +54,6 @@ outputs:
DEFAULT_IMAGE_TAG:
description: "Default E2E target image tag"
value: ${{ steps.determine_tag_name.outputs.DEFAULT_TAG }}

runs:
using: "composite"
steps:
Expand All @@ -66,45 +63,37 @@ runs:
run: |
sudo apt-get update
sudo apt-get install -y libhdf5-dev
- name: Setup Go environment
if: ${{ inputs.require_go == 'true' }}
uses: ./.github/actions/setup-go

- name: Setup Helm environment
if: ${{ inputs.require_helm == 'true' }}
uses: ./.github/actions/setup-helm

- name: Wait for target Docker images
if: startsWith( github.ref, 'refs/tags/')
uses: ./.github/actions/wait-for-docker-image
with:
images: ${{ inputs.target_images }}

- name: Determine Docker image tag
id: determine_tag_name
uses: ./.github/actions/determine-docker-image-tag

- name: Specify container versions
id: specify_container_versions
uses: ./.github/actions/detect-docker-image-tags
with:
tag_name: ${{ steps.determine_tag_name.outputs.PRIMARY_TAG }}
images: ${{ inputs.target_images }}

- uses: ./.github/actions/setup-k3d
if: ${{ inputs.require_k3d == 'true' }}
with:
agents: 3
ingress_port: ${{ inputs.ingress_port }}

- name: Setup Minikube environment
if: ${{ inputs.require_minikube == 'true' }}
shell: bash
run: |
make minikube/install
make minikube/start
- name: Check Kubernetes cluster
shell: bash
run: |
Expand Down
6 changes: 1 addition & 5 deletions .github/actions/setup-go/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
#
name: "Setup Go environment"
description: "A action to set up Go environment"

inputs:
go_version:
description: "The Go version to use. The default version is `versions/GO_VERSION`"
required: false
default: ""

runs:
using: "composite"
steps:
Expand All @@ -34,11 +32,9 @@ runs:
echo "version=${GO_VERSION}" >> $GITHUB_OUTPUT
env:
GO_VERSION: ${{ inputs.go_version }}

- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: ${{ steps.go_version.outputs.version }}

- name: Check Go version
shell: bash
run: |
Expand Down
7 changes: 1 addition & 6 deletions .github/actions/wait-for-docker-image/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,12 @@
#
name: "Wait for Docker Images"
description: "A action to wait for Docker images to be published"

inputs:
images:
description: "image names"
required: false
default: "vdaas/vald-agent-ngt \
vdaas/vald-discoverer-k8s \
vdaas/vald-lb-gateway \
vdaas/vald-manager-index"
default: "vdaas/vald-agent-ngt vdaas/vald-agent-faiss vdaas/vald-agent-sidecar vdaas/vald-discoverer-k8s vdaas/vald-lb-gateway vdaas/vald-filter-gateway vdaas/vald-mirror-gateway vdaas/vald-manager-index"
outputs: {}

runs:
using: "composite"
steps:
Expand Down
1 change: 0 additions & 1 deletion .github/codeql/codeql-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@
name: "Go CodeQL config"
queries:
- uses: security-and-quality
# - uses: github/codeql-go/ql/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/_detect-ci-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
outputs:
TAG_NAME: ${{ steps.merge_detection_results.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Determine Docker image tag
id: determine_tag_name
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/_docker-image-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set Git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Build the Docker image
id: build_image
run: |
Expand All @@ -48,7 +46,6 @@ jobs:
TARGET: ${{ inputs.target }}
LABEL_OPTS: "--label org.opencontainers.image.url=${{ github.event.repository.html_url }} --label org.opencontainers.image.source=${{ github.event.repository.html_url }} --label org.opencontainers.image.revision=${{ github.sha }}"
PRIMARY_TAG: ${{ github.sha }}

- name: Scan the Docker image
uses: ./.github/actions/scan-docker-image
with:
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/_docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ on:
description: "If it is specified, specified platforms will be used."
required: false
default: ""

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref != 'refs/heads/main' && github.ref || github.sha }}-${{ github.event_name }}-${{ inputs.target }}
cancel-in-progress: true

jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
Expand All @@ -41,6 +39,8 @@ jobs:
runs-on: ubuntu-latest
if: >-
${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) ||
(github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) ||
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'push' && startsWith( github.ref, 'refs/heads/release/v')) ||
Expand All @@ -55,21 +55,17 @@ jobs:
else
echo ref=${{ github.sha }} >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v4
with:
ref: ${{ steps.ref.outputs.ref }}

- name: Set Git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:master
platforms: linux/amd64,linux/arm64

- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -80,13 +76,11 @@ jobs:
image=moby/buildkit:master
network=host
buildkitd-flags: "--debug --oci-worker-gc=false"

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -95,15 +89,13 @@ jobs:
# password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ secrets.PACKAGE_USER }}
password: ${{ secrets.PACKAGE_TOKEN }}

- name: Build and Publish
id: build_and_publish
uses: ./.github/actions/docker-build
with:
target: ${{ inputs.target }}
platforms: ${{ inputs.platforms }}
builder: ${{ steps.buildx.outputs.name }}

- name: Scan the Docker image
if: startsWith( github.ref, 'refs/tags/')
uses: ./.github/actions/scan-docker-image
Expand All @@ -115,7 +107,6 @@ jobs:
if: github.ref == 'refs/heads/main' || startsWith( github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/notify-slack
with:
author_name: ${{ inputs.target }} image build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/_release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

detect-ci-container:
Expand All @@ -49,7 +49,7 @@ jobs:
PREPARE_RELEASE_BRANCH_NAME: prepare/${{ inputs.release_branch_name }}
RELEASE_TAG: ${{ inputs.release_tag }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.DISPATCH_TOKEN }}
Expand All @@ -58,7 +58,7 @@ jobs:
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- uses: crazy-max/ghaction-import-gpg@v4
- uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
Expand Down
Loading

0 comments on commit ce685c8

Please sign in to comment.