added DownloadFileSize

pull/730/head
Jingyi 2024-04-29 11:53:07 +08:00
parent 529659175a
commit 6ffab1a001
44 changed files with 1085 additions and 4 deletions

View File

@ -15,6 +15,7 @@ download_file_seconds = os.getenv('DOWNLOAD_FILE_SECONDS')
decompress_seconds = os.getenv('DECOMPRESS_SECONDS')
instance_init_seconds = os.getenv('INSTANCE_INIT_SECONDS')
upload_endpoint_cache_seconds = os.getenv('UPLOAD_ENDPOINT_CACHE_SECONDS')
download_file_size = os.getenv('DOWNLOAD_FILE_SIZE')
if service_type == 'sd':
service_type = 'Stable-Diffusion'
@ -23,6 +24,28 @@ if service_type == 'comfy':
service_type = 'Comfy'
def record_size(metric_name, size: float):
response = cloudwatch.put_metric_data(
Namespace='ESD',
MetricData=[
{
'MetricName': metric_name,
'Dimensions': [
{
'Name': 'Service',
'Value': service_type
},
],
'Timestamp': datetime.datetime.utcnow(),
'Value': size,
'Unit': 'Megabytes'
},
]
)
logger.info(f"record_metric response: {response}")
def record_seconds(metric_name, seconds):
response = cloudwatch.put_metric_data(
Namespace='ESD',
@ -61,3 +84,7 @@ if __name__ == "__main__":
if upload_endpoint_cache_seconds is not None:
upload_endpoint_cache_seconds = int(upload_endpoint_cache_seconds)
record_seconds('UploadEndpointCacheSeconds', upload_endpoint_cache_seconds)
if download_file_size is not None:
download_file_size = float(download_file_size)
record_size('DownloadFileSize', download_file_size)

View File

@ -172,6 +172,8 @@ sd_launch_from_public_s3(){
export DOWNLOAD_FILE_SECONDS=$((end_at-start_at))
echo "download file: $DOWNLOAD_FILE_SECONDS seconds"
export DOWNLOAD_FILE_SIZE=$(du -sm /home/ubuntu/stable-diffusion-webui | awk '{print $1}' | grep -oE '[0-9]+')
start_at=$(date +%s)
tar --overwrite -xf "$SERVICE_TYPE.tar" -C /home/ubuntu/
rm -rf "$SERVICE_TYPE.tar"
@ -310,6 +312,8 @@ comfy_launch_from_public_s3(){
export DOWNLOAD_FILE_SECONDS=$((end_at-start_at))
echo "download file: $DOWNLOAD_FILE_SECONDS seconds"
export DOWNLOAD_FILE_SIZE=$(du -sm /home/ubuntu/ComfyUI | awk '{print $1}' | grep -oE '[0-9]+')
start_at=$(date +%s)
tar --overwrite -xf "$SERVICE_TYPE.tar" -C /home/ubuntu/
rm -rf "$SERVICE_TYPE.tar"

View File

@ -25,6 +25,31 @@ class TestTxt2ImgInferenceAsyncCn2E2E:
def teardown_class(cls):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_txt2img_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestTxt2ImgInferenceAsyncCn3E2E:
def teardown_class(cls):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_txt2img_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestTxt2ImgInferenceAsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_txt2img_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestTxt2ImgInferenceRealTimeE2E:
def teardown_class(cls):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_txt2img_real_time_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestTxt2ImgReactorAsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_txt2img_reactor_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestEsiInferenceAsyncE2E:
def teardown_class(cls):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_esi_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestEsiRealTimeE2E:
def teardown_class(cls):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_esi_real_time_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestImg2ImgInferenceAsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_img2img_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestImg2ImgInferenceRealTimeE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_img2img_real_time_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestRembgInferenceAsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_rembg_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -30,6 +30,31 @@ class TestSLaTxt2ImgAsync:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
@pytest.mark.skipif(config.test_fast, reason="test_fast")
def test_1_sla_txt2img(self):

View File

@ -30,6 +30,31 @@ class TestTurboE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_0_delete_checkpoints_turbo(self):
headers = {
"x-api-key": config.api_key,

View File

@ -40,7 +40,32 @@ class TestTpsRealTimeE2E:
def teardown_class(cls):
pass
def test_0_clear_inferences_jobs(self):
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_clear_inferences_jobs(self):
headers = {
"x-api-key": config.api_key,
"username": config.username
@ -56,7 +81,7 @@ class TestTpsRealTimeE2E:
}
self.api.delete_inferences(data=data, headers=headers)
def test_1_start_real_time_tps(self):
def test_2_start_real_time_tps(self):
ids = []
for i in range(20):

View File

@ -22,6 +22,31 @@ class TestRembgRealTimeE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_rembg_real_time_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -23,6 +23,31 @@ class TestInferenceOneApiAsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_one_api_async(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestInferenceOneApiRealTimeE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_one_api_real_time(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestInferenceOneApiLcm15AsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_one_api_lcm_15_async(self):
headers = {
"x-api-key": config.api_key,

View File

@ -21,6 +21,31 @@ class TestInferenceOneApiLcm15RealTimeE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_one_api_lcm_15_real_time(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestInferenceOneApiLcmXlAsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_one_api_lcm_xl_async(self):
headers = {
"x-api-key": config.api_key,

View File

@ -21,6 +21,31 @@ class TestInferenceOneApiLcmXLRealTimeE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_one_api_lcm_xl_real_time(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestTxt2ImgInferenceAsyncCn1E2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_txt2img_re_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestTxt2ImgInferenceAsyncCn2E2E:
def teardown_class(cls):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_txt2img_re_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestTxt2ImgInferenceAsyncCn3E2E:
def teardown_class(cls):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_txt2img_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestTxt2ImgReReactorAsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_txt2img_re_reactor_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestTxt2ImgInferenceAsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_txt2img_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestTxt2ImgInferenceRealTimeE2E:
def teardown_class(cls):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_txt2img_real_time_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -34,6 +34,31 @@ class TestXyzCheckpointE2E:
if 'id' in inference_data:
delete_inference_jobs([inference_data['id']])
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
@pytest.mark.skip(reason="not ready")
def test_1_xyz_checkpoint_txt2img_job_create(self):

View File

@ -34,6 +34,31 @@ class TestXyzRefinerCheckpointE2E:
if 'id' in inference_data:
delete_inference_jobs([inference_data['id']])
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
@pytest.mark.skip(reason="not ready")
def test_1_xyz_refiner_checkpoint_txt2img_job_create(self):

View File

@ -34,6 +34,31 @@ class TestXyzVaeE2E:
if 'id' in inference_data:
delete_inference_jobs([inference_data['id']])
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
@pytest.mark.skip(reason="not ready")
def test_1_xyz_vae_txt2img_job_create(self):

View File

@ -25,6 +25,31 @@ class TestEsiInferenceAsyncE2E:
def teardown_class(cls):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_esi_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -21,6 +21,31 @@ class TestInferenceOneApiLcmXLRealTimeE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_one_api_lcm_xl_real_time(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestEsiRealTimeE2E:
def teardown_class(cls):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_esi_real_time_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestImg2ImgInferenceAsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_img2img_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestImg2ImgInferenceRealTimeE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_img2img_real_time_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -25,6 +25,31 @@ class TestRembgInferenceAsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_rembg_async_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestRembgRealTimeE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_rembg_real_time_create(self):
headers = {
"x-api-key": config.api_key,

View File

@ -40,7 +40,32 @@ class TestTpsRealTimeE2E:
def teardown_class(cls):
pass
def test_0_clear_inferences_jobs(self):
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_clear_inferences_jobs(self):
headers = {
"x-api-key": config.api_key,
"username": config.username
@ -56,7 +81,7 @@ class TestTpsRealTimeE2E:
}
self.api.delete_inferences(data=data, headers=headers)
def test_1_start_real_time_tps(self):
def test_2_start_real_time_tps(self):
ids = []
for i in range(20):

View File

@ -23,6 +23,31 @@ class TestInferenceOneApiAsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_one_api_async(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestInferenceOneApiRealTimeE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_one_api_real_time(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestInferenceOneApiLcm15AsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_one_api_lcm_15_async(self):
headers = {
"x-api-key": config.api_key,

View File

@ -21,6 +21,31 @@ class TestInferenceOneApiLcm15RealTimeE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_one_api_lcm_15_real_time(self):
headers = {
"x-api-key": config.api_key,

View File

@ -22,6 +22,31 @@ class TestInferenceOneApiLcmXlAsyncE2E:
def teardown_class(self):
pass
def test_0_update_api_roles(self):
headers = {
"x-api-key": config.api_key,
"username": config.username,
}
data = {
"username": "api",
"password": "admin",
"creator": "api",
"roles": [
'IT Operator',
'byoc',
config.role_sd_real_time,
config.role_sd_async,
config.role_comfy_async,
config.role_comfy_real_time,
],
}
resp = self.api.create_user(headers=headers, data=data)
assert resp.status_code == 201, resp.dumps()
assert resp.json()["statusCode"] == 201
def test_1_one_api_lcm_xl_async(self):
headers = {
"x-api-key": config.api_key,