Skip to content

Commit

Permalink
Merge branch 'main' into feature/metrics/malloc_info
Browse files Browse the repository at this point in the history
  • Loading branch information
kmrmt authored Aug 29, 2023
2 parents c07dcd6 + 15522cc commit 7c60cb8
Show file tree
Hide file tree
Showing 63 changed files with 1,910 additions and 3,496 deletions.
65 changes: 65 additions & 0 deletions .github/actions/deploy-chaos-mesh/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# Copyright (C) 2019-2023 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: "Deploy Chaos Mesh"
description: "A action to deploy Chaos Mesh"

inputs:
chaos_mesh_version:
description: "The Chaos Mesh version to use. The default version is `versions/CHAOS_MESH_VERSION`"
required: false
default: ""
helm_extra_options:
description: "Extra options that passed to Helm command"
required: false
default: ""

runs:
using: "composite"
steps:
- name: Fetch Chaos Mesh version
id: chaos_mesh_version
shell: bash
run: |
CHAOS_MESH_VERSION=${CHAOS_MESH_VERSION:-`cat versions/CHAOS_MESH_VERSION`}
echo "version=${CHAOS_MESH_VERSION}" >> $GITHUB_OUTPUT
env:
CHAOS_MESH_VERSION: ${{ inputs.chaos_mesh_version }}

- name: Check k3d
shell: bash
id: check_k3d
run: |
kubectl cluster-info
- name: Check Helm
shell: bash
run: |
helm version
- name: Deploy Chaos Mesh
shell: bash
run: |
make kubectl/install
curl -sSL "https://mirrors.chaos-mesh.org/v${CHAOS_MESH_VERSION}/install.sh" | bash -s -- --k3s
helm install \
${HELM_EXTRA_OPTIONS} \
vald-chaos-test tests/chaos/chart
env:
HELM_EXTRA_OPTIONS: ${{ inputs.helm_extra_options }}
CHAOS_MESH_VERSION: ${{ steps.chaos_mesh_version.outputs.version }}
13 changes: 8 additions & 5 deletions .github/actions/detect-docker-image-tags/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,28 @@
# limitations under the License.
#
name: "Detect Docker image tags"
description: "Detect Docker image tags"
description: "A action to detect Docker image tags"

inputs:
tag_name:
description: "tag name to check whether exists or not"
description: "Tag name to check whether exists or not"
required: true
default: ""
images:
description: "image names"
description: "Image names"
required: false
default: "vdaas/vald-agent-ngt \
vdaas/vald-discoverer-k8s \
vdaas/vald-lb-gateway \
vdaas/vald-manager-index"
outputs:
HELM_EXTRA_OPTIONS:
description: "helm extra options that specifies image tags"
description: "Helm extra options that specifies image tags"
value: ${{ steps.specify_container_versions.outputs.HELM_EXTRA_OPTIONS }}
IMAGE_TAGS:
description: "specifies image tags"
description: "Specifies image tags"
value: ${{ steps.specify_container_versions.outputs.IMAGE_TAGS }}

runs:
using: "composite"
steps:
Expand All @@ -47,6 +49,7 @@ runs:
["vdaas/vald-discoverer-k8s"]="discoverer.image.tag"
["vdaas/vald-lb-gateway"]="gateway.lb.image.tag"
["vdaas/vald-manager-index"]="manager.index.image.tag"
["vdaas/vald-helm-operator"]="image.tag"
)
for image in ${IMAGES}
Expand Down
57 changes: 57 additions & 0 deletions .github/actions/determine-docker-image-tag/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Copyright (C) 2019-2023 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: "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 }}

runs:
using: "composite"
steps:
- name: Dump Github context
shell: bash
run: |
echo "GITHUB_REF $GITHUB_REF"
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
run: |
if [[ "$GITHUB_REF" =~ ^refs/tags/.* ]]; then
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/tags/::'`
primary_tag="${tag_name}"
elif [ "${{ github.event_name }}" = "pull_request" ]; then
pr_num=`cat $GITHUB_EVENT_PATH | jq -r ".number"`
echo "PR-${pr_num}" > versions/VALD_VERSION
primary_tag="pr-${pr_num}"
elif [ "${{ github.event_name }}" = "pull_request_target" ]; then
pr_num=`cat $GITHUB_EVENT_PATH | jq -r ".number"`
echo "PR-${pr_num}" > versions/VALD_VERSION
primary_tag="pr-${pr_num}"
elif [ "$GITHUB_REF" = "refs/heads/main" ]; then
echo "nightly" > versions/VALD_VERSION
primary_tag="nightly"
else
primary_tag="unknown"
fi
echo "PRIMARY_TAG is determined: ${primary_tag}"
echo "PRIMARY_TAG=${primary_tag}" >> $GITHUB_OUTPUT
50 changes: 16 additions & 34 deletions .github/actions/docker-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,38 @@
# limitations under the License.
#
name: "Build Docker images"
description: "Build Docker images and publish them"
description: "A action to build Docker images and publish them"

inputs:
target:
description: "build target"
description: "Build target"
required: true
default: "base"
builder:
description: "buildx builder name"
description: "Buildx builder name"
required: true
default: ""
platforms:
description: "if it is specified, specified platforms will be used."
description: "If it is specified, specified platforms will be used."
required: false
default: ""
outputs:
IMAGE_NAME:
description: "image name"
description: "Image name"
value: ${{ steps.image_name.outputs.IMAGE_NAME }}
ALTER_IMAGE_NAME:
description: "alter image name"
description: "Alter image name"
value: ${{ steps.image_name.outputs.ALTER_IMAGE_NAME }}
PRIMARY_TAG:
description: "primary tag"
description: "Primary tag"
value: ${{ steps.determine_tag_name.outputs.PRIMARY_TAG }}
PLATFORMS:
description: "target platforms"
description: "Target platforms"
value: ${{ steps.determine_platforms.outputs.PLATFORMS }}
EXTRA_TAGS:
description: "extra tags"
description: "Extra tags"
value: ${{ steps.add_extra_tags.outputs.EXTRA_TAGS }}

runs:
using: "composite"
steps:
Expand All @@ -60,33 +62,11 @@ runs:
echo "ALTER_IMAGE_NAME=${alter_image_name}" >> $GITHUB_OUTPUT
env:
TARGET: ${{ inputs.target }}

- name: Determine tag name
shell: bash
id: determine_tag_name
run: |
echo "GITHUB_REF $GITHUB_REF"
echo "GITHUB_EVENT_PATH $GITHUB_EVENT_PATH"
echo "GITHUB_EVENT_NAME ${{ github.event_name }}"
echo "GITHUB_EVENT_NUMBER ${{ github.event.number }}"
if [[ "$GITHUB_REF" =~ ^refs/tags/.* ]]; then
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/tags/::'`
primary_tag="${tag_name}"
elif [ "${{ github.event_name }}" = "pull_request" ]; then
pr_num=`cat $GITHUB_EVENT_PATH | jq -r ".number"`
echo "PR-${pr_num}" > versions/VALD_VERSION
primary_tag="pr-${pr_num}"
elif [ "${{ github.event_name }}" = "pull_request_target" ]; then
pr_num=`cat $GITHUB_EVENT_PATH | jq -r ".number"`
echo "PR-${pr_num}" > versions/VALD_VERSION
primary_tag="pr-${pr_num}"
elif [ "$GITHUB_REF" = "refs/heads/main" ]; then
echo "nightly" > versions/VALD_VERSION
primary_tag="nightly"
else
primary_tag="unknown"
fi
echo "PRIMARY_TAG is determined: ${primary_tag}"
echo "PRIMARY_TAG=${primary_tag}" >> $GITHUB_OUTPUT
uses: ./.github/actions/determine-docker-image-tag

- name: Determine platforms
shell: bash
id: determine_platforms
Expand All @@ -106,6 +86,7 @@ runs:
echo "PLATFORMS=${platforms}" >> $GITHUB_OUTPUT
env:
TARGET_PLATFORMS: ${{ inputs.platforms }}

- name: Add extra tags
shell: bash
id: add_extra_tags
Expand All @@ -121,6 +102,7 @@ runs:
IMAGE_NAME: ${{ steps.image_name.outputs.IMAGE_NAME }}
ALTER_IMAGE_NAME: ${{ steps.image_name.outputs.ALTER_IMAGE_NAME }}
PRIMARY_TAG: ${{ steps.determine_tag_name.outputs.PRIMARY_TAG }}

- name: Build and Push
shell: bash
id: build_and_push
Expand Down
56 changes: 56 additions & 0 deletions .github/actions/dump-context/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#
# Copyright (C) 2019-2023 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: "Dump context to log"
description: "A action to dump context to log"

runs:
using: "composite"
steps:
- name: "Dump GitHub context"
shell: bash
run: echo $JSON
env:
JSON: ${{toJSON(github)}}

- name: "Dump job context"
shell: bash
run: echo $JSON
env:
JSON: ${{ toJSON(job) }}

- name: "Dump steps context"
shell: bash
run: echo $JSON
env:
JSON: ${{toJSON(steps)}}

- name: "Dump runner context"
shell: bash
run: echo $JSON
env:
JSON: ${{toJSON(runner)}}

- name: "Dump strategy context"
shell: bash
run: echo $JSON
env:
JSON: ${{toJSON(strategy)}}

- name: "Dump matrix context"
shell: bash
run: echo $JSON
env:
JSON: ${{toJSON(matrix)}}
Loading

0 comments on commit 7c60cb8

Please sign in to comment.