locust-cloud 1.26.4.dev9__tar.gz → 1.26.4.dev12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of locust-cloud might be problematic. Click here for more details.
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/PKG-INFO +1 -1
- locust_cloud-1.26.4.dev9/.github/workflows/daily-alb-teardown.yml +0 -59
- locust_cloud-1.26.4.dev9/alb-teardown.py +0 -119
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/.github/workflows/daily-check.yml +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/.github/workflows/tests.yml +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/.gitignore +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/.pre-commit-config.yaml +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/.vscode/extensions.json +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/.vscode/launch.json +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/.vscode/settings.json +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/LICENSE +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/README.md +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/__init__.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/apisession.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/args.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/common.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/docs/.gitignore +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/docs/1-first-run.rst +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/docs/2-examples.rst +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/docs/images/locust-cloud-screenshot.png +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/docs/locust-cloud.rst +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/import_finder.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/input_events.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/web_login.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locust_cloud/websocket.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/locustfile.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/pyproject.toml +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/testdata/autodetected.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/testdata/extra-files/extra.txt +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/testdata/extra-package/example/__init__.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/testdata/extra-package/setup.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/testdata/requirements.txt +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/tests/args_test.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/tests/browser_tests.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/tests/cloud_test.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/tests/import_finder_test.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/tests/web_login_test.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/tests/websocket_test.py +0 -0
- {locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/uv.lock +0 -0
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
name: Daily ALB Teardown
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
schedule:
|
|
5
|
-
- cron: "0 0 * * *"
|
|
6
|
-
workflow_dispatch:
|
|
7
|
-
|
|
8
|
-
permissions:
|
|
9
|
-
id-token: write
|
|
10
|
-
contents: read
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
teardown_eu:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
timeout-minutes: 5
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v4
|
|
18
|
-
- uses: actions/setup-python@v5
|
|
19
|
-
with:
|
|
20
|
-
python-version: "3.11"
|
|
21
|
-
|
|
22
|
-
- name: Install dependencies
|
|
23
|
-
run: pip install boto3 kubernetes
|
|
24
|
-
|
|
25
|
-
- name: Configure AWS Credentials using OIDC
|
|
26
|
-
uses: aws-actions/configure-aws-credentials@v4
|
|
27
|
-
with:
|
|
28
|
-
role-to-assume: arn:aws:iam::637423602143:role/GitHubActionsDeleteIngress
|
|
29
|
-
aws-region: eu-north-1
|
|
30
|
-
role-session-name: github-actions-teardown-alb
|
|
31
|
-
|
|
32
|
-
- name: Teardown ALB
|
|
33
|
-
run: python alb-teardown.py
|
|
34
|
-
env:
|
|
35
|
-
AWS_DEFAULT_REGION: eu-north-1
|
|
36
|
-
|
|
37
|
-
teardown_us:
|
|
38
|
-
runs-on: ubuntu-latest
|
|
39
|
-
timeout-minutes: 5
|
|
40
|
-
steps:
|
|
41
|
-
- uses: actions/checkout@v4
|
|
42
|
-
- uses: actions/setup-python@v5
|
|
43
|
-
with:
|
|
44
|
-
python-version: "3.11"
|
|
45
|
-
|
|
46
|
-
- name: Install dependencies
|
|
47
|
-
run: pip install boto3 kubernetes
|
|
48
|
-
|
|
49
|
-
- name: Configure AWS Credentials using OIDC
|
|
50
|
-
uses: aws-actions/configure-aws-credentials@v4
|
|
51
|
-
with:
|
|
52
|
-
role-to-assume: arn:aws:iam::637423602143:role/GitHubActionsDeleteIngress
|
|
53
|
-
aws-region: eu-north-1
|
|
54
|
-
role-session-name: github-actions-teardown-alb
|
|
55
|
-
|
|
56
|
-
- name: Teardown ALB
|
|
57
|
-
run: python alb-teardown.py
|
|
58
|
-
env:
|
|
59
|
-
AWS_DEFAULT_REGION: us-east-1
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# pyright: reportMissingModuleSource=false
|
|
2
|
-
# pyright: reportMissingImports=false
|
|
3
|
-
import base64
|
|
4
|
-
import re
|
|
5
|
-
import tempfile
|
|
6
|
-
from datetime import datetime, timezone
|
|
7
|
-
|
|
8
|
-
import boto3
|
|
9
|
-
from botocore.signers import RequestSigner
|
|
10
|
-
from kubernetes import client
|
|
11
|
-
|
|
12
|
-
STS_TOKEN_EXPIRES_IN = 60
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def create_cafile(data: str) -> str:
|
|
16
|
-
with tempfile.NamedTemporaryFile(delete=False) as cafile:
|
|
17
|
-
cadata = base64.b64decode(data)
|
|
18
|
-
cafile.write(cadata)
|
|
19
|
-
return cafile.name
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def get_bearer_token(session: boto3.session.Session, cluster_name: str) -> str:
|
|
23
|
-
client = session.client("sts")
|
|
24
|
-
region_name = session.region_name
|
|
25
|
-
service_id = client.meta.service_model.service_id
|
|
26
|
-
credentials = session.get_credentials()
|
|
27
|
-
assert credentials
|
|
28
|
-
signer = RequestSigner(service_id, region_name, "sts", "v4", credentials, session.events)
|
|
29
|
-
|
|
30
|
-
headers = {"x-k8s-aws-id": cluster_name}
|
|
31
|
-
|
|
32
|
-
params = {
|
|
33
|
-
"method": "GET",
|
|
34
|
-
"url": f"https://sts.{region_name}.amazonaws.com/?Action=GetCallerIdentity&Version=2011-06-15",
|
|
35
|
-
"body": {},
|
|
36
|
-
"headers": headers,
|
|
37
|
-
"context": {},
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
signed_url = signer.generate_presigned_url(
|
|
41
|
-
params,
|
|
42
|
-
region_name=region_name,
|
|
43
|
-
expires_in=STS_TOKEN_EXPIRES_IN,
|
|
44
|
-
operation_name="",
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
base64_url = base64.urlsafe_b64encode(signed_url.encode("utf-8")).decode("utf-8")
|
|
48
|
-
|
|
49
|
-
# remove any base64 encoding padding:
|
|
50
|
-
return "k8s-aws-v1." + re.sub(r"=*", "", base64_url)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
def get_kubernetes_client() -> client.ApiClient:
|
|
54
|
-
cluster_name = "locust-auto"
|
|
55
|
-
session = boto3.session.Session()
|
|
56
|
-
bearer = get_bearer_token(session, cluster_name)
|
|
57
|
-
eks_client = session.client("eks")
|
|
58
|
-
response = eks_client.describe_cluster(name=cluster_name)
|
|
59
|
-
cluster = response["cluster"]
|
|
60
|
-
cert_filename = create_cafile(cluster["certificateAuthority"]["data"])
|
|
61
|
-
|
|
62
|
-
configuration = client.Configuration()
|
|
63
|
-
configuration.host = cluster["endpoint"]
|
|
64
|
-
configuration.verify_ssl = True
|
|
65
|
-
configuration.ssl_ca_cert = cert_filename
|
|
66
|
-
configuration.api_key["authorization"] = bearer
|
|
67
|
-
configuration.api_key_prefix["authorization"] = "Bearer"
|
|
68
|
-
|
|
69
|
-
return client.ApiClient(configuration)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
EXCLUDE_NAMESPACES = {
|
|
73
|
-
"kube-system",
|
|
74
|
-
"kube-public",
|
|
75
|
-
"voyado",
|
|
76
|
-
"amazon-cloudwatch",
|
|
77
|
-
"amadeu",
|
|
78
|
-
"default",
|
|
79
|
-
"dev",
|
|
80
|
-
"kube-node-lease",
|
|
81
|
-
"aws-observability",
|
|
82
|
-
"zefr",
|
|
83
|
-
"dmdb",
|
|
84
|
-
"wolters-kluwer",
|
|
85
|
-
"codepath",
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
kubernetes_client = get_kubernetes_client()
|
|
89
|
-
|
|
90
|
-
core_api = client.CoreV1Api(api_client=kubernetes_client)
|
|
91
|
-
networking_api = client.NetworkingV1Api(api_client=kubernetes_client)
|
|
92
|
-
|
|
93
|
-
# Get all namespaces
|
|
94
|
-
namespaces = core_api.list_namespace().items
|
|
95
|
-
current_time = datetime.now(timezone.utc)
|
|
96
|
-
|
|
97
|
-
for ns in namespaces:
|
|
98
|
-
namespace = ns.metadata.name
|
|
99
|
-
if namespace in EXCLUDE_NAMESPACES:
|
|
100
|
-
print(f"Skipping namespace: {namespace}")
|
|
101
|
-
continue
|
|
102
|
-
|
|
103
|
-
print(f"Checking namespace: {namespace}")
|
|
104
|
-
try:
|
|
105
|
-
ingress = networking_api.read_namespaced_ingress(name="locust-master-ingress", namespace=namespace)
|
|
106
|
-
creation_time = ingress.metadata.creation_timestamp
|
|
107
|
-
age_seconds = int((current_time - creation_time).total_seconds())
|
|
108
|
-
|
|
109
|
-
if age_seconds > 3600:
|
|
110
|
-
print(f"Deleting Ingress in namespace: {namespace} (age: {age_seconds} seconds)")
|
|
111
|
-
networking_api.delete_namespaced_ingress(name="locust-master-ingress", namespace=namespace)
|
|
112
|
-
else:
|
|
113
|
-
print(f"Skipping Ingress in {namespace} (created within the last hour)")
|
|
114
|
-
|
|
115
|
-
except client.exceptions.ApiException as e:
|
|
116
|
-
if e.status == 404:
|
|
117
|
-
print(f"Ingress not found in {namespace}")
|
|
118
|
-
else:
|
|
119
|
-
print(e)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{locust_cloud-1.26.4.dev9 → locust_cloud-1.26.4.dev12}/testdata/extra-package/example/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|