Make FIFA17 roster hostname configurable
This commit is contained in:
+25
-13
@@ -12,10 +12,10 @@ ONE entry point. It starts, in order:
|
||||
and then prints the three `openfut.cfg` lines the operator must put on the client.
|
||||
Tear the whole thing down with `scripts/sold-staging-down.py`.
|
||||
|
||||
WHY the client only needs Blaze ports: FIFA 17 learns the UTAS base URL from Blaze
|
||||
(`blaze_responder_v3b.py`'s `UTAS_BASE`, where the `8099` is HARDCODED). This script
|
||||
copies the responder into the staging dir and rewrites that literal to the staging
|
||||
UTAS port, so pointing the client at staging Blaze is sufficient to move UTAS too.
|
||||
WHY the client only needs Blaze ports: FIFA 17 learns both the UTAS base URL and
|
||||
the roster URL from Blaze. This script copies the responder into the staging dir,
|
||||
rewrites the hardcoded UTAS port, and passes the independently configurable roster
|
||||
host through `OPENFUT_ROSTER_HOST`.
|
||||
|
||||
ISOLATION, enforced not assumed:
|
||||
* production ports 8099 8199 18080 8443 42127 42130 42131 4216 8080 8081 8094 are
|
||||
@@ -33,10 +33,11 @@ ISOLATION, enforced not assumed:
|
||||
edits `openfut.cfg` by hand, using the block this script prints.
|
||||
|
||||
Read-only reuse of production: staging Blaze advertises the production roster
|
||||
(10.10.0.120:8081) and POW content/API hosts (10.10.0.120:8085 / :8094) verbatim, the
|
||||
same values production Blaze advertises. Those services hold NO economy state (roster
|
||||
XML and POW content are static), staging never connects to them itself -- it only
|
||||
hands the client the same strings -- and they are therefore shared deliberately.
|
||||
service through a certificate dNSName (`winter15.gosredirector.ea.com:8081` by
|
||||
default) and advertises the production POW content/API hosts
|
||||
(`10.10.0.120:8085` / `:8094`) verbatim. These services hold NO economy state.
|
||||
The client must resolve the roster hostname to this server without changing the
|
||||
advertised URL.
|
||||
|
||||
python3 scripts/sold-staging-up.py --variant highest
|
||||
python3 scripts/sold-staging-up.py --variant buyNow --coins-processed 1 \
|
||||
@@ -98,6 +99,7 @@ ADVERTISE = "10.10.0.120"
|
||||
BIND = "0.0.0.0"
|
||||
POW_CONTENT_HOST = "10.10.0.120:8085"
|
||||
POW_HOST = "10.10.0.120:8094"
|
||||
DEFAULT_ROSTER_HOST = "winter15.gosredirector.ea.com:8081"
|
||||
|
||||
BLAZE_SRC = os.path.join(REPO, "fifa17-recon", "tools", "blaze_responder_v3b.py")
|
||||
BLAZE_ASSETS = ("redir_cert.pem", "redir_key.pem")
|
||||
@@ -729,11 +731,12 @@ def start_host(lay: Layout, variant: str, coins_processed: str, count_mode: str)
|
||||
return Launched("staging-utas-host", proc, lay.host_log, f"{BIND}:{HOST_PORT}")
|
||||
|
||||
|
||||
def start_blaze(lay: Layout) -> Launched:
|
||||
def start_blaze(lay: Layout, roster_host: str) -> Launched:
|
||||
env = dict(
|
||||
os.environ,
|
||||
OPENFUT_ADVERTISE=ADVERTISE,
|
||||
OPENFUT_BIND=BIND,
|
||||
OPENFUT_ROSTER_HOST=roster_host,
|
||||
# Read-only reuse of the production auxiliary services: static content, no
|
||||
# economy state, and staging never connects to them -- it only advertises
|
||||
# the same strings production Blaze advertises.
|
||||
@@ -766,7 +769,8 @@ def start_blaze(lay: Layout) -> Launched:
|
||||
)
|
||||
ok(
|
||||
f"staging blaze ready: redirector {BLAZE_REDIR_PORT}, main {BLAZE_MAIN_PORT}, "
|
||||
f"nucleus {BLAZE_NUCLEUS_PORT} (pid {proc.pid}); logged {want!r}"
|
||||
f"nucleus {BLAZE_NUCLEUS_PORT} (pid {proc.pid}); roster {roster_host}; "
|
||||
f"logged {want!r}"
|
||||
)
|
||||
return Launched(
|
||||
"staging-blaze", proc, lay.blaze_log,
|
||||
@@ -850,7 +854,7 @@ def cfg_block() -> list[str]:
|
||||
|
||||
|
||||
def print_summary(lay: Layout, variant: str, coins_processed: str, count_mode: str,
|
||||
records: list[dict]) -> None:
|
||||
roster_host: str, records: list[dict]) -> None:
|
||||
banner("STAGING STACK IS UP")
|
||||
rows = [
|
||||
("staging Core", f"127.0.0.1:{CORE_PORT}", "loopback only; client never talks to it"),
|
||||
@@ -888,6 +892,7 @@ def print_summary(lay: Layout, variant: str, coins_processed: str, count_mode: s
|
||||
print(f" experiment variant : {variant}")
|
||||
print(f" coinsProcessed : {coins_processed}")
|
||||
print(f" count mode : {count_mode}")
|
||||
print(f" roster host : {roster_host}")
|
||||
print(f" banner : {host_banner_line(lay)}")
|
||||
print(f" seeded state : {db_summary(lay)}")
|
||||
print(f" disposable item to sell : {DISPOSABLE_ITEM} ({DISPOSABLE_CARD})")
|
||||
@@ -931,6 +936,11 @@ def main() -> int:
|
||||
ap.add_argument("--count-mode", choices=["active", "active_plus_sold"],
|
||||
default="active",
|
||||
help="what /tradePile/counts.count reports (default: active)")
|
||||
ap.add_argument(
|
||||
"--roster-host",
|
||||
default=os.environ.get("OPENFUT_ROSTER_HOST", DEFAULT_ROSTER_HOST),
|
||||
help=f"host:port advertised for roster HTTPS (default: {DEFAULT_ROSTER_HOST})",
|
||||
)
|
||||
ap.add_argument("--dir", default=os.environ.get("OPENFUT_SOLD_STAGING_DIR",
|
||||
DEFAULT_STAGING_DIR),
|
||||
help=f"staging directory (default: {DEFAULT_STAGING_DIR})")
|
||||
@@ -968,7 +978,7 @@ def main() -> int:
|
||||
args.count_mode))
|
||||
|
||||
banner("STAGING BLAZE")
|
||||
started.append(start_blaze(lay))
|
||||
started.append(start_blaze(lay, args.roster_host))
|
||||
|
||||
records = [item.record() for item in started]
|
||||
for rec in records:
|
||||
@@ -986,6 +996,7 @@ def main() -> int:
|
||||
"variant": args.variant,
|
||||
"coins_processed": args.coins_processed,
|
||||
"count_mode": args.count_mode,
|
||||
"roster_host": args.roster_host,
|
||||
"ports": {
|
||||
"core": CORE_PORT,
|
||||
"utas_host": HOST_PORT,
|
||||
@@ -1012,7 +1023,8 @@ def main() -> int:
|
||||
banner("VERIFY ISOLATION")
|
||||
verify(lay, args.variant)
|
||||
|
||||
print_summary(lay, args.variant, args.coins_processed, args.count_mode, records)
|
||||
print_summary(lay, args.variant, args.coins_processed, args.count_mode,
|
||||
args.roster_host, records)
|
||||
return 0
|
||||
except Fatal as exc:
|
||||
print(f"\nFATAL: {exc}", file=sys.stderr)
|
||||
|
||||
Reference in New Issue
Block a user