Skip to content

Commit 6ee6975

Browse files
authored
Merge pull request #432 from frappe/mergify/bp/master/pr-343
fix: Jan fixes 2 (backport #343)
2 parents 92a866c + e38a364 commit 6ee6975

File tree

6 files changed

+543
-6
lines changed

6 files changed

+543
-6
lines changed

agent/bench.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -849,10 +849,10 @@ def force_update_limits(self, memory_high, memory_max, memory_swap, vcpu):
849849
self._update_runtime_limits(memory_high, memory_max, memory_swap, vcpu)
850850
self._start()
851851

852-
def update_runtime_limits(self):
853-
memory_high = self.bench_config.get("memory_high")
854-
memory_max = self.bench_config.get("memory_max")
855-
memory_swap = self.bench_config.get("memory_swap")
852+
def update_runtime_limits(self, multiplier=1.0):
853+
memory_high = self.bench_config.get("memory_high", 0) * multiplier
854+
memory_max = self.bench_config.get("memory_max", 0) * multiplier
855+
memory_swap = self.bench_config.get("memory_swap", 0) * multiplier
856856
vcpu = self.bench_config.get("vcpu")
857857
if not any([memory_high, memory_max, memory_swap, vcpu]):
858858
return

agent/pages/bad_gateway.html

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Bad Gateway</title>
6+
<style>
7+
html {
8+
-webkit-font-smoothing: antialiased;
9+
-moz-osx-font-smoothing: grayscale;
10+
}
11+
body {
12+
font-family:
13+
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
14+
Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
15+
color: #1a4469;
16+
background-color: #f9fafa;
17+
}
18+
19+
.container {
20+
padding-top: 4rem;
21+
max-width: 768px;
22+
margin: 0 auto;
23+
}
24+
25+
.logo {
26+
text-align: center;
27+
display: flex;
28+
justify-content: center;
29+
align-items: center;
30+
}
31+
32+
.logo svg {
33+
height: 2rem;
34+
}
35+
36+
.logo h1 {
37+
font-size: 18px;
38+
font-weight: 600;
39+
color: #171717;
40+
}
41+
42+
.message-container {
43+
width: 24rem;
44+
margin: 0 auto;
45+
background-color: white;
46+
padding: 2.5rem;
47+
margin-top: 1.5rem;
48+
-webkit-box-shadow:
49+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
50+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
51+
box-shadow:
52+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
53+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
54+
font-size: 13px;
55+
text-align: center;
56+
border-radius: 0.375rem;
57+
}
58+
59+
.alert-icon svg {
60+
height: 2rem;
61+
width: 2rem;
62+
}
63+
64+
h1 {
65+
font-size: 16px;
66+
font-weight: 500;
67+
}
68+
69+
p {
70+
color: #4c5a67;
71+
line-height: 1.5;
72+
}
73+
74+
a {
75+
color: #1579d0;
76+
text-decoration: none;
77+
border-bottom: 1px solid #1579d0;
78+
}
79+
</style>
80+
</head>
81+
82+
<body>
83+
<div class="container">
84+
<div class="logo">
85+
<svg
86+
width="40"
87+
height="100"
88+
viewBox="0 0 160 120"
89+
fill="none"
90+
xmlns="http://www.w3.org/2000/svg"
91+
>
92+
<path
93+
d="M93.4626 0H23.5665C10.5511 0 0 10.5511 0 23.5665V93.4626C0 106.478 10.5511 117.029 23.5665 117.029H93.4626C106.478 117.029 117.029 106.478 117.029 93.4626V23.5665C117.029 10.5511 106.478 0 93.4626 0Z"
94+
fill="url(#paint0_radial_0_9)"
95+
/>
96+
<path
97+
d="M94.4529 48.9854C89.7801 42.265 81.9046 38.3798 73.7142 38.9048C70.1965 32.552 63.6861 28.3517 56.0732 27.8792C50.7704 27.5642 45.4151 29.4018 41.2674 32.972C38.4322 35.4396 36.3846 38.2748 35.1245 41.4775C34.3895 43.3676 32.7094 44.5751 30.9243 44.5751H18.3761V55.0757H30.9243C37.0671 55.0757 42.5799 51.243 44.8901 45.3102C45.5201 43.6826 46.5702 42.265 48.1453 40.8999C50.1929 39.1148 52.8705 38.1698 55.3907 38.3273C59.1709 38.5898 61.8485 40.3224 63.5286 42.475C65.3137 44.4701 66.3113 47.5678 66.8888 50.6655C70.249 49.7204 73.9242 48.9329 77.4419 49.5104C80.3296 49.9829 83.0072 51.5055 84.9498 53.7631C85.2648 54.1307 85.5798 54.4982 85.8424 54.9182C88.3625 58.5409 88.835 63.0037 87.1549 67.4139C85.6324 71.5091 80.0145 75.2369 75.3418 75.2369H38.7997C33.8119 75.2369 29.7167 71.5091 29.0867 66.7314H18.5861C19.2686 77.337 28.0366 85.7374 38.7997 85.7374H75.3943C84.4248 85.7374 93.9278 79.3321 97.0255 71.1416C99.9132 63.4762 98.9681 55.3907 94.5054 48.9329L94.4529 48.9854Z"
98+
fill="#FFFAE9"
99+
/>
100+
<defs>
101+
<radialGradient
102+
id="paint0_radial_0_9"
103+
cx="0"
104+
cy="0"
105+
r="1"
106+
gradientUnits="userSpaceOnUse"
107+
gradientTransform="translate(-28.5 -58) rotate(54.335) scale(209.246)"
108+
>
109+
<stop stop-color="#40D1FF" />
110+
<stop offset="1" stop-color="#0097FF" />
111+
</radialGradient>
112+
</defs>
113+
</svg>
114+
<div class="logo-text">
115+
<h1>Frappe Cloud</h1>
116+
</div>
117+
</div>
118+
<div class="message-container">
119+
<div class="alert-icon">
120+
<!-- Red filled circle with white exclamation mark (scaled down via CSS) -->
121+
<svg
122+
xmlns="http://www.w3.org/2000/svg"
123+
viewBox="0 0 24 24"
124+
fill="none"
125+
stroke-width="2"
126+
stroke-linecap="round"
127+
stroke-linejoin="round"
128+
>
129+
<circle cx="12" cy="12" r="10" fill="#EF4444" stroke="#EF4444" />
130+
<line x1="12" x2="12" y1="8" y2="12" stroke="white" />
131+
<line x1="12" x2="12.01" y1="16" y2="16" stroke="white" />
132+
</svg>
133+
</div>
134+
<h1>Bad Gateway</h1>
135+
<p class="message">
136+
Your bench appears to be down.
137+
<a
138+
href="https://docs.frappe.io/cloud/performance-error-debugging#502-bad-gateway"
139+
style="
140+
display: inline-block;
141+
margin-top: 10px;
142+
padding: 8px 16px;
143+
background: #f5f5f5;
144+
border-radius: 4px;
145+
color: #333;
146+
text-decoration: none;
147+
font-weight: bold;
148+
border: 1px solid #e0e0e0;
149+
"
150+
>
151+
📄 Follow the step-by-step guide to debug this issue
152+
</a>
153+
</p>
154+
<p>
155+
If you are the owner of this site, please check the error logs on your
156+
site's
157+
<a class="dashboard-url" href="https://frappecloud.com/dashboard"
158+
><strong>dashboard</strong></a
159+
>.
160+
</p>
161+
</div>
162+
</div>
163+
</body>
164+
165+
<script>
166+
const dashboardUrl = document.querySelector(".dashboard-url");
167+
const siteName = window.location.hostname;
168+
dashboardUrl.href = `https://frappecloud.com/dashboard/sites/${siteName}`;
169+
</script>
170+
</html>

agent/pages/gateway_timeout.html

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Gateway Timeout</title>
6+
<style>
7+
html {
8+
-webkit-font-smoothing: antialiased;
9+
-moz-osx-font-smoothing: grayscale;
10+
}
11+
body {
12+
font-family:
13+
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
14+
Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
15+
color: #1a4469;
16+
background-color: #f9fafa;
17+
}
18+
19+
.container {
20+
padding-top: 4rem;
21+
max-width: 768px;
22+
margin: 0 auto;
23+
}
24+
25+
.logo {
26+
text-align: center;
27+
display: flex;
28+
justify-content: center;
29+
align-items: center;
30+
}
31+
32+
.logo svg {
33+
height: 2rem;
34+
}
35+
36+
.logo h1 {
37+
font-size: 18px;
38+
font-weight: 600;
39+
color: #171717;
40+
}
41+
42+
.message-container {
43+
width: 24rem;
44+
margin: 0 auto;
45+
background-color: white;
46+
padding: 2.5rem;
47+
margin-top: 1.5rem;
48+
-webkit-box-shadow:
49+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
50+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
51+
box-shadow:
52+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
53+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
54+
font-size: 13px;
55+
text-align: center;
56+
border-radius: 0.375rem;
57+
}
58+
59+
.alert-icon svg {
60+
height: 2rem;
61+
width: 2rem;
62+
}
63+
64+
h1 {
65+
font-size: 16px;
66+
font-weight: 500;
67+
}
68+
69+
p {
70+
color: #4c5a67;
71+
line-height: 1.5;
72+
}
73+
74+
a {
75+
color: #1579d0;
76+
text-decoration: none;
77+
border-bottom: 1px solid #1579d0;
78+
}
79+
</style>
80+
</head>
81+
82+
<body>
83+
<div class="container">
84+
<div class="logo">
85+
<svg
86+
width="40"
87+
height="100"
88+
viewBox="0 0 160 120"
89+
fill="none"
90+
xmlns="http://www.w3.org/2000/svg"
91+
>
92+
<path
93+
d="M93.4626 0H23.5665C10.5511 0 0 10.5511 0 23.5665V93.4626C0 106.478 10.5511 117.029 23.5665 117.029H93.4626C106.478 117.029 117.029 106.478 117.029 93.4626V23.5665C117.029 10.5511 106.478 0 93.4626 0Z"
94+
fill="url(#paint0_radial_0_9)"
95+
/>
96+
<path
97+
d="M94.4529 48.9854C89.7801 42.265 81.9046 38.3798 73.7142 38.9048C70.1965 32.552 63.6861 28.3517 56.0732 27.8792C50.7704 27.5642 45.4151 29.4018 41.2674 32.972C38.4322 35.4396 36.3846 38.2748 35.1245 41.4775C34.3895 43.3676 32.7094 44.5751 30.9243 44.5751H18.3761V55.0757H30.9243C37.0671 55.0757 42.5799 51.243 44.8901 45.3102C45.5201 43.6826 46.5702 42.265 48.1453 40.8999C50.1929 39.1148 52.8705 38.1698 55.3907 38.3273C59.1709 38.5898 61.8485 40.3224 63.5286 42.475C65.3137 44.4701 66.3113 47.5678 66.8888 50.6655C70.249 49.7204 73.9242 48.9329 77.4419 49.5104C80.3296 49.9829 83.0072 51.5055 84.9498 53.7631C85.2648 54.1307 85.5798 54.4982 85.8424 54.9182C88.3625 58.5409 88.835 63.0037 87.1549 67.4139C85.6324 71.5091 80.0145 75.2369 75.3418 75.2369H38.7997C33.8119 75.2369 29.7167 71.5091 29.0867 66.7314H18.5861C19.2686 77.337 28.0366 85.7374 38.7997 85.7374H75.3943C84.4248 85.7374 93.9278 79.3321 97.0255 71.1416C99.9132 63.4762 98.9681 55.3907 94.5054 48.9329L94.4529 48.9854Z"
98+
fill="#FFFAE9"
99+
/>
100+
<defs>
101+
<radialGradient
102+
id="paint0_radial_0_9"
103+
cx="0"
104+
cy="0"
105+
r="1"
106+
gradientUnits="userSpaceOnUse"
107+
gradientTransform="translate(-28.5 -58) rotate(54.335) scale(209.246)"
108+
>
109+
<stop stop-color="#40D1FF" />
110+
<stop offset="1" stop-color="#0097FF" />
111+
</radialGradient>
112+
</defs>
113+
</svg>
114+
<div class="logo-text">
115+
<h1>Frappe Cloud</h1>
116+
</div>
117+
</div>
118+
<div class="message-container">
119+
<div class="alert-icon">
120+
<!-- Red filled circle with white exclamation mark (scaled down via CSS) -->
121+
<svg
122+
xmlns="http://www.w3.org/2000/svg"
123+
viewBox="0 0 24 24"
124+
fill="none"
125+
stroke-width="2"
126+
stroke-linecap="round"
127+
stroke-linejoin="round"
128+
>
129+
<circle cx="12" cy="12" r="10" fill="#EF4444" stroke="#EF4444" />
130+
<line x1="12" x2="12" y1="8" y2="12" stroke="white" />
131+
<line x1="12" x2="12.01" y1="16" y2="16" stroke="white" />
132+
</svg>
133+
</div>
134+
<h1>Gateway Timeout</h1>
135+
<p class="message">
136+
Your site appears to be running slow.
137+
<a
138+
href="https://docs.frappe.io/cloud/performance-error-debugging#site-slow-504-gateway-timeout"
139+
style="
140+
display: inline-block;
141+
margin-top: 10px;
142+
padding: 8px 16px;
143+
background: #f5f5f5;
144+
border-radius: 4px;
145+
color: #333;
146+
text-decoration: none;
147+
font-weight: bold;
148+
border: 1px solid #e0e0e0;
149+
"
150+
>
151+
📄 Follow the step-by-step guide to debug this issue
152+
</a>
153+
</p>
154+
<p>
155+
If you are the owner of this site, please check the analytics on your
156+
site's
157+
<a class="dashboard-url" href="https://frappecloud.com/dashboard"
158+
><strong>dashboard</strong></a
159+
>.
160+
</p>
161+
</div>
162+
</div>
163+
</body>
164+
165+
<script>
166+
const dashboardUrl = document.querySelector(".dashboard-url");
167+
const siteName = window.location.hostname;
168+
dashboardUrl.href = `https://frappecloud.com/dashboard/sites/${siteName}/insights/analytics`;
169+
</script>
170+
</html>

0 commit comments

Comments
 (0)