Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/node-split-poc' into nodesplit/s…
Browse files Browse the repository at this point in the history
…ystestasutil
  • Loading branch information
poszu committed Jan 21, 2025
2 parents d4a8ce9 + f31f02b commit 76281db
Show file tree
Hide file tree
Showing 371 changed files with 33,162 additions and 5,768 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# Default owners for the repository.
# Unless further specified all of those will be requested for review whenever someone opens a PR.
# These are also the only users who are allowed to `bors try` and `bors merge`.
* @dshulyak @fasmat @poszu @ivan4th @acud @jellonek
* @dshulyak @fasmat @poszu @ivan4th @acud @jellonek @kacpersaw
19 changes: 11 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: CI

env:
go-version: "1.23"
GCLOUD_KEY: ${{ secrets.GCLOUD_KEY }}
PROJECT_NAME: ${{ secrets.PROJECT_NAME }}
CLUSTER_NAME: ${{ secrets.CLUSTER_NAME }}
Expand Down Expand Up @@ -79,7 +78,7 @@ jobs:
uses: actions/setup-go@v5
with:
check-latest: true
go-version: ${{ env.go-version }}
go-version-file: "go.mod"
- name: fmt, tidy, generate
run: |
make install
Expand Down Expand Up @@ -110,7 +109,7 @@ jobs:
uses: actions/setup-go@v5
with:
check-latest: true
go-version: ${{ env.go-version }}
go-version-file: "go.mod"
- name: setup env
run: make install
- name: lint
Expand Down Expand Up @@ -157,7 +156,7 @@ jobs:
uses: actions/setup-go@v5
with:
check-latest: true
go-version: ${{ env.go-version }}
go-version-file: "go.mod"
cache: ${{ runner.arch != 'arm64' }}
- name: setup env
run: make install
Expand All @@ -184,7 +183,6 @@ jobs:
with:
lfs: true
ssh-key: ${{ secrets.GH_ACTION_PRIVATE_KEY }}

- uses: extractions/netrc@v2
with:
machine: github.com
Expand All @@ -203,7 +201,12 @@ jobs:
- name: test coverage
run: make cover
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -263,7 +266,7 @@ jobs:
uses: actions/setup-go@v5
with:
check-latest: true
go-version: ${{ env.go-version }}
go-version-file: "go.mod"
cache: ${{ runner.arch != 'arm64' }}
- name: Add OpenCL support - Ubuntu
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-latest-arm-8-cores' }}
Expand All @@ -282,7 +285,7 @@ jobs:
GOTESTSUM_JUNITFILE: unit-tests.xml
run: make test
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
uses: mikepenz/action-junit-report@v5
# always run even if the previous step fails
if: always()
with:
Expand Down
187 changes: 162 additions & 25 deletions .github/workflows/systest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,18 @@ jobs:
- uses: dorny/paths-filter@v3
id: filter
with:
predicate-quantifier: 'every'
filters: |
nondoc:
- '!**/*.md'
- '!.github/CODEOWNERS'
systest:
build-docker-images:
runs-on: ubuntu-22.04
if: ${{ needs.filter-changes.outputs.nondocchanges == 'true' }}
needs:
- filter-changes
timeout-minutes: 70
timeout-minutes: 20
permissions:
contents: 'read'
id-token: 'write'
Expand All @@ -66,31 +68,19 @@ jobs:
with:
ssh-key: ${{ secrets.GH_ACTION_PRIVATE_KEY }}

- name: Setup kubectl
id: install
uses: azure/setup-kubectl@v4
with:
version: "v1.27.16"

- name: Setup gcloud authentication
uses: google-github-actions/auth@v2
with:
project_id: ${{ secrets.GCP_WI_PROJECT_ID }}
workload_identity_provider: ${{ secrets.GCP_WI_PROVIDER_SA }}
service_account: ${{ secrets.GCP_WI_SA }}
service_account: ${{ secrets.GCP_WI_SA }}
token_format: access_token

- name: Configure gcloud
uses: google-github-actions/setup-gcloud@v2
with:
version: "469.0.0"

- name: Configure gke authentication plugin
run: gcloud components install gke-gcloud-auth-plugin --quiet

- name: Configure kubectl
run: gcloud container clusters get-credentials ${{ secrets.CI_CLUSTER_NAME }} --region ${{ secrets.CI_REGION_NAME }} --project ${{ secrets.CI_GCP_PROJECT_ID }}

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -128,6 +118,122 @@ jobs:
- name: Push tests docker images
run: make -C systest push

provision-cluster:
runs-on: ubuntu-22.04
if: ${{ needs.filter-changes.outputs.nondocchanges == 'true' }}
needs:
- filter-changes
timeout-minutes: 20
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.GH_ACTION_PRIVATE_KEY }}

- name: Setup gcloud authentication
uses: google-github-actions/auth@v2
with:
project_id: ${{ secrets.GCP_WI_PROJECT_ID }}
workload_identity_provider: ${{ secrets.GCP_WI_PROVIDER_SA }}
service_account: ${{ secrets.GCP_WI_SA }}
token_format: access_token

- name: Configure gcloud
uses: google-github-actions/setup-gcloud@v2
with:
version: "469.0.0"

- name: Create Node Pool
run: |
NODE_POOL_NAME="systemtest-${{ github.run_id }}"
echo "nodepool-name=${NODE_POOL_NAME}" >> $GITHUB_OUTPUT
gcloud container node-pools create $NODE_POOL_NAME \
--cluster ${{ secrets.CI_CLUSTER_NAME }} \
--num-nodes 2 \
--preemptible \
--location ${{ secrets.CI_REGION_NAME }} \
--machine-type ${{ secrets.CI_NODE_MACHINE_TYPE }} \
--disk-type pd-ssd \
--disk-size 300GB \
--image-type COS_CONTAINERD \
--enable-autorepair \
--no-enable-autoupgrade \
--node-labels env=dev,cluster=${{ secrets.CI_CLUSTER_NAME }},pipeline-id=${{ github.run_id }} \
--metadata disable-legacy-endpoints=true \
--service-account ${{ secrets.CI_GKE_NODEPOOL_SA }} \
--project ${{ secrets.CI_GCP_PROJECT_ID }} \
--quiet
echo "Node pool created: $NODE_POOL_NAME"
systest-gke:
runs-on: ubuntu-22.04
if: ${{ needs.filter-changes.outputs.nondocchanges == 'true' }}
needs:
- filter-changes
- provision-cluster
- build-docker-images
timeout-minutes: 70
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.GH_ACTION_PRIVATE_KEY }}

- name: Setup kubectl
uses: azure/setup-kubectl@v4
with:
version: "v1.27.16"

- name: Setup gcloud authentication
uses: google-github-actions/auth@v2
with:
project_id: ${{ secrets.GCP_WI_PROJECT_ID }}
workload_identity_provider: ${{ secrets.GCP_WI_PROVIDER_SA }}
service_account: ${{ secrets.GCP_WI_SA }}
token_format: access_token

- name: Configure gcloud
uses: google-github-actions/setup-gcloud@v2
with:
version: "469.0.0"

- name: Configure gke authentication plugin
run: gcloud components install gke-gcloud-auth-plugin --quiet

- name: Configure kubectl
run: gcloud container clusters get-credentials ${{ secrets.CI_CLUSTER_NAME }} --region ${{ secrets.CI_REGION_NAME }} --project ${{ secrets.CI_GCP_PROJECT_ID }}

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- uses: extractions/netrc@v2
with:
machine: github.com
username: ${{ secrets.GH_ACTION_TOKEN_USER }}
password: ${{ secrets.GH_ACTION_TOKEN }}
if: vars.GOPRIVATE

- name: Get commit hash
id: vars
shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- uses: extractions/netrc@v2
with:
machine: github.com
username: ${{ secrets.GH_ACTION_TOKEN_USER }}
password: ${{ secrets.GH_ACTION_TOKEN }}
if: vars.GOPRIVATE

- name: set up go
uses: actions/setup-go@v5
with:
Expand All @@ -138,7 +244,7 @@ jobs:
env:
test_id: systest-${{ steps.vars.outputs.sha_short }}
storage: premium-rwo=10Gi
node_selector: cloud.google.com/gke-nodepool=systemtest
node_selector: pipeline-id=${{ github.run_id }}
size: 20
bootstrap: 4m
level: ${{ inputs.log_level }}
Expand All @@ -152,23 +258,54 @@ jobs:
test_id: systest-${{ steps.vars.outputs.sha_short }}
run: make -C systest clean

delete-pool:
runs-on: ubuntu-22.04
if: always()
needs:
- filter-changes
- systest-gke
timeout-minutes: 20
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.GH_ACTION_PRIVATE_KEY }}

- name: Setup gcloud authentication
uses: google-github-actions/auth@v2
with:
project_id: ${{ secrets.GCP_WI_PROJECT_ID }}
workload_identity_provider: ${{ secrets.GCP_WI_PROVIDER_SA }}
service_account: ${{ secrets.GCP_WI_SA }}
token_format: access_token

- name: Configure gcloud
uses: google-github-actions/setup-gcloud@v2
with:
version: "469.0.0"

- name: Delete Node Pool
run: |
NODE_POOL_NAME="systemtest-${{ github.run_id }}"
gcloud container node-pools delete $NODE_POOL_NAME \
--cluster ${{ secrets.CI_CLUSTER_NAME }} \
--location ${{ secrets.CI_REGION_NAME }} \
--project ${{ secrets.CI_GCP_PROJECT_ID }} \
--quiet
echo "Node pool deleted: $NODE_POOL_NAME"
systest-status:
if: always()
needs:
- filter-changes
- systest
- systest-gke
runs-on: ubuntu-22.04
env:
# short-circuit success if no non-doc files were modified
status: ${{ (needs.filter-changes.outputs.nondocchanges == 'false' || needs.systest.result == 'success') && 'success' || 'failure' }}
status: ${{ (needs.filter-changes.outputs.nondocchanges == 'false' || needs.systest-gke.result == 'success') && 'success' || 'failure' }}
steps:
# print a single, clean status update to slack
- uses: act10ns/slack@v2
name: Slack notification
# skip if the secret is not accessible
if: env.SLACK_WEBHOOK_URL
with:
status: ${{ env.status }}
- name: Mark the job as succeeded
if: env.status == 'success'
run: exit 0
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ temp.js
/cover-all.out
/trace
cover.out
junit.xml
coverage.html
gcloud.json
spacemesh.json
Expand Down
Loading

0 comments on commit 76281db

Please sign in to comment.