Skip to content

Commit 091fd27

Browse files
CLDSRV-717: Update sproxyd container
Use latest sproxyd with latest configs changes from federation And add sproxyd logs into artifacts The latest sproxyd has: - adminapi for monitoring (but ignored here) - disable FUSE S3C-4129 scality/Federation#5653 - nginx openresty replaces tengine S3C-8479 scality/Federation#5495
1 parent 2d3c697 commit 091fd27

File tree

5 files changed

+36
-27
lines changed

5 files changed

+36
-27
lines changed

.github/actions/setup-ci/action.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,3 @@ runs:
4646
run: |
4747
sudo apt-get install -y libdigest-hmac-perl
4848
pip install 's3cmd==2.3.0'
49-
- name: fix sproxyd.conf permissions
50-
shell: bash
51-
run: sudo chown root:root .github/docker/sproxyd/conf/sproxyd0.conf
52-
- name: ensure fuse kernel module is loaded (for sproxyd)
53-
shell: bash
54-
run: sudo modprobe fuse

.github/docker/docker-compose.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,6 @@ services:
113113
image: sproxyd-standalone
114114
build: ./sproxyd
115115
user: 0:0
116-
privileged: yes
116+
privileged: yes # for setxattr on local filesystem
117+
volumes:
118+
- /tmp/artifacts/${JOB_NAME}/sproxyd:/logs

.github/docker/sproxyd/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM ghcr.io/scality/federation/sproxyd:7.10.6.8
2-
ADD ./conf/supervisord.conf ./conf/nginx.conf ./conf/fastcgi_params ./conf/sproxyd0.conf /conf/
3-
RUN chown root:root /conf/sproxyd0.conf
1+
FROM ghcr.io/scality/federation/sproxyd:9.5.1.0
2+
ADD --chown=root:root ./conf/supervisord.conf ./conf/nginx.conf ./conf/fastcgi_params ./conf/sproxyd0.conf /conf/
3+
RUN mkdir -p /run0

.github/docker/sproxyd/conf/nginx.conf

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ error_log /logs/error.log;
33
user root root;
44
events {
55
worker_connections 1000;
6-
reuse_port on;
76
multi_accept on;
87
}
98
worker_rlimit_nofile 20000;
@@ -14,12 +13,25 @@ http {
1413
keepalive 40;
1514
server 127.0.0.1:20000;
1615
}
16+
17+
# Define a custom log format
18+
log_format irm '{ "time":"$now","connection":"$connection","request":"$connection_requests","hrtime":"$msec",'
19+
'"httpMethod":"$request_method","httpURL":"$uri","elapsed_ms":$elapsed_ms,'
20+
'"httpCode":$status,"requestLength":$request_length,"bytesSent":$bytes_sent,'
21+
'"contentLength":"$content_length","sentContentLength":"$sent_http_content_length",'
22+
'"contentType":"$content_type","s3Address":"$remote_addr",'
23+
'"requestUserMd":"$usermd","responseUserMd":"$sentusermd",'
24+
'"ringKeyVersion":"$sent_http_x_scal_version","ringStatus":"$sent_http_x_scal_ring_status",'
25+
'"s3Port":"$remote_port","sproxydStatus":"$upstream_status","req_id":"$http_x_scal_request_uids",'
26+
'"ifMatch":"$http_if_match","ifNoneMatch":"$http_if_none_match",'
27+
'"range":"$http_range","contentRange":"$sent_http_content_range","nginxPID":$PID,'
28+
'"sproxydAddress":"$upstream_addr","sproxydResponseTime_s":"$upstream_response_time" }';
29+
1730
server {
1831
client_max_body_size 0;
1932
client_body_timeout 150;
2033
client_header_timeout 150;
2134
postpone_output 0;
22-
client_body_postpone_size 0;
2335
keepalive_requests 1100;
2436
keepalive_timeout 300s;
2537
server_tokens off;
@@ -28,7 +40,7 @@ http {
2840
tcp_nodelay on;
2941
tcp_nopush on;
3042
sendfile on;
31-
listen 81;
43+
listen 81 reuseport;
3244
server_name localhost;
3345
rewrite ^/arc/(.*)$ /dc1/$1 permanent;
3446
location ~* ^/proxy/(.*)$ {
@@ -56,28 +68,19 @@ http {
5668
local time = tonumber(ngx.var.msec) * 1000
5769
ngx.var.now = time
5870
';
59-
log_format irm '{ "time":"$now","connection":"$connection","request":"$connection_requests","hrtime":"$msec",'
60-
'"httpMethod":"$request_method","httpURL":"$uri","elapsed_ms":$elapsed_ms,'
61-
'"httpCode":$status,"requestLength":$request_length,"bytesSent":$bytes_sent,'
62-
'"contentLength":"$content_length","sentContentLength":"$sent_http_content_length",'
63-
'"contentType":"$content_type","s3Address":"$remote_addr",'
64-
'"requestUserMd":"$usermd","responseUserMd":"$sentusermd",'
65-
'"ringKeyVersion":"$sent_http_x_scal_version","ringStatus":"$sent_http_x_scal_ring_status",'
66-
'"s3Port":"$remote_port","sproxydStatus":"$upstream_status","req_id":"$http_x_scal_request_uids",'
67-
'"ifMatch":"$http_if_match","ifNoneMatch":"$http_if_none_match",'
68-
'"range":"$http_range","contentRange":"$sent_http_content_range","nginxPID":$PID,'
69-
'"sproxydAddress":"$upstream_addr","sproxydResponseTime_s":"$upstream_response_time" }';
7071
access_log /dev/stdout irm;
7172
error_log /dev/stdout error;
7273
location / {
74+
proxy_buffering off;
7375
proxy_request_buffering off;
76+
# proxy_http_version 1.1; Option disabled as it affects performance cf citadel design
7477
fastcgi_request_buffering off;
7578
fastcgi_no_cache 1;
7679
fastcgi_cache_bypass 1;
7780
fastcgi_buffering off;
7881
fastcgi_ignore_client_abort on;
7982
fastcgi_keep_conn on;
80-
include fastcgi_params;
83+
include /conf/fastcgi_params;
8184
fastcgi_pass sproxyds;
8285
fastcgi_next_upstream error timeout;
8386
fastcgi_send_timeout 285s;

.github/docker/sproxyd/conf/supervisord.conf

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ serverurl = unix://%(ENV_SUP_RUN_DIR)s/supervisor.sock
1717

1818
[program:nginx]
1919
directory=%(ENV_SUP_RUN_DIR)s
20-
command=bash -c "/usr/sbin/nginx -c %(ENV_CONF_DIR)s/nginx.conf -g 'daemon off;'"
20+
command=bash -c "/usr/bin/openresty -c %(ENV_CONF_DIR)s/nginx.conf -g 'daemon off;'"
2121
stdout_logfile = %(ENV_LOG_DIR)s/%(program_name)s-%(process_num)s.log
2222
stderr_logfile = %(ENV_LOG_DIR)s/%(program_name)s-%(process_num)s-stderr.log
2323
stdout_logfile_maxbytes=100MB
@@ -27,17 +27,27 @@ stderr_logfile_backups=7
2727
autorestart=true
2828
autostart=true
2929
user=root
30+
priority=40
3031

3132
[program:sproxyd]
3233
directory=%(ENV_SUP_RUN_DIR)s
3334
process_name=%(program_name)s-%(process_num)s
3435
numprocs=1
3536
numprocs_start=0
36-
command=/usr/bin/sproxyd -dlw -V127 -c %(ENV_CONF_DIR)s/sproxyd%(process_num)s.conf -P /run%(process_num)s
37+
# -d no daemon
38+
# -l log on console
39+
# -w no watchdog
40+
# -V127 log level info
41+
# -c config file
42+
# -P sysfs confpath
43+
# -A adminapi directory
44+
# -s no sysfs do not mount FUSE sysfs
45+
command=/usr/bin/sproxyd -dlw -V127 -c %(ENV_CONF_DIR)s/sproxyd%(process_num)s.conf -P /run%(process_num)s -A /run%(process_num)s -s
3746
stdout_logfile = %(ENV_LOG_DIR)s/%(program_name)s-%(process_num)s.log
3847
stdout_logfile_maxbytes=100MB
3948
stdout_logfile_backups=7
4049
redirect_stderr=true
4150
autorestart=true
4251
autostart=true
4352
user=root
53+
priority=20

0 commit comments

Comments
 (0)