-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8,428 changed files
with
1,191 additions
and
359,582 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
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,20 @@ | ||
name: Set sleep_after_tests variable | ||
description: Set up sleep after tests variable | ||
inputs: | ||
sleep_after_tests: | ||
required: false | ||
default: '7200' | ||
description: default sleep_after_tests value | ||
outputs: | ||
sleep_after_tests: | ||
value: ${{ steps.result.outputs.sleep_after_tests }} | ||
description: "sleep_after_tests" | ||
runs: | ||
using: composite | ||
steps: | ||
- id: result | ||
name: set sleep_after_tests | ||
shell: bash | ||
run: | | ||
echo "sleep_after_tests=${{inputs.sleep_after_tests}}" >> $GITHUB_OUTPUT | ||
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,73 @@ | ||
name: Add members ssh keys for VM | ||
description: Add team members public ssh keys to github@ user | ||
inputs: | ||
org: | ||
required: true | ||
description: "org name" | ||
team: | ||
required: true | ||
description: "team slug name" | ||
token: | ||
required: true | ||
description: "GITHUB_TOKEN" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: init | ||
shell: bash | ||
run: | | ||
echo "LOGINS_FILE=$(mktemp)" >> $GITHUB_ENV | ||
echo "KEYS_FILE=$(mktemp)" >> $GITHUB_ENV | ||
- name: collect members | ||
shell: bash | ||
if: ${{ github.repository == 'ydb-platform/nbs'}} | ||
run: | | ||
echo "https://api.github.com/orgs/${org}/teams/${team}/members?per_page=100&page=1" | ||
curl -s -L -H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $token" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"https://api.github.com/orgs/${org}/teams/${team}/members?per_page=100&page=1" | ||
curl -s -L -H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $token" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"https://api.github.com/orgs/${org}/teams/${team}/members?per_page=100&page=1" | jq -r .[].login | tee -a $LOGINS_FILE | ||
env: | ||
org: ${{ inputs.org }} | ||
team: ${{ inputs.team }} | ||
token: ${{ inputs.token }} | ||
- name: collect members | ||
shell: bash | ||
if: ${{ github.repository != 'ydb-platform/nbs' }} | ||
run: | | ||
echo "https://api.github.com/orgs/${org}/members?per_page=100&page=1" | ||
curl -s -L -H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $token" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"https://api.github.com/orgs/${org}/members?per_page=100&page=1" | ||
curl -s -L -H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $token" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"https://api.github.com/orgs/${org}/members?per_page=100&page=1" | jq -r .[].login | tee -a $LOGINS_FILE | ||
env: | ||
org: ${{ inputs.org }} | ||
team: ${{ inputs.team }} | ||
token: ${{ inputs.token }} | ||
- name: collect members public ssh keys | ||
shell: bash | ||
run: | | ||
cat $LOGINS_FILE | while read login; do | ||
curl -s -L -H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $token" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/users/${login}/keys | jq -r .[].key | while read key; do | ||
echo $key $login; | ||
done; | ||
done | tee -a $KEYS_FILE | ||
env: | ||
token: ${{ inputs.token }} | ||
- name: add ssh keys to user authorized_keys file | ||
shell: bash | ||
run: | | ||
cat $KEYS_FILE >> /home/github/.ssh/authorized_keys | ||
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
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
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 |
---|---|---|
|
@@ -91,6 +91,7 @@ on: | |
default: false | ||
description: "Update build cache in test stage" | ||
|
||
|
||
jobs: | ||
provide-runner: | ||
name: Start self-hosted runner | ||
|
@@ -103,6 +104,7 @@ jobs: | |
- name: Start YC runner | ||
id: start-yc-runner | ||
uses: librarian/[email protected] | ||
timeout-minutes: 60 | ||
with: | ||
mode: start | ||
yc-sa-json-credentials: ${{ secrets.NEBIUS_SA_JSON_CREDENTIALS }} | ||
|
@@ -123,9 +125,11 @@ jobs: | |
ssh-public-key: ${{ secrets.RUNNER_PUBLIC_KEY }} | ||
|
||
prepare-vm: | ||
name: Prepare runner | ||
name: Prepare runner [id=${{ needs.provide-runner.outputs.instance-id }}] | ||
needs: provide-runner | ||
runs-on: [ self-hosted, "${{ needs.provide-runner.outputs.label }}" ] | ||
outputs: | ||
runner_ipv4: ${{ steps.configure-ncp.outputs.runner_ipv4 }} | ||
steps: | ||
- name: Checkout PR | ||
uses: actions/checkout@v3 | ||
|
@@ -135,47 +139,62 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v3 | ||
if: github.event.pull_request.head.sha == '' | ||
- name: Configure NCP | ||
- id: configure-ncp | ||
name: Configure NCP | ||
uses: ./.github/actions/ncp | ||
with: | ||
instance_id: ${{ needs.provide-runner.outputs.instance-id }} | ||
sa_json: ${{ secrets.NEBIUS_GITHUB_USER_SA_JSON}} | ||
- id: configure-authorized-keys | ||
name: Configure authorized_keys | ||
uses: ./.github/actions/ssh_keys | ||
with: | ||
org: ydb-platform | ||
team: nbs | ||
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
- name: Prepare VM | ||
uses: ./.github/actions/prepare | ||
|
||
build-and-test: | ||
name: Build and test NBS | ||
name: Build and test NBS [id=${{ needs.provide-runner.outputs.instance-id }} ip=${{ needs.prepare-vm.outputs.runner_ipv4 }}] | ||
uses: ./.github/workflows/build_and_test_ya.yaml | ||
needs: | ||
- provide-runner | ||
- prepare-vm | ||
with: | ||
runner_kind: self-hosted | ||
runner_label: ${{ needs.provide-runner.outputs.label }} | ||
runner_instance_id: ${{ needs.provide-runner.outputs.instance-id }} | ||
runner_ipv4: ${{ needs.prepare-vm.outputs.runner_ipv4 }} | ||
build_target: ${{ inputs.build_target }} | ||
test_target: ${{ inputs.test_target }} | ||
build_preset: ${{ inputs.build_preset }} | ||
run_build: ${{ inputs.run_build }} | ||
run_tests: ${{ inputs.run_tests }} | ||
test_size: ${{ inputs.test_size }} | ||
test_type: ${{ inputs.test_type }} | ||
sleep_after_tests: ${{ inputs.sleep_after_tests }} | ||
link_threads: 32 | ||
test_threads: 64 | ||
link_threads: 24 | ||
test_threads: 24 | ||
cache_update_build: ${{ fromJson(github.event_name == 'workflow_dispatch' && format('{0}', inputs.cache_update) || format('{0}', inputs.cache_update_build)) }} | ||
cache_update_tests: ${{ fromJson(github.event_name == 'workflow_dispatch' && format('{0}', inputs.cache_update) || format('{0}', inputs.cache_update_tests)) }} | ||
secrets: inherit | ||
|
||
release-runner: | ||
name: Release self-hosted runner | ||
name: Release self-hosted runner ${{ needs.provide-runner.outputs.instance-id }} | ||
needs: | ||
- provide-runner # required to get output from the start-runner job | ||
- build-and-test # required to wait when the main job is done | ||
runs-on: ubuntu-latest | ||
if: always() | ||
steps: | ||
- name: Sleep ${{ needs.build-and-test.outputs.sleep_after_tests }}s if build failed | ||
shell: bash | ||
if: ${{ needs.build-and-test.outputs.sleep_after_tests && needs.build-and-test.outputs.sleep_after_tests != '0' }} | ||
run: sleep ${{ needs.build-and-test.outputs.sleep_after_tests }} | ||
|
||
- name: Stop YC runner | ||
uses: librarian/[email protected] | ||
timeout-minutes: 60 | ||
with: | ||
mode: stop | ||
yc-sa-json-credentials: ${{ secrets.NEBIUS_SA_JSON_CREDENTIALS }} | ||
|
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 |
---|---|---|
|
@@ -20,6 +20,10 @@ on: | |
type: boolean | ||
default: true | ||
description: "run tests" | ||
sleep_after_tests: | ||
type: string | ||
default: "0" | ||
description: "Amount of seconds to sleep after tests" | ||
workflow_call: | ||
inputs: | ||
build_preset: | ||
|
@@ -31,6 +35,10 @@ on: | |
run_tests: | ||
type: boolean | ||
default: true | ||
sleep_after_tests: | ||
type: string | ||
default: "0" | ||
description: "Amount of seconds to sleep after tests" | ||
|
||
jobs: | ||
provide-runner: | ||
|
@@ -44,6 +52,7 @@ jobs: | |
- name: Start YC runner | ||
id: start-yc-runner | ||
uses: librarian/[email protected] | ||
timeout-minutes: 60 | ||
with: | ||
mode: start | ||
yc-sa-json-credentials: ${{ secrets.NEBIUS_SA_JSON_CREDENTIALS }} | ||
|
@@ -67,6 +76,8 @@ jobs: | |
name: Prepare runner | ||
needs: provide-runner | ||
runs-on: [ self-hosted, "${{ needs.provide-runner.outputs.label }}" ] | ||
outputs: | ||
runner_ipv4: ${{ steps.configure-ncp.outputs.runner_ipv4 }} | ||
steps: | ||
- name: Checkout PR | ||
uses: actions/checkout@v3 | ||
|
@@ -76,26 +87,37 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v3 | ||
if: github.event.pull_request.head.sha == '' | ||
- name: Configure NCP | ||
- id: configure-ncp | ||
name: Configure NCP | ||
uses: ./.github/actions/ncp | ||
with: | ||
instance_id: ${{ needs.provide-runner.outputs.instance-id }} | ||
sa_json: ${{ secrets.NEBIUS_GITHUB_USER_SA_JSON}} | ||
- id: configure-authorized-keys | ||
name: Configure authorized_keys | ||
uses: ./.github/actions/ssh_keys | ||
with: | ||
org: ydb-platform | ||
team: nbs | ||
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
- name: Prepare VM | ||
uses: ./.github/actions/prepare | ||
|
||
build-and-test: | ||
name: Build and test NBS | ||
name: Build and test NBS [id=${{ needs.provide-runner.outputs.instance-id }} ip=${{ needs.prepare-vm.outputs.runner_ipv4 }}] | ||
uses: ./.github/workflows/build_and_test_cmake.yaml | ||
needs: | ||
- provide-runner | ||
- prepare-vm | ||
with: | ||
runner_kind: self-hosted | ||
runner_label: ${{ needs.provide-runner.outputs.label }} | ||
runner_instance_id: ${{ needs.provide-runner.outputs.instance-id }} | ||
runner_ipv4: ${{ needs.prepare-vm.outputs.runner_ipv4 }} | ||
build_preset: ${{ inputs.build_preset }} | ||
run_build: ${{ inputs.run_build }} | ||
run_tests: ${{ inputs.run_tests }} | ||
sleep_after_tests: ${{ inputs.sleep_after_tests }} | ||
secrets: inherit | ||
|
||
release-runner: | ||
|
@@ -106,8 +128,14 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: always() | ||
steps: | ||
- name: Sleep ${{ needs.build-and-test.outputs.sleep_after_tests || '0' }}s if build failed | ||
shell: bash | ||
if: ${{ needs.build-and-test.outputs.sleep_after_tests && needs.build-and-test.outputs.sleep_after_tests != '0' }} | ||
run: sleep ${{ needs.build-and-test.outputs.sleep_after_tests }} | ||
|
||
- name: Stop YC runner | ||
uses: librarian/[email protected] | ||
timeout-minutes: 60 | ||
with: | ||
mode: stop | ||
yc-sa-json-credentials: ${{ secrets.NEBIUS_SA_JSON_CREDENTIALS }} | ||
|
Oops, something went wrong.