Skip to content

Commit 48e85a8

Browse files
committed
Working on Traffic Server 10.1 upgrades and cleanup.
1 parent b44122d commit 48e85a8

File tree

9 files changed

+19
-60
lines changed

9 files changed

+19
-60
lines changed

src/api-umbrella/cli/reload.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ local function reload_perp(perp_base)
1313
end
1414

1515
local function reload_trafficserver()
16-
local _, err = shell_blocking_capture_combined({ "env", "TS_ROOT=" .. config["root_dir"], "traffic_ctl", "config", "reload" })
16+
local _, err = shell_blocking_capture_combined({ "env", "TS_RUNROOT=" .. path_join(config["etc_dir"], "trafficserver/runroot.yaml"), "traffic_ctl", "config", "reload" })
1717
if err then
1818
print("Failed to reload trafficserver\n" .. err)
1919
os.exit(1)

tasks/deps/trafficserver

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

3-
trafficserver_version="10.0.2"
4-
trafficserver_hash="5de65130d4c0997d619d0c1be6840aaffd3e17abd820d22b9294c4d78834eb71a58fed12f3166396c7169583850a8b42ed768e5af11e855c87b2fca8a10da7f3"
3+
trafficserver_version="10.1.0"
4+
trafficserver_hash="836cac33f6a54be2b62eaa881b333d16a6029177f3ce788fce3eec7d097843bbbd49bb9a748d6ec6592d86e6d425975f6a9b462401ab808e1e4f0726488eb2b8"
55

66
set -e -u -x
77
source ./tasks/helpers.sh

tasks/outdated.thor

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class Outdated < Thor
8888
},
8989
"trafficserver" => {
9090
:http => "https://archive.apache.org/dist/trafficserver/",
91-
:constraint => "~> 9.2.0",
9291
:checksums_download => "https://archive.apache.org/dist/trafficserver/trafficserver-<%= version.fetch(:wanted_version) %>.tar.bz2.sha512",
9392
:filename_matcher => /trafficserver.*\.tar\.bz2/,
9493
},

templates/etc/fluent-bit/fluent-bit.yaml.etlua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,6 @@ pipeline:
2828
format: json
2929
storage.type: filesystem
3030

31-
<% if config["log"]["destination"] == "console" then %>
32-
# Workaround for error.log currently being hard-coded to output to a file
33-
# that won't work if symlinked to /dev/stdout (it insists on rolling the file
34-
# since it doesn't think it can write to it).
35-
#
36-
# This workaround should no longer be needed once Trafficserver 10 is
37-
# released and things can be configured to output to stdout/stderr directly:
38-
# https://github.com/apache/trafficserver/pull/7937
39-
- name: tail
40-
tag: trafficserver
41-
path: <%- json_encode(path_join(config["log_dir"], "trafficserver/error.log")) %>
42-
refresh_interval: 5
43-
<% end %>
44-
4531
filters:
4632
- name: rewrite_tag
4733
match: analytics.allowed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
LD_LIBRARY_PATH=<%- config["_embedded_root_dir"] %>/openresty/luajit/lib:<%- config["_embedded_root_dir"] %>/lib
2-
TS_ROOT=<%- config["root_dir"] %>
2+
TS_RUNROOT=<%- path_join(config["etc_dir"], "trafficserver/runroot.yaml") %>

templates/etc/trafficserver/records.yaml.etlua

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,6 @@ records:
66
# will handle switching the user).
77
user_id: "#-1"
88

9-
# Specify where to find the TrafficServer binaries, plugins, etc. Our config
10-
# files are in a non-default location by using TS_ROOT (this is done so that
11-
# the config files can co-exist with the rest of the API Umbrella config
12-
# files, and so that we can relocate the location for running tests).
13-
# Therefore, we must explicitly point back to the original TrafficServer
14-
# install directory. This could potentially be made cleaner without the use
15-
# of TS_ROOT with the new proxy.config.config_dir setting
16-
# (https://issues.apache.org/jira/browse/TS-3192), but I wasn't able to get
17-
# that to quite work properly.
18-
bin_path: <%- json_encode(path_join(config["_embedded_root_dir"], "bin")) %>
19-
body_factory:
20-
template_sets_dir: <%- json_encode(path_join(config["_embedded_root_dir"], "etc/trafficserver/body_factory")) %>
21-
plugin:
22-
plugin_dir: <%- json_encode(path_join(config["_embedded_root_dir"], "libexec/trafficserver")) %>
23-
249
output:
2510
logfile:
2611
name: <%- json_encode(config["log"]["destination"] == "console" and "stdout" or "traffic.out") %>
@@ -34,11 +19,6 @@ records:
3419
logfile:
3520
filename: <%- json_encode(config["log"]["destination"] == "console" and "stdout" or "diags.log") %>
3621

37-
# Disable Trafficserver's own log file rotation for these files. We'll
38-
# either output to stdout or rotate log files with logrotate (to be
39-
# consistent with all the other API Umbrella components).
40-
rolling_enabled: 0
41-
4222
# Log all diagnostic output to stderr (instead of also shipping it to the
4323
# system-wide syslog).
4424
output:
@@ -53,19 +33,15 @@ records:
5333
warning: E
5434

5535
# Enable for debug logging.
56-
debug:
57-
enabled: 1
58-
# tags: ".*"
59-
tags: "http_hdrs|http_tproxy|http_trans"
36+
# debug:
37+
# enabled: 1
38+
# tags: ".*"
6039

6140
error:
6241
logfile:
6342
filename: <%- json_encode(config["log"]["destination"] == "console" and "stderr" or "error.log") %>
6443

6544
log:
66-
# Log to the standard API Umbrella log directory location.
67-
logfile_dir: <%- json_encode(path_join(config["log_dir"], "trafficserver")) %>
68-
6945
# Allow longer lines in logging.
7046
ascii_buffer_size: 24576
7147
log_buffer_size: 24576
@@ -93,11 +69,6 @@ records:
9369
sock_option_flag_out: 3
9470

9571
http:
96-
# request_buffer_enabled: 0
97-
# post_copy_size: 100M
98-
# keep_alive_post_out: 0
99-
# max_post_size: "1000000"
100-
10172
server_ports: <%- json_encode(config["trafficserver"]["port"]) %>
10273

10374
# Increase timeouts to match the timeouts in other pieces of the stack.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
prefix: <%- json_encode(path_join(config["_embedded_root_dir"])) %>
2+
sysconfdir: <%- json_encode(path_join(config["etc_dir"], "trafficserver")) %>
3+
localstatedir: <%- json_encode(path_join(config["var_dir"], "trafficserver")) %>
4+
runtimedir: <%- json_encode(path_join(config["var_dir"], "trafficserver")) %>
5+
logdir: <%- json_encode(path_join(config["log_dir"], "trafficserver")) %>
6+
runtimedir: <%- json_encode(path_join(config["var_dir"], "trafficserver")) %>
7+
cachedir: <%- json_encode(path_join(config["var_dir"], "trafficserver")) %>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
var/trafficserver <%- config["trafficserver"]["storage"]["size"] %>
1+
<%- path_join(config["var_dir"], "trafficserver") %> <%- config["trafficserver"]["storage"]["size"] %>

test/apis/test_web_app_large_body.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,10 @@ def test_fails_with_large_body_above_default_limit
5151
assert_operator(body.bytesize, :>, 1 * 1024 * 1024) # 1MB
5252
assert_operator(body.bytesize, :<, 1.1 * 1024 * 1024) # 1.1MB
5353

54-
response = nil
55-
100.times do
56-
response = Typhoeus.post("https://127.0.0.1:9081/api-umbrella/v1/users/#{user.id}.json", http_options.deep_merge(admin_token).deep_merge({
57-
:headers => { "Content-Type" => "application/json" },
58-
:body => body,
59-
}))
60-
ap response.code
61-
end
54+
response = Typhoeus.post("https://127.0.0.1:9081/api-umbrella/v1/users/#{user.id}.json", http_options.deep_merge(admin_token).deep_merge({
55+
:headers => { "Content-Type" => "application/json" },
56+
:body => body,
57+
}))
6258
assert_above_max_body_size(response)
6359

6460
user.reload

0 commit comments

Comments
 (0)