-
Notifications
You must be signed in to change notification settings - Fork 23
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 users/debnatkh/issue-539-service
- Loading branch information
Showing
631 changed files
with
26,436 additions
and
3,635 deletions.
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
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 |
---|---|---|
@@ -1,23 +1,3 @@ | ||
cloud/blockstore/tests/fio/qemu-vhost-local-test * | ||
cloud/blockstore/tests/fio/qemu-vhost-null-test * | ||
cloud/blockstore/tests/rdma/rdma-test * | ||
cloud/blockstore/tests/resize-disk * | ||
cloud/disk_manager/internal/pkg/dataplane/snapshot/storage/tests tests.TestShallowCopySnapshotWithRandomFailure | ||
cloud/disk_manager/internal/pkg/dataplane/snapshot/storage/tests tests.TestShallowCopySnapshotWithRandomFailure/store_chunks_in_s3 | ||
cloud/disk_manager/internal/pkg/dataplane/snapshot/storage/tests tests.TestShallowCopySnapshotWithRandomFailure/store_chunks_in_ydb | ||
cloud/filestore/tests/fio_index_migration/qemu-intrahost-migration-kikimr-nemesis-test * | ||
cloud/filestore/tests/fio_index_migration/qemu-intrahost-migration-kikimr-test * | ||
cloud/filestore/tests/fio_index_migration/qemu-intrahost-migration-local-test * | ||
cloud/filestore/tests/fio_index/qemu-kikimr-nemesis-test * | ||
cloud/filestore/tests/fio_index/qemu-kikimr-test * | ||
cloud/filestore/tests/fio_index/qemu-local-test * | ||
cloud/filestore/tests/fio_migration/qemu-intrahost-migration-kikimr-nemesis-test * | ||
cloud/filestore/tests/fio_migration/qemu-intrahost-migration-kikimr-test * | ||
cloud/filestore/tests/fio_migration/qemu-intrahost-migration-local-test * | ||
cloud/filestore/tests/fio/qemu-kikimr-nemesis-test * | ||
cloud/filestore/tests/fio/qemu-kikimr-test * | ||
cloud/filestore/tests/fio/qemu-local-test * | ||
cloud/filestore/tests/fs_posix_compliance/qemu-kikimr-nemesis-test * | ||
cloud/filestore/tests/fs_posix_compliance/qemu-kikimr-test * | ||
cloud/filestore/tests/profile_log/qemu-kikimr-test * | ||
cloud/filestore/tests/profile_log/qemu-local-test * | ||
cloud/disk_manager/internal/pkg/dataplane/snapshot/storage/tests tests.TestShallowCopySnapshotWithRandomFailure/store_chunks_in_ydb |
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,123 @@ | ||
import os | ||
import grpc | ||
import json | ||
import logging | ||
import argparse | ||
from github import Github, Auth as GithubAuth | ||
from datetime import datetime, timedelta, timezone | ||
from yandexcloud import SDK, RetryInterceptor | ||
from yandex.cloud.compute.v1.instance_service_pb2_grpc import InstanceServiceStub | ||
from yandex.cloud.compute.v1.instance_service_pb2 import ( | ||
ListInstancesRequest, | ||
DeleteInstanceRequest, | ||
) | ||
|
||
logging.basicConfig( | ||
level=logging.INFO, format="%(asctime)s: %(levelname)s: %(message)s" | ||
) | ||
|
||
CACHE_VM_ID = "dp7329odurnhplpf5ff0" | ||
|
||
|
||
def find_workflows_containing_string( | ||
client, specified_time, search_string, owner="ydb-platform", repo="nbs" | ||
): | ||
repo = client.get_repo(f"{owner}/{repo}") | ||
|
||
# Calculate start time for search (-10 minutes) | ||
start_time = specified_time - timedelta(minutes=10) | ||
end_time = specified_time + timedelta(minutes=10) | ||
|
||
# Initialize list to keep track of matching runs | ||
matching_runs_info = [] | ||
|
||
for run in repo.get_workflow_runs(): | ||
# Check if the run started within our time window | ||
run_started_at = run.created_at | ||
if start_time <= run_started_at <= end_time: | ||
print("Workflow", run.name, run.created_at, run.html_url) | ||
# Get jobs or the current workflow run | ||
for job in run.jobs(): | ||
|
||
if "Start self-hosted runner" in job.name: | ||
print("Job", job.name) | ||
# Attempt to get logs (note: this might require additional handling for large logs) | ||
try: | ||
logs = job.get_log() | ||
if search_string in logs: | ||
matching_runs_info.append( | ||
{ | ||
"run_id": run.id, | ||
"run_url": run.html_url, # Link to the workflow run | ||
"job_name": job.name, | ||
} | ||
) | ||
except Exception as e: | ||
print( | ||
f"Error fetching logs for job {job.name} in run {run.id}: {e}" | ||
) | ||
|
||
return matching_runs_info | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"--service-account-key", | ||
required=True, | ||
help="Path to the service account key file", | ||
) | ||
parser.add_argument( | ||
"--folder-id", | ||
required=True, | ||
help="The ID of the folder to list instances in", | ||
default="bjeuq5o166dq4ukv3eec", | ||
) | ||
parser.add_argument( | ||
"--ttl", required=True, help="The TTL for the VMs", default=24, type=int | ||
) | ||
parser.add_argument("--apply", action="store_true", help="Apply the changes") | ||
|
||
args = parser.parse_args() | ||
|
||
threshold = datetime.now() - timedelta(hours=args.ttl) | ||
|
||
interceptor = RetryInterceptor( | ||
max_retry_count=5, retriable_codes=[grpc.StatusCode.UNAVAILABLE] | ||
) | ||
|
||
with open(args.service_account_key, "r") as fp: | ||
sdk = SDK( | ||
service_account_key=json.load(fp), | ||
endpoint="api.ai.nebius.cloud", | ||
interceptor=interceptor, | ||
) | ||
|
||
gh = Github(auth=GithubAuth.Token(os.environ["GITHUB_TOKEN"])) | ||
|
||
client = sdk.client(InstanceServiceStub) | ||
response = client.List(ListInstancesRequest(folder_id=args.folder_id)) | ||
|
||
for vm in response.instances: | ||
if vm.id == CACHE_VM_ID: | ||
logging.info(f"Skipping VM {vm.id} as it is a cache VM") | ||
continue | ||
|
||
creation_time = vm.created_at.ToDatetime() | ||
if creation_time < threshold: | ||
logging.info( | ||
f"VM {vm.id} is older than 24 hours, deleting it, created at {creation_time}" | ||
) | ||
|
||
if args.apply: | ||
client.Delete(DeleteInstanceRequest(instance_id=vm.id)) | ||
else: | ||
runs = find_workflows_containing_string( | ||
gh, creation_time.replace(tzinfo=timezone.utc), vm.id | ||
) | ||
print("Runs that match this id", runs) | ||
|
||
else: | ||
logging.info( | ||
f"VM {vm.id} is younger than 24 hours, keeping it, created at {creation_time}" | ||
) |
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 |
---|---|---|
|
@@ -103,14 +103,16 @@ on: | |
jobs: | ||
provide-runner: | ||
name: Start self-hosted runner | ||
timeout-minutes: 5 | ||
timeout-minutes: 60 | ||
if: always() | ||
runs-on: ubuntu-latest | ||
outputs: | ||
label: ${{ steps.start-yc-runner.outputs.label }} | ||
instance-id: ${{ steps.start-yc-runner.outputs.instance-id }} | ||
steps: | ||
- name: Start YC runner | ||
id: start-yc-runner | ||
if: always() | ||
uses: librarian/[email protected] | ||
timeout-minutes: 60 | ||
with: | ||
|
@@ -143,6 +145,7 @@ jobs: | |
with: | ||
submodules: true | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: ${{ contains(github.event.pull_request.labels.*.name, 'rebase') && 0 || 1 }} | ||
- name: Rebase PR | ||
if: ${{ github.event.pull_request.head.sha != '' && contains(github.event.pull_request.labels.*.name, 'rebase') }} | ||
shell: bash | ||
|
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 |
---|---|---|
|
@@ -43,14 +43,16 @@ on: | |
jobs: | ||
provide-runner: | ||
name: Start self-hosted runner | ||
timeout-minutes: 5 | ||
timeout-minutes: 60 | ||
if: always() | ||
runs-on: ubuntu-latest | ||
outputs: | ||
label: ${{ steps.start-yc-runner.outputs.label }} | ||
instance-id: ${{ steps.start-yc-runner.outputs.instance-id }} | ||
steps: | ||
- name: Start YC runner | ||
id: start-yc-runner | ||
if: always() | ||
uses: librarian/[email protected] | ||
timeout-minutes: 60 | ||
with: | ||
|
@@ -83,6 +85,7 @@ jobs: | |
with: | ||
submodules: true | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: ${{ contains(github.event.pull_request.labels.*.name, 'rebase') && 0 || 1 }} | ||
- name: Rebase PR | ||
if: ${{ github.event.pull_request.head.sha != '' && contains(github.event.pull_request.labels.*.name, 'rebase') }} | ||
shell: bash | ||
|
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,17 @@ | ||
name: Nightly build (asan) | ||
on: | ||
schedule: | ||
- cron: "0 1 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build/test x86_64 using YA (asan) | ||
uses: ./.github/workflows/build_and_test_on_demand.yaml | ||
secrets: inherit | ||
with: | ||
build_preset: release-asan | ||
test_type: "unittest,clang_tidy,gtest,py3test,py2test,pytest,flake8,black,py2_flake8,gofmt" | ||
cache_update_build: true | ||
cache_update_tests: false | ||
test_threads: 6 |
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,17 @@ | ||
name: Nightly build (tsan) | ||
on: | ||
schedule: | ||
- cron: "0 1 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build/test x86_64 using YA (tsan) | ||
uses: ./.github/workflows/build_and_test_on_demand.yaml | ||
secrets: inherit | ||
with: | ||
build_preset: release-tsan | ||
test_type: "unittest,clang_tidy,gtest,py3test,py2test,pytest,flake8,black,py2_flake8,gofmt" | ||
cache_update_build: true | ||
cache_update_tests: false | ||
test_threads: 6 |
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ on: | |
- '.github/**' | ||
- 'example/**' | ||
- 'doc/**' | ||
- '**.md' | ||
types: | ||
- 'opened' | ||
- 'synchronize' | ||
|
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.