-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cost-1665-node-in-storage-report
- Loading branch information
Showing
4,255 changed files
with
1,510,738 additions
and
2,080 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
target-branch: "main" | ||
|
||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
# Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.) | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
groups: | ||
ci-dependencies: | ||
patterns: | ||
- "*" # update all github-actions in single PR | ||
ignore: | ||
# v4 codecov is broken for dependabot updates because dependabot does not have access to secrets. | ||
- dependency-name: "codecov/codecov-action" | ||
|
||
|
||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
groups: | ||
k8s.io-dependencies: | ||
patterns: | ||
- "*k8s.io*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build and Publish Images | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: # run on any tag that starts with `v` but not tags that end with `-downstream` | ||
- 'v**' | ||
- '!v**-downstream' | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Build and Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Get the repository's code | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
quay.io/project-koku/koku-metrics-operator | ||
tags: | | ||
type=semver,pattern={{raw}} | ||
type=sha,prefix=,enable=${{ github.ref_type == 'tag' }} | ||
# set latest tag for default branch | ||
type=raw,value=latest | ||
type=ref,event=branch | ||
- name: Login to Quay.io | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USER }} | ||
password: ${{ secrets.QUAY_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/arm64,linux/amd64,linux/s390x,linux/ppc64le | ||
provenance: false | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
name: CI - user triggered jobs | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ibmcloudRegion: | ||
description: 'ibm cloud instance region' | ||
required: true | ||
default: 'us-south' | ||
type: choice | ||
options: | ||
- us-south | ||
- ca-tor | ||
- us-east | ||
- eu-es | ||
- eu-gb | ||
- jp-tok | ||
- br-sao | ||
# pull_request_target: | ||
|
||
jobs: | ||
|
||
unit-tests-s390x: | ||
name: unit-test-zvsi (s390x) | ||
runs-on: ubuntu-22.04 | ||
env: | ||
ZVSI_SSH_KEY: koku-ci-ssh-key-${{ github.run_id }}-${{ github.run_number }} | ||
ZVSI_VPC_NAME: koku-ci-vpc-${{ github.run_id }}-${{ github.run_number }} | ||
ZVSI_PROFILE_NAME: bz2-4x16 | ||
ZVSI_SUBNET_NAME: koku-ci-subnet-${{ github.run_id }}-${{ github.run_number }} | ||
ZVSI_FIP_NAME: koku-ci-fip-${{ github.run_id }}-${{ github.run_number }} | ||
ZVSI_INS_NAME: koku-ci-zvsi-${{ github.run_id }}-${{ github.run_number }} | ||
ZVSI_IMAGE_NAME: ibm-ubuntu-22-04-3-minimal-s390x-2 | ||
steps: | ||
- name: install ibmcli and setup ibm login | ||
run: | | ||
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh | ||
ibmcloud login -q --apikey ${{ secrets.IBMCLOUD_API_KEY }} -r ${{ inputs.ibmcloudRegion }} | head -3 | ||
ibmcloud plugin install -f vpc-infrastructure | ||
- name: generate ssh key | ||
run: | | ||
ibmcloud is key-create $ZVSI_SSH_KEY "${{ secrets.ZVSI_PUBLIC_KEY }}" --key-type rsa --resource-group-id ${{ secrets.IBMCLOUD_RESOURCE_GROUP_ID }} -q --output JSON | jq 'del(.public_key,.resource_group)' | ||
sleep 2 | ||
- name: create a virtual private cloud instance | ||
run: | | ||
ibmcloud is vpc-create $ZVSI_VPC_NAME --resource-group-id ${{ secrets.IBMCLOUD_RESOURCE_GROUP_ID }} -q --output JSON | jq 'del(.resource_group)' | ||
sleep 2 | ||
- name: select a zone randomly | ||
run: | | ||
query=.cse_source_ips[$(awk "BEGIN{srand(); print int(rand()*(2-0+1))+0}")].zone.name | ||
echo "ZVSI_ZONE=$(ibmcloud is vpc $ZVSI_VPC_NAME --output JSON | jq -r $query)" >> $GITHUB_ENV | ||
- name: create a subnet for vpc | ||
run: | | ||
ibmcloud is subnet-create $ZVSI_SUBNET_NAME $ZVSI_VPC_NAME --ipv4-address-count 256 --zone $ZVSI_ZONE --resource-group-id ${{ secrets.IBMCLOUD_RESOURCE_GROUP_ID }} -q --output JSON | jq 'del(.resource_group)' | ||
sleep 2 | ||
- name: create security group rule for ssh access | ||
run: | | ||
ibmcloud is security-group-rule-add $(ibmcloud is vpc $ZVSI_VPC_NAME --output JSON | jq -r .default_security_group.id) inbound tcp --port-min 22 --port-max 22 -q --output JSON | ||
sleep 2 | ||
- name: create a zvsi instance | ||
run: | | ||
ibmcloud is instance-create $ZVSI_INS_NAME $ZVSI_VPC_NAME $ZVSI_ZONE $ZVSI_PROFILE_NAME $ZVSI_SUBNET_NAME --keys $ZVSI_SSH_KEY --image $ZVSI_IMAGE_NAME --resource-group-id ${{ secrets.IBMCLOUD_RESOURCE_GROUP_ID }} -q --output JSON | jq 'del(.resource_group)' | ||
sleep 30 | ||
- name: floating ip addess assignment | ||
run: | | ||
ibmcloud is floating-ip-reserve $ZVSI_FIP_NAME --resource-group-id ${{ secrets.IBMCLOUD_RESOURCE_GROUP_ID }} --vni $(ibmcloud is instance-network-attachment $ZVSI_INS_NAME $(ibmcloud is instance $ZVSI_INS_NAME -q --output JSON | jq -r .primary_network_interface.id) -q --output JSON | jq -r .virtual_network_interface.id) -q --output JSON | jq 'del(.resource_group)' | ||
- name: setup floating ip address for ssh connection | ||
run: | | ||
echo "ZVSI_FIP_ADD=$(ibmcloud is floating-ip $ZVSI_FIP_NAME -q --output JSON | jq -r .address)" >> $GITHUB_ENV | ||
- name: Check ZVSI is online | ||
run: | | ||
zvsi_status=$(ibmcloud is instance $ZVSI_INS_NAME -q --output JSON | jq -r .status) | ||
if [[ -z "$zvsi_status" ]]; then | ||
echo "ZVSI is not created"; | ||
exit 1 | ||
fi | ||
while [[ $zvsi_status == "pending" || $zvsi_status == "starting" || $zvsi_status == "running" ]] | ||
do | ||
sleep 5 | ||
zvsi_status=$(ibmcloud is instance $ZVSI_INS_NAME -q --output JSON | jq -r .status) | ||
if [[ $zvsi_status == "failed" ]]; then | ||
echo "zvsi failed to start"; | ||
exit 1; | ||
elif [[ $zvsi_status == "running" ]]; then | ||
echo "zvsi is running"; | ||
break; | ||
elif [[ -z "$zvsi_status" ]]; then | ||
echo "ZVSI is not created"; | ||
exit 1 | ||
fi | ||
done | ||
- name: go unit test in zvsi | ||
uses: appleboy/ssh-action@v1.0.3 | ||
with: | ||
host: ${{ env.ZVSI_FIP_ADD }} | ||
username: root | ||
key: ${{ secrets.ZVSI_PRIVATE_KEY }} | ||
script: | | ||
apt update -y && apt install -y make | ||
git clone -b ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }} koku-zvsi-clone | ||
cd koku-zvsi-clone && snap install go --classic --channel=$(grep -m 1 go go.mod | cut -d\ -f2)/stable && cd .. | ||
adduser --disabled-password --gecos "" runner | ||
cp -r koku-zvsi-clone /home/runner/koku-zvsi-clone | ||
chmod -R 777 /home/runner/koku-zvsi-clone | ||
su runner -c "cd /home/runner/koku-zvsi-clone && make test" | ||
- name: destroy zvsi instance | ||
if: always() | ||
run: | | ||
ibmcloud is instance-delete -f -q $ZVSI_INS_NAME | ||
sleep 15 | ||
- name: Check ZVSI is offline | ||
if: always() | ||
run: | | ||
zvsi_status=$(ibmcloud is instance $ZVSI_INS_NAME -q --output JSON | jq -r .status) | ||
if [[ -z "$zvsi_status" ]]; then | ||
echo "ZVSI is destroyed"; | ||
break | ||
fi | ||
while [[ $zvsi_status == "running" || $zvsi_status == "deleting" ]] | ||
do | ||
sleep 5 | ||
zvsi_status=$(ibmcloud is instance $ZVSI_INS_NAME -q --output JSON | jq -r .status) | ||
if [[ -z "$zvsi_status" ]]; then | ||
echo "ZVSI is destroyed"; | ||
break | ||
fi | ||
done | ||
- name: release floating ip address | ||
if: always() | ||
run: | | ||
ibmcloud is floating-ip-release -f -q $ZVSI_FIP_NAME | ||
- name: cleanup subnet | ||
if: always() | ||
run: | | ||
ibmcloud is subnet-delete -f -q $ZVSI_SUBNET_NAME | ||
sleep 2 | ||
- name: cleanup virtual private cloud instance | ||
if: always() | ||
run: | | ||
ibmcloud is vpc-delete -f -q $ZVSI_VPC_NAME | ||
sleep 2 | ||
- name: cleanup ssh key | ||
if: always() | ||
run: | | ||
ibmcloud is key-delete -f -q $ZVSI_SSH_KEY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.